All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Webcrawler.Visualizer.Visualizer

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----com.sun.java.swing.JFrame
                                           |
                                           +----Webcrawler.Visualizer.Visualizer

public class Visualizer
extends JFrame
implements Observer, ActionListener, ClipboardOwner
This is the Visualizer that displays the tree-structure created by the Crawler. A JTree object with the custom VisualizerCellRenderer is used for doing this. This visualizer also creates a menu for further operations on a selected node. One of those options is "Open With Browser" for which you need to specify the path to the browser. You can do this in the Settings-Dialog which can be reached by selecting Settings from the Visualizer menu. "Examine with NodeViewer" opens a new NodeViewer window and shows the info of the selected node there. "Copy URL" puts the URL of the selected node into the systems clipboard.

See Also:
VisualizerCellRenderer, NodeViewer, Visualizer. SettingsWindow

Variable Index

 o browserPath
 o completeURLs
 o lc
 o nodeNum
 o saveIcon
 o scrollpane
 o theCrawler
 o top
 o tracer
 o tree
 o treewin

Constructor Index

 o Visualizer()
Creates a new Visualizer-window which, in the beginnning, only contains the menu.

Method Index

 o actionPerformed(ActionEvent)
 o addVisualNode(URLNode)
If there's no JTree in this window yet, it is created and the node n is added as the root of the tree.
 o findNode(URLNode)
 o lostOwnership(Clipboard, Transferable)
 o typeChanged(URLNode)
only updates the graphics, so that it corresponds to the info stored in n.
 o update(Observable, Object)
Called when the Crawler sends out VisualizerMessages.

Variables

 o saveIcon
 static ImageIcon saveIcon
 o browserPath
 private String browserPath
 o top
 private DefaultMutableTreeNode top
 o tree
 private JTree tree
 o scrollpane
 private JScrollPane scrollpane
 o lc
 private JLayeredPane lc
 o treewin
 private JInternalFrame treewin
 o tracer
 private Tracer tracer
 o theCrawler
 private Crawler theCrawler
 o nodeNum
 private int nodeNum
 o completeURLs
 private boolean completeURLs

Constructors

 o Visualizer
 public Visualizer()
Creates a new Visualizer-window which, in the beginnning, only contains the menu. When the crawler sends out VisualizerMessages to its attached observers, this window will be filled with the visualisation of the tree-structure built by the Crawler.

Methods

 o update
 public synchronized void update(Observable crawler,
                                 Object message)
Called when the Crawler sends out VisualizerMessages. Depending on the ID of the message this method calls either addVisualNode or typeChanged.

Parameters:
message - a VisualizerMessage-object
 o addVisualNode
 public void addVisualNode(URLNode n)
If there's no JTree in this window yet, it is created and the node n is added as the root of the tree. Otherwise this method searches for the visualised father of n and attaches n as a visualised son. This method is called by the update()-method.

Parameters:
n - the node that was added by the crawler
 o typeChanged
 public void typeChanged(URLNode n)
only updates the graphics, so that it corresponds to the info stored in n. This method is called by the update()-method.

Parameters:
n - the node whose info changed
 o findNode
 private DefaultMutableTreeNode findNode(URLNode n)
 o actionPerformed
 public void actionPerformed(ActionEvent e)
 o lostOwnership
 public void lostOwnership(Clipboard clipboard,
                           Transferable contents)

All Packages  Class Hierarchy  This Package  Previous  Next  Index