public class GraphWidget extends javax.swing.JPanel implements Control, IEventListener
Modifier and Type | Class and Description |
---|---|
static class |
GraphWidget.LayoutMode
Settings mode
|
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
private static GraphWidget.LayoutMode |
altMode
Current layout mode for filter
|
private java.lang.String |
base
Application base directory
|
private IMutableFilter<HasId> |
edgeFilter
Edge filter
|
private IPalette<HasId> |
edgePalette
Edge palette
|
private IFilterWidget |
edgeWidget
Filter component
|
private javax.swing.JComponent |
filterComponent
Filter component
|
private GraphWidget.LayoutMode |
filterMode
Current layout mode for filter
|
private java.lang.String |
imageBase
Image base directory
|
private javax.swing.JPanel |
mainPanel
Main panel (views + tools)
|
javax.swing.JProgressBar |
progressBar
Progress bar
|
private static long |
serialVersionUID |
private Settings |
settings
Settings properties
|
private javax.swing.JComponent |
settingsComponent
Settings component
|
private SettingsEditor |
settingsEditor
Settings component
|
private GraphWidget.LayoutMode |
settingsMode
Current layout mode for settings
|
private javax.swing.JToolBar |
toolbar
Toolbar
|
private javax.swing.JPanel |
viewPanel
View panel (views)
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
GraphWidget(Settings settings0,
IMutableFilter<HasId> edgeFilter0,
IPalette<HasId> edgePalette0,
java.lang.String base0,
java.lang.String imageBase0)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
applyEdgeFilter(IMutableFilter<HasId> edgeFilter)
Apply edge filter
|
void |
applyEdgeFilter(java.lang.String id,
java.lang.Boolean value)
Apply edge filter
|
void |
applyEdgeFilterEnable(boolean flag)
Apply edge filter enable
|
void |
applyEdgeShape(java.lang.Class<? extends edu.uci.ics.jung.visualization.decorators.AbstractEdgeShapeTransformer<GNode,GEdge>> edgeShapeClass)
Apply lens shape
|
void |
applyFilterMode(GraphWidget.LayoutMode mode)
Apply settings mode
|
void |
applyLayout(java.lang.Class<? extends edu.uci.ics.jung.algorithms.layout.Layout<GNode,GEdge>> layoutClass)
Apply layout
|
javax.swing.JComponent |
applyLayoutMode(javax.swing.JComponent component,
javax.swing.JComponent component0,
GraphWidget.LayoutMode mode,
boolean west)
Apply settings mode
|
void |
applyLens(View.LensType lensType)
Apply lens
|
void |
applyModel()
(Re)Apply data model
|
void |
applyMouseMode(edu.uci.ics.jung.visualization.control.ModalGraphMouse.Mode mode)
Apply mouse node
|
void |
applyNodeMode(View.NodeMode mode)
Apply node rendering mode
|
void |
applyPartitionMode(SubGraph.PartitionMode mode)
Apply partition mode
|
void |
applyResetTransforms(edu.uci.ics.jung.visualization.Layer layer,
boolean scaleDown)
Reset transforms
|
void |
applySetting(Settings.Setting setting,
java.lang.Object value)
Apply Setting
|
void |
applySettings(Settings settings)
Apply Settings
|
void |
applySettingsMode(GraphWidget.LayoutMode mode)
Apply settings mode
|
void |
applySubLayouts(java.lang.Class<? extends edu.uci.ics.jung.algorithms.layout.Layout<GNode,GEdge>> layoutClass1,
java.lang.Class<? extends edu.uci.ics.jung.algorithms.layout.Layout<GNode,GEdge>> layoutClass2)
Apply sub layouts
|
private void |
changeSetting(Settings.Setting setting,
java.lang.Object value) |
void |
editFilter()
Edit filter
|
void |
editSettings()
Edit settings
|
void |
editSettings2() |
IMutableFilter<HasId> |
getFilter()
Get filter
|
javax.swing.JPopupMenu |
getMenu()
Get menu
|
private javax.swing.JMenu |
getModeMenu()
Get mouse mode menu
|
Settings |
getSettings()
Get settings
|
protected View |
getView() |
private void |
initialize()
Initialize
|
void |
loadFilter()
Load filter from file
|
void |
loadSettings()
Load settings from file
|
static Settings |
makeSettings()
Settings factory
|
private static javax.swing.JSplitPane |
makeSplitPane(int dividerLocation)
Make split panel to wrap left panel and editor panel
|
private static java.net.URL |
makeUrl(java.lang.String urlString)
Make URL
|
View |
makeView() |
void |
notified(Event event)
Event notification
|
void |
preset(Settings.Preset preset)
Enforce preset
|
void |
resizeToView()
Resize layout to view
|
void |
set(Graph<GraphNode,GraphEdge> graph,
GraphDecorator<GNode,GEdge> decorator,
boolean lemmatize) |
void |
set(IFilterWidget edgeWidget) |
void |
test()
Test
|
void |
zoomIn()
Zoom in
|
void |
zoomOut()
Zoom out
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private static final long serialVersionUID
private javax.swing.JPanel mainPanel
private javax.swing.JPanel viewPanel
private javax.swing.JComponent settingsComponent
private javax.swing.JComponent filterComponent
private SettingsEditor settingsEditor
private IFilterWidget edgeWidget
private javax.swing.JToolBar toolbar
public javax.swing.JProgressBar progressBar
private final Settings settings
private final IMutableFilter<HasId> edgeFilter
private GraphWidget.LayoutMode settingsMode
private GraphWidget.LayoutMode filterMode
private static final GraphWidget.LayoutMode altMode
private final java.lang.String base
private final java.lang.String imageBase
public GraphWidget(Settings settings0, IMutableFilter<HasId> edgeFilter0, IPalette<HasId> edgePalette0, java.lang.String base0, java.lang.String imageBase0)
settings0
- settingsedgeFilter0
- edge filteredgePalette0
- edge palettebase0
- document baseimageBase0
- image basepublic static Settings makeSettings()
private void initialize()
protected View getView()
public void notified(Event event)
IEventListener
notified
in interface IEventListener
event
- eventpublic javax.swing.JPopupMenu getMenu()
private javax.swing.JMenu getModeMenu()
public void applySettingsMode(GraphWidget.LayoutMode mode)
mode
- mode (none, splitpane, toolbar)public void applyFilterMode(GraphWidget.LayoutMode mode)
mode
- mode (none,splitpane,toolbar)public javax.swing.JComponent applyLayoutMode(javax.swing.JComponent component, javax.swing.JComponent component0, GraphWidget.LayoutMode mode, boolean west)
component
- component to addcomponent0
- component to removemode
- mode (none,splitpane,toolbar)west
- place to the westprivate static java.net.URL makeUrl(java.lang.String urlString)
urlString
- url stringprivate static javax.swing.JSplitPane makeSplitPane(int dividerLocation)
dividerLocation
- divider locationpublic View makeView()
public void set(Graph<GraphNode,GraphEdge> graph, GraphDecorator<GNode,GEdge> decorator, boolean lemmatize)
public void set(IFilterWidget edgeWidget)
private void changeSetting(Settings.Setting setting, java.lang.Object value)
public void applySettings(Settings settings)
settings
- settingspublic void applySetting(Settings.Setting setting, java.lang.Object value)
setting
- setting keyvalue
- setting valuepublic void applyEdgeFilter(IMutableFilter<HasId> edgeFilter)
edgeFilter
- edge filterpublic void applyEdgeFilter(java.lang.String id, java.lang.Boolean value)
id
- edge idvalue
- valuepublic void applyModel()
Control
applyModel
in interface Control
public void applyLayout(java.lang.Class<? extends edu.uci.ics.jung.algorithms.layout.Layout<GNode,GEdge>> layoutClass)
Control
applyLayout
in interface Control
layoutClass
- layout class for graphpublic void applySubLayouts(java.lang.Class<? extends edu.uci.ics.jung.algorithms.layout.Layout<GNode,GEdge>> layoutClass1, java.lang.Class<? extends edu.uci.ics.jung.algorithms.layout.Layout<GNode,GEdge>> layoutClass2)
Control
applySubLayouts
in interface Control
layoutClass1
- layout class for graph/subgraph1layoutClass2
- layout class for subgraph 2 (null if no aggregate layout)public void applyPartitionMode(SubGraph.PartitionMode mode)
Control
applyPartitionMode
in interface Control
mode
- partition modepublic void applyResetTransforms(edu.uci.ics.jung.visualization.Layer layer, boolean scaleDown)
Control
applyResetTransforms
in interface Control
layer
- layer (view or layout layers, null means both)scaleDown
- whether to scale downpublic void applyLens(View.LensType lensType)
Control
public void applyEdgeShape(java.lang.Class<? extends edu.uci.ics.jung.visualization.decorators.AbstractEdgeShapeTransformer<GNode,GEdge>> edgeShapeClass)
Control
applyEdgeShape
in interface Control
edgeShapeClass
- edge shape classpublic void applyEdgeFilterEnable(boolean flag)
Control
applyEdgeFilterEnable
in interface Control
flag
- whether to apply filterpublic void applyNodeMode(View.NodeMode mode)
Control
applyNodeMode
in interface Control
mode
- node rendering modepublic void applyMouseMode(edu.uci.ics.jung.visualization.control.ModalGraphMouse.Mode mode)
Control
applyMouseMode
in interface Control
mode
- mouse modepublic Settings getSettings()
Control
getSettings
in interface Control
public IMutableFilter<HasId> getFilter()
Control
public void loadSettings()
public void editSettings()
Control
editSettings
in interface Control
public void editSettings2()
public void loadFilter()
public void editFilter()
Control
editFilter
in interface Control
public void resizeToView()
Control
resizeToView
in interface Control
public void zoomIn()
Control
public void zoomOut()
Control
public void test()
Control
public void preset(Settings.Preset preset)
Control