org.jgraph.example
Class GraphEd

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by javax.swing.JApplet
                      extended by org.jgraph.example.GraphEd
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, org.jgraph.event.GraphSelectionListener
Direct Known Subclasses:
FastGraph, GraphEdMV, GraphEdX, IconExample, JGraphAdapterExample, PortLabelGraph, PortLabelGraph

public class GraphEd
extends javax.swing.JApplet
implements org.jgraph.event.GraphSelectionListener, java.awt.event.KeyListener

See Also:
Serialized Form

Nested Class Summary
 class GraphEd.EdStatusBar
           
 class GraphEd.EventRedirector
           
static class GraphEd.MyEdgeHandle
           
static class GraphEd.MyGraph
           
 class GraphEd.MyMarqueeHandler
           
static class GraphEd.MyModel
           
 class GraphEd.StatusBarGraphListener
           
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
 
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
GraphEd()
           
 
Method Summary
 void connect(org.jgraph.graph.Port source, org.jgraph.graph.Port target)
           
 java.util.Map createCellAttributes(java.awt.geom.Point2D point)
           
 java.util.Map createEdgeAttributes()
           
 javax.swing.JPopupMenu createPopupMenu(java.awt.Point pt, java.lang.Object cell)
           
 javax.swing.JToolBar createToolBar()
           
 void destroy()
           
 javax.swing.Action getCopy()
           
 javax.swing.Action getCut()
           
 org.jgraph.JGraph getGraph()
           
 javax.swing.Action getPaste()
           
 javax.swing.Action getRedo()
           
 javax.swing.Action getRemove()
           
 javax.swing.Action getToback()
           
 javax.swing.Action getTofront()
           
 javax.swing.Action getUndo()
           
 void group(java.lang.Object[] cells)
           
 void insert(java.awt.geom.Point2D point)
           
 boolean isGroup(java.lang.Object cell)
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
static void main(java.lang.String[] args)
           
 void redo()
           
 void setCopy(javax.swing.Action copy)
           
 void setCut(javax.swing.Action cut)
           
 void setGraph(org.jgraph.JGraph graph)
           
 void setPaste(javax.swing.Action paste)
           
 void setRedo(javax.swing.Action redo)
           
 void setRemove(javax.swing.Action remove)
           
 void setToback(javax.swing.Action toback)
           
 void setTofront(javax.swing.Action tofront)
           
 void setUndo(javax.swing.Action undo)
           
 void toBack(java.lang.Object[] c)
           
 void toFront(java.lang.Object[] c)
           
 void undo()
           
 void ungroup(java.lang.Object[] cells)
           
 void valueChanged(org.jgraph.event.GraphSelectionEvent e)
           
 
Methods inherited from class javax.swing.JApplet
getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
 
Methods inherited from class java.applet.Applet
getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphEd

public GraphEd()
Method Detail

main

public static void main(java.lang.String[] args)

destroy

public void destroy()
Overrides:
destroy in class java.applet.Applet

insert

public void insert(java.awt.geom.Point2D point)

createCellAttributes

public java.util.Map createCellAttributes(java.awt.geom.Point2D point)

connect

public void connect(org.jgraph.graph.Port source,
                    org.jgraph.graph.Port target)

createEdgeAttributes

public java.util.Map createEdgeAttributes()

group

public void group(java.lang.Object[] cells)

ungroup

public void ungroup(java.lang.Object[] cells)

isGroup

public boolean isGroup(java.lang.Object cell)

toFront

public void toFront(java.lang.Object[] c)

toBack

public void toBack(java.lang.Object[] c)

undo

public void undo()

redo

public void redo()

valueChanged

public void valueChanged(org.jgraph.event.GraphSelectionEvent e)
Specified by:
valueChanged in interface org.jgraph.event.GraphSelectionListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

createPopupMenu

public javax.swing.JPopupMenu createPopupMenu(java.awt.Point pt,
                                              java.lang.Object cell)

createToolBar

public javax.swing.JToolBar createToolBar()

getGraph

public org.jgraph.JGraph getGraph()
Returns:
Returns the graph.

setGraph

public void setGraph(org.jgraph.JGraph graph)
Parameters:
graph - The graph to set.

getRedo

public javax.swing.Action getRedo()
Returns:
Returns the redo.

setRedo

public void setRedo(javax.swing.Action redo)
Parameters:
redo - The redo to set.

getUndo

public javax.swing.Action getUndo()
Returns:
Returns the undo.

setUndo

public void setUndo(javax.swing.Action undo)
Parameters:
undo - The undo to set.

getCopy

public javax.swing.Action getCopy()
Returns:
Returns the copy.

setCopy

public void setCopy(javax.swing.Action copy)
Parameters:
copy - The copy to set.

getCut

public javax.swing.Action getCut()
Returns:
Returns the cut.

setCut

public void setCut(javax.swing.Action cut)
Parameters:
cut - The cut to set.

getPaste

public javax.swing.Action getPaste()
Returns:
Returns the paste.

setPaste

public void setPaste(javax.swing.Action paste)
Parameters:
paste - The paste to set.

getToback

public javax.swing.Action getToback()
Returns:
Returns the toback.

setToback

public void setToback(javax.swing.Action toback)
Parameters:
toback - The toback to set.

getTofront

public javax.swing.Action getTofront()
Returns:
Returns the tofront.

setTofront

public void setTofront(javax.swing.Action tofront)
Parameters:
tofront - The tofront to set.

getRemove

public javax.swing.Action getRemove()
Returns:
Returns the remove.

setRemove

public void setRemove(javax.swing.Action remove)
Parameters:
remove - The remove to set.