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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jgraph.JGraph
org.jgraph.JGraph.EmptySelectionModel, org.jgraph.JGraph.GraphSelectionRedirectorNested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsFields inherited from class org.jgraph.JGraph
antiAliased, ANTIALIASED_PROPERTY, autoResizeGraph, backgroundComponent, backgroundImage, backgroundScaled, bendable, cloneable, connectable, CROSS_GRID_MODE, disconnectable, disconnectOnMove, DOT_GRID_MODE, dragEnabled, dropEnabled, edgeLabelsMovable, editable, EDITABLE_PROPERTY, editClickCount, enabled, GRAPH_LAYOUT_CACHE_PROPERTY, GRAPH_MODEL_PROPERTY, graphLayoutCache, graphModel, GRID_COLOR_PROPERTY, GRID_SIZE_PROPERTY, GRID_VISIBLE_PROPERTY, gridColor, gridEnabled, gridMode, gridSize, gridVisible, groupsEditable, HANDLE_COLOR_PROPERTY, HANDLE_SIZE_PROPERTY, handleColor, handleSize, highlightColor, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, IS_MAC, isJumpToDefaultPort, isMoveIntoGroups, isMoveOutOfGroups, LINE_GRID_MODE, LOCKED_HANDLE_COLOR_PROPERTY, lockedHandleColor, marquee, MARQUEE_HANDLER_PROPERTY, marqueeColor, minimumMove, moveable, moveBelowZero, moveBeyondGraphBounds, offgraphics, offscreen, offscreenBounds, offscreenBuffer, offscreenOffset, offscreenValid, PORTS_SCALED_PROPERTY, PORTS_VISIBLE_PROPERTY, portsScaled, portsVisible, previewInvalidNullPorts, PROPERTY_BACKGROUNDIMAGE, scale, SCALE_PROPERTY, SELECTION_MODEL_PROPERTY, selectionEnabled, SELECTIONENABLED_PROPERTY, selectionModel, selectionRedirector, sizeable, tolerance, useLegacyPainting, VERSION, volatileOffscreen, xorEnabledFields inherited from class JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionReturns aJGraphwith a sample model.Returns an instance ofJGraphwhich displays the the specified data model.Returns an instance ofJGraphwhich displays the specified data model using the specified view.Returns an instance ofJGraphwhich displays the specified data model using the specified view.JmtJGraph(org.jgraph.graph.GraphModel model, org.jgraph.graph.GraphLayoutCache view, org.jgraph.graph.BasicMarqueeHandler mh, Mediator m) Returns an instance ofJGraphwhich displays the specified data model using the specified view. -
Method Summary
Modifier and TypeMethodDescriptionprotected static org.jgraph.graph.GraphLayoutCachecreateDefaultGraphView(org.jgraph.JGraph graph) Creates and returns a defaultGraphLayoutCache.getInPortAt(int x, int y) Gets the input port for the cell under Point(x,y)getOutPortAt(int x, int y) Gets the output port for the cell under Point(x,y)getVertexAt(int x, int y) Gets the first vertex at this position.protected voidOverrides paintComponent method to add support for screenshotsvoidsetMediator(Mediator mediator) Sets theMediatorfor this objectvoidShows a screenshot dialog used to select screenshot formatvoidupdateUI()Notification from theUIManagerthat the L&F has changed.Methods inherited from class org.jgraph.JGraph
addGraphSelectionListener, addSampleData, addSelectionCell, addSelectionCells, cancelEditing, clearSelection, cloneCells, convertValueToString, createBounds, createBufferedImage, drawImage, drawImage, drawTransparentImage, fireValueChanged, fromScreen, fromScreen, getAttributes, getBackgroundComponent, getBackgroundImage, getCellBounds, getCellBounds, getCenterPoint, getDefaultPortForCell, getDescendants, getEdgeLabelsMovable, getEditClickCount, getEditingCell, getFirstCellForLocation, getGraphLayoutCache, getGridColor, getGridMode, getGridSize, getHandleColor, getHandleSize, getHighlightColor, getImage, getInvokesStopCellEditing, getLeafViewAt, getLockedHandleColor, getMarqueeColor, getMarqueeHandler, getMinimumMove, getModel, getNextCellForLocation, getNextSelectableViewAt, getNextViewAt, getNextViewAt, getNextViewAt, getNextViewAt, getOffgraphics, getOffscreen, getOffscreenOffset, getPortForLocation, getPortViewAt, getPortViewAt, getPreferredScrollableViewportSize, getRoots, getRoots, getScale, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectionCell, getSelectionCellAt, getSelectionCells, getSelectionCells, getSelectionCount, getSelectionModel, getTolerance, getToolTipText, getTopmostViewAt, getTransparentOffgraphics, getUI, getUIClassID, getViewPortBounds, graphDidChange, isAntiAliased, isAutoResizeGraph, isBackgroundScaled, isBendable, isCellEditable, isCellSelected, isCloneable, isConnectable, isDisconnectable, isDisconnectOnMove, isDragEnabled, isDropEnabled, isEditable, isEditing, isGridEnabled, isGridVisible, isGroupsEditable, isJumpToDefaultPort, isMoveable, isMoveBelowZero, isMoveBeyondGraphBounds, isMoveIntoGroups, isMoveOutOfGroups, isOffscreenValid, isPortsScaled, isPortsVisible, isPreviewInvalidNullPorts, isSelectionEmpty, isSelectionEnabled, isSizeable, isUseLegacyPainting, isVolatileOffscreen, isXorEnabled, main, order, paramString, removeGraphSelectionListener, removeSelectionCell, repaint, repaint, repaint, repaint, repaint, scrollCellToVisible, scrollPointToVisible, setAntiAliased, setAutoResizeGraph, setBackgroundComponent, setBackgroundImage, setBackgroundScaled, setBendable, setCloneable, setConnectable, setDisconnectable, setDisconnectOnMove, setDragEnabled, setDropEnabled, setEdgeLabelsMovable, setEditable, setEditClickCount, setGraphLayoutCache, setGridColor, setGridEnabled, setGridMode, setGridSize, setGridVisible, setGroupsEditable, setHandleColor, setHandleSize, setHighlightColor, setInvokesStopCellEditing, setJumpToDefaultPort, setLockedHandleColor, setMarqueeColor, setMarqueeHandler, setMinimumMove, setModel, setMoveable, setMoveBelowZero, setMoveBeyondGraphBounds, setMoveIntoGroups, setMoveOutOfGroups, setOffscreenOffset, setOffscreenValid, setOpaque, setPortsScaled, setPortsVisible, setPreviewInvalidNullPorts, setScale, setScale, setSelectionCell, setSelectionCells, setSelectionEnabled, setSelectionModel, setSizeable, setTolerance, setUI, setupOffScreen, setUseLegacyPainting, setVolatileOffscreen, setXorEnabled, snap, snap, snap, startEditingAtCell, stopEditing, toScreen, toScreen, updateAutoSizeMethods inherited from class JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, 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, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class 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, validateTreeMethods inherited from class 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, getAccessibleContext, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Accessible
getAccessibleContext
-
Field Details
-
mediator
-
-
Constructor Details
-
JmtJGraph
Returns aJGraphwith a sample model. -
JmtJGraph
Returns an instance ofJGraphwhich displays the the specified data model.- Parameters:
model- theGraphModelto use as the data model
-
JmtJGraph
public JmtJGraph(org.jgraph.graph.GraphModel model, org.jgraph.graph.BasicMarqueeHandler mh, Mediator m) Returns an instance ofJGraphwhich displays the specified data model using the specified view.- Parameters:
model- theGraphModelto use as the data modelmh- theMarqueeHandler
-
JmtJGraph
public JmtJGraph(org.jgraph.graph.GraphModel model, org.jgraph.graph.GraphLayoutCache view, Mediator m) Returns an instance ofJGraphwhich displays the specified data model using the specified view.- Parameters:
model- theGraphModelto use as the data modelview- theGraphLayoutCacheto 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 ofJGraphwhich displays the specified data model using the specified view.- Parameters:
model- theGraphModelto use as the data modelview- theGraphLayoutCacheto use as the view
-
-
Method Details
-
setMediator
-
getMediator
- Returns:
- the
Mediatorfor this object
-
createDefaultGraphView
protected static org.jgraph.graph.GraphLayoutCache createDefaultGraphView(org.jgraph.JGraph graph) Creates and returns a defaultGraphLayoutCache.- Returns:
- the default
GraphLayoutCache
-
getInPortAt
Gets the input port for the cell under Point(x,y)- Parameters:
x- horizontal coordinatey- vertical coordinate- Returns:
- the input port if available else null
-
getOutPortAt
Gets the output port for the cell under Point(x,y)- Parameters:
x- horizontal coordinatey- vertical coordinate- Returns:
- the output port if available else null
-
getVertexAt
Gets the first vertex at this position.- Parameters:
x- horizontal coordinatey- vertical coordinate- Returns:
- first vertex
-
updateUI
public void updateUI()Notification from theUIManagerthat the L&F has changed. Replaces the current UI object with the latest version from theUIManager. Subclasses can override this to support different GraphUIs.- Overrides:
updateUIin classorg.jgraph.JGraph- See Also:
-
paintComponent
Overrides paintComponent method to add support for screenshots- Overrides:
paintComponentin classJComponent
-
showScreenShotDialog
public void showScreenShotDialog()Shows a screenshot dialog used to select screenshot format
-