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
-
browserPath
-
-
completeURLs
-
-
lc
-
-
nodeNum
-
-
saveIcon
-
-
scrollpane
-
-
theCrawler
-
-
top
-
-
tracer
-
-
tree
-
-
treewin
-
-
Visualizer()
- Creates a new Visualizer-window which, in the beginnning, only
contains the menu.
-
actionPerformed(ActionEvent)
-
-
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.
-
findNode(URLNode)
-
-
lostOwnership(Clipboard, Transferable)
-
-
typeChanged(URLNode)
- only updates the graphics, so that it corresponds to the info stored in n.
-
update(Observable, Object)
-
Called when the Crawler sends out VisualizerMessages.
saveIcon
static ImageIcon saveIcon
browserPath
private String browserPath
top
private DefaultMutableTreeNode top
tree
private JTree tree
scrollpane
private JScrollPane scrollpane
lc
private JLayeredPane lc
treewin
private JInternalFrame treewin
tracer
private Tracer tracer
theCrawler
private Crawler theCrawler
nodeNum
private int nodeNum
completeURLs
private boolean completeURLs
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.
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
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
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
findNode
private DefaultMutableTreeNode findNode(URLNode n)
actionPerformed
public void actionPerformed(ActionEvent e)
lostOwnership
public void lostOwnership(Clipboard clipboard,
Transferable contents)
All Packages Class Hierarchy This Package Previous Next Index