java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.fast_view.FastView
All Implemented Interfaces:
Autoscroll, ImageObserver, MenuContainer, Printable, Serializable, EventListener, AttributeListener, EdgeListener, GraphListener, NodeListener, TransactionListener, GraphView, View, Zoomable, ZoomListener

public class FastView
extends JComponent
implements Printable, GraphView
Author:
Christian Klukas 21.12.2006
See Also:
Serialized Form
  • Constructor Details

    • FastView

      public FastView()
  • Method Details

    • getChart

      public ChartPanel getChart()
    • getChartWidth

      public int getChartWidth()
    • getChartHeight

      public int getChartHeight()
    • setAttributeComponentManager

      public void setAttributeComponentManager​(AttributeComponentManager acm)
      Description copied from interface: View
      Sets the AttributeComponentManager used by this view.
      Specified by:
      setAttributeComponentManager in interface View
    • getComponentElementMap

      public Map<?,​?> getComponentElementMap()
      Description copied from interface: View
      Returns the map mapping GraphElements with GraphElementComponents.
      Specified by:
      getComponentElementMap in interface View
      Returns:
      DOCUMENT ME!
    • getComponentForElement

      public GraphElementComponent getComponentForElement​(GraphElement ge)
      Description copied from interface: View
      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.
    • setGraph

      public void setGraph​(Graph graph)
      Description copied from interface: View
      Sets the graph of the view to the specified value.
      Specified by:
      setGraph in interface View
      Parameters:
      graph - the new value of the graph.
    • 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.
    • getViewName

      public String getViewName()
      Description copied from interface: View
      Returns the viewName.
      Specified by:
      getViewName in interface View
      Returns:
      String
    • addMessageListener

      public void addMessageListener​(MessageListener ml)
      Description copied from interface: View
      Adds a message listener to the view. If the view have been started without editor instance, this method may be empty.
      Specified by:
      addMessageListener in interface View
      Parameters:
      ml - a message listener
    • close

      public void close()
      Description copied from interface: View
      Closes the current view.
      Specified by:
      close in interface View
    • completeRedraw

      public void completeRedraw()
      Description copied from interface: View
      Instructs the view to do completely refresh its contents.
      Specified by:
      completeRedraw in interface View
    • removeMessageListener

      public void removeMessageListener​(MessageListener ml)
      Description copied from interface: View
      Removes a message listener from the view.If the view have been started without editor instance, this method may be empty.
      Specified by:
      removeMessageListener in interface View
      Parameters:
      ml - a message listener
    • repaint

      public void repaint​(GraphElement ge)
      Description copied from interface: View
      Repaints the given graph element
      Specified by:
      repaint in interface View
      Parameters:
      ge - the GraphElement to repaint.
    • postEdgeAdded

      public void postEdgeAdded​(GraphEvent e)
      Description copied from interface: GraphListener
      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)
      Description copied from interface: GraphListener
      Called after an edge has been removed from the graph.
      Specified by:
      postEdgeRemoved in interface GraphListener
      Parameters:
      e - the GraphEvent detailing the changes.
    • postGraphCleared

      public void postGraphCleared​(GraphEvent e)
      Description copied from interface: GraphListener
      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.
    • postNodeAdded

      public void postNodeAdded​(GraphEvent e)
      Description copied from interface: GraphListener
      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)
      Description copied from interface: GraphListener
      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.
    • preEdgeAdded

      public void preEdgeAdded​(GraphEvent e)
      Description copied from interface: GraphListener
      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)
      Description copied from interface: GraphListener
      Called just before an edge is removed from the graph.
      Specified by:
      preEdgeRemoved in interface GraphListener
      Parameters:
      e - the GraphEvent detailing the changes.
    • preGraphCleared

      public void preGraphCleared​(GraphEvent e)
      Description copied from interface: GraphListener
      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.
    • preNodeAdded

      public void preNodeAdded​(GraphEvent e)
      Description copied from interface: GraphListener
      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)
      Description copied from interface: GraphListener
      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.
    • postInEdgeAdded

      public void postInEdgeAdded​(NodeEvent e)
    • postInEdgeRemoved

      public void postInEdgeRemoved​(NodeEvent e)
    • postOutEdgeAdded

      public void postOutEdgeAdded​(NodeEvent e)
    • postOutEdgeRemoved

      public void postOutEdgeRemoved​(NodeEvent e)
    • postUndirectedEdgeAdded

      public void postUndirectedEdgeAdded​(NodeEvent e)
      Description copied from interface: NodeListener
      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)
      Description copied from interface: NodeListener
      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.
    • preInEdgeAdded

      public void preInEdgeAdded​(NodeEvent e)
    • preInEdgeRemoved

      public void preInEdgeRemoved​(NodeEvent e)
    • preOutEdgeAdded

      public void preOutEdgeAdded​(NodeEvent e)
    • preOutEdgeRemoved

      public void preOutEdgeRemoved​(NodeEvent e)
    • preUndirectedEdgeAdded

      public void preUndirectedEdgeAdded​(NodeEvent e)
      Description copied from interface: NodeListener
      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)
      Description copied from interface: NodeListener
      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.
    • postDirectedChanged

      public void postDirectedChanged​(EdgeEvent e)
      Description copied from interface: EdgeListener
      Called after the edge was set directed or undirected.
      Specified by:
      postDirectedChanged in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • postEdgeReversed

      public void postEdgeReversed​(EdgeEvent e)
      Description copied from interface: EdgeListener
      Called after the edge has been reversed.
      Specified by:
      postEdgeReversed in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • postSourceNodeChanged

      public void postSourceNodeChanged​(EdgeEvent e)
      Description copied from interface: EdgeListener
      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)
      Description copied from interface: EdgeListener
      Called after the target node of an edge has changed.
      Specified by:
      postTargetNodeChanged in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • preDirectedChanged

      public void preDirectedChanged​(EdgeEvent e)
      Description copied from interface: EdgeListener
      Called before the edge is set directed or undirected.
      Specified by:
      preDirectedChanged in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • preEdgeReversed

      public void preEdgeReversed​(EdgeEvent e)
      Description copied from interface: EdgeListener
      Called before the edge is going to be reversed.
      Specified by:
      preEdgeReversed in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • preSourceNodeChanged

      public void preSourceNodeChanged​(EdgeEvent e)
      Description copied from interface: EdgeListener
      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)
      Description copied from interface: EdgeListener
      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.
    • postAttributeAdded

      public void postAttributeAdded​(AttributeEvent e)
      Description copied from interface: AttributeListener
      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)
      Description copied from interface: AttributeListener
      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)
      Description copied from interface: AttributeListener
      Called after an attribute has been removed.
      Specified by:
      postAttributeRemoved in interface AttributeListener
      Parameters:
      e - the AttributeEvent detailing the changes.
    • preAttributeAdded

      public void preAttributeAdded​(AttributeEvent e)
      Description copied from interface: AttributeListener
      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)
      Description copied from interface: AttributeListener
      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)
      Description copied from interface: AttributeListener
      Called just before an attribute is removed.
      Specified by:
      preAttributeRemoved in interface AttributeListener
      Parameters:
      e - the AttributeEvent detailing the changes.
    • getAutoscrollInsets

      public Insets getAutoscrollInsets()
      Specified by:
      getAutoscrollInsets in interface Autoscroll
    • autoscroll

      public void autoscroll​(Point cursorLocn)
      Specified by:
      autoscroll in interface Autoscroll
    • getEdgeAttribute

      public CollectionAttribute getEdgeAttribute()
    • getGraphAttribute

      public CollectionAttribute getGraphAttribute()
    • getNodeAttribute

      public CollectionAttribute getNodeAttribute()
    • zoomChanged

      public void zoomChanged​(AffineTransform newZoom)
      Description copied from interface: ZoomListener
      Indicates that a zoom value has changed.
      Specified by:
      zoomChanged in interface ZoomListener
    • getZoom

      public AffineTransform getZoom()
      Description copied from interface: Zoomable
      DOCUMENT ME!
      Specified by:
      getZoom in interface Zoomable
      Returns:
      DOCUMENT ME!
    • transactionFinished

      public void transactionFinished​(TransactionEvent e, BackgroundTaskStatusProviderSupportingExternalCall status)
      Description copied from interface: TransactionListener
      Called when a transaction has stopped.
      The class TransactionHashMap merges duplicate AttributeEvents. In case the Attribute path for the same Attributable is not equal, detailed information about Attribute path is lost. Instead a generic AttributeEvent containing just the Attributable is in the list of changed Objects (see TransactionEvent).
      In case no detailed information about an Attribute change is available, your code should completely re-process the affected Attributable.
      Specified by:
      transactionFinished in interface TransactionListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • transactionStarted

      public void transactionStarted​(TransactionEvent e)
      Description copied from interface: TransactionListener
      Called when a transaction has started.
      Specified by:
      transactionStarted in interface TransactionListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • clearComponents

      public void clearComponents()
    • getGraph

      public Graph getGraph()
      Specified by:
      getGraph in interface View
    • putInScrollPane

      public boolean putInScrollPane()
      Specified by:
      putInScrollPane in interface View
    • print

      public void print​(Graphics g)
      Overrides:
      print in class JComponent
    • print

      public int print​(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException
      Specified by:
      print in interface Printable
      Throws:
      PrinterException
    • getAttributeComponentsForElement

      public Set<AttributeComponent> getAttributeComponentsForElement​(GraphElement ge)
      Specified by:
      getAttributeComponentsForElement in interface View
    • isHidden

      public boolean isHidden​(GraphElement ge)
      Specified by:
      isHidden in interface GraphView
    • getViewToolbarComponentTop

      public JComponent getViewToolbarComponentTop()
      Specified by:
      getViewToolbarComponentTop in interface View
      Returns:
      Null, or a Double Object specifying the height (or a TableLayout-constant) of empty space or a JComponent, placed above the graph view and sized according to its preferred height, the full width of the window is used.
    • getViewToolbarComponentBottom

      public JComponent getViewToolbarComponentBottom()
      Specified by:
      getViewToolbarComponentBottom in interface View
      Returns:
      Null, or a Double Object specifying the height (or a TableLayout-constant) of empty space or a JComponent, placed below the graph view and sized according to its preferred height, the full width of the window is used.
    • getViewToolbarComponentLeft

      public JComponent getViewToolbarComponentLeft()
      Specified by:
      getViewToolbarComponentLeft in interface View
      Returns:
      Null, or a Double Object specifying the width (or a TableLayout-constant) of empty space or a JComponent, placed left of the graph view and sized according to its preferred height, the height of graph view next to the component is used.
    • getViewToolbarComponentRight

      public JComponent getViewToolbarComponentRight()
      Specified by:
      getViewToolbarComponentRight in interface View
      Returns:
      Null, or a Double Object specifying the width (or a TableLayout-constant) of empty space or a JComponent, placed to the right of the graph view and sized according to its preferred height, the height of graph view next to the component is used.
    • getViewToolbarComponentBackground

      public JComponent getViewToolbarComponentBackground()
      Specified by:
      getViewToolbarComponentBackground in interface View
      Returns:
      Either null or JComponent, placed behind the graph view. The size corresponds to the window size. Certain components may draw over the graph view, resulting in redraw bugs. But a simple JComponent with hand-made paint-code should work fine.
    • closing

      public void closing​(AWTEvent e)
      Specified by:
      closing in interface View
    • worksWithTab

      public boolean worksWithTab​(InspectorTab tab)
      Specified by:
      worksWithTab in interface View
    • redrawActive

      public boolean redrawActive()
      Specified by:
      redrawActive in interface Zoomable
      Returns:
    • attributeChanged

      public void attributeChanged​(Attribute attr)
      Description copied from interface: View
      Called when a graphics attributes of the Graph represented by this view has changed.
      Specified by:
      attributeChanged in interface View
      Parameters:
      attr - the attribute that has triggered the event.