|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.tigris.gef.graph.presentation.JGraph
JGraph is a Swing component that displays a connected graph and allows interactive editing. In many ways this class serves as a simple front-end to class Editor, and other classes which do the real work.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected java.lang.String |
_currentDiagramId
|
protected java.awt.Dimension |
_defaultSize
|
protected org.tigris.gef.graph.presentation.JGraphInternalPane |
_drawingPane
|
protected Editor |
_editor
The Editor object that is being shown in this panel |
protected javax.swing.JScrollPane |
_scroll
|
protected java.util.Hashtable |
_viewPortPositions
|
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JGraph()
Make a new JGraph with a new DefaultGraphModel. |
|
JGraph(Diagram d)
Make a new JGraph with a the GraphModel and Layer from the given Diagram. |
|
JGraph(Editor ed)
Make a new JGraph with the given Editor. |
|
JGraph(GraphModel gm)
Make a new JGraph with the given GraphModel |
Method Summary | |
void |
addGraphSelectionListener(GraphSelectionListener listener)
Add listener to the objects to notify whenever the Editor changes its current selection. |
void |
addKeyListener(java.awt.event.KeyListener listener)
|
void |
addModeChangeListener(ModeChangeListener listener)
|
void |
addMouseListener(java.awt.event.MouseListener listener)
|
void |
addMouseMotionListener(java.awt.event.MouseMotionListener listener)
|
void |
bindKey(java.awt.event.ActionListener action,
int keyCode,
int modifiers)
Utility function to bind a keystroke to a Swing Action. |
java.lang.Object |
clone()
Make a copy of this JGraph so that it can be shown in another window. |
void |
deselect(org.tigris.gef.presentation.Fig f)
Remove the given item from this editors selections. |
void |
deselectAll()
Deslect everything that is currently selected. |
java.awt.Dimension |
getDefaultSize()
|
Editor |
getEditor()
Get the Editor that is being displayed |
GraphEdgeRenderer |
getGraphEdgeRenderer()
|
GraphModel |
getGraphModel()
|
GraphNodeRenderer |
getGraphNodeRenderer()
|
void |
initKeys()
|
boolean |
isFocusTraversable()
Tell Swing/AWT that JGraph can be tabbed into. |
boolean |
isManagingFocus()
Tell Swing/AWT that JGraph handles tab-order itself. |
void |
layoutGraph()
|
void |
removeGraphSelectionListener(GraphSelectionListener listener)
|
void |
removeModeChangeListener(ModeChangeListener listener)
|
void |
select(org.tigris.gef.presentation.Fig f)
Add the given item to this Editor's selections. |
void |
select(java.util.Vector items)
Select a collection of Figs. |
void |
selectByOwner(java.lang.Object owner)
Find the Fig that owns the given item and select it. |
void |
selectByOwnerOrFig(java.lang.Object owner)
Find Fig that owns the given item, or the item if it is a Fig, and select it. |
void |
selectByOwnerOrNoChange(java.lang.Object owner)
Add the Fig that owns the given item to this Editor's selections. |
java.util.Vector |
selectedFigs()
reply a Vector of all selected Figs. |
void |
setDefaultSize(java.awt.Dimension dim)
|
void |
setDefaultSize(int width,
int height)
|
void |
setDiagram(Diagram d)
Set the Diagram that should be displayed by setting the GraphModel and Layer that the Editor is using. |
void |
setDrawingSize(java.awt.Dimension dim)
|
void |
setDrawingSize(int width,
int height)
|
void |
setGraphEdgeRenderer(GraphEdgeRenderer r)
Get and set the Renderer used to make FigEdges for edges in the GraphModel. |
void |
setGraphModel(GraphModel gm)
Get and set the GraphModel the Editor is using. |
void |
setGraphNodeRenderer(GraphNodeRenderer r)
Get and set the Renderer used to make FigNodes for nodes in the GraphModel. |
void |
setVisible(boolean b)
When the JGraph is hidden, hide its internal pane |
void |
toggleItem(org.tigris.gef.presentation.Fig f)
Select the given item if it was not already selected, and vis-a-versa. |
void |
toggleItems(java.util.Vector items)
Toggle the selection of a collection of Figs. |
protected void |
updateDrawingSizeToIncludeAllFigs(java.util.Enumeration enum)
Enlarges the JGraphInternalPane dimensions as necessary to insure that all the contained Figs are visible. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Editor _editor
protected org.tigris.gef.graph.presentation.JGraphInternalPane _drawingPane
protected javax.swing.JScrollPane _scroll
protected java.awt.Dimension _defaultSize
protected java.util.Hashtable _viewPortPositions
protected java.lang.String _currentDiagramId
Constructor Detail |
public JGraph()
DefaultGraphModel
public JGraph(Diagram d)
public JGraph(GraphModel gm)
public JGraph(Editor ed)
Method Detail |
public void addMouseListener(java.awt.event.MouseListener listener)
public void addMouseMotionListener(java.awt.event.MouseMotionListener listener)
public void addKeyListener(java.awt.event.KeyListener listener)
public java.lang.Object clone()
public void initKeys()
public void bindKey(java.awt.event.ActionListener action, int keyCode, int modifiers)
public Editor getEditor()
public void setDiagram(Diagram d)
protected void updateDrawingSizeToIncludeAllFigs(java.util.Enumeration enum)
public void setDrawingSize(int width, int height)
public void setDrawingSize(java.awt.Dimension dim)
public void setGraphModel(GraphModel gm)
public GraphModel getGraphModel()
public void setGraphNodeRenderer(GraphNodeRenderer r)
public GraphNodeRenderer getGraphNodeRenderer()
public void setGraphEdgeRenderer(GraphEdgeRenderer r)
public GraphEdgeRenderer getGraphEdgeRenderer()
public void setVisible(boolean b)
public boolean isManagingFocus()
public boolean isFocusTraversable()
public void addGraphSelectionListener(GraphSelectionListener listener)
public void removeGraphSelectionListener(GraphSelectionListener listener)
public void addModeChangeListener(ModeChangeListener listener)
public void removeModeChangeListener(ModeChangeListener listener)
public void layoutGraph()
public void select(org.tigris.gef.presentation.Fig f)
public void selectByOwner(java.lang.Object owner)
public void selectByOwnerOrFig(java.lang.Object owner)
public void selectByOwnerOrNoChange(java.lang.Object owner)
public void deselect(org.tigris.gef.presentation.Fig f)
public void toggleItem(org.tigris.gef.presentation.Fig f)
public void deselectAll()
public void select(java.util.Vector items)
public void toggleItems(java.util.Vector items)
public java.util.Vector selectedFigs()
public void setDefaultSize(int width, int height)
public void setDefaultSize(java.awt.Dimension dim)
public java.awt.Dimension getDefaultSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |