public class PluggableRendererDemo
extends javax.swing.JApplet
implements java.awt.event.ActionListener
PluggableRenderer
.
This code provides examples of different ways to provide and
change the various functions that provide property information
to the renderer.
This demo creates a random mixed-mode graph with random edge
weights using TestGraph.generateMixedRandomGraph
.
It then runs VoltageRanker
on this graph, using half
of the "seed" vertices from the random graph generation as
voltage sources, and half of them as voltage sinks.
What the controls do:
Modifier and Type | Class and Description |
---|---|
class |
PluggableRendererDemo.GradientPickedEdgePaintFunction |
protected class |
PluggableRendererDemo.PopupGraphMousePlugin
a GraphMousePlugin that offers popup
menu support
|
class |
PluggableRendererDemo.VoltageTips |
javax.swing.JApplet.AccessibleJApplet
java.applet.Applet.AccessibleApplet
Modifier and Type | Field and Description |
---|---|
protected Transformer |
affineTransformer |
protected javax.swing.JRadioButton |
e_bent |
protected javax.swing.JCheckBox |
e_color |
protected javax.swing.JRadioButton |
e_cubic |
protected javax.swing.JCheckBox |
e_darrow_pred |
protected javax.swing.JCheckBox |
e_labels |
protected javax.swing.JRadioButton |
e_line |
protected javax.swing.JRadioButton |
e_quad |
protected javax.swing.JCheckBox |
e_show_d |
protected javax.swing.JCheckBox |
e_show_u |
protected javax.swing.JCheckBox |
e_uarrow_pred |
protected javax.swing.JRadioButton |
e_wedge |
protected NumberEdgeValue |
edge_weight |
protected PluggableRendererDemo.GradientPickedEdgePaintFunction |
edgePaint |
protected EdgeStringer |
es |
protected EdgeStringer |
es_none |
protected samples.graph.PluggableRendererDemo.EdgeWeightStrokeFunction |
ewcs |
protected samples.graph.PluggableRendererDemo.FontHandler |
ff |
protected javax.swing.JCheckBox |
fill_edges |
protected javax.swing.JCheckBox |
font |
protected DefaultModalGraphMouse |
gm |
protected static int |
gradient_level |
protected static int |
GRADIENT_NONE |
protected javax.swing.JRadioButton |
gradient_relative |
protected static int |
GRADIENT_RELATIVE |
protected javax.swing.JRadioButton |
no_gradient |
protected PluggableRenderer |
pr |
protected samples.graph.PluggableRendererDemo.DirectionDisplayPredicate |
show_arrow |
protected samples.graph.PluggableRendererDemo.DirectionDisplayPredicate |
show_edge |
protected samples.graph.PluggableRendererDemo.VertexDisplayPredicate |
show_vertex |
protected NumberVertexValue |
transparency |
protected static java.lang.Object |
TRANSPARENCY |
protected javax.swing.JCheckBox |
v_aspect |
protected javax.swing.JCheckBox |
v_color |
protected javax.swing.JCheckBox |
v_labels |
protected javax.swing.JCheckBox |
v_shape |
protected javax.swing.JCheckBox |
v_size |
protected javax.swing.JCheckBox |
v_small |
protected javax.swing.JCheckBox |
v_stroke |
protected samples.graph.PluggableRendererDemo.SeedColor |
vcf |
protected static java.lang.Object |
VOLTAGE_KEY |
protected NumberVertexValue |
voltages |
protected VertexStringer |
vs |
protected VertexStringer |
vs_none |
protected samples.graph.PluggableRendererDemo.VertexStrokeHighlight |
vsh |
protected samples.graph.PluggableRendererDemo.VertexShapeSizeAspect |
vssa |
protected VisualizationViewer |
vv |
protected javax.swing.JCheckBox |
zoom_at_mouse |
accessibleContext, rootPane, rootPaneCheckingEnabled
Constructor and Description |
---|
PluggableRendererDemo() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
protected void |
addBottomControls(javax.swing.JPanel jp) |
Graph |
getGraph()
Generates a mixed-mode random graph, runs VoltageRanker on it, and
returns the resultant graph.
|
static void |
main(java.lang.String[] s) |
void |
start() |
javax.swing.JPanel |
startFunction() |
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus, stop
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, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, 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, transferFocusBackward, transferFocusUpCycle
protected javax.swing.JCheckBox v_color
protected javax.swing.JCheckBox e_color
protected javax.swing.JCheckBox v_stroke
protected javax.swing.JCheckBox e_uarrow_pred
protected javax.swing.JCheckBox e_darrow_pred
protected javax.swing.JCheckBox v_shape
protected javax.swing.JCheckBox v_size
protected javax.swing.JCheckBox v_aspect
protected javax.swing.JCheckBox v_labels
protected javax.swing.JRadioButton e_line
protected javax.swing.JRadioButton e_bent
protected javax.swing.JRadioButton e_wedge
protected javax.swing.JRadioButton e_quad
protected javax.swing.JRadioButton e_cubic
protected javax.swing.JCheckBox e_labels
protected javax.swing.JCheckBox font
protected javax.swing.JCheckBox e_show_d
protected javax.swing.JCheckBox e_show_u
protected javax.swing.JCheckBox v_small
protected javax.swing.JCheckBox zoom_at_mouse
protected javax.swing.JCheckBox fill_edges
protected javax.swing.JRadioButton no_gradient
protected javax.swing.JRadioButton gradient_relative
protected static final int GRADIENT_NONE
protected static final int GRADIENT_RELATIVE
protected static int gradient_level
protected PluggableRenderer pr
protected samples.graph.PluggableRendererDemo.SeedColor vcf
protected samples.graph.PluggableRendererDemo.EdgeWeightStrokeFunction ewcs
protected samples.graph.PluggableRendererDemo.VertexStrokeHighlight vsh
protected VertexStringer vs
protected VertexStringer vs_none
protected EdgeStringer es
protected EdgeStringer es_none
protected samples.graph.PluggableRendererDemo.FontHandler ff
protected samples.graph.PluggableRendererDemo.VertexShapeSizeAspect vssa
protected samples.graph.PluggableRendererDemo.DirectionDisplayPredicate show_edge
protected samples.graph.PluggableRendererDemo.DirectionDisplayPredicate show_arrow
protected samples.graph.PluggableRendererDemo.VertexDisplayPredicate show_vertex
protected PluggableRendererDemo.GradientPickedEdgePaintFunction edgePaint
protected static final java.lang.Object VOLTAGE_KEY
protected static final java.lang.Object TRANSPARENCY
protected NumberEdgeValue edge_weight
protected NumberVertexValue voltages
protected NumberVertexValue transparency
protected VisualizationViewer vv
protected DefaultModalGraphMouse gm
protected Transformer affineTransformer
public void start()
start
in class java.applet.Applet
public static void main(java.lang.String[] s)
public javax.swing.JPanel startFunction()
public Graph getGraph()
protected void addBottomControls(javax.swing.JPanel jp)
jp
- panel to which controls will be addedpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener