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<V,E> |
protected class |
PluggableRendererDemo.PopupGraphMousePlugin
a GraphMousePlugin that offers popup
menu support
|
class |
PluggableRendererDemo.VoltageTips<E> |
javax.swing.JApplet.AccessibleJApplet
java.applet.Applet.AccessibleApplet
Modifier and Type | Field and Description |
---|---|
protected javax.swing.JCheckBox |
e_arrow_centered |
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_ortho |
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 java.util.Map<java.lang.Number,java.lang.Number> |
edge_weight |
protected PluggableRendererDemo.GradientPickedEdgePaintFunction<java.lang.Integer,java.lang.Number> |
edgeDrawPaint |
protected PluggableRendererDemo.GradientPickedEdgePaintFunction<java.lang.Integer,java.lang.Number> |
edgeFillPaint |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.EdgeFontTransformer<java.lang.Number> |
eff |
protected org.apache.commons.collections4.Transformer<java.lang.Number,java.lang.String> |
es |
protected org.apache.commons.collections4.Transformer<java.lang.Number,java.lang.String> |
es_none |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.EdgeWeightStrokeFunction<java.lang.Number> |
ewcs |
protected javax.swing.JCheckBox |
fill_edges |
protected javax.swing.JCheckBox |
font |
protected edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse<java.lang.Integer,java.lang.Number> |
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 edu.uci.ics.jung.samples.PluggableRendererDemo.SeedDrawColor<java.lang.Integer> |
seedDrawColor |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.SeedFillColor<java.lang.Integer> |
seedFillColor |
protected java.util.Set<java.lang.Integer> |
seedVertices |
protected org.apache.commons.collections4.Predicate<edu.uci.ics.jung.graph.util.Context<edu.uci.ics.jung.graph.Graph<java.lang.Integer,java.lang.Number>,java.lang.Number>> |
self_loop |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.DirectionDisplayPredicate<java.lang.Integer,java.lang.Number> |
show_arrow |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.DirectionDisplayPredicate<java.lang.Integer,java.lang.Number> |
show_edge |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexDisplayPredicate<java.lang.Integer,java.lang.Number> |
show_vertex |
protected java.util.Map<java.lang.Integer,java.lang.Number> |
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 edu.uci.ics.jung.samples.PluggableRendererDemo.VertexFontTransformer<java.lang.Integer> |
vff |
protected static java.lang.Object |
VOLTAGE_KEY |
protected org.apache.commons.collections4.Transformer<java.lang.Integer,java.lang.Double> |
voltages |
protected org.apache.commons.collections4.Transformer<java.lang.Integer,java.lang.String> |
vs |
protected org.apache.commons.collections4.Transformer<java.lang.Integer,java.lang.String> |
vs_none |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexStrokeHighlight<java.lang.Integer,java.lang.Number> |
vsh |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexShapeSizeAspect<java.lang.Integer,java.lang.Number> |
vssa |
protected edu.uci.ics.jung.visualization.VisualizationViewer<java.lang.Integer,java.lang.Number> |
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) |
edu.uci.ics.jung.graph.Graph<java.lang.Integer,java.lang.Number> |
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 e_arrow_centered
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_ortho
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 edu.uci.ics.jung.samples.PluggableRendererDemo.SeedFillColor<java.lang.Integer> seedFillColor
protected edu.uci.ics.jung.samples.PluggableRendererDemo.SeedDrawColor<java.lang.Integer> seedDrawColor
protected edu.uci.ics.jung.samples.PluggableRendererDemo.EdgeWeightStrokeFunction<java.lang.Number> ewcs
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexStrokeHighlight<java.lang.Integer,java.lang.Number> vsh
protected org.apache.commons.collections4.Transformer<java.lang.Integer,java.lang.String> vs
protected org.apache.commons.collections4.Transformer<java.lang.Integer,java.lang.String> vs_none
protected org.apache.commons.collections4.Transformer<java.lang.Number,java.lang.String> es
protected org.apache.commons.collections4.Transformer<java.lang.Number,java.lang.String> es_none
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexFontTransformer<java.lang.Integer> vff
protected edu.uci.ics.jung.samples.PluggableRendererDemo.EdgeFontTransformer<java.lang.Number> eff
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexShapeSizeAspect<java.lang.Integer,java.lang.Number> vssa
protected edu.uci.ics.jung.samples.PluggableRendererDemo.DirectionDisplayPredicate<java.lang.Integer,java.lang.Number> show_edge
protected edu.uci.ics.jung.samples.PluggableRendererDemo.DirectionDisplayPredicate<java.lang.Integer,java.lang.Number> show_arrow
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexDisplayPredicate<java.lang.Integer,java.lang.Number> show_vertex
protected org.apache.commons.collections4.Predicate<edu.uci.ics.jung.graph.util.Context<edu.uci.ics.jung.graph.Graph<java.lang.Integer,java.lang.Number>,java.lang.Number>> self_loop
protected PluggableRendererDemo.GradientPickedEdgePaintFunction<java.lang.Integer,java.lang.Number> edgeDrawPaint
protected PluggableRendererDemo.GradientPickedEdgePaintFunction<java.lang.Integer,java.lang.Number> edgeFillPaint
protected static final java.lang.Object VOLTAGE_KEY
protected static final java.lang.Object TRANSPARENCY
protected java.util.Map<java.lang.Number,java.lang.Number> edge_weight
protected org.apache.commons.collections4.Transformer<java.lang.Integer,java.lang.Double> voltages
protected java.util.Map<java.lang.Integer,java.lang.Number> transparency
protected edu.uci.ics.jung.visualization.VisualizationViewer<java.lang.Integer,java.lang.Number> vv
protected edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse<java.lang.Integer,java.lang.Number> gm
protected java.util.Set<java.lang.Integer> seedVertices
public void start()
start
in class java.applet.Applet
public static void main(java.lang.String[] s)
public javax.swing.JPanel startFunction()
public edu.uci.ics.jung.graph.Graph<java.lang.Integer,java.lang.Number> 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