KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > websphinx > workbench > WebOutline


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.net.URL JavaDoc;
40 import java.net.MalformedURLException JavaDoc;
41 import rcm.awt.ClosableFrame;
42 import java.awt.image.MemoryImageSource JavaDoc;
43 import rcm.awt.Constrain;
44 import rcm.awt.PopupDialog;
45 import rcm.awt.Colors;
46
47 // Symantec tree widget
48
import symantec.itools.awt.TreeView;
49 import symantec.itools.awt.TreeNode;
50
51 public class WebOutline extends TreeView implements CrawlListener, LinkListener {
52
53     Hashtable JavaDoc links = new Hashtable JavaDoc ();
54        // maps Link -> TreeNode
55

56     /**
57      * Make a WebOutline.
58      */

59     public WebOutline () {
60         setPageIcon (defaultPageIcon);
61         setLinkIcon (defaultRetrievingIcon);
62         setRetrievingIcon (defaultRetrievingIcon);
63         setErrorIcon (defaultErrorIcon);
64     }
65
66
67     /**
68      * Show control panel for changing layout parameters.
69      */

70     public void showControlPanel () {
71         new WorkbenchControlPanel (null, this).show ();
72     }
73
74     /**
75      * Clear the outline.
76      */

77     public synchronized void clear () {
78         super.clear ();
79         links.clear ();
80     }
81
82     /**
83      * Notify that the crawler started.
84      */

85     public void started (CrawlEvent event) {
86     }
87
88     /**
89      * Notify that the crawler has stopped.
90      */

91     public void stopped (CrawlEvent event) {
92     }
93
94     /**
95      * Notify that the crawler's state was cleared.
96      */

97     public void cleared (CrawlEvent event) {
98         clear ();
99     }
100
101     /**
102      * Notify that the crawler has timed out
103      */

104     public void timedOut (CrawlEvent event) {
105     }
106
107     /**
108      * Notify that the crawler is paused
109      */

110     public void paused (CrawlEvent event) {
111     }
112
113     /**
114      * Notify that a crawling event has occured.
115      */

116     public void crawled (LinkEvent event) {
117         update (event.getLink ());
118     }
119
120
121     // Page filter
122

123     static final int NO_LINKS = 0;
124         // Show no outgoing links
125

126     static final int RETRIEVED_LINKS = 1;
127         // Show only links that crawler started to retrieve
128

129     static final int WALKED_LINKS = 2;
130         // Show RETRIEVED_LINKS, plus links queued for retrieval
131

132     static final int TREE_LINKS = 3;
133         // Show WALKED_LINKS, plus links skipped by walk()
134

135     static final int ALL_LINKS = 4;
136         // Show TREE_LINKS, plus links to already-visited pages
137

138     int defaultFilter = RETRIEVED_LINKS;
139
140     // Change the filter of ALL nodes
141
synchronized void setLinkFilter (int filter) {
142         if (filter == defaultFilter)
143             return;
144            
145         int old = defaultFilter;
146         defaultFilter = filter;
147         reFilter (getRootNode (), old > filter);
148         triggerRedraw ();
149     }
150         
151     void reFilter (TreeNode n, boolean restrict) {
152         for (; n != null; n = n.getSibling ()) {
153             Link link = (Link)n.getDataObject();
154             Page page = link.getPage ();
155             if (page != null) {
156                 Link[] linkarray = page.getLinks ();
157
158                 if (restrict) {
159                     // new mode is more restrictive; delete undesired children
160
for (int j=0; j<linkarray.length; ++j) {
161                         if (!shouldDisplay (linkarray[j].getStatus())) {
162                             TreeNode child = findNode (linkarray[j]);
163                             if (child != null)
164                                 remove (child);
165                         }
166                     }
167                 }
168                 else {
169                     // new mode is less restrictive; add children
170
for (int j=0; j<linkarray.length; ++j) {
171                         update (linkarray[j]); // update() will check shouldDisplay()
172
}
173                 }
174             }
175             
176             TreeNode c = n.getChild();
177             if (c != null)
178                 reFilter (c, restrict);
179         }
180     }
181     
182
183     // check whether we want to display a link with this status
184
boolean shouldDisplay (int status) {
185         switch (status) {
186            case LinkEvent.QUEUED:
187            case LinkEvent.TOO_DEEP:
188              return (defaultFilter > RETRIEVED_LINKS);
189            case LinkEvent.SKIPPED:
190              return (defaultFilter > WALKED_LINKS);
191            case LinkEvent.ALREADY_VISITED:
192              return false;
193           case LinkEvent.RETRIEVING:
194           case LinkEvent.DOWNLOADED:
195           case LinkEvent.VISITED:
196           case LinkEvent.ERROR:
197             return true;
198           default:
199             return false;
200         }
201     }
202
203     // Node rendering
204

205     static final int TITLE = 0;
206         // Show page title (or URL if not downloaded)
207

208     static final int ABSOLUTE_URL = 1;
209         // Show absolute URL
210

211     static final int RELATIVE_URL = 2;
212         // Show URL relative to parent
213

214     int defaultRendering = TITLE;
215
216     // Change the rendering of ALL nodes
217
synchronized void setNodeRendering (int r) {
218         defaultRendering = r;
219         reRender (getRootNode ());
220         triggerRedraw ();
221     }
222
223     void reRender (TreeNode n) {
224         for (; n != null; n = n.getSibling ()) {
225             update (n);
226             
227             TreeNode c = n.getChild();
228             if (c != null)
229                 reRender (c);
230         }
231     }
232     
233
234     /**
235      * Update all the links that the crawler reached from this link.
236      * Any reachable links not present in the graph are added.
237      */

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

262     public synchronized void update (Link link) {
263         if (!shouldDisplay (link.getStatus ()))
264             return;
265
266         TreeNode n = findNode (link);
267         if (n == null)
268             add (link);
269         else
270             update (n);
271
272         redraw ();
273     }
274
275     synchronized void add (Link link) {
276         TreeNode n = new TreeNode ("");
277         n.setDataObject (link);
278
279         Page source = link.getSource ();
280         Link origin = source.getOrigin ();
281         TreeNode parent = findNode (origin);
282
283         if (parent == null) {
284             update (n);
285             append (n);
286         }
287         else {
288             update (n);
289             insert (n, parent, CHILD);
290             parent.expand ();
291         }
292         links.put (link, n);
293     }
294
295     void update (TreeNode n) {
296         Link link = (Link)n.getDataObject ();
297         Page page = link.getPage ();
298         int status = link.getStatus ();
299
300         Image icon = getIcon (LinkEvent.eventName[status]);
301         n.setExpandedImage (icon);
302         n.setCollapsedImage (icon);
303
304         if (page == null) {
305             // not downloaded yet
306
String JavaDoc name = "";
307             switch (defaultRendering) {
308                 case TITLE:
309                 case ABSOLUTE_URL:
310                     name = link.getURL().toString();
311                     break;
312                 case RELATIVE_URL: {
313                     Link origin = link.getSource().getOrigin();
314                     if (origin != null)
315                         name = Link.relativeTo (origin.getURL(), link.getURL());
316                     else
317                         name = link.getURL().toString();
318                     break;
319                 }
320             }
321             n.setText (name);
322
323             n.setColor (Colors.parseColor (link.getLabel ("Workbench.color")));
324         }
325         else {
326             String JavaDoc name = "";
327             switch (defaultRendering) {
328                 case TITLE: {
329                     name = page.getTitle ();
330                     if (name == null)
331                         name = link.getURL().toString();
332                     break;
333                 }
334                 case ABSOLUTE_URL:
335                     name = link.getURL().toString();
336                     break;
337                 case RELATIVE_URL: {
338                     Link origin = link.getSource().getOrigin();
339                     if (origin != null)
340                         name = Link.relativeTo (origin.getURL(), link.getURL());
341                     else
342                         name = link.getURL().toString();
343                     break;
344                 }
345             }
346             n.setText (name);
347
348             n.setColor (Colors.parseColor (page.getLabel ("Workbench.color")));
349         }
350
351     }
352
353     TreeNode findNode (Link l) {
354         if (l == null)
355             return null;
356         else
357             return (TreeNode)links.get (l);
358     }
359
360     /*
361      * LinkView listeners
362      */

363
364     private Vector JavaDoc listeners = new Vector JavaDoc ();
365
366     /**
367      * Add a listener for LinkViewEvents. A LinkViewEvent is sent every time a
368      * node or edge in the graph is double-clicked.
369      * @param listener Object that wants to receive LinkViewEvents
370      */

371     public void addLinkViewListener (LinkViewListener listener) {
372         if (!listeners.contains (listener))
373             listeners.addElement (listener);
374     }
375
376     /**
377      * Removes a listener from the set of LinkViewEvent listeners. If it is not found in the set,
378      * does nothing.
379      *
380      * @param listen a listener
381      */

382     public void removeLinkViewListener (CrawlListener listener) {
383         listeners.removeElement (listener);
384     }
385
386     void fireEvent (Link link) {
387         LinkViewEvent event = new LinkViewEvent (this, link);
388
389         for (int j=0, len=listeners.size(); j<len; ++j) {
390             LinkViewListener listen = (LinkViewListener)listeners.elementAt(j);
391             listen.viewLink (event);
392         }
393     }
394
395     public boolean handleEvent (Event event) {
396         if (event.id == Event.ACTION_EVENT) {
397             TreeNode n = (TreeNode)getSelectedNode();
398             if (n != null)
399                 fireEvent ((Link)n.getDataObject());
400         }
401         else if (event.id == Event.MOUSE_DOWN && event.metaDown())
402             showControlPanel ();
403         else
404             return super.handleEvent (event);
405         return true;
406     }
407     
408     public Link getSelectedLink () {
409         TreeNode n = getSelectedNode();
410         if (n != null)
411             return (Link)n.getDataObject();
412             
413         return null;
414     }
415     
416
417     /**
418      * Create a new Frame containing a WebOutline connected to a crawler.
419      */

420     public static Frame monitor (Crawler crawler) {
421         Frame win = new ClosableFrame ("Outline: " + crawler.getName ());
422
423         WebOutline g = new WebOutline ();
424         crawler.addCrawlListener (g);
425         crawler.addLinkListener (g);
426
427         win.add ("Center", g);
428         win.pack ();
429         win.show ();
430
431         return win;
432     }
433
434
435
436     Hashtable JavaDoc icons = new Hashtable JavaDoc ();
437        // maps String (CrawlEvent name or user-defined icon name) to Image
438

439     Image pageIcon;
440     Image linkIcon;
441     Image retrievingIcon;
442     Image errorIcon;
443
444     /**
445      * Get a named icon.
446      * @param name Name of icon.
447      * @return icon associated with the name, or null if name unknown.
448      */

449     public Image getIcon (String JavaDoc name) {
450             return (Image)icons.get (name);
451     }
452
453     /**
454      * Map a name to an icon.
455      * @param name Name of icon.
456      * @param icon Icon image. If null, mapping is deleted.
457      */

458     public void setIcon (String JavaDoc name, Image icon) {
459         if (icon != null)
460            icons.put (name, icon);
461         else
462            icons.remove (name);
463     }
464
465     /**
466      * Set the default icon used for pages.
467      * @param icon Icon image. If null, mapping is deleted.
468      */

469     public void setPageIcon (Image icon) {
470         pageIcon = icon;
471         setIcon (LinkEvent.eventName[LinkEvent.VISITED], icon);
472     }
473
474     /**
475      * Set the default icon used for links.
476      * @param icon Icon image. If null, mapping is deleted.
477      */

478     public void setLinkIcon (Image icon) {
479         linkIcon = icon;
480         setIcon (LinkEvent.eventName[LinkEvent.QUEUED], icon);
481         setIcon (LinkEvent.eventName[LinkEvent.ALREADY_VISITED], icon);
482         setIcon (LinkEvent.eventName[LinkEvent.SKIPPED], icon);
483     }
484
485     /**
486      * Set the default icon used for requests in progress.
487      * @param icon Icon image. If null, mapping is deleted.
488      */

489     public void setRetrievingIcon (Image icon) {
490         retrievingIcon = icon;
491         setIcon (LinkEvent.eventName[LinkEvent.RETRIEVING], icon);
492         setIcon (LinkEvent.eventName[LinkEvent.DOWNLOADED], icon);
493    }
494
495     /**
496      * Set the default icon used for failed requests.
497      * @param icon Icon image. If null, mapping is deleted.
498      */

499     public void setErrorIcon (Image icon) {
500         errorIcon = icon;
501         setIcon (LinkEvent.eventName[LinkEvent.ERROR], icon);
502     }
503
504
505     public static Image defaultPageIcon;
506     public static Image defaultLinkIcon;
507     public static Image defaultRetrievingIcon;
508     public static Image defaultErrorIcon;
509
510     static int errorWidth = 16;
511     static int errorHeight = 16;
512     static int[] errorData = {
513         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
514         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
515         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
516         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
517         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
518         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
519         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
520         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
521         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
522         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
523         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
524         0xffffff, 0xffffff, 0xfffc0404, 0xfffc0404, 0xffffff, 0xffffff,
525         0xffffff, 0xffffff, 0xfffc0404, 0xfffc0404, 0xffffff, 0xffffff,
526         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
527         0xfffc0404, 0xfffc0404, 0xfffc0404, 0xffffff, 0xffffff, 0xfffc0404,
528         0xfffc0404, 0xfffc0404, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
529         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xfffc0404,
530         0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xffffff,
531         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
532         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xfffc0404, 0xfffc0404,
533         0xfffc0404, 0xfffc0404, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
534         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
535         0xffffff, 0xffffff, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404,
536         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
537         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xfffc0404,
538         0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xffffff,
539         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
540         0xffffff, 0xffffff, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xffffff,
541         0xffffff, 0xfffc0404, 0xfffc0404, 0xfffc0404, 0xffffff, 0xffffff,
542         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
543         0xfffc0404, 0xfffc0404, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
544         0xfffc0404, 0xfffc0404, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
545         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
546         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
547         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
548         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
549         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
550         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
551         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
552         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
553         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
554         0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
555         0xffffff, 0xffffff, 0xffffff, 0xffffff
556     };
557
558     static int linkWidth = 16;
559     static int linkHeight = 16;
560     static int[] linkData = {
561         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
562         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
563         0xfcfcfc, 0xff343464, 0xff343464, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
564         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
565         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xff343464, 0xff343464, 0xffd4d4fc,
566         0xffc4c4c4, 0xff343464, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
567         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xff343464, 0xff343464, 0xff343464,
568         0xff343464, 0xffd4d4fc, 0xffd4d4fc, 0xffc4c4c4, 0xff6464cc, 0xff343464,
569         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
570         0xff343464, 0xffccccfc, 0xff848484, 0xff343464, 0xffd4d4fc, 0xff848484,
571         0xff848484, 0xff6464cc, 0xff343464, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
572         0xfcfcfc, 0xfcfcfc, 0xff343464, 0xff343464, 0xffd4d4fc, 0xffc4c4c4,
573         0xff343464, 0xffd4d4fc, 0xffc4c4c4, 0xff6464cc, 0xff6464cc, 0xff343464,
574         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
575         0xff343464, 0xff343464, 0xffd4d4fc, 0xffc4c4c4, 0xff343464, 0xffd4d4fc,
576         0xffc4c4c4, 0xff6464cc, 0xff6464cc, 0xff343464, 0xfcfcfc, 0xfcfcfc,
577         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xff343464, 0xffccccfc, 0xffd4d4fc,
578         0xffc4c4c4, 0xff343464, 0xff343464, 0xff6464cc, 0xff6464cc, 0xff343464,
579         0xff343464, 0xff343464, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
580         0xff343464, 0xffd4d4fc, 0xffc4c4c4, 0xffc4c4c4, 0xff343464, 0xfcfcfc,
581         0xfcfcfc, 0xff343464, 0xff343464, 0xffd4d4fc, 0xffccccfc, 0xff343464,
582         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xff343464, 0xffccccfc, 0xffc4c4c4,
583         0xff343464, 0xff343464, 0xfcfcfc, 0xfcfcfc, 0xff040404, 0xff343464,
584         0xffccccfc, 0xffc4c4c4, 0xffc4c4c4, 0xff343464, 0xfcfcfc, 0xfcfcfc,
585         0xfcfcfc, 0xff343464, 0xff040404, 0xff343464, 0xff343464, 0xff343464,
586         0xfcfcfc, 0xff040404, 0xff343464, 0xffccccfc, 0xffc4c4c4, 0xff343464,
587         0xff343464, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xff343464,
588         0xff343464, 0xffd4d4fc, 0xffc4c4c4, 0xffc4c4c4, 0xff343464, 0xff343464,
589         0xffccccfc, 0xffc4c4c4, 0xff343464, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
590         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xff343464, 0xffccccfc, 0xff040404,
591         0xff6464cc, 0xff6464cc, 0xff343464, 0xffccccfc, 0xff040404, 0xff343464,
592         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
593         0xfcfcfc, 0xff343464, 0xffccccfc, 0xff040404, 0xff6464cc, 0xff6464cc,
594         0xff343464, 0xffccccfc, 0xff040404, 0xff343464, 0xfcfcfc, 0xfcfcfc,
595         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xff343464, 0xffccccfc,
596         0xffc4c4c4, 0xff6464cc, 0xff343464, 0xff343464, 0xffccccfc, 0xffc4c4c4,
597         0xff343464, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
598         0xfcfcfc, 0xfcfcfc, 0xff343464, 0xff040404, 0xff6464cc, 0xff343464,
599         0xff343464, 0xff343464, 0xff343464, 0xff343464, 0xfcfcfc, 0xfcfcfc,
600         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
601         0xff343464, 0xff343464, 0xff343464, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
602         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc,
603         0xfcfcfc, 0xfcfcfc, 0xfcfcfc, 0xfcfcfc
604     };
605
606 static int retrieveWidth = 16;
607 static int retrieveHeight = 16;
608 static int[] retrieveData = {
609 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
610 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
611 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
612 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
613 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
614 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
615 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
616 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
617 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
618 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
619 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
620 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff008000, 0xff008000,
621 0xff008000, 0xff008000, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
622 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
623 0xffffff, 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
624 0xff008000, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
625 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff008000, 0xff008000,
626 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
627 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
628 0xffffff, 0xffffff, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
629 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xffffff, 0xffffff,
630 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
631 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
632 0xff008000, 0xff008000, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
633 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xff008000, 0xff008000,
634 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
635 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
636 0xffffff, 0xffffff, 0xffffff, 0xff008000, 0xff008000, 0xff008000,
637 0xff008000, 0xff008000, 0xff008000, 0xffffff, 0xffffff, 0xffffff,
638 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
639 0xffffff, 0xffffff, 0xff008000, 0xff008000, 0xff008000, 0xff008000,
640 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
641 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
642 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
643 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
644 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
645 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
646 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
647 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
648 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
649 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
650 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
651 0xffffff, 0xffffff, 0xffffff, 0xffffff
652 };
653
654 static int pageWidth = 16;
655 static int pageHeight = 16;
656 static int[] pageData = {
657 0xffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
658 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
659 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff343434,
660 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
661 0xfffcfcfc, 0xfffcfcfc, 0xff343434, 0xffffffff, 0xff000000, 0xffff,
662 0xffff, 0xffff, 0xffff, 0xff343434, 0xfffcfcfc, 0xff343434,
663 0xff343434, 0xff343434, 0xff343434, 0xff343434, 0xfffcfcfc, 0xfffcfcfc,
664 0xff343434, 0xffffffff, 0xffffffff, 0xff343434, 0xffff, 0xffff,
665 0xffff, 0xff343434, 0xfffcfcfc, 0xff343434, 0xfffccc34, 0xfffccc34,
666 0xff64ccfc, 0xff64ccfc, 0xfffcfcfc, 0xfffcfcfc, 0xff343434, 0xffffffff,
667 0xffffffff, 0xffffffff, 0xff343434, 0xffff, 0xffff, 0xff343434,
668 0xfffcfcfc, 0xff343434, 0xff64ccfc, 0xff64ccfc, 0xff64ccfc, 0xff64ccfc,
669 0xfffcfcfc, 0xfffcfcfc, 0xff040404, 0xff040404, 0xff040404, 0xff040404,
670 0xff040404, 0xffff, 0xffff, 0xff343434, 0xfffcfcfc, 0xff343434,
671 0xff9c6434, 0xff9c6434, 0xff9c6434, 0xff9c6434, 0xfffcfcfc, 0xfffcfcfc,
672 0xfffcfcfc, 0xfffcfcfc, 0xffffffff, 0xff000000, 0xff9c9c9c, 0xffff,
673 0xffff, 0xff343434, 0xfffcfcfc, 0xff343434, 0xff9c6434, 0xff9c6434,
674 0xff9c6434, 0xff9c6434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
675 0xfffcfcfc, 0xff000000, 0xff9c9c9c, 0xffff, 0xffff, 0xff343434,
676 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
677 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff000000,
678 0xff9c9c9c, 0xffff, 0xffff, 0xff343434, 0xfffcfcfc, 0xff040404,
679 0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xff040404,
680 0xff040404, 0xff040404, 0xfffcfcfc, 0xff000000, 0xff9c9c9c, 0xffff,
681 0xffff, 0xff343434, 0xfffcfcfc, 0xffffffff, 0xffffffff, 0xffffffff,
682 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
683 0xfffcfcfc, 0xff000000, 0xff9c9c9c, 0xffff, 0xffff, 0xff343434,
684 0xffffffff, 0xffffffff, 0xfffcfcfc, 0xfffc3434, 0xfffcfcfc, 0xff040404,
685 0xff040404, 0xff040404, 0xff040404, 0xff040404, 0xfffcfcfc, 0xff000000,
686 0xff9c9c9c, 0xffff, 0xffff, 0xff343434, 0xfffcfcfc, 0xfffcfcfc,
687 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc,
688 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xff000000, 0xff9c9c9c, 0xffff,
689 0xffff, 0xff343434, 0xfffcfcfc, 0xfffcfcfc, 0xfffcfcfc, 0xfffc3434,
690 0xfffcfcfc, 0xff000000, 0xff000000, 0xff040404, 0xff040404, 0xff040404,
691 0xfffcfcfc, 0xff000000, 0xff9c9c9c, 0xffff, 0xffff, 0xff343434,
692 0xfffcfcfc, 0xfffcfcfc, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
693 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffcfcfc, 0xff000000,
694 0xff9c9c9c, 0xffff, 0xffff, 0xff000000, 0xff000000, 0xff000000,
695 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
696 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff9c9c9c, 0xffff,
697 0xffff, 0xffff, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c,
698 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c, 0xff9c9c9c,
699 0xff9c9c9c, 0xff9c9c9c, 0xffff, 0xffff
700 };
701   
702     static {
703         Toolkit tkit = Toolkit.getDefaultToolkit ();
704         defaultPageIcon = tkit.createImage (
705             new MemoryImageSource JavaDoc (pageWidth, pageHeight,
706                                    pageData, 0, pageWidth));
707         defaultLinkIcon = tkit.createImage (
708             new MemoryImageSource JavaDoc (linkWidth, linkHeight,
709                                    linkData, 0, linkWidth));
710         defaultRetrievingIcon = tkit.createImage (
711             new MemoryImageSource JavaDoc (retrieveWidth, retrieveHeight,
712                                    retrieveData, 0, retrieveWidth));
713         defaultErrorIcon = tkit.createImage (
714             new MemoryImageSource JavaDoc (errorWidth, errorHeight,
715                                    errorData, 0, errorWidth));
716     }
717
718 }
719
720
Popular Tags