websphinx.workbench
Class WebGraph

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--websphinx.workbench.GraphLayout
                    |
                    +--websphinx.workbench.WebGraph
All Implemented Interfaces:
javax.accessibility.Accessible, CrawlListener, java.awt.image.ImageObserver, LinkListener, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable

public class WebGraph
extends GraphLayout
implements CrawlListener, LinkListener


Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.awt.Image defaultErrorIcon
           
static java.awt.Image defaultLinkIcon
           
static java.awt.Image defaultPageIcon
           
static java.awt.Image defaultRetrievingIcon
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WebGraph()
          Make a WebGraph.
 
Method Summary
 void addLinkViewListener(LinkViewListener listener)
          Add a listener for LinkViewEvents.
 void clear()
          Clear the graph display.
 void cleared(CrawlEvent event)
          Notify that the crawler's state was cleared.
 void crawled(LinkEvent event)
          Notify that a crawling event has occured.
 java.awt.Image getIcon(java.lang.String name)
          Get a named icon.
 Link getSelectedLink()
           
 boolean handleEvent(java.awt.Event event)
           
static java.awt.Frame monitor(Crawler crawler)
          Create a new Frame containing a WebGraph connected to a crawler.
 void paused(CrawlEvent event)
          Notify that the crawler is paused
 void removeLinkViewListener(CrawlListener listener)
          Removes a listener from the set of LinkViewEvent listeners.
 void setErrorIcon(java.awt.Image icon)
          Set the default icon used for failed requests.
 void setIcon(java.lang.String name, java.awt.Image icon)
          Map a name to an icon.
 void setLinkIcon(java.awt.Image icon)
          Set the default icon used for links.
 void setPageIcon(java.awt.Image icon)
          Set the default icon used for pages.
 void setRetrievingIcon(java.awt.Image icon)
          Set the default icon used for requests in progress.
 void showControlPanel()
          Show control panel for changing graph layout parameters.
 void started(CrawlEvent event)
          Notify that the crawler started.
 void stopped(CrawlEvent event)
          Notify that the crawler has stopped.
 void timedOut(CrawlEvent event)
          Notify that the crawler has timed out
 void update(Link link)
          Update the edge and node associated with a link.
 void updateClosure(Link[] links)
          Update all the links that the crawler reached from this link.
 
Methods inherited from class websphinx.workbench.GraphLayout
addEdge, addNode, changedGraph, finalize, getAlgorithm, getAutomaticLayout, getEdgeColor, getFontMetrics, getGraph, getInterval, getIterations, getNodeCharge, getNodeColor, getQuiescent, getRestLength, getRunning, getSelectedEdge, getSelectedNode, getSpringConstant, getThreshold, getTipColor, imageUpdate, paint, pick, placeNodeOnGraph, placeNodeOnScreen, removeEdge, removeNode, repaint, run, setAlgorithm, setAutomaticLayout, setEdgeColor, setFont, setGraph, setInterval, setIterations, setNodeCharge, setNodeColor, setRestLength, setSpringConstant, setThreshold, setTipColor, start, stop, update
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, hasFocus, hide, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultPageIcon

public static java.awt.Image defaultPageIcon

defaultLinkIcon

public static java.awt.Image defaultLinkIcon

defaultRetrievingIcon

public static java.awt.Image defaultRetrievingIcon

defaultErrorIcon

public static java.awt.Image defaultErrorIcon
Constructor Detail

WebGraph

public WebGraph()
Make a WebGraph.

Method Detail

showControlPanel

public void showControlPanel()
Show control panel for changing graph layout parameters.

Overrides:
showControlPanel in class GraphLayout

clear

public void clear()
Clear the graph display.

Overrides:
clear in class GraphLayout

started

public void started(CrawlEvent event)
Notify that the crawler started.

Specified by:
started in interface CrawlListener

stopped

public void stopped(CrawlEvent event)
Notify that the crawler has stopped.

Specified by:
stopped in interface CrawlListener

cleared

public void cleared(CrawlEvent event)
Notify that the crawler's state was cleared.

Specified by:
cleared in interface CrawlListener

timedOut

public void timedOut(CrawlEvent event)
Notify that the crawler has timed out

Specified by:
timedOut in interface CrawlListener

paused

public void paused(CrawlEvent event)
Notify that the crawler is paused

Specified by:
paused in interface CrawlListener

crawled

public void crawled(LinkEvent event)
Notify that a crawling event has occured.

Specified by:
crawled in interface LinkListener

updateClosure

public void updateClosure(Link[] links)
Update all the links that the crawler reached from this link. Any reachable links not present in the graph are added.


update

public void update(Link link)
Update the edge and node associated with a link. If the link is not present in the graph, it is added.


addLinkViewListener

public void addLinkViewListener(LinkViewListener listener)
Add a listener for LinkViewEvents. A LinkViewEvent is sent every time a node or edge in the graph is double-clicked.

Parameters:
listener - Object that wants to receive LinkViewEvents

removeLinkViewListener

public void removeLinkViewListener(CrawlListener listener)
Removes a listener from the set of LinkViewEvent listeners. If it is not found in the set, does nothing.

Parameters:
listen - a listener

handleEvent

public boolean handleEvent(java.awt.Event event)
Overrides:
handleEvent in class GraphLayout

getSelectedLink

public Link getSelectedLink()

monitor

public static java.awt.Frame monitor(Crawler crawler)
Create a new Frame containing a WebGraph connected to a crawler.


getIcon

public java.awt.Image getIcon(java.lang.String name)
Get a named icon.

Parameters:
name - Name of icon.
Returns:
icon associated with the name, or null if name unknown.

setIcon

public void setIcon(java.lang.String name,
                    java.awt.Image icon)
Map a name to an icon.

Parameters:
name - Name of icon.
icon - Icon image. If null, mapping is deleted.

setPageIcon

public void setPageIcon(java.awt.Image icon)
Set the default icon used for pages.

Parameters:
icon - Icon image. If null, mapping is deleted.

setLinkIcon

public void setLinkIcon(java.awt.Image icon)
Set the default icon used for links.

Parameters:
icon - Icon image. If null, mapping is deleted.

setRetrievingIcon

public void setRetrievingIcon(java.awt.Image icon)
Set the default icon used for requests in progress.

Parameters:
icon - Icon image. If null, mapping is deleted.

setErrorIcon

public void setErrorIcon(java.awt.Image icon)
Set the default icon used for failed requests.

Parameters:
icon - Icon image. If null, mapping is deleted.