de.aitools.iv.graphdrawing
Class Visualization

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLayeredPane
                  extended by de.aitools.iv.graphdrawing.Visualization
All Implemented Interfaces:
ProvidesConfigurationPanel, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
DistortionVisualization, EmptyAISearchPanel, JTreeVisualization, NativeBoxTreeVisualization, NativeTreeVisualization

public abstract class Visualization
extends javax.swing.JLayeredPane
implements ProvidesConfigurationPanel

This abstract class is the common interface for all Visualizations.
Every Visualization must have a default constructor with no arguments.

Author:
Frank Benteler, bigben@upb.de 2004-01
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
Visualization()
           
 
Method Summary
abstract  void addClickHandler(ClickHandler clickHandler)
          adds a click handler, that will be notified, if the user left-clicks on a vertex
abstract  void addClientPopupHandler(java.awt.event.MouseListener listener)
          adds a click handler, that will be notified, if the user left-click on empty space within the visualization panel
abstract  void createDefaultConfiguration()
          create and use the default configuration
 int getAttachmentId()
          Returns an identifier, which is used to extract the attachment from a Vertex for this visualization.
If a client is attached, then method will return the id of this visualization.
If there is no client (stand-alone visualization) it will return zero.
abstract  VisualizationConfig getConfiguration()
           
abstract  ConfigurationPanel getConfigurationPanel()
           
abstract  UndirectedGraph getGraph()
           
abstract  java.lang.String getPreferredGraphType()
          currently not used.
abstract  Vertex getRoot()
           
abstract  void removeClickHandler(ClickHandler clickHandler)
           
abstract  void removeClientPopupHandler(java.awt.event.MouseListener listener)
           
 void setAttachmentID(int id)
          Sets the attachment ID to the specified one.
abstract  void setConfiguration(VisualizationConfig config)
          sets the Configuration to the specified one
abstract  void setParameters(java.lang.String params)
          Sets some internal parameters of the visualization
abstract  void setPopupClickHandler(PopupClickHandler pch)
          sets a click handler, that pops up, if the user right-clicks on a vertex
abstract  void setShade(Vertex vertex, double shade)
          Sets the shade value of the specified vertex.
 java.lang.String toString()
           
abstract  void update(UndirectedGraph graph, Vertex root)
          show the specified graph, with its root vertex.
abstract  void updateDisplayConfiguration()
          calculate new positions for every vertex of the graph.
abstract  void validate()
          make shure, the panel is painted correctly.
 
Methods inherited from class javax.swing.JLayeredPane
getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getPosition, highestLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, remove, removeAll, setLayer, setLayer, setPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Visualization

public Visualization()
Method Detail

update

public abstract void update(UndirectedGraph graph,
                            Vertex root)
show the specified graph, with its root vertex.
The vertices of the graph have to have special ID numbers: they have to be durchnummeriert form 0 to n-1, where n is the number of vertices in the graph.

Parameters:
graph - - UndirectedGraph to be shown
root - - the root vertex of the graph

updateDisplayConfiguration

public abstract void updateDisplayConfiguration()
calculate new positions for every vertex of the graph.


validate

public abstract void validate()
make shure, the panel is painted correctly.

Overrides:
validate in class java.awt.Container

getGraph

public abstract UndirectedGraph getGraph()
Returns:
the graph, that is currently shown.
Can be null.

getRoot

public abstract Vertex getRoot()
Returns:
the root vertex of the graph, that is currently shown.
Can be null.

setAttachmentID

public final void setAttachmentID(int id)
Sets the attachment ID to the specified one.

Parameters:
id - - int to be used as the attachmentID

getAttachmentId

public final int getAttachmentId()
Returns an identifier, which is used to extract the attachment from a Vertex for this visualization.
If a client is attached, then method will return the id of this visualization.
If there is no client (stand-alone visualization) it will return zero.

Returns:
id of this client-visualization, or zero, if this visualization is stand-alone

setPopupClickHandler

public abstract void setPopupClickHandler(PopupClickHandler pch)
sets a click handler, that pops up, if the user right-clicks on a vertex


addClickHandler

public abstract void addClickHandler(ClickHandler clickHandler)
adds a click handler, that will be notified, if the user left-clicks on a vertex


removeClickHandler

public abstract void removeClickHandler(ClickHandler clickHandler)

addClientPopupHandler

public abstract void addClientPopupHandler(java.awt.event.MouseListener listener)
adds a click handler, that will be notified, if the user left-click on empty space within the visualization panel


removeClientPopupHandler

public abstract void removeClientPopupHandler(java.awt.event.MouseListener listener)

setParameters

public abstract void setParameters(java.lang.String params)
Sets some internal parameters of the visualization


setShade

public abstract void setShade(Vertex vertex,
                              double shade)
Sets the shade value of the specified vertex.

Parameters:
vertex - - the vertex, where to set the shade value
shade - - double value between zero and one

createDefaultConfiguration

public abstract void createDefaultConfiguration()
create and use the default configuration


setConfiguration

public abstract void setConfiguration(VisualizationConfig config)
sets the Configuration to the specified one


getConfiguration

public abstract VisualizationConfig getConfiguration()
Returns:
the currently used VisualizationConfig

getConfigurationPanel

public abstract ConfigurationPanel getConfigurationPanel()
Specified by:
getConfigurationPanel in interface ProvidesConfigurationPanel
Returns:
a GUI-panel with settings which the user can change

getPreferredGraphType

public abstract java.lang.String getPreferredGraphType()
currently not used. Is intend to return a hint, which graph-type that visualization shows best


toString

public java.lang.String toString()
Overrides:
toString in class java.awt.Component
Returns:
getConfigurationPanel().getTitle();