org.graffiti.plugin.view
Class AbstractView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.graffiti.plugin.view.AbstractView
All Implemented Interfaces:
Autoscroll, ImageObserver, MenuContainer, Serializable, EventListener, AttributeConsumer, AttributeListener, EdgeListener, GraphListener, NodeListener, TransactionListener, View, Zoomable

public abstract class AbstractView
extends JComponent
implements View, Zoomable

enclosing_type

Version:
$Revision: 5768 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  AttributeComponentManager acm
          The AttributeComponentManager that tells the view what class to use as AttributeComponents for attributes
protected static int autoresizeMargin
          The autoresize margin.
protected static Insets autoscrollInsets
          The insets of the autoscroll.
protected static int autoscrollMargin
          The autoscroll margin.
protected static Bundle coreBundle
          The Bundle of the exceptions.
protected  Graph currentGraph
          The Graph with which this view is associated.
protected  Map<GraphElement,GraphElementComponent> graphElementComponents
          Contains a mapping from GraphElement to its GraphElementComponent.
protected  int id
          Unique id of the view (session wide).
protected  Set<MessageListener> messageListeners
          Contains MessageListeners which are interesting for messages generated by the view i.e.
protected  String viewName
          The name of the this view.
protected  AffineTransform zoom
          The current zoom for this view.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 org.graffiti.plugin.view.View
NO_ZOOM
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AbstractView()
          Constructs a new GraffitiView.
AbstractView(Graph currentGraph)
          Constructs a new GraffitiView for the specified Graph.
 
Method Summary
 void addMessageListener(MessageListener ml)
          Adds a message listener to the view.
 void autoresize(Point location)
          Resizes the panel dynamically so that enough drawing space is available.
 void autoscroll(Point location)
           
 void close()
          Closes the current view.
protected abstract  String extractName()
          Extracts the name of the view class.
 Insets getAutoscrollInsets()
           
 Map<GraphElement,GraphElementComponent> getComponentElementMap()
          Returns the map mapping GraphElements with GraphElementComponents.
 GraphElementComponent getComponentForElement(GraphElement ge)
          Returns the main GraphElementComponent associated with the given GraphELement.
 Grid getGrid()
          Returns the current Grid of this view.
 int getId()
          Get unique id of this view.
 JComponent getViewComponent()
          Returns the main component of the view.
 String getViewName()
          Returns the viewName.
 double getZoom()
          Returns the zoom factor.
 AffineTransform getZoomTransform()
          Returns the AffineTransform representing the current zoom.
protected  void informMessageListener(String message, int type)
          Method informMessageListener informs all registered message listener about a new message having to be displayed.
 void postAttributeAdded(AttributeEvent e)
          Called after an attribute has been added.
 void postAttributeChanged(AttributeEvent e)
          Called after an attribute has been changed.
 void postAttributeRemoved(AttributeEvent e)
          Called after an attribute has been removed.
 void postDirectedChanged(EdgeEvent e)
          Called after the edge was set directed or undirected.
 void postEdgeAdded(GraphEvent e)
          Called after an edge has been added to the graph.
 void postEdgeRemoved(GraphEvent e)
          Called after an edge has been removed from the graph.
 void postEdgeReversed(EdgeEvent e)
          Called after the edge has been reversed.
 void postGraphCleared(GraphEvent e)
          Called after method clear() has been called on a graph.
 void postInEdgeAdded(NodeEvent e)
          Called just after an incoming edge has been added to the node.
 void postInEdgeRemoved(NodeEvent e)
          Called after an incoming edge has been removed from the node.
 void postNodeAdded(GraphEvent e)
          Called after an edge has been added to the graph.
 void postNodeRemoved(GraphEvent e)
          Called after a node has been removed from the graph.
 void postOutEdgeAdded(NodeEvent e)
          Called after an outgoing edge has been added to the node.
 void postOutEdgeRemoved(NodeEvent e)
          Called after an outgoing edge has been removed from the node.
 void postSourceNodeChanged(EdgeEvent e)
          Called after the source node of an edge has changed.
 void postTargetNodeChanged(EdgeEvent e)
          Called after the target node of an edge has changed.
 void postUndirectedEdgeAdded(NodeEvent e)
          Called after an (undirected) edge has been added to the node.
 void postUndirectedEdgeRemoved(NodeEvent e)
          Called after an (undirected) edge has been removed from the node.
 void preAttributeAdded(AttributeEvent e)
          Called just before an attribute is added.
 void preAttributeChanged(AttributeEvent e)
          Called before a change of an attribute takes place.
 void preAttributeRemoved(AttributeEvent e)
          Called just before an attribute is removed.
 void preDirectedChanged(EdgeEvent e)
          Called before the edge is set directed or undirected.
 void preEdgeAdded(GraphEvent e)
          Called just before an edge is added to the graph.
 void preEdgeRemoved(GraphEvent e)
          Called just before an edge is removed from the graph.
 void preEdgeReversed(EdgeEvent e)
          Called before the edge is going to be reversed.
 void preGraphCleared(GraphEvent e)
          Called before method clear() is called on a graph.
 void preInEdgeAdded(NodeEvent e)
          Called just before an incoming edge is added to the node.
 void preInEdgeRemoved(NodeEvent e)
          Called just before an incoming edge is removed from the node.
 void preNodeAdded(GraphEvent e)
          Called just before a node is added to the graph.
 void preNodeRemoved(GraphEvent e)
          Called just before a node is removed from the graph.
 void preOutEdgeAdded(NodeEvent e)
          Called just before an outgoing edge is added to the node.
 void preOutEdgeRemoved(NodeEvent e)
          Called just before an outgoing edge is removed from the node.
 void preSourceNodeChanged(EdgeEvent e)
          Called before a change of the source node of an edge takes place.
 void preTargetNodeChanged(EdgeEvent e)
          Called before a change of the target node of an edge takes place.
 void preUndirectedEdgeAdded(NodeEvent e)
          Called just before an (undirected) edge is added to the node.
 void preUndirectedEdgeRemoved(NodeEvent e)
          Called just before an (undirected) edge is removed from the node.
 void removeMessageListener(MessageListener ml)
          Removes a message listener from the view.
 void setAttributeComponentManager(AttributeComponentManager acm)
          Sets the AttributeComponentManager used by this view.
abstract  void setGraph(Graph g)
          Sets the graph this view displays.
 void setGrid(Grid grid)
          Sets the current Grid for this view.
 void setId(int id)
          Assign a unique, as far as the session is concerned, to this view.
 void setZoom(double factor)
          Sets the scale factor.
 boolean supportsGrid()
          Returns if this view supports Grids.
 void transactionFinished(TransactionEvent e)
          Called when a transaction has stopped.
 void transactionStarted(TransactionEvent e)
          Called when a transaction has started.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.graffiti.plugin.view.View
completeRedraw, embedsInJScrollPane, repaint
 
Methods inherited from interface org.graffiti.attributes.AttributeConsumer
getDirectedEdgeAttribute, getGraphAttribute, getNodeAttribute, getUndirectedEdgeAttribute
 

Field Detail

autoscrollMargin

protected static final int autoscrollMargin
The autoscroll margin.

See Also:
Constant Field Values

autoresizeMargin

protected static final int autoresizeMargin
The autoresize margin.

See Also:
Constant Field Values

autoscrollInsets

protected static final Insets autoscrollInsets
The insets of the autoscroll.


coreBundle

protected static final Bundle coreBundle
The Bundle of the exceptions.


zoom

protected AffineTransform zoom
The current zoom for this view.


acm

protected AttributeComponentManager acm
The AttributeComponentManager that tells the view what class to use as AttributeComponents for attributes


currentGraph

protected Graph currentGraph
The Graph with which this view is associated.


graphElementComponents

protected Map<GraphElement,GraphElementComponent> graphElementComponents
Contains a mapping from GraphElement to its GraphElementComponent.


messageListeners

protected Set<MessageListener> messageListeners
Contains MessageListeners which are interesting for messages generated by the view i.e. if the painting of graph elements failed.


viewName

protected String viewName
The name of the this view.


id

protected int id
Unique id of the view (session wide).

Constructor Detail

AbstractView

public AbstractView()
Constructs a new GraffitiView. The graph is initialized with an instance of the default implementation.


AbstractView

public AbstractView(Graph currentGraph)
Constructs a new GraffitiView for the specified Graph.

Parameters:
currentGraph - the Graph for which to construct the new GraffitiView.
Method Detail

setAttributeComponentManager

public void setAttributeComponentManager(AttributeComponentManager acm)
Sets the AttributeComponentManager used by this view.

Specified by:
setAttributeComponentManager in interface View
Parameters:
acm - DOCUMENT ME!

setGraph

public abstract void setGraph(Graph g)
Sets the graph this view displays.

Specified by:
setGraph in interface View
Parameters:
g - the graph this view should display.

getAutoscrollInsets

public Insets getAutoscrollInsets()
Specified by:
getAutoscrollInsets in interface Autoscroll
See Also:
Autoscroll.getAutoscrollInsets()

getComponentElementMap

public Map<GraphElement,GraphElementComponent> getComponentElementMap()
Description copied from interface: View
Returns the map mapping GraphElements with GraphElementComponents.

Specified by:
getComponentElementMap in interface View
Returns:
DOCUMENT ME!
See Also:
View.getComponentElementMap()

getComponentForElement

public GraphElementComponent getComponentForElement(GraphElement ge)
Returns the main GraphElementComponent associated with the given GraphELement.

Specified by:
getComponentForElement in interface View
Parameters:
ge - GraphElement for which the component is wanted.
Returns:
the GraphElementComponent used to display the given GraphElement. null if no component is registered for the element (or it has been mapped to null explicitly).

getViewComponent

public JComponent getViewComponent()
Description copied from interface: View
Returns the main component of the view.

Specified by:
getViewComponent in interface View
Returns:
the main component of the view.
See Also:
View.getViewComponent()

getViewName

public String getViewName()
Returns the viewName.

Specified by:
getViewName in interface View
Returns:
String

addMessageListener

public void addMessageListener(MessageListener ml)
Adds a message listener to the view.

Specified by:
addMessageListener in interface View
Parameters:
ml - a message listener
Throws:
IllegalArgumentException - DOCUMENT ME!

autoresize

public void autoresize(Point location)
Resizes the panel dynamically so that enough drawing space is available.

Parameters:
location - the point that should be checked for border conflicts

autoscroll

public void autoscroll(Point location)
Specified by:
autoscroll in interface Autoscroll
See Also:
Autoscroll.autoscroll(Point)

close

public void close()
Closes the current view.

Specified by:
close in interface View

postAttributeAdded

public void postAttributeAdded(AttributeEvent e)
Called after an attribute has been added.

Specified by:
postAttributeAdded in interface AttributeListener
Parameters:
e - the AttributeEvent detailing the changes.

postAttributeChanged

public void postAttributeChanged(AttributeEvent e)
Called after an attribute has been changed.

Specified by:
postAttributeChanged in interface AttributeListener
Parameters:
e - the AttributeEvent detailing the changes.

postAttributeRemoved

public void postAttributeRemoved(AttributeEvent e)
Called after an attribute has been removed.

Specified by:
postAttributeRemoved in interface AttributeListener
Parameters:
e - the AttributeEvent detailing the changes.

postDirectedChanged

public void postDirectedChanged(EdgeEvent e)
Called after the edge was set directed or undirected.

Specified by:
postDirectedChanged in interface EdgeListener
Parameters:
e - the EdgeEvent detailing the changes.

postEdgeAdded

public void postEdgeAdded(GraphEvent e)
Called after an edge has been added to the graph.

Specified by:
postEdgeAdded in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

postEdgeRemoved

public void postEdgeRemoved(GraphEvent e)
Called after an edge has been removed from the graph.

Specified by:
postEdgeRemoved in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

postEdgeReversed

public void postEdgeReversed(EdgeEvent e)
Called after the edge has been reversed.

Specified by:
postEdgeReversed in interface EdgeListener
Parameters:
e - the EdgeEvent detailing the changes.

postGraphCleared

public void postGraphCleared(GraphEvent e)
Called after method clear() has been called on a graph. No other events (like remove events) are generated.

Specified by:
postGraphCleared in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

postInEdgeAdded

public void postInEdgeAdded(NodeEvent e)
Called just after an incoming edge has been added to the node. (For undirected edges postUndirectedEdgeAdded is called instead.)

Specified by:
postInEdgeAdded in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

postInEdgeRemoved

public void postInEdgeRemoved(NodeEvent e)
Called after an incoming edge has been removed from the node. (For undirected edges postUndirectedEdgeRemoved is called.)

Specified by:
postInEdgeRemoved in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

postNodeAdded

public void postNodeAdded(GraphEvent e)
Called after an edge has been added to the graph.

Specified by:
postNodeAdded in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

postNodeRemoved

public void postNodeRemoved(GraphEvent e)
Called after a node has been removed from the graph. All edges incident to this node have already been removed (preEdgeRemoved and postEdgeRemoved have been called).

Specified by:
postNodeRemoved in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

postOutEdgeAdded

public void postOutEdgeAdded(NodeEvent e)
Called after an outgoing edge has been added to the node. (For undirected edges postUndirectedEdgeAdded is called instead.)

Specified by:
postOutEdgeAdded in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

postOutEdgeRemoved

public void postOutEdgeRemoved(NodeEvent e)
Called after an outgoing edge has been removed from the node. (For undirected edges postUndirectedEdgeRemoved is called.)

Specified by:
postOutEdgeRemoved in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

postSourceNodeChanged

public void postSourceNodeChanged(EdgeEvent e)
Called after the source node of an edge has changed.

Specified by:
postSourceNodeChanged in interface EdgeListener
Parameters:
e - the EdgeEvent detailing the changes.

postTargetNodeChanged

public void postTargetNodeChanged(EdgeEvent e)
Called after the target node of an edge has changed.

Specified by:
postTargetNodeChanged in interface EdgeListener
Parameters:
e - the EdgeEvent detailing the changes.

postUndirectedEdgeAdded

public void postUndirectedEdgeAdded(NodeEvent e)
Called after an (undirected) edge has been added to the node. (For directed edges pre- In/Out- EdgeAdded is called.)

Specified by:
postUndirectedEdgeAdded in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

postUndirectedEdgeRemoved

public void postUndirectedEdgeRemoved(NodeEvent e)
Called after an (undirected) edge has been removed from the node. (For directed edges pre- In/Out- EdgeRemoved is called.)

Specified by:
postUndirectedEdgeRemoved in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

preAttributeAdded

public void preAttributeAdded(AttributeEvent e)
Called just before an attribute is added.

Specified by:
preAttributeAdded in interface AttributeListener
Parameters:
e - the AttributeEvent detailing the changes.

preAttributeChanged

public void preAttributeChanged(AttributeEvent e)
Called before a change of an attribute takes place.

Specified by:
preAttributeChanged in interface AttributeListener
Parameters:
e - the AttributeEvent detailing the changes.

preAttributeRemoved

public void preAttributeRemoved(AttributeEvent e)
Called just before an attribute is removed.

Specified by:
preAttributeRemoved in interface AttributeListener
Parameters:
e - the AttributeEvent detailing the changes.

preDirectedChanged

public void preDirectedChanged(EdgeEvent e)
Called before the edge is set directed or undirected.

Specified by:
preDirectedChanged in interface EdgeListener
Parameters:
e - the EdgeEvent detailing the changes.

preEdgeAdded

public void preEdgeAdded(GraphEvent e)
Called just before an edge is added to the graph.

Specified by:
preEdgeAdded in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

preEdgeRemoved

public void preEdgeRemoved(GraphEvent e)
Called just before an edge is removed from the graph.

Specified by:
preEdgeRemoved in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

preEdgeReversed

public void preEdgeReversed(EdgeEvent e)
Called before the edge is going to be reversed.

Specified by:
preEdgeReversed in interface EdgeListener
Parameters:
e - the EdgeEvent detailing the changes.

preGraphCleared

public void preGraphCleared(GraphEvent e)
Called before method clear() is called on a graph. No other events (like remove events) are generated.

Specified by:
preGraphCleared in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

preInEdgeAdded

public void preInEdgeAdded(NodeEvent e)
Called just before an incoming edge is added to the node. (For undirected edges preUndirectedEdgeAdded is called instead.)

Specified by:
preInEdgeAdded in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

preInEdgeRemoved

public void preInEdgeRemoved(NodeEvent e)
Called just before an incoming edge is removed from the node. (For undirected edges preUndirectedEdgeRemoved is called.)

Specified by:
preInEdgeRemoved in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

preNodeAdded

public void preNodeAdded(GraphEvent e)
Called just before a node is added to the graph.

Specified by:
preNodeAdded in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

preNodeRemoved

public void preNodeRemoved(GraphEvent e)
Called just before a node is removed from the graph. This method is called before the incident edges are deleted.

Specified by:
preNodeRemoved in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

preOutEdgeAdded

public void preOutEdgeAdded(NodeEvent e)
Called just before an outgoing edge is added to the node. (For undirected edges preUndirectedEdgeAdded is called instead.)

Specified by:
preOutEdgeAdded in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

preOutEdgeRemoved

public void preOutEdgeRemoved(NodeEvent e)
Called just before an outgoing edge is removed from the node. (For undirected edges preUndirectedEdgeRemoved is called.)

Specified by:
preOutEdgeRemoved in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

preSourceNodeChanged

public void preSourceNodeChanged(EdgeEvent e)
Called before a change of the source node of an edge takes place.

Specified by:
preSourceNodeChanged in interface EdgeListener
Parameters:
e - the EdgeEvent detailing the changes.

preTargetNodeChanged

public void preTargetNodeChanged(EdgeEvent e)
Called before a change of the target node of an edge takes place.

Specified by:
preTargetNodeChanged in interface EdgeListener
Parameters:
e - the EdgeEvent detailing the changes.

preUndirectedEdgeAdded

public void preUndirectedEdgeAdded(NodeEvent e)
Called just before an (undirected) edge is added to the node. (For directed edges pre- In/Out- EdgeAdded is called.)

Specified by:
preUndirectedEdgeAdded in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

preUndirectedEdgeRemoved

public void preUndirectedEdgeRemoved(NodeEvent e)
Called just before an (undirected) edge is removed from the node. (For directed edges pre- In/Out- EdgeRemoved is called.)

Specified by:
preUndirectedEdgeRemoved in interface NodeListener
Parameters:
e - The NodeEvent detailing the changes.

removeMessageListener

public void removeMessageListener(MessageListener ml)
Removes a message listener from the view.

Specified by:
removeMessageListener in interface View
Parameters:
ml - a message listener
Throws:
IllegalArgumentException - DOCUMENT ME!

transactionFinished

public void transactionFinished(TransactionEvent e)
Called when a transaction has stopped.

Specified by:
transactionFinished in interface TransactionListener
Parameters:
e - the EdgeEvent detailing the changes.

transactionStarted

public void transactionStarted(TransactionEvent e)
Called when a transaction has started.

Specified by:
transactionStarted in interface TransactionListener
Parameters:
e - the EdgeEvent detailing the changes.

extractName

protected abstract String extractName()
Extracts the name of the view class. It has to be overridden by all extended subclasses of this class.

Returns:
DOCUMENT ME!

informMessageListener

protected void informMessageListener(String message,
                                     int type)
Method informMessageListener informs all registered message listener about a new message having to be displayed.

Parameters:
message - a new mesage having to be displayed
type - a type of the new message (e.g. ERROR or INFO)

setId

public void setId(int id)
Assign a unique, as far as the session is concerned, to this view.

Specified by:
setId in interface View
Parameters:
id - Unique id.

getId

public int getId()
Get unique id of this view.

Specified by:
getId in interface View
Returns:
Unique id.

getZoomTransform

public AffineTransform getZoomTransform()
Returns the AffineTransform representing the current zoom.

Specified by:
getZoomTransform in interface Zoomable
Returns:
the AffineTransform representing the current zoom.

getZoom

public double getZoom()
Returns the zoom factor.

Specified by:
getZoom in interface Zoomable
Returns:
the zoom factor. Smaller values yield in the display of a greater area with fewer details ("a view from greater distance"). 1.0 is the default value. Must be a finite value greater than 0.0.

setZoom

public void setZoom(double factor)
Sets the scale factor. Should call ViewportEventDispatcher.onViewportChange(Viewport) on the ZoomEventDispatcher returned by MainFrame.getViewportEventDispatcher(). Do not call setZoom from within an implementation of ViewportListener.onViewportChange(Viewport), as it may cause a deadlock. An actual change of the zoom is not guaranteed. The Zoomable may arbitrarily restrict the values.

Specified by:
setZoom in interface Zoomable
Parameters:
factor - the zoom factor to set. Smaller values yield in the display of a greater area with fewer details ("a view from greater distance"). 1.0 is the default value. Must be a finite value greater than 0.0.

getGrid

public Grid getGrid()
Returns the current Grid of this view. The default implementation throws a UnsupportedOperationException.

Specified by:
getGrid in interface View
Returns:
the current Grid of this view.
See Also:
View.setGrid(Grid)

setGrid

public void setGrid(Grid grid)
Sets the current Grid for this view. The default implementation throws a UnsupportedOperationException.

Specified by:
setGrid in interface View
Parameters:
grid - the grid to be set for this view.
See Also:
View.getGrid()

supportsGrid

public boolean supportsGrid()
Returns if this view supports Grids. The default implementation returns false.

Specified by:
supportsGrid in interface View
Returns:
true if this view supports Grids, false else.
See Also:
View.getGrid(), View.setGrid(Grid)


Generated at 2012-05-30 11:00:36 PM CEST