Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.uci.ics.jung.visualization
Class GraphDraw

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  edu.uci.ics.jung.visualization.GraphDraw

All Implemented Interfaces:
  ImageObserver, MenuContainer, Serializable, StatusCallback

Deprecated. As of version 1.7, use `VisualizationViewer` directly instead.

public class GraphDraw
extends JComponent
implements StatusCallback

A Swing-only component for drawing graphs. Allows a series of manipulations to access and show graphs, to set their various colors and lines, and to dynamically change values. This is a good starting place for getting a graph up quickly.

Author:
  Danyel Fisher, Joshua O'Madadhain
See Also:
  Serialized Form

Nested Class Summary
`protected class` | `GraphDraw.SliderChangeListener` Deprecated.

Nested classes inherited from class javax.swing.JComponent
`JComponent.AccessibleJComponent`

Nested classes inherited from class java.awt.Container
`Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy`

Field Summary
`protected List` | `allFilters` Deprecated.
`protected Filter` | `mainFilter` Deprecated.
`protected List` | `sliders` Deprecated.
`protected JLabel` | `statusbar` Deprecated.
`protected JPanel` | `toolbar` Deprecated.
`protected VisualizationViewer` | `vv` Deprecated.

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
`GraphDraw(Graph g)` Deprecated. Creates a graph drawing environment that draws this graph object.
`GraphDraw(Layout layout)` Deprecated. Creates a graph drawing environment with the specified layout algorithm

Method Summary
`void` | `addGraphMouseListener(GraphMouseListener gel)` Deprecated. Use getVisualizationViewer.addMouseListener( new MouseListenerTranslator(gel, vv));
`JSlider` | `addSlider(LevelFilter l, int low, int high, int defaultVal)` Deprecated. Use the PluggableRenderer's vertex and edge visibility predicates instead. See the release notes for version 1.6 for more information.
`void` | `addStaticFilter(Filter f)` Deprecated. Use the PluggableRenderer's vertex and edge visibility predicates instead. See the release notes for version 1.6 for more information.
`void` | `addTool(JComponent jc)` Deprecated. Use the PluggableRenderer's vertex and edge visibility predicates instead. See the release notes for version 1.6 for more information.
`void` | `callBack(String status)` Deprecated.
`Layout` | `getGraphLayout()` Deprecated. Use `getVisualizationViewer().getGraphLayout()` instead.
`Renderer` | `getRender()` Deprecated. As of version 1.5.2, replaced by getRenderer.
`Renderer` | `getRenderer()` Deprecated. Use getVisualizationViewer.getRenderer() instead.
`VisualizationViewer` | `getVisualizationViewer()` Deprecated. Returns the visualizationviewer that actually does the graph drawing.
`void` | `hideStatus()` Deprecated. Hides the status bar at bottom left
`void` | `removeAllFilters()` Deprecated. Use the PluggableRenderer's vertex and edge visibility predicates instead. See the release notes for version 1.6 for more information.
`void` | `resetRenderer()` Deprecated.
`void` | `restartLayout()` Deprecated. Use `getVisualizationViewer().restart()` instead.
`void` | `setBackground(Color bg)` Deprecated.
`void` | `setEdgeColor(Color c)` Deprecated. Modify this property via the renderer instead.
`void` | `setEdgeColorFunction(EdgeColorFunction ecf)` Deprecated. Modify this property via the renderer instead.
`void` | `setEdgeThickness(int i)` Deprecated. Modify this property via the renderer instead.
`void` | `setEdgeThicknessFunction(EdgeThicknessFunction etf)` Deprecated. Modify this property via the renderer instead.
`void` | `setGraphLayout(Layout l)` Deprecated. Use getVisualizationViewer.setGraphLayout(l) instead.
`void` | `setRenderer(Renderer r)` Deprecated. Use getVisualizationViewer().setRenderer(r) instead.
`void` | `setVertexBGColor(Color vertexColor)` Deprecated. Modify this property via the renderer instead.
`void` | `setVertexColorFunction(VertexColorFunction vcf)` Deprecated. Modify this property via the renderer instead.
`void` | `setVertexForegroundColor(Color vertexColor)` Deprecated. Modify this property via the renderer instead.
`void` | `setVertexPickedColor(Color vertexColor)` Deprecated. Modify this property via the renderer instead.
`void` | `showStatus()` Deprecated. Shows the status bar at bottom left
`void` | `stop()` Deprecated. Use `getVisualizationViewer().stop()` instead.

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, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI`

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, addKeyListener, addMouseListener, addMouseMotionListener, 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, isFocusTraversable, 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
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### vv

    protected VisualizationViewer vv

  Deprecated.

### mainFilter

    protected Filter mainFilter

  Deprecated.

### allFilters

    protected List allFilters

  Deprecated.

### sliders

    protected List sliders

  Deprecated.

### toolbar

    protected JPanel toolbar

  Deprecated.

### statusbar

    protected JLabel statusbar

  Deprecated.

Constructor Detail

### GraphDraw

    public GraphDraw(Graph g)

  Deprecated.
  Creates a graph drawing environment that draws this graph object. By default, uses the Spring layout, the Fade renderer and the AbstractSettable renderer, the Drop Solo Nodes filter, and no adjustable filters at all. By default, now HIDES the status bar; call showStatus() to show it.

Parameters:
  `g` -

### GraphDraw

    public GraphDraw(Layout layout)

  Deprecated.
  Creates a graph drawing environment with the specified layout algorithm

Parameters:
  `layout` -

Method Detail

### getVisualizationViewer

    public VisualizationViewer getVisualizationViewer()

  Deprecated.
  Returns the visualizationviewer that actually does the graph drawing.

### addGraphMouseListener

    public void addGraphMouseListener(GraphMouseListener gel)

  Deprecated. Use getVisualizationViewer.addMouseListener( new MouseListenerTranslator(gel, vv));

  This is the interface for adding a mouse listener. The GEL will be called back with mouse clicks on vertices.

  Parameters:
    `gel` -

### showStatus

    public void showStatus()

  Deprecated.
  Shows the status bar at bottom left

### hideStatus

    public void hideStatus()

  Deprecated.
  Hides the status bar at bottom left

### setBackground

    public void setBackground(Color bg)

  Deprecated.

### callBack

    public void callBack(String status)

  Deprecated.
  Specified by:
    `callBack` in interface `StatusCallback`

### setRenderer

    public void setRenderer(Renderer r)

  Deprecated. Use getVisualizationViewer().setRenderer(r) instead.

  A method to set the renderer.

  Parameters:
    `r` - the new renderer

### resetRenderer

    public void resetRenderer()

  Deprecated.

  Resets the renderer to its original state.

### getRender

    public Renderer getRender()

  Deprecated. As of version 1.5.2, replaced by getRenderer.

### getRenderer

    public Renderer getRenderer()

  Deprecated. Use getVisualizationViewer.getRenderer() instead.

  Returns the renderer currently in use.

### setEdgeColor

    public void setEdgeColor(Color c)

  Deprecated. Modify this property via the renderer instead.

  A passthrough to the renderer used by this instance of `VisualizationViewer`. Has no effect if the renderer is not an instance of `PluggableRenderer`.

  Parameters:
    `c` - the new edge color

### setEdgeColorFunction

    public void setEdgeColorFunction(EdgeColorFunction ecf)

  Deprecated. Modify this property via the renderer instead.

  A passthrough to the renderer used by this instance of `VisualizationViewer`. Has no effect if the renderer is not an instance of `PluggableRenderer`.

  Parameters:
    `ecf` - the new `EdgeColorFunction`

### setEdgeThickness

    public void setEdgeThickness(int i)

  Deprecated. Modify this property via the renderer instead.

  A passthrough to the renderer used by this instance of `VisualizationViewer`. Has no effect if the renderer is not an instance of `PluggableRenderer`.

  Parameters:
    `i` - the thickness of the edge

### setEdgeThicknessFunction

    public void setEdgeThicknessFunction(EdgeThicknessFunction etf)

  Deprecated. Modify this property via the renderer instead.

  A passthrough to the renderer used by this instance of `VisualizationViewer`. Has no effect if the renderer is not an instance of `PluggableRenderer`.

  Parameters:
    `etf` - the new `EdgeThicknessFunction`

### setVertexForegroundColor

    public void setVertexForegroundColor(Color vertexColor)

  Deprecated. Modify this property via the renderer instead.

  A passthrough to the renderer used by this instance of `VisualizationViewer`. Has no effect if the renderer is not an instance of `PluggableRenderer`. Resets the background (fill) and the picked color to Color.RED and Color.ORANGE, respectively; to modify all of these at once, access the renderer directly (see `PickableVertexPaintFunction`).

  Parameters:
    `vertexColor` - the new foreground (draw) color of the vertices

### setVertexPickedColor

    public void setVertexPickedColor(Color vertexColor)

  Deprecated. Modify this property via the renderer instead.

  A passthrough to the renderer used by this instance of `VisualizationViewer`. Has no effect if the renderer is not an instance of `PluggableRenderer`. Resets the background (fill) and the foreground (draw) color to Color.RED and Color.BLACK, respectively; to modify all of these at once, access the renderer directly (see `PickableVertexPaintFunction`).

  Parameters:
    `vertexColor` - the new picked color of the vertices

### setVertexBGColor

    public void setVertexBGColor(Color vertexColor)

  Deprecated. Modify this property via the renderer instead.

  A passthrough to the renderer used by this instance of `VisualizationViewer`. Has no effect if the renderer is not an instance of `PluggableRenderer`. Resets the picked color and the foreground (draw) color to Color.ORANGE and Color.BLACK, respectively; to modify all of these at once, access the renderer directly (see `PickableVertexPaintFunction`).

  Parameters:
    `vertexColor` - the background color of the vertex that is to be set

### setVertexColorFunction

    public void setVertexColorFunction(VertexColorFunction vcf)

  Deprecated. Modify this property via the renderer instead.

  A passthrough to the renderer used by this instance of `VisualizationViewer`. Has no effect if the renderer is not an instance of `PluggableRenderer`.

  Parameters:
    `vcf` - the new `VertexColorFunction`

### setGraphLayout

    public void setGraphLayout(Layout l)

  Deprecated. Use getVisualizationViewer.setGraphLayout(l) instead.

  Replaces the layout used by the VisualizationViewer with `l`.

  Parameters:
    `l` - the new graph layout algorithm

### removeAllFilters

    public void removeAllFilters()

  Deprecated. Use the PluggableRenderer's vertex and edge visibility predicates instead. See the release notes for version 1.6 for more information.

  Removes all the filters, deleting the sliders that drive them.

### addStaticFilter

    public void addStaticFilter(Filter f)

  Deprecated. Use the PluggableRenderer's vertex and edge visibility predicates instead. See the release notes for version 1.6 for more information.

  Adds a Filter that doesn't slide.

  Parameters:
    `f` -

### addSlider

    public JSlider addSlider(LevelFilter l,
                             int low,
                             int high,
                             int defaultVal)

  Deprecated. Use the PluggableRenderer's vertex and edge visibility predicates instead. See the release notes for version 1.6 for more information.

  Creates a new slider based off of a `LevelFilter`. The function adds the `Filter` into the sequence of filters preserved by the current visualization, creates a JSlider to go with it, and then returns it.

  TODO: The situation may not be entirely right until applyFilter has been called.

  Parameters:
    `l` - The Filter to use.
    `low` - The low value on the filter: this will be the low point on the slider
    `high` - The high value on the filter: this will be the high point on the slider
    `defaultVal` - The starting point on the filter
  Returns:
    the slider (which will have been also added to the Sliders panel)

### addTool

    public void addTool(JComponent jc)

  Deprecated. Use the PluggableRenderer's vertex and edge visibility predicates instead. See the release notes for version 1.6 for more information.

  Adds a tool to the toolbar.

  Parameters:
    `jc` - the tool--any JComponent--to be added to the Toolbar on the left side

### getGraphLayout

    public Layout getGraphLayout()

  Deprecated. Use `getVisualizationViewer().getGraphLayout()` instead.

  Returns the currently operative layout.

### restartLayout

    public void restartLayout()

  Deprecated. Use `getVisualizationViewer().restart()` instead.

  This is the "scramble" button--it resets the layout.

### stop

    public void stop()

  Deprecated. Use `getVisualizationViewer().stop()` instead.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD