public class PluggableRendererDemo extends JApplet implements 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> |
JApplet.AccessibleJApplet
Applet.AccessibleApplet
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected JCheckBox |
e_arrow_centered |
protected JRadioButton |
e_bent |
protected JCheckBox |
e_color |
protected JRadioButton |
e_cubic |
protected JCheckBox |
e_darrow_pred |
protected JCheckBox |
e_labels |
protected JRadioButton |
e_line |
protected JRadioButton |
e_ortho |
protected JRadioButton |
e_quad |
protected JCheckBox |
e_show_d |
protected JCheckBox |
e_show_u |
protected JCheckBox |
e_uarrow_pred |
protected JRadioButton |
e_wedge |
protected Map<Number,Number> |
edge_weight |
protected PluggableRendererDemo.GradientPickedEdgePaintFunction<Integer,Number> |
edgeDrawPaint |
protected PluggableRendererDemo.GradientPickedEdgePaintFunction<Integer,Number> |
edgeFillPaint |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.EdgeFontTransformer<Number> |
eff |
protected com.google.common.base.Function<? super Number,String> |
es |
protected com.google.common.base.Function<? super Number,String> |
es_none |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.EdgeWeightStrokeFunction<Number> |
ewcs |
protected JCheckBox |
fill_edges |
protected JCheckBox |
font |
protected DefaultModalGraphMouse<Integer,Number> |
gm |
protected static int |
gradient_level |
protected static int |
GRADIENT_NONE |
protected JRadioButton |
gradient_relative |
protected static int |
GRADIENT_RELATIVE |
protected JRadioButton |
no_gradient |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.SeedDrawColor<Integer> |
seedDrawColor |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.SeedFillColor<Integer> |
seedFillColor |
protected Set<Integer> |
seedVertices |
protected com.google.common.base.Predicate<Context<Graph<Integer,Number>,Number>> |
self_loop |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.DirectionDisplayPredicate<Integer,Number> |
show_arrow |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.DirectionDisplayPredicate<Integer,Number> |
show_edge |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexDisplayPredicate<Integer,Number> |
show_vertex |
protected Map<Integer,Number> |
transparency |
protected static Object |
TRANSPARENCY |
protected JCheckBox |
v_aspect |
protected JCheckBox |
v_color |
protected JCheckBox |
v_labels |
protected JCheckBox |
v_shape |
protected JCheckBox |
v_size |
protected JCheckBox |
v_small |
protected JCheckBox |
v_stroke |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexFontTransformer<Integer> |
vff |
protected static Object |
VOLTAGE_KEY |
protected com.google.common.base.Function<Integer,Double> |
voltages |
protected com.google.common.base.Function<? super Integer,String> |
vs |
protected com.google.common.base.Function<? super Integer,String> |
vs_none |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexStrokeHighlight<Integer,Number> |
vsh |
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexShapeSizeAspect<Integer,Number> |
vssa |
protected VisualizationViewer<Integer,Number> |
vv |
protected JCheckBox |
zoom_at_mouse |
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
PluggableRendererDemo() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
protected void |
addBottomControls(JPanel jp) |
Graph<Integer,Number> |
buildGraph()
Generates a mixed-mode random graph, runs VoltageRanker on it, and
returns the resultant graph.
|
static void |
main(String[] s) |
void |
start() |
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 JCheckBox v_color
protected JCheckBox e_color
protected JCheckBox v_stroke
protected JCheckBox e_uarrow_pred
protected JCheckBox e_darrow_pred
protected JCheckBox e_arrow_centered
protected JCheckBox v_shape
protected JCheckBox v_size
protected JCheckBox v_aspect
protected JCheckBox v_labels
protected JRadioButton e_line
protected JRadioButton e_bent
protected JRadioButton e_wedge
protected JRadioButton e_quad
protected JRadioButton e_ortho
protected JRadioButton e_cubic
protected JCheckBox e_labels
protected JCheckBox font
protected JCheckBox e_show_d
protected JCheckBox e_show_u
protected JCheckBox v_small
protected JCheckBox zoom_at_mouse
protected JCheckBox fill_edges
protected JRadioButton no_gradient
protected 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<Integer> seedFillColor
protected edu.uci.ics.jung.samples.PluggableRendererDemo.SeedDrawColor<Integer> seedDrawColor
protected edu.uci.ics.jung.samples.PluggableRendererDemo.EdgeWeightStrokeFunction<Number> ewcs
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexStrokeHighlight<Integer,Number> vsh
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexFontTransformer<Integer> vff
protected edu.uci.ics.jung.samples.PluggableRendererDemo.EdgeFontTransformer<Number> eff
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexShapeSizeAspect<Integer,Number> vssa
protected edu.uci.ics.jung.samples.PluggableRendererDemo.DirectionDisplayPredicate<Integer,Number> show_edge
protected edu.uci.ics.jung.samples.PluggableRendererDemo.DirectionDisplayPredicate<Integer,Number> show_arrow
protected edu.uci.ics.jung.samples.PluggableRendererDemo.VertexDisplayPredicate<Integer,Number> show_vertex
protected com.google.common.base.Predicate<Context<Graph<Integer,Number>,Number>> self_loop
protected PluggableRendererDemo.GradientPickedEdgePaintFunction<Integer,Number> edgeDrawPaint
protected PluggableRendererDemo.GradientPickedEdgePaintFunction<Integer,Number> edgeFillPaint
protected static final Object VOLTAGE_KEY
protected static final Object TRANSPARENCY
protected VisualizationViewer<Integer,Number> vv
protected DefaultModalGraphMouse<Integer,Number> gm
public static void main(String[] s)
public JPanel startFunction()
public Graph<Integer,Number> buildGraph()
protected void addBottomControls(JPanel jp)
jp
- panel to which controls will be addedpublic void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
Copyright © 2015. All rights reserved.