Package de.saar.chorus.ubench.jdomgraph
Class JDomGraph
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.jgraph.JGraph
de.saar.chorus.ubench.jdomgraph.JDomGraph
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Cloneable,Accessible,Scrollable
A Swing component that represents a labelled dominance graph.
- Author:
- Alexander Koller, Michaela Regneri
- 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 javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class org.jgraph.JGraph
antiAliased, ANTIALIASED_PROPERTY, autoResizeGraph, 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, 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, PORTS_SCALED_PROPERTY, PORTS_VISIBLE_PROPERTY, portsScaled, portsVisible, previewInvalidNullPorts, scale, SCALE_PROPERTY, SELECTION_MODEL_PROPERTY, selectionEnabled, SELECTIONENABLED_PROPERTY, selectionModel, selectionRedirector, sizeable, tolerance, VERSION, xorEnabledFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.jgraph.graph.DefaultEdgeaddEdge(EdgeData data, org.jgraph.graph.DefaultGraphCell src, org.jgraph.graph.DefaultGraphCell tgt) Adds a new edge to the graph (and the underlying model).addFragment(Fragment fragment) org.jgraph.graph.DefaultGraphCellAdds a new node to the graph (and the underlying model).voidAdd some sample nodes and edges to the graph.voidclear()Remove all nodes and edges in the graph.voidRemoves all dominance edges from this graph.clone()Clones this graph.protected org.jgraph.graph.AttributeMapCompute JGraph attributes for a node of the given type.protected org.jgraph.graph.AttributeMapCompute JGraph attributes for a node of the given type.Set<org.jgraph.graph.DefaultEdge>getEdgeData(org.jgraph.graph.DefaultEdge edge) Get the edge data of an edge cell.Set<org.jgraph.graph.DefaultEdge>getEdges()getName()getNodeData(org.jgraph.graph.DefaultGraphCell node) Get the node data of a node cell.org.jgraph.graph.DefaultGraphCellgetNodeForName(String name) Look up the node with the specified name.Set<org.jgraph.graph.DefaultGraphCell>getNodes()List<org.jgraph.graph.DefaultEdge>getOutEdges(org.jgraph.graph.DefaultGraphCell node) Compute the outgoing edges for a node.org.jgraph.graph.DefaultGraphCellgetSourceNode(org.jgraph.graph.DefaultEdge edge) Returns the source node of an edge.org.jgraph.graph.DefaultGraphCellgetTargetNode(org.jgraph.graph.DefaultEdge edge) Returns the target node of and edge.This overrides thegetToolTipText(MouseEvent)method of JGraph.voidsetBoundingBox(Rectangle boundingBox) voidsetDominanceEdges(Set<org.jgraph.graph.DefaultEdge> dominanceEdges) voidvoidsetLabeltype(LayoutOptions.LabelType labeltype) voidsetLayouttype(Preferences.LayoutType layouttype) voidvoidvoidvoidsetUpperBoundFont(Font upperBoundFont) Methods inherited from class org.jgraph.JGraph
addGraphSelectionListener, addSampleData, addSelectionCell, addSelectionCells, cancelEditing, clearSelection, cloneCells, convertValueToString, createBounds, fireValueChanged, fromScreen, fromScreen, getAttributes, 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, getPortForLocation, getPortViewAt, getPortViewAt, getPreferredScrollableViewportSize, getRoots, getRoots, getScale, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectionCell, getSelectionCellAt, getSelectionCells, getSelectionCells, getSelectionCount, getSelectionModel, getTolerance, getTopmostViewAt, getUI, getUIClassID, graphDidChange, isAntiAliased, isAutoResizeGraph, isBendable, isCellEditable, isCellSelected, isCloneable, isConnectable, isDisconnectable, isDisconnectOnMove, isDragEnabled, isDropEnabled, isEditable, isEditing, isGridEnabled, isGridVisible, isJumpToDefaultPort, isMoveable, isMoveBelowZero, isMoveIntoGroups, isMoveOutOfGroups, isPortsScaled, isPortsVisible, isPreviewInvalidNullPorts, isSelectionEmpty, isSelectionEnabled, isSizeable, isXorEnabled, main, order, paramString, removeGraphSelectionListener, removeSelectionCell, scrollCellToVisible, scrollPointToVisible, setAntiAliased, setAutoResizeGraph, setBendable, setCloneable, setConnectable, setDisconnectable, setDisconnectOnMove, setDragEnabled, setDropEnabled, setEdgeLabelsMovable, setEditable, setEditClickCount, setGraphLayoutCache, setGridColor, setGridEnabled, setGridMode, setGridSize, setGridVisible, setHandleColor, setHandleSize, setHighlightColor, setInvokesStopCellEditing, setJumpToDefaultPort, setLockedHandleColor, setMarqueeColor, setMarqueeHandler, setMinimumMove, setModel, setMoveable, setMoveBelowZero, setMoveIntoGroups, setMoveOutOfGroups, setPortsScaled, setPortsVisible, setPreviewInvalidNullPorts, setScale, setScale, setSelectionCell, setSelectionCells, setSelectionEnabled, setSelectionModel, setSizeable, setTolerance, setUI, setXorEnabled, snap, snap, snap, startEditingAtCell, stopEditing, toScreen, toScreen, updateAutoSize, updateUIMethods inherited from class javax.swing.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, paintComponent, paintImmediately, paintImmediately, 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, updateMethods 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, validateTreeMethods 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, 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, 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, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.accessibility.Accessible
getAccessibleContext
-
Constructor Details
-
JDomGraph
public JDomGraph()Sets up an empty dominance graph.- Parameters:
origin- theDomGraphrepresented here.
-
-
Method Details
-
getUpperBoundFont
-
setLayoutType
-
getLayoutType
-
clear
public void clear()Remove all nodes and edges in the graph. -
defaultNodeAttributes
Compute JGraph attributes for a node of the given type. (So far, the type is ignored.)- Parameters:
type- the node type.- Returns:
- an AttributeMap object with reasonable style information.
-
addFragment
-
defaultEdgeAttributes
Compute JGraph attributes for a node of the given type.- Parameters:
type- the edge type.- Returns:
- an AttributeMap object with reasonable style information.
-
addNode
Adds a new node to the graph (and the underlying model). The attributes of the new node are computed automatically from the node data.- Parameters:
data- the data for the new node.- Returns:
- a new DefaultGraphCell object in this graph.
-
addSampleData
public void addSampleData()Add some sample nodes and edges to the graph. -
addEdge
public org.jgraph.graph.DefaultEdge addEdge(EdgeData data, org.jgraph.graph.DefaultGraphCell src, org.jgraph.graph.DefaultGraphCell tgt) Adds a new edge to the graph (and the underlying model). The edge goes from the 0-th port of the node src to the 0-th port of the node tgt. The style attributes of the new edge are computed automatically from the edge data.- Parameters:
data- the data for the new edge.src- the node cell at which the edge should start.tgt- the node cell at which the edge should end.- Returns:
- a new DefaultEdge object in this graph.
-
getDominanceEdges
- Returns:
- Returns the dominanceEdges.
-
getBoundingBox
- Returns:
- Returns the boundingBox.
-
setBoundingBox
- Parameters:
boundingBox- The boundingBox to set.
-
clone
Clones this graph. -
getSourceNode
public org.jgraph.graph.DefaultGraphCell getSourceNode(org.jgraph.graph.DefaultEdge edge) Returns the source node of an edge.- Parameters:
edge- the edge- Returns:
- the edge's source node
-
getTargetNode
public org.jgraph.graph.DefaultGraphCell getTargetNode(org.jgraph.graph.DefaultEdge edge) Returns the target node of and edge.- Parameters:
edge- the edge- Returns:
- the edge's target node
-
clearDominanceEdges
public void clearDominanceEdges()Removes all dominance edges from this graph. -
getNodeData
Get the node data of a node cell.- Parameters:
node-- Returns:
- the node data.
-
getEdgeData
Get the edge data of an edge cell.- Parameters:
edge-- Returns:
- the edge data.
-
getNodeForName
Look up the node with the specified name.- Parameters:
name-- Returns:
- that node.
-
getLabeltype
-
setLabeltype
-
getEdges
-
setEdges
-
getLayouttype
-
setLayouttype
-
getName
-
setName
-
getNodes
-
setNodes
-
setDominanceEdges
-
getOutEdges
Compute the outgoing edges for a node. The returned list lists the complete edges (with types). The list is sorted before returning by theEdgeSortingComparator- Parameters:
node- the node to compute the outgoing edges for- Returns:
- the sorted list of out-edges
-
setUpperBoundFont
-
getToolTipText
This overrides thegetToolTipText(MouseEvent)method of JGraph. As JGraph overwrites the originalComponentmethod but ignores the tooltips returned by the user objects of its cells, the tooltips are reconfigured here.- Overrides:
getToolTipTextin classorg.jgraph.JGraph- Returns:
- the tooltip text of the recent node
- See Also:
-
JGraph.getToolTipText(MouseEvent)
-