Class JmtJGraph

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.jgraph.JGraph
jsimgraph.JGraphMod.JmtJGraph
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class JmtJGraph extends org.jgraph.JGraph
Jmt version of JGraph.
Author:
Federico Granata Date: 11-lug-2003 Time: 10.38.27 Modified by Bertoli Marco to support JGraph 5.8 - 21/mar/2006 Added Blocking Region Support 24-mar-2006, Bertoli Marco (16-jun-2006) Added support for screenshots in vectorial format.
See Also:
  • Field Details

    • mediator

      protected Mediator mediator
  • Constructor Details

    • JmtJGraph

      public JmtJGraph(Mediator m)
      Returns a JGraph with a sample model.
    • JmtJGraph

      public JmtJGraph(org.jgraph.graph.GraphModel model, Mediator m)
      Returns an instance of JGraph which displays the the specified data model.
      Parameters:
      model - the GraphModel to use as the data model
    • JmtJGraph

      public JmtJGraph(org.jgraph.graph.GraphModel model, org.jgraph.graph.BasicMarqueeHandler mh, Mediator m)
      Returns an instance of JGraph which displays the specified data model using the specified view.
      Parameters:
      model - the GraphModel to use as the data model
      mh - the MarqueeHandler
    • JmtJGraph

      public JmtJGraph(org.jgraph.graph.GraphModel model, org.jgraph.graph.GraphLayoutCache view, Mediator m)
      Returns an instance of JGraph which displays the specified data model using the specified view.
      Parameters:
      model - the GraphModel to use as the data model
      view - the GraphLayoutCache to use as the view
    • JmtJGraph

      public JmtJGraph(org.jgraph.graph.GraphModel model, org.jgraph.graph.GraphLayoutCache view, org.jgraph.graph.BasicMarqueeHandler mh, Mediator m)
      Returns an instance of JGraph which displays the specified data model using the specified view.
      Parameters:
      model - the GraphModel to use as the data model
      view - the GraphLayoutCache to use as the view
  • Method Details

    • setMediator

      public void setMediator(Mediator mediator)
      Sets the Mediator for this object
      Parameters:
      mediator -
    • getMediator

      public Mediator getMediator()
      Returns:
      the Mediator for this object
    • createDefaultGraphView

      protected static org.jgraph.graph.GraphLayoutCache createDefaultGraphView(org.jgraph.JGraph graph)
      Creates and returns a default GraphLayoutCache.
      Returns:
      the default GraphLayoutCache
    • getInPortAt

      public InputPort getInPortAt(int x, int y)
      Gets the input port for the cell under Point(x,y)
      Parameters:
      x - horizontal coordinate
      y - vertical coordinate
      Returns:
      the input port if available else null
    • getOutPortAt

      public OutputPort getOutPortAt(int x, int y)
      Gets the output port for the cell under Point(x,y)
      Parameters:
      x - horizontal coordinate
      y - vertical coordinate
      Returns:
      the output port if available else null
    • getVertexAt

      public JmtCell getVertexAt(int x, int y)
      Gets the first vertex at this position.
      Parameters:
      x - horizontal coordinate
      y - vertical coordinate
      Returns:
      first vertex
    • updateUI

      public void updateUI()
      Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager. Subclasses can override this to support different GraphUIs.
      Overrides:
      updateUI in class org.jgraph.JGraph
      See Also:
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides paintComponent method to add support for screenshots
      Overrides:
      paintComponent in class JComponent
    • showScreenShotDialog

      public void showScreenShotDialog()
      Shows a screenshot dialog used to select screenshot format