com.jgraph.navigation
public class GraphNavigator extends JPanel implements GraphLayoutCacheListener, GraphModelListener, PropertyChangeListener, AdjustmentListener
Nested Class Summary | |
---|---|
class | GraphNavigator.NavigatorPane
Scrollpane that implements special painting used for the navigator
preview. |
Field Summary | |
---|---|
protected JGraph | backingGraph
Holds the backing graph and references the displayed (current) graph. |
protected ComponentListener | componentListener
Component listener to udpate the scale. |
protected WeakReference | currentGraph
Weak reference to the current graph. |
protected static Cursor | CURSOR_DEFAULT
Shared cursor objects to avoid expensive constructor calls. |
protected static Cursor | CURSOR_HAND
Shared cursor objects to avoid expensive constructor calls. |
protected GraphLayoutCache | initialLayoutCache
References the inital layout cache of the backing graph. |
protected double | maximumScale
Specifies the maximum scale for the navigator view. |
protected GraphNavigator.NavigatorPane | navigatorPane
Holds the navigator pane the displays the backing graph. |
Constructor Summary | |
---|---|
GraphNavigator(JGraph backingGraph)
Constructs a new graph navigator using backingGraph to
display the graph in currentGraph.
|
Method Summary | |
---|---|
void | adjustmentValueChanged(AdjustmentEvent e) |
static GraphNavigator | createInstance(JGraph graph) |
JGraph | getBackingGraph()
Returns the backing graph that is used to display currentGraph.
|
JGraph | getCurrentGraph()
Returns the graph that is currently displayed.
|
double | getMaximumScale()
Returns the maximum scale to be used for the backing graph.
|
static JGraph | getParentGraph(Component component)
Helper method that returns the parent JGraph for the specified component
in the component hierarchy. |
static JScrollPane | getParentScrollPane(Component component)
Helper method that returns the parent scrollpane for the specified
component in the component hierarchy. |
GraphNavigator.NavigatorPane | getScrollPane()
Returns the navigator pane that contains the backing graph.
|
void | graphChanged(GraphModelEvent e) |
void | graphLayoutCacheChanged(GraphLayoutCacheEvent e) |
void | propertyChange(PropertyChangeEvent event) |
void | setBackingGraph(JGraph backingGraph)
Sets the backing graph that is used to display currentGraph.
|
void | setCurrentGraph(JGraph sourceGraph)
Sets the graph that is currently displayed.
|
void | setMaximumScale(double maximumScale)
Sets the maximum scale to be used for the backing graph.
|
protected void | updateScale()
Updates the scale of the backing graph. |
backingGraph
to
display the graph in currentGraph.
Parameters: backingGraph The backing graph to render the display.
Returns: Returns the backing graph.
Returns: Returns the backing graph.
Returns: Returns the maximumScale.
Returns: Returns the parent scrollpane or component.
Returns: Returns the parent scrollpane or component.
Returns: Returns the navigator pane.
Parameters: backingGraph The backing graph to set.
Parameters: sourceGraph The current graph to set.
Parameters: maximumScale The maximumScale to set.