|
||||||||||
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 |
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(ConnectionConstrainer cc)
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. |
boolean |
equals(java.lang.Object o)
|
void |
establishAlternateMouseWheelListener(java.awt.event.MouseWheelListener listener,
int mask)
Establishes alternate MouseWheelListener object that's only active when the alt/shift/ctrl keys are held down. |
protected java.lang.String |
getCurrentDiagramId()
|
java.awt.Dimension |
getDefaultSize()
|
Editor |
getEditor()
Get the Editor that is being displayed |
GraphEdgeRenderer |
getGraphEdgeRenderer()
|
GraphModel |
getGraphModel()
Get the GraphModel the Editor is using. |
GraphNodeRenderer |
getGraphNodeRenderer()
|
java.awt.Point |
getViewPosition()
Get the position of the editor's scrollpane. |
int |
hashCode()
|
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 |
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)
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 |
setViewPosition(java.awt.Point p)
Set the position of the editor's scrollpane. |
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 iter)
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 |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JGraph()
DefaultGraphModel
public JGraph(ConnectionConstrainer cc)
DefaultGraphModel
public JGraph(Diagram d)
public JGraph(GraphModel gm)
public JGraph(Editor ed)
Method Detail |
public boolean equals(java.lang.Object o)
Object.equals(java.lang.Object)
public int hashCode()
TODO: Investigate further:
According to a mail from GZ (6th November 2004) on the ArgoUML dev list,
{@link javax.swing.RepaintManager} puts these objects in
some kind of data structure that uses this function.
Assuming that there is a reason for this we dare not sabotage
this by short-circuiting this to 0. Instead we rely on that
{@link org.tigris.gef.graph.presentation.JGraph#setDiagram(
org.tigris.gef.base.Diagram)} actually removes this object from
the {@link javax.swing.RepaintManager} and registers it again
when resetting the diagram id.
This is based on the assumption that the function
{@link #equals(Object)} must work as it does. I (Linus) have not
understood why it must. Could someone please explain that in the
javadoc.
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 iter)
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 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()
public java.awt.Point getViewPosition()
public void setViewPosition(java.awt.Point p)
public void establishAlternateMouseWheelListener(java.awt.event.MouseWheelListener listener, int mask)
listener
- MouseWheelListener that will receive MouseWheelEvents
generated by this JGraph.mask
- logical OR of key modifier values as defined by
java.awt.event.KeyEvent constants. This has been tested with
ALT_MASK, SHIFT_MASK, and CTRL_MASK.protected java.lang.String getCurrentDiagramId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |