KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > websphinx > workbench > WebGraph


1 /*
2  * WebSphinx web-crawling toolkit
3  *
4  * Copyright (c) 1998-2002 Carnegie Mellon University. All rights
5  * reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in
16  * the documentation and/or other materials provided with the
17  * distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
20  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
23  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  */

32
33 package websphinx.workbench;
34
35 import websphinx.*;
36 import java.awt.*;
37 import java.util.Hashtable JavaDoc;
38 import java.util.Vector JavaDoc;
39 import java.applet.Applet JavaDoc;
40 import java.applet.AppletContext JavaDoc;
41 import java.net.URL JavaDoc;
42 import java.net.MalformedURLException JavaDoc;
43 import rcm.awt.Colors;
44 import rcm.awt.ClosableFrame;
45 import java.awt.image.MemoryImageSource JavaDoc;
46 import graph.Graph;
47 import rcm.awt.Constrain;
48 import rcm.awt.PopupDialog;
49
50 // FIX: connect ALREADY_VISITED links to page
51

52 public class WebGraph extends GraphLayout implements CrawlListener, LinkListener {
53
54     Hashtable JavaDoc links = new Hashtable JavaDoc ();
55        // maps Link -> WebNode (for root links) or WebEdge (for internal links)
56

57     /**
58      * Make a WebGraph.
59      */

60     public WebGraph () {
61         setPageIcon (defaultPageIcon);
62         setLinkIcon (defaultLinkIcon);
63         setRetrievingIcon (defaultRetrievingIcon);
64         setErrorIcon (defaultErrorIcon);
65     }
66
67     // Filtering of a node's outgoing links
68

69     static final int NO_LINKS = 0;
70         // Show no outgoing links
71

72     static final int RETRIEVED_LINKS = 1;
73         // Show only links that crawler started to retrieve
74

75     static final int WALKED_LINKS = 2;
76         // Show RETRIEVED_LINKS, plus links queued for retrieval
77

78     static final int TREE_LINKS = 3;
79         // Show WALKED_LINKS, plus links skipped by walk()
80

81     static final int ALL_LINKS = 4;
82         // Show TREE_LINKS, plus links to already-visited pages
83

84     int defaultFilter = RETRIEVED_LINKS;
85
86     // Change the filter of a node
87
synchronized void setLinkFilter (WebNode node, int filter) {
88         if (filter == node.filter)
89             return;
90
91         Page page = node.link.getPage ();
92         if (page != null) {
93             Link[] linkarray = page.getLinks ();
94
95             if (filter < node.filter) {
96                 // new mode is more restrictive; delete undesired edges
97
for (int j=0; j<linkarray.length; ++j) {
98                     if (!shouldDisplay (filter, linkarray[j].getStatus())) {
99                         WebEdge edge = (WebEdge)links.get (linkarray[j]);
100                         if (edge != null) {
101                             removeNode ((WebNode)edge.to);
102                             removeEdge (edge);
103                             links.remove (linkarray[j]);
104                         }
105                        }
106                 }
107             }
108             else if (filter > node.filter) {
109                 // new mode is less restrictive; add edges
110
for (int j=0; j<linkarray.length; ++j) {
111                     update (linkarray[j]); // update() will check shouldDisplay()
112
}
113             }
114         }
115
116         node.filter = filter;
117     }
118
119     // Change the filter of ALL nodes
120
synchronized void setLinkFilter (int filter) {
121         defaultFilter = filter;
122         Graph graph = getGraph ();
123         for (int i=0; i<graph.sizeNodes; ++i) {
124             WebNode n = (WebNode)graph.nodes[i];
125             setLinkFilter (n, filter);
126         }
127     }
128
129     // Node rendering
130

131     static final int ICON = 0;
132         // Show an icon
133

134     static final int TITLE = 1;
135         // Show page title (or URL if not downloaded)
136

137     static final int ABSOLUTE_URL = 2;
138         // Show absolute URL
139

140     static final int RELATIVE_URL = 3;
141         // Show URL relative to parent
142

143     int defaultRendering = ICON;
144
145     // Change the rendering of a node
146
void setNodeRendering (WebNode n, int r) {
147         n.rendering = r;
148         update(n);
149
150         repaint ();
151     }
152
153     // Change the rendering of ALL nodes
154
synchronized void setNodeRendering (int r) {
155         defaultRendering = r;
156
157         Graph graph = getGraph ();
158         for (int i=0; i<graph.sizeNodes; ++i) {
159             WebNode n = (WebNode)graph.nodes[i];
160             n.rendering = r;
161             update (n);
162         }
163
164         changedGraph ();
165     }
166
167     /**
168      * Show control panel for changing graph layout parameters.
169      */

170     public void showControlPanel () {
171         new WorkbenchControlPanel (this, null).show ();
172     }
173
174     /**
175      * Clear the graph display.
176      */

177     public synchronized void clear () {
178         links.clear ();
179         super.clear ();
180     }
181
182     /**
183      * Notify that the crawler started.
184      */

185     public void started (CrawlEvent event) {
186     }
187
188     /**
189      * Notify that the crawler has stopped.
190      */

191     public void stopped (CrawlEvent event) {
192     }
193
194     /**
195      * Notify that the crawler's state was cleared.
196      */

197     public void cleared (CrawlEvent event) {
198         clear ();
199     }
200
201     /**
202      * Notify that the crawler has timed out
203      */

204     public void timedOut (CrawlEvent event) {
205     }
206
207     /**
208      * Notify that the crawler is paused
209      */

210     public void paused (CrawlEvent event) {
211     }
212
213     /**
214      * Notify that a crawling event has occured.
215      */

216     public void crawled (LinkEvent event) {
217         update (event.getLink ());
218     }
219
220     // check whether we want to display a link with this status
221
boolean shouldDisplay (int filter, int status) {
222         switch (status) {
223            case LinkEvent.QUEUED:
224            case LinkEvent.TOO_DEEP:
225              return (filter > RETRIEVED_LINKS);
226            case LinkEvent.SKIPPED:
227              return (filter > WALKED_LINKS);
228            case LinkEvent.ALREADY_VISITED:
229              return (filter > TREE_LINKS);
230           case LinkEvent.RETRIEVING:
231           case LinkEvent.DOWNLOADED:
232           case LinkEvent.VISITED:
233           case LinkEvent.ERROR:
234             return true;
235           default:
236             return false;
237         }
238     }
239
240     /**
241      * Update all the links that the crawler reached from this link.
242      * Any reachable links not present in the graph are added.
243      */

244     public void updateClosure (Link[] links) {
245         if (links == null)
246             return;
247         for (int i=0; i < links.length; ++i) {
248             Link link = links[i];
249             int status = link.getStatus();
250
251             if (status == LinkEvent.NONE)
252                 continue;
253
254             update (link);
255
256             if (status == LinkEvent.DOWNLOADED || status == LinkEvent.VISITED) {
257                 Page page = link.getPage();
258                 if (page != null)
259                     updateClosure (page.getLinks ());
260             }
261         }
262     }
263
264     /**
265      * Update the edge and node associated with a link.
266      * If the link is not present in the graph, it is added.
267      */

268     public synchronized void update (Link link) {
269         Object JavaDoc obj = links.get (link);
270
271         if (obj == null) {
272             add (link);
273         }
274         else if (obj instanceof WebEdge) {
275             WebEdge e = (WebEdge) obj;
276             update (e);
277             update ((WebNode)e.to);
278         }
279         else {
280             // obj instanceof WebNode
281
update ((WebNode)obj);
282         }
283
284         repaint ();
285     }
286
287     synchronized void add (Link link) {
288         WebNode n = new WebNode (link, defaultFilter, defaultRendering);
289         WebNode parent = findParent (link);
290         
291         if (parent == null) {
292             links.put (link, n);
293             update (n);
294             addNode (n);
295
296             if (getGraph().sizeNodes == 1) {
297                 // root node of first tree -- put it at the origin and fix it
298
n.fixed = true;
299                 placeNodeOnGraph (n, 0, 0);
300             }
301             else {
302                 // root node of an additional tree -- drop it randomly
303
// within window
304

305                 Dimension d = size ();
306                 
307                 int x = (int)(Math.random() * d.width);
308                 int y = (int)(Math.random() * d.height);
309                 placeNodeOnScreen (n, x, y);
310             }
311         }
312         else {
313             // check if parent's filter allows this link to be displayed
314
if (!shouldDisplay (parent.filter, link.getStatus ()))
315                 return;
316
317             // hang the node off its parent in a random direction
318
double len = getRestLength();
319             double angle = Math.random () * 2 * Math.PI;
320             double x = parent.x + len*Math.cos(angle);
321             double y = parent.y + len*Math.sin(angle);
322
323             update (n);
324             addNode (n);
325             placeNodeOnGraph (n, x, y);
326
327             WebEdge e = new WebEdge (link, parent, n);
328             links.put (link, e);
329             update (e);
330             addEdge (e);
331         }
332     }
333
334     void update (WebEdge e) {
335         e.color = Colors.parseColor (e.link.getLabel ("Workbench.color"));
336         e.thick = e.link.hasLabel ("Workbench.thick");
337     }
338
339     void update (WebNode n) {
340         Page page = n.link.getPage ();
341         int status = n.link.getStatus ();
342
343         if (page == null) {
344             // not downloaded yet
345
switch (n.rendering) {
346             case ICON:
347                 n.name = null;
348                 n.icon = getIcon (LinkEvent.eventName[status]);
349                 break;
350             case TITLE:
351             case ABSOLUTE_URL:
352                 n.name = n.link.getURL().toString();
353                 n.icon = null;
354                 break;
355             case RELATIVE_URL: {
356                 Link origin = n.link.getSource().getOrigin();
357                 if (origin != null)
358                     n.name = Link.relativeTo (origin.getURL(), n.link.getURL());
359                 else
360                     n.name = n.link.getURL().toString();
361                 n.icon = null;
362                 break;
363             }
364             }
365         }
366         else {
367             switch (n.rendering) {
368             case ICON:
369                 n.name = null;
370                 n.icon = getIcon (page.getLabel ("Workbench.icon",
371                                                  LinkEvent.eventName[status]));
372                 break;
373             case TITLE:
374                 n.name = page.getTitle ();
375                 if (n.name == null)
376                     n.name = "[" + n.link.getURL().toString() + "]";
377                 n.icon = null;
378                 break;
379             case ABSOLUTE_URL:
380                 n.name = n.link.getURL().toString();
381                 n.icon = null;
382                 break;
383             case RELATIVE_URL: {
384                 Link origin = n.link.getSource().getOrigin();
385                 if (origin != null)
386                     n.name = Link.relativeTo (origin.getURL(), n.link.getURL());
387                 else
388                     n.name = n.link.getURL().toString();
389                 n.icon = null;
390                 break;
391             }
392             }
393             n.color = Colors.parseColor (page.getLabel ("Workbench.color"));
394             n.scale = page.getNumericLabel ("Workbench.size",
395                             new Integer JavaDoc (1)).doubleValue ();
396         }
397
398         if (n.icon == null) {
399             FontMetrics fm = getFontMetrics ();
400             n.width = fm.stringWidth (n.name) + 10;
401             n.height = fm.getHeight () + 4;
402         }
403         else {
404             n.width = (int)(n.icon.getWidth(this) * n.scale);
405             n.height = (int)(n.icon.getHeight(this) * n.scale);
406         }
407     }
408
409     WebEdge findEdge (Link l) {
410         if (l == null)
411                 return null;
412             Object JavaDoc obj = links.get (l);
413             if (obj instanceof WebEdge)
414                 return (WebEdge)obj;
415             else
416                 return null;
417     }
418
419     WebNode findNode (Link l) {
420         if (l == null)
421             return null;
422         Object JavaDoc obj = links.get (l);
423         if (obj instanceof WebEdge)
424             return (WebNode)((WebEdge)obj).to;
425         else
426             return (WebNode)obj;
427     }
428     
429     WebNode findParent (Link l) {
430         if (l == null)
431             return null;
432         Page source = l.getSource ();
433         Link origin = source.getOrigin ();
434         return findNode (origin);
435     }
436
437     /*
438      * LinkView listeners
439      */

440
441     private Vector JavaDoc listeners = new Vector JavaDoc ();
442
443     /**
444      * Add a listener for LinkViewEvents. A LinkViewEvent is sent every time a
445      * node or edge in the graph is double-clicked.
446      * @param listener Object that wants to receive LinkViewEvents
447      */

448     public void addLinkViewListener (LinkViewListener listener) {
449         if (!listeners.contains (listener))
450             listeners.addElement (listener);
451     }
452
453     /**
454      * Removes a listener from the set of LinkViewEvent listeners. If it is not found in the set,
455      * does nothing.
456      *
457      * @param listen a listener
458      */

459     public void removeLinkViewListener (CrawlListener listener) {
460         listeners.removeElement (listener);
461     }
462
463     void fireEvent (Link link) {
464         LinkViewEvent event = new LinkViewEvent (this, link);
465
466         for (int j=0, len=listeners.size(); j<len; ++j) {
467             LinkViewListener listen = (LinkViewListener)listeners.elementAt(j);
468             listen.viewLink (event);
469         }
470     }
471
472     void doubleClick (int x, int y) {
473         Object JavaDoc over = pick (x, y);
474         if (over != null) {
475             Link link;
476             if (over instanceof WebNode)
477                 link = ((WebNode)over).link;
478             else
479                 link = ((WebEdge)over).link;
480             fireEvent (link);
481         }
482     }
483         
484     public boolean handleEvent (Event event) {
485         if (event.id == Event.MOUSE_DOWN && event.clickCount == 2) {
486             doubleClick (event.x, event.y);
487         }
488         else
489             return super.handleEvent (event);
490         return true;
491     }
492     
493     public Link getSelectedLink () {
494         WebNode n = (WebNode)getSelectedNode();
495         if (n != null)
496             return n.link;
497             
498         WebEdge e = (WebEdge)getSelectedEdge();
499         if (e != null)
500             return e.link;
501             
502         return null;
503     }
504     
505     /**
506      * Create a new Frame containing a WebGraph connected to a crawler.
507      */

508     public static Frame monitor (Crawler crawler) {
509         Frame win = new ClosableFrame ("Graph: " + crawler.getName ());
510
511         WebGraph g = new WebGraph ();
512         crawler.addCrawlListener (g);
513         crawler.addLinkListener (g);
514         g.setNodeCharge (1000);
515         g.setRestLength (50);
516
517         win.add ("Center", g);
518         win.pack ();
519         win.show ();
520
521         return win;
522     }
523
524     static String JavaDoc[] getTip (Link link) {
525         Vector JavaDoc result = new Vector JavaDoc ();
526
527         String JavaDoc exception = link.getLabel ("exception");
528         if (exception != null && exception.length() > 0)
529             result.addElement ("*** " + exception);
530
531         String JavaDoc anchor = link.toText ();
532         if (anchor != null && anchor.length() > 0)
533             result.addElement (anchor);
534
535         String JavaDoc url = link.getURL ().toString ();
536         if (url != null && url.length() > 0)
537             result.addElement (url);
538
539         String JavaDoc labels = link.getObjectLabels ();
540         if (labels != null && labels.length() > 0)
541             result.addElement (labels);
542
543         String JavaDoc[] tip = new String JavaDoc[result.size ()];
544         result.copyInto (tip);
545         return tip;
546     }
547
548     static String JavaDoc[] getTip (Page page) {
549         Vector JavaDoc result = new Vector JavaDoc ();
550
551         String JavaDoc title = page.getTitle ();
552         if (title != null && title.length() > 0)
553             result.addElement (title);
554
555         String JavaDoc url = page.getURL ().toString();
556         if (url != null && url.length() > 0)
557             result.addElement (url);
558
559         String JavaDoc labels = page.getObjectLabels ();
560         if (labels != null && labels.length() > 0)
561             result.addElement (labels);
562
563         String JavaDoc[] tip = new String JavaDoc[result.size ()];
564         result.copyInto (tip);
565         return tip;
566     }
567
568
569     Hashtable JavaDoc icons = new Hashtable JavaDoc ();
570        // maps String (CrawlEvent name or user-defined icon name) to Image
571

572     Image pageIcon;
573     Image linkIcon;
574     Image retrievingIcon;
575     Image errorIcon;
576
577     /**
578      * Get a named icon.
579      * @param name Name of icon.
580      * @return icon associated with the name, or null if name unknown.
581      */

582     public synchronized Image getIcon (String JavaDoc name) {
583             return (Image)icons.get (name);
584     }
585
586     /**
587      * Map a name to an icon.
588      * @param name Name of icon.
589      * @param icon Icon image. If null, mapping is deleted.
590      */

591     public synchronized void setIcon (String JavaDoc name, Image icon) {
592         if (icon != null)
593            icons.put (name, icon);
594         else
595            icons.remove (name);
596     }
597
598     /**
599      * Set the default icon used for pages.
600      * @param icon Icon image. If null, mapping is deleted.
601      */

602     public synchronized void setPageIcon (Image icon) {
603         pageIcon = icon;
604         setIcon (LinkEvent.eventName[LinkEvent.VISITED], icon);
605     }
606
607     /**
608      * Set the default icon used for links.
609      * @param icon Icon image. If null, mapping is deleted.
610      */

611     public synchronized void setLinkIcon (Image icon) {
612         linkIcon = icon;
613         setIcon (LinkEvent.eventName[LinkEvent.QUEUED], icon);
614         setIcon (LinkEvent.eventName[LinkEvent.TOO_DEEP], icon);
615         setIcon (LinkEvent.eventName[LinkEvent.ALREADY_VISITED], icon);
616         setIcon (LinkEvent.eventName[LinkEvent.SKIPPED], icon);
617     }
618
619     /**
620      * Set the default icon used for requests in progress.
621      * @param icon Icon image. If null, mapping is deleted.
622      */

623     public synchronized void setRetrievingIcon (Image icon) {
624         retrievingIcon = icon;
625         setIcon (LinkEvent.eventName[LinkEvent.RETRIEVING], icon);
626         setIcon (LinkEvent.eventName[LinkEvent.DOWNLOADED], icon);
627    }
628
629     /**
630      * Set the default icon used for failed requests.
631      * @param icon Icon image. If null, mapping is deleted.
632      */

633     public synchronized void setErrorIcon (Image icon) {
634         errorIcon = icon;
635         setIcon (LinkEvent.eventName[LinkEvent.ERROR], icon);
636     }
637
638
639     public static Image defaultPageIcon;
640     public static Image defaultLinkIcon;
641     public static Image defaultRetrievingIcon;
642     public static Image defaultErrorIcon;
643
644     static int linkWidth = 17;
645     static int linkHeight = 17;
646     static int[] linkData = {
647     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
648     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
649     0xfffcfcfc, 0xff343464, 0xff343464, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
650     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
651     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464, 0xff343464,
652     0xffd4d4fc, 0xffc4c4c4, 0xff343464, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
653     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464,
654     0xff343464, 0xff343464, 0xff343464, 0xffd4d4fc, 0xffd4d4fc, 0xffc4c4c4,
655     0xff6464cc, 0xff343464, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
656     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464, 0xffccccfc, 0xff848484,
657     0xff343464, 0xffd4d4fc, 0xff848484, 0xff848484, 0xff6464cc, 0xff343464,
658     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
659     0xff343464, 0xff343464, 0xffd4d4fc, 0xffc4c4c4, 0xff343464, 0xffd4d4fc,
660     0xffc4c4c4, 0xff6464cc, 0xff6464cc, 0xff343464, 0xfffcfcfc, 0xfffcfcfc,
661     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464,
662     0xff343464, 0xffd4d4fc, 0xffc4c4c4, 0xff343464, 0xffd4d4fc, 0xffc4c4c4,
663     0xff6464cc, 0xff6464cc, 0xff343464, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
664     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464, 0xffccccfc, 0xffd4d4fc,
665     0xffc4c4c4, 0xff343464, 0xff343464, 0xff6464cc, 0xff6464cc, 0xff343464,
666     0xff343464, 0xff343464, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
667     0xfffcfcfc, 0xff343464, 0xffd4d4fc, 0xffc4c4c4, 0xffc4c4c4, 0xff343464,
668     0xfffcfcfc, 0xfffcfcfc, 0xff343464, 0xff343464, 0xffd4d4fc, 0xffccccfc,
669     0xff343464, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464,
670     0xffccccfc, 0xffc4c4c4, 0xff343464, 0xff343464, 0xfffcfcfc, 0xfffcfcfc,
671     0xff040404, 0xff343464, 0xffccccfc, 0xffc4c4c4, 0xffc4c4c4, 0xff343464,
672     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464, 0xff040404,
673     0xff343464, 0xff343464, 0xff343464, 0xfffcfcfc, 0xff040404, 0xff343464,
674     0xffccccfc, 0xffc4c4c4, 0xff343464, 0xff343464, 0xfffcfcfc, 0xfffcfcfc,
675     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464, 0xff343464, 0xffd4d4fc,
676     0xffc4c4c4, 0xffc4c4c4, 0xff343464, 0xff343464, 0xffccccfc, 0xffc4c4c4,
677     0xff343464, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
678     0xfffcfcfc, 0xfffcfcfc, 0xff343464, 0xffccccfc, 0xff040404, 0xff6464cc,
679     0xff6464cc, 0xff343464, 0xffccccfc, 0xff040404, 0xff343464, 0xfffcfcfc,
680     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
681     0xfffcfcfc, 0xff343464, 0xffccccfc, 0xff040404, 0xff6464cc, 0xff6464cc,
682     0xff343464, 0xffccccfc, 0xff040404, 0xff343464, 0xfffcfcfc, 0xfffcfcfc,
683     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464,
684     0xffccccfc, 0xffc4c4c4, 0xff6464cc, 0xff343464, 0xff343464, 0xffccccfc,
685     0xffc4c4c4, 0xff343464, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
686     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464, 0xff040404,
687     0xff6464cc, 0xff343464, 0xff343464, 0xff343464, 0xff343464, 0xff343464,
688     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
689     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343464, 0xff343464, 0xff343464,
690     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
691     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
692     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
693     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
694     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
695     0xfffcfcfc
696     };
697
698     static int pageWidth = 22;
699     static int pageHeight = 26;
700     static int[] pageData = {
701     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
702     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
703     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
704     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
705     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
706     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
707     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
708     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff343434, 0xff343434,
709     0xff343434, 0xff343434, 0xff343434, 0xff343434, 0xff343434, 0xff343434,
710     0xff343434, 0xff343434, 0xff343434, 0xff343434, 0xff343434, 0xffffff,
711     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
712     0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
713     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
714     0xfffcfcfc, 0xff343434, 0xfffcfcfc, 0xff343434, 0xffffff, 0xffffff,
715     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
716     0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
717     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343434,
718     0xfffcfcfc, 0xfffcfcfc, 0xff343434, 0xffffff, 0xffffff, 0xffffff,
719     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc,
720     0xfffcfcfc, 0xff343434, 0xff343434, 0xff343434, 0xff343434, 0xff343434,
721     0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xff343434, 0xfffcfcfc, 0xfffcfcfc,
722     0xfffcfcfc, 0xff343434, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
723     0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xff343434,
724     0xfffccc34, 0xfffccc34, 0xff64ccfc, 0xff64ccfc, 0xff64ccfc, 0xfffcfcfc,
725     0xfffcfcfc, 0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
726     0xff343434, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
727     0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xff343434, 0xfffccc34, 0xff64ccfc,
728     0xff64ccfc, 0xff64ccfc, 0xff64ccfc, 0xfffcfcfc, 0xfffcfcfc, 0xff040404,
729     0xff343434, 0xff040404, 0xff343434, 0xff040404, 0xff343434, 0xff040404,
730     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc,
731     0xfffcfcfc, 0xff343434, 0xff64ccfc, 0xff64ccfc, 0xff64ccfc, 0xff64ccfc,
732     0xff64ccfc, 0xfffcfcfc, 0xfffcfcfc, 0xff040404, 0xff040404, 0xff040404,
733     0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xffffff, 0xffffff,
734     0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xff343434,
735     0xff9c6434, 0xff9c6434, 0xff9c6434, 0xff9c6434, 0xff9c6434, 0xfffcfcfc,
736     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c,
737     0xff9c9c9c, 0xff040404, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
738     0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xff343434, 0xff9c6434, 0xff9c6434,
739     0xff9c6434, 0xff9c6434, 0xff9c6434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
740     0xfffcfcfc, 0xfffcfcfc, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff040404,
741     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc,
742     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
743     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
744     0xfffcfcfc, 0xfffcfcfc, 0xff9c9c9c, 0xff040404, 0xffffff, 0xffffff,
745     0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
746     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
747     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
748     0xff9c9c9c, 0xff040404, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
749     0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xff040404, 0xff040404, 0xff040404,
750     0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404,
751     0xff040404, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff9c9c9c, 0xff040404,
752     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc,
753     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
754     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
755     0xfffcfcfc, 0xfffcfcfc, 0xff9c9c9c, 0xff040404, 0xffffff, 0xffffff,
756     0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xff040404,
757     0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404,
758     0xff040404, 0xff040404, 0xff040404, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
759     0xff9c9c9c, 0xff040404, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
760     0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
761     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
762     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff9c9c9c, 0xff040404,
763     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc,
764     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffc3434, 0xfffcfcfc, 0xff040404,
765     0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xfffcfcfc,
766     0xfffcfcfc, 0xfffcfcfc, 0xff9c9c9c, 0xff040404, 0xffffff, 0xffffff,
767     0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
768     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
769     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
770     0xff9c9c9c, 0xff040404, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
771     0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffc3434,
772     0xfffcfcfc, 0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404,
773     0xff040404, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff9c9c9c, 0xff040404,
774     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc,
775     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
776     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
777     0xfffcfcfc, 0xfffcfcfc, 0xff9c9c9c, 0xff040404, 0xffffff, 0xffffff,
778     0xffffff, 0xffffff, 0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
779     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
780     0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
781     0xff9c9c9c, 0xff040404, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
782     0xff343434, 0xff343434, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c,
783     0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c,
784     0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff343434, 0xff040404,
785     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
786     0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404,
787     0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404,
788     0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xffffff, 0xffffff,
789     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
790     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
791     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
792     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
793     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
794     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
795     0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
796     0xffffff, 0xffffff
797     };
798
799     static int retrieveWidth = 8;
800     static int retrieveHeight = 8;
801     static int[] retrieveData = {
802         0xffffff, 0xffffff, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
803         0xffffff, 0xffffff, 0xffffff, 0xff008000, 0xff008000, 0xff008000,
804         0xff008000, 0xff008000, 0xff008000, 0xffffff, 0xff008000, 0xff008000,
805         0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
806         0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
807         0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
808         0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
809         0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
810         0xffffff, 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
811         0xff008000, 0xffffff, 0xffffff, 0xffffff, 0xff008000, 0xff008000,
812         0xff008000, 0xff008000, 0xffffff, 0xffffff
813     };
814
815     static int errorWidth = 8;
816     static int errorHeight = 8;
817     static int[] errorData = {
818     0xfffc0404, 0xfffc0404, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
819     0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfcfcfc,
820     0xfcfcfc, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfcfcfc, 0xfffc0404,
821     0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfcfcfc,
822     0xfcfcfc, 0xfcfcfc, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404,
823     0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfffc0404, 0xfffc0404,
824     0xfffc0404, 0xfffc0404, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfffc0404,
825     0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfcfcfc,
826     0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfcfcfc, 0xfcfcfc, 0xfffc0404,
827     0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfcfcfc, 0xfcfcfc,
828     0xfcfcfc, 0xfcfcfc, 0xfffc0404, 0xfffc0404
829     };
830   
831     static {
832         Toolkit tkit = Toolkit.getDefaultToolkit ();
833         defaultPageIcon = tkit.createImage (
834             new MemoryImageSource JavaDoc (pageWidth, pageHeight,
835                                    pageData, 0, pageWidth));
836         defaultLinkIcon = tkit.createImage (
837             new MemoryImageSource JavaDoc (linkWidth, linkHeight,
838                                    linkData, 0, linkWidth));
839         defaultRetrievingIcon = tkit.createImage (
840             new MemoryImageSource JavaDoc (retrieveWidth, retrieveHeight,
841                                    retrieveData, 0, retrieveWidth));
842         defaultErrorIcon = tkit.createImage (
843             new MemoryImageSource JavaDoc (errorWidth, errorHeight,
844                                    errorData, 0, errorWidth));
845
846     }
847 }
848
849
Popular Tags