gishur.graph.gui
Class DisplayGraph

java.lang.Object
  |
  +--gishur.gui2.DrawAtom
        |
        +--gishur.gui2.DrawObject
              |
              +--gishur.gui2.DisplayObject
                    |
                    +--gishur.gui2.DisplayInteractiveObject
                          |
                          +--gishur.gui2.DisplayInteractiveModel
                                |
                                +--gishur.graph.gui.DisplayGraph

public class DisplayGraph
extends DisplayInteractiveModel

Class for visualizing a Graph.

Version:
1.0
Author:
Thomas Wolf & Christoph Sachse

Fields inherited from class gishur.gui2.DisplayInteractiveObject
ACTIVE, ACTIVE1, ACTIVE2, ACTIVE3, ACTIVE4, NORMAL, SELECTED
 
Fields inherited from class gishur.gui2.DrawAtom
BLOCK_REPAINT, MARK_RECALC, MARK_REPAINT, MARK_SIZE, REPAINT, UNBLOCK_REPAINT, USER_STATES_FIRST, USER_STATES_MASK
 
Constructor Summary
DisplayGraph(Graph g)
          Constructs a new DisplayGraph for the given Graph using the default visualization (registered under the name default_visualization).
DisplayGraph(ModelController control)
          Constructs a new DisplayGraph for the Graph controlled by the given ModelController using the default visualization (registered under the name default_visualization).
DisplayGraph(java.lang.String visual_name, Graph g)
          Constructs a new DisplayGraph for the given Graph using the specified visualization.
DisplayGraph(java.lang.String visual_name, ModelController control)
          Constructs a new DisplayGraph for the Graph controlled by the given ModelController using the specified visualization.
 
Method Summary
protected  void dispatchEvent(java.awt.AWTEvent e)
          Dispatches the given event e.
protected  java.lang.String getDisplayID()
          Returns the visualization id; a string, which is a key at the properties of the GraphElement, where the Visualization is stored.
protected  java.lang.String getVisualizationID()
          Returns the visualization id; a string, which is a key at the properties of the GraphElement, where the Visualization is stored.
protected  void preprocessEvent(int id, DrawAtom sender)
          Preprocesses the event specified via its id sent by the given source.
 void recalculate(RenderContext context, PropertyStatusReader properties)
          Forces the DrawObject to recalculate its representation.
 void setPositionsPreferred()
          Sets the positions of this DisplayGraph as preferred graph positions (see Node.setPreferredPosition(java.lang.Object)).
 
Methods inherited from class gishur.gui2.DisplayInteractiveModel
controller, setContoller, setSource, source
 
Methods inherited from class gishur.gui2.DisplayInteractiveObject
activate, activate, active, checkActiveElement, createElementTransform, deactivate, elementTransform, refreshPropertyStatus, select, selected, setActiveElement, setSupportActivation, setSupportElementTransform, setSupportSelection, supportActivation, supportElementTransform, supportSelection, unselect
 
Methods inherited from class gishur.gui2.DisplayObject
addEventListener, calculateDockingPoint, calculateDockingPoint, next, parent, prev, processDrawEvent, removeEventListener
 
Methods inherited from class gishur.gui2.DrawObject
addDrawDependency, addPainter, blockRepaint, checkState, checkStateCleared, child, clear, clearCache, clearState, dependency, dirty, disableEvents, draw, draw, enableEvents, ensureRecalculate, findPainter, firstPainter, fullscreen, hide, hide, insert, levelMask, levelUsed, locate, makeDirty, makeDirty, next, nextPainter, prepeareRenderContext, prev, processEvent, propertyReader, recalculate, remove, removeDrawDependency, repaint, screenTransformation, setFullscreen, setPaintBeforeMembers, setScreenTransformation, setState, show, show, state, state, unblockRepaint, unblockRepaint, visible
 
Methods inherited from class gishur.gui2.DrawAtom
addProperties, collectHits, displayManager, drawComponent, getBounds, getLocalProperty, getProperty, getProperty, getRequiredProperty, processMessage, properties, removeProperty, sendEvent, sendMessage, setBounds, setPropertiesTo, setProperty, setProperty, setProperty, setProperty, toString, toString, toStringDetail, toTreeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DisplayGraph

public DisplayGraph(java.lang.String visual_name,
                    ModelController control)
Constructs a new DisplayGraph for the Graph controlled by the given ModelController using the specified visualization.
Parameters:
visual_name - the name under which the DisplayGraph registers its visualization-id at the Graph. This enables serialization of visual information along the Graph
control - the ModelController that controls the source Graph

DisplayGraph

public DisplayGraph(ModelController control)
Constructs a new DisplayGraph for the Graph controlled by the given ModelController using the default visualization (registered under the name default_visualization).
Parameters:
g - the Graph to be represented

DisplayGraph

public DisplayGraph(java.lang.String visual_name,
                    Graph g)
Constructs a new DisplayGraph for the given Graph using the specified visualization.
Parameters:
visual_name - the name under which the DisplayGraph registers its visualization-id at the Graph. This enables serialization of visual information along the Graph
g - the Graph to be represented

DisplayGraph

public DisplayGraph(Graph g)
Constructs a new DisplayGraph for the given Graph using the default visualization (registered under the name default_visualization).
Parameters:
g - the Graph to be represented
Method Detail

preprocessEvent

protected void preprocessEvent(int id,
                               DrawAtom sender)
Preprocesses the event specified via its id sent by the given source. This method will be called by events produced by the DrawAtom itself and by DrawAtom where this depends from. The method will be called before events are filtered out.
Overrides:
preprocessEvent in class DrawAtom
Parameters:
id - the event id
sender - the source of the event
See Also:
DrawEvent

getVisualizationID

protected java.lang.String getVisualizationID()
Returns the visualization id; a string, which is a key at the properties of the GraphElement, where the Visualization is stored.
Returns:
the visualization id.

getDisplayID

protected java.lang.String getDisplayID()
Returns the visualization id; a string, which is a key at the properties of the GraphElement, where the Visualization is stored.
Returns:
the visualization id.

dispatchEvent

protected void dispatchEvent(java.awt.AWTEvent e)
Dispatches the given event e. This method is redefined here in order to enable to dispatch events.
Overrides:
dispatchEvent in class DrawAtom
Parameters:
e - event to dispatch

recalculate

public void recalculate(RenderContext context,
                        PropertyStatusReader properties)
Forces the DrawObject to recalculate its representation. This method will only be called, if it became dirty via a call to the DrawObject.makeDirty(boolean) method or something has happened, that causes all DrawAtoms to recalculate their representation. This method should only be called by the render system.
Overrides:
recalculate in class DrawObject
Parameters:
context - the RenderContext to use
properties - the PropertyStatusReader to use for reading properties

setPositionsPreferred

public void setPositionsPreferred()
Sets the positions of this DisplayGraph as preferred graph positions (see Node.setPreferredPosition(java.lang.Object)).