1 32 33 package websphinx.workbench; 34 35 import websphinx.*; 36 import java.awt.*; 37 import java.util.Hashtable ; 38 import java.util.Vector ; 39 import java.net.URL ; 40 import java.net.MalformedURLException ; 41 import rcm.awt.ClosableFrame; 42 import java.awt.image.MemoryImageSource ; 43 import rcm.awt.Constrain; 44 import rcm.awt.PopupDialog; 45 import rcm.awt.Colors; 46 47 import symantec.itools.awt.TreeView; 49 import symantec.itools.awt.TreeNode; 50 51 public class WebOutline extends TreeView implements CrawlListener, LinkListener { 52 53 Hashtable links = new Hashtable (); 54 56 59 public WebOutline () { 60 setPageIcon (defaultPageIcon); 61 setLinkIcon (defaultRetrievingIcon); 62 setRetrievingIcon (defaultRetrievingIcon); 63 setErrorIcon (defaultErrorIcon); 64 } 65 66 67 70 public void showControlPanel () { 71 new WorkbenchControlPanel (null, this).show (); 72 } 73 74 77 public synchronized void clear () { 78 super.clear (); 79 links.clear (); 80 } 81 82 85 public void started (CrawlEvent event) { 86 } 87 88 91 public void stopped (CrawlEvent event) { 92 } 93 94 97 public void cleared (CrawlEvent event) { 98 clear (); 99 } 100 101 104 public void timedOut (CrawlEvent event) { 105 } 106 107 110 public void paused (CrawlEvent event) { 111 } 112 113 116 public void crawled (LinkEvent event) { 117 update (event.getLink ()); 118 } 119 120 121 123 static final int NO_LINKS = 0; 124 126 static final int RETRIEVED_LINKS = 1; 127 129 static final int WALKED_LINKS = 2; 130 132 static final int TREE_LINKS = 3; 133 135 static final int ALL_LINKS = 4; 136 138 int defaultFilter = RETRIEVED_LINKS; 139 140 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 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 for (int j=0; j<linkarray.length; ++j) { 171 update (linkarray[j]); } 173 } 174 } 175 176 TreeNode c = n.getChild(); 177 if (c != null) 178 reFilter (c, restrict); 179 } 180 } 181 182 183 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 205 static final int TITLE = 0; 206 208 static final int ABSOLUTE_URL = 1; 209 211 static final int RELATIVE_URL = 2; 212 214 int defaultRendering = TITLE; 215 216 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 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 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 String 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 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 363 364 private Vector listeners = new Vector (); 365 366 371 public void addLinkViewListener (LinkViewListener listener) { 372 if (!listeners.contains (listener)) 373 listeners.addElement (listener); 374 } 375 376 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 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 icons = new Hashtable (); 437 439 Image pageIcon; 440 Image linkIcon; 441 Image retrievingIcon; 442 Image errorIcon; 443 444 449 public Image getIcon (String name) { 450 return (Image)icons.get (name); 451 } 452 453 458 public void setIcon (String name, Image icon) { 459 if (icon != null) 460 icons.put (name, icon); 461 else 462 icons.remove (name); 463 } 464 465 469 public void setPageIcon (Image icon) { 470 pageIcon = icon; 471 setIcon (LinkEvent.eventName[LinkEvent.VISITED], icon); 472 } 473 474 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 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 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 (pageWidth, pageHeight, 706 pageData, 0, pageWidth)); 707 defaultLinkIcon = tkit.createImage ( 708 new MemoryImageSource (linkWidth, linkHeight, 709 linkData, 0, linkWidth)); 710 defaultRetrievingIcon = tkit.createImage ( 711 new MemoryImageSource (retrieveWidth, retrieveHeight, 712 retrieveData, 0, retrieveWidth)); 713 defaultErrorIcon = tkit.createImage ( 714 new MemoryImageSource (errorWidth, errorHeight, 715 errorData, 0, errorWidth)); 716 } 717 718 } 719 720 | Popular Tags |