giny.view
Interface GraphView


public interface GraphView

Author:
xmas

Field Summary
static int EDGE_LINE_TYPE
           
static int EDGE_PAINT
           
static int EDGE_SELECTION_PAINT
           
static int EDGE_SOURCE_END_PAINT
           
static int EDGE_SOURCE_END_SELECTED_PAINT
           
static int EDGE_SOURCE_END_TYPE
           
static int EDGE_TARGET_END_PAINT
           
static int EDGE_TARGET_END_SELECTED_PAINT
           
static int EDGE_TARGET_END_TYPE
           
static int EDGE_WIDTH
           
static int NODE_BORDER_PAINT
           
static int NODE_BORDER_WIDTH
           
static int NODE_HEIGHT
           
static int NODE_LABEL
           
static int NODE_PAINT
           
static int NODE_SELECTION_PAINT
           
static int NODE_SHAPE
           
static int NODE_WIDTH
           
static int NODE_X_POSITION
           
static int NODE_Y_POSITION
           
static int NODE_Z_POSITION
           
static int SOURCE_INDEX
           
static int TARGET_INDEX
           
 
Method Summary
 boolean addContextMethod(java.lang.String class_name, java.lang.String method_class_name, java.lang.String method_name, java.lang.Object[] args, java.lang.ClassLoader loader)
          Context Menu Support
 EdgeView addEdgeView(int edge_index)
           
 EdgeView addEdgeView(java.lang.String class_name, int edge_index)
          To facilitate adding Custome EdgeViews It is recomended that All Custom Edge Views follow the patterns outlined in PEdgeView and BasicPEdgeView.
 void addGraphViewChangeListener(GraphViewChangeListener listener)
          Adds a new GraphViewChangeListener to this GraphViews list of listeners.
 NodeView addNodeView(int node_index)
           
 NodeView addNodeView(int node_index, NodeView node_view_replacement)
          Add in a NodeView for a Node in the GraphPerspective.
 NodeView addNodeView(java.lang.String class_name, int node_index)
          To facilitate adding Custome NodeViews It is recomended that All Custom Node Views follow the patterns outlined in PNodeView and BasicPNodeView.
 void disableEdgeSelection()
           
 void disableNodeSelection()
           
 int edgeCount()
           
 boolean edgeSelectionEnabled()
           
 void enableEdgeSelection()
           
 void enableNodeSelection()
           
 void fitContent()
          Fits all Viewable elements onto the Graph
 java.lang.Object[] getAllEdgePropertyData(int edge_index)
           
 java.lang.Object[] getAllNodePropertyData(int node_index)
           
 java.awt.Paint getBackgroundPaint()
           
 java.awt.Component getComponent()
           
 java.lang.Object[] getContextMethods(java.lang.String class_name, boolean plus_superclass)
          Context Menu Support
 java.lang.Object[] getContextMethods(java.lang.String class_name, java.lang.Object[] methods)
          Context Menu Support
 boolean getEdgeBooleanProperty(int edge_index, int property)
           
 double getEdgeDoubleProperty(int edge_index, int property)
           
 float getEdgeFloatProperty(int edge_index, int property)
           
 int getEdgeIntProperty(int edge_index, int property)
           
 java.lang.Object getEdgeObjectProperty(int edge_index, int property)
          Return the stored value for the edge for the given property
 EdgeView getEdgeView(Edge edge)
           
 EdgeView getEdgeView(int edge_index)
           
 int getEdgeViewCount()
           
 java.util.Iterator getEdgeViewsIterator()
          Return all of the EdgeViews in this GraphView
 java.util.List getEdgeViewsList()
          Return all of the EdgeViews in this GraphView
 java.util.List getEdgeViewsList(int from_node_index, int to_node_index, boolean include_undirected_edges)
           
 java.util.List getEdgeViewsList(Node oneNode, Node otherNode)
          Note that this will return a list of Edge objects, the other one will return indices
 GraphPerspective getGraphPerspective()
           
 java.lang.String getIdentifier()
           
 boolean getNodeBooleanProperty(int node_index, int property)
           
 double getNodeDoubleProperty(int node_index, int property)
           
 float getNodeFloatProperty(int node_index, int property)
           
 int getNodeIntProperty(int node_index, int property)
           
 java.lang.Object getNodeObjectProperty(int node_index, int property)
          Return the stored value for the node for the given property
 NodeView getNodeView(int index)
           
 NodeView getNodeView(Node node)
           
 int getNodeViewCount()
           
 java.util.Iterator getNodeViewsIterator()
          nodeViewsIterator only returns the NodeViews that are explicitly associated with this GraphView
 RootGraph getRootGraph()
           
 int[] getSelectedEdgeIndices()
           
 java.util.List getSelectedEdges()
           
 int[] getSelectedNodeIndices()
           
 java.util.List getSelectedNodes()
           
 double getZoom()
           
 boolean hideGraphObject(java.lang.Object object)
          use this to hide a node or edge
 boolean hideGraphObjects(java.util.List objects)
           Warning!!!!!!!
Only to be used for homogenous groups!!!!
 int nodeCount()
           
 boolean nodeSelectionEnabled()
           
 EdgeView removeEdgeView(Edge edge)
          This will entirely remove a NodeView/EdgeView from the GraphView.
 EdgeView removeEdgeView(EdgeView edge_view)
          This will entirely remove a NodeView/EdgeView from the GraphView.
 EdgeView removeEdgeView(int edge)
          This will entirely remove a NodeView/EdgeView from the GraphView.
 void removeGraphViewChangeListener(GraphViewChangeListener listener)
          Removes a GraphViewChangeListener from this GraphViews list of listeners.
 NodeView removeNodeView(int node)
          This will entirely remove a NodeView/EdgeView from the GraphView.
 NodeView removeNodeView(Node node)
          This will entirely remove a NodeView/EdgeView from the GraphView.
 NodeView removeNodeView(NodeView node_view)
          This will entirely remove a NodeView/EdgeView from the GraphView.
 void setAllEdgePropertyData(int edge_index, java.lang.Object[] data)
          Set All Data For an Edge
Big Bold Faced Warning
Talk to rowan before using.
 void setAllNodePropertyData(int node_index, java.lang.Object[] data)
          Set All Data For a NOde Big Bold Faced Warning
Talk to rowan before using.
 void setBackgroundPaint(java.awt.Paint paint)
           
 boolean setEdgeBooleanProperty(int edge_index, int property, boolean value)
           
 boolean setEdgeDoubleProperty(int edge_index, int property, double value)
           
 boolean setEdgeFloatProperty(int edge_index, int property, float value)
           
 boolean setEdgeIntProperty(int edge_index, int property, int value)
           
 boolean setEdgeObjectProperty(int edge_index, int property, java.lang.Object value)
           
 void setIdentifier(java.lang.String new_identifier)
           
 boolean setNodeBooleanProperty(int node_index, int property, boolean value)
           
 boolean setNodeDoubleProperty(int node_index, int property, double value)
           
 boolean setNodeFloatProperty(int node_index, int property, float value)
           
 boolean setNodeIntProperty(int node_index, int property, int value)
           
 boolean setNodeObjectProperty(int node_index, int property, java.lang.Object value)
           
 void setZoom(double zoom)
           
 boolean showGraphObject(java.lang.Object object)
          use this to show a node or edge
 boolean showGraphObjects(java.util.List objects)
           Warning!!!!!!!
Only to be used for homogenous groups!!!!
 void updateView()
          Do a global redraw of the entire canvas
 

Field Detail

NODE_X_POSITION

public static final int NODE_X_POSITION
See Also:
Constant Field Values

NODE_Y_POSITION

public static final int NODE_Y_POSITION
See Also:
Constant Field Values

NODE_SHAPE

public static final int NODE_SHAPE
See Also:
Constant Field Values

NODE_PAINT

public static final int NODE_PAINT
See Also:
Constant Field Values

NODE_SELECTION_PAINT

public static final int NODE_SELECTION_PAINT
See Also:
Constant Field Values

NODE_BORDER_PAINT

public static final int NODE_BORDER_PAINT
See Also:
Constant Field Values

NODE_BORDER_WIDTH

public static final int NODE_BORDER_WIDTH
See Also:
Constant Field Values

NODE_WIDTH

public static final int NODE_WIDTH
See Also:
Constant Field Values

NODE_HEIGHT

public static final int NODE_HEIGHT
See Also:
Constant Field Values

NODE_LABEL

public static final int NODE_LABEL
See Also:
Constant Field Values

NODE_Z_POSITION

public static final int NODE_Z_POSITION
See Also:
Constant Field Values

SOURCE_INDEX

public static final int SOURCE_INDEX
See Also:
Constant Field Values

TARGET_INDEX

public static final int TARGET_INDEX
See Also:
Constant Field Values

EDGE_WIDTH

public static final int EDGE_WIDTH
See Also:
Constant Field Values

EDGE_LINE_TYPE

public static final int EDGE_LINE_TYPE
See Also:
Constant Field Values

EDGE_PAINT

public static final int EDGE_PAINT
See Also:
Constant Field Values

EDGE_SELECTION_PAINT

public static final int EDGE_SELECTION_PAINT
See Also:
Constant Field Values

EDGE_SOURCE_END_TYPE

public static final int EDGE_SOURCE_END_TYPE
See Also:
Constant Field Values

EDGE_SOURCE_END_PAINT

public static final int EDGE_SOURCE_END_PAINT
See Also:
Constant Field Values

EDGE_SOURCE_END_SELECTED_PAINT

public static final int EDGE_SOURCE_END_SELECTED_PAINT
See Also:
Constant Field Values

EDGE_TARGET_END_TYPE

public static final int EDGE_TARGET_END_TYPE
See Also:
Constant Field Values

EDGE_TARGET_END_PAINT

public static final int EDGE_TARGET_END_PAINT
See Also:
Constant Field Values

EDGE_TARGET_END_SELECTED_PAINT

public static final int EDGE_TARGET_END_SELECTED_PAINT
See Also:
Constant Field Values
Method Detail

getGraphPerspective

public GraphPerspective getGraphPerspective()

nodeSelectionEnabled

public boolean nodeSelectionEnabled()

edgeSelectionEnabled

public boolean edgeSelectionEnabled()

enableNodeSelection

public void enableNodeSelection()

disableNodeSelection

public void disableNodeSelection()

enableEdgeSelection

public void enableEdgeSelection()

disableEdgeSelection

public void disableEdgeSelection()

getSelectedNodeIndices

public int[] getSelectedNodeIndices()
Returns:
an int array of the graph perspective indices of the selected nodes

getSelectedNodes

public java.util.List getSelectedNodes()
Returns:
a list of the selected NodeView

getSelectedEdgeIndices

public int[] getSelectedEdgeIndices()
Returns:
an int array of the graph perspective indices of the selected edges

getSelectedEdges

public java.util.List getSelectedEdges()
Returns:
a list of the selected EdgeView

addGraphViewChangeListener

public void addGraphViewChangeListener(GraphViewChangeListener listener)
Adds a new GraphViewChangeListener to this GraphViews list of listeners.


removeGraphViewChangeListener

public void removeGraphViewChangeListener(GraphViewChangeListener listener)
Removes a GraphViewChangeListener from this GraphViews list of listeners.


setBackgroundPaint

public void setBackgroundPaint(java.awt.Paint paint)

getBackgroundPaint

public java.awt.Paint getBackgroundPaint()
Returns:
the backgroundPaint

getComponent

public java.awt.Component getComponent()
Returns:
the java.awt.Component that can be added to most screen thingys

addNodeView

public NodeView addNodeView(int node_index)
Parameters:
node_index - the index of a node to have a view created for it
Returns:
a new NodeView based on the node with the given index

addEdgeView

public EdgeView addEdgeView(int edge_index)
Parameters:
edge_index - the index of an edge
Returns:
the newly created edgeview

addEdgeView

public EdgeView addEdgeView(java.lang.String class_name,
                            int edge_index)
To facilitate adding Custome EdgeViews It is recomended that All Custom Edge Views follow the patterns outlined in PEdgeView and BasicPEdgeView.

Parameters:
class_name - the name of the class that implements EdgeView and esnted PEdge
edge_index - the index of the edge

addNodeView

public NodeView addNodeView(java.lang.String class_name,
                            int node_index)
To facilitate adding Custome NodeViews It is recomended that All Custom Node Views follow the patterns outlined in PNodeView and BasicPNodeView.

Parameters:
class_name - the name of the class that implements NodeView and esnted PNode
node_index - the index of the node

addNodeView

public NodeView addNodeView(int node_index,
                            NodeView node_view_replacement)
Add in a NodeView for a Node in the GraphPerspective. Note that this means that if there already was a NodeView for this node, the new NodeView will take its place.

Returns:
If it is replacing, it returns the old NodeView.

removeNodeView

public NodeView removeNodeView(NodeView node_view)
This will entirely remove a NodeView/EdgeView from the GraphView. This is different than


removeNodeView

public NodeView removeNodeView(Node node)
This will entirely remove a NodeView/EdgeView from the GraphView. This is different than


removeNodeView

public NodeView removeNodeView(int node)
This will entirely remove a NodeView/EdgeView from the GraphView. This is different than


removeEdgeView

public EdgeView removeEdgeView(EdgeView edge_view)
This will entirely remove a NodeView/EdgeView from the GraphView. This is different than


removeEdgeView

public EdgeView removeEdgeView(Edge edge)
This will entirely remove a NodeView/EdgeView from the GraphView. This is different than


removeEdgeView

public EdgeView removeEdgeView(int edge)
This will entirely remove a NodeView/EdgeView from the GraphView. This is different than


getIdentifier

public java.lang.String getIdentifier()
Returns:
The Unique Identifier of this GraphView

setIdentifier

public void setIdentifier(java.lang.String new_identifier)
Parameters:
new_identifier - The New Identifier for this GraphView

getZoom

public double getZoom()
Returns:
The Current Zoom Level

setZoom

public void setZoom(double zoom)
Parameters:
zoom - The New ZoomLevel

fitContent

public void fitContent()
Fits all Viewable elements onto the Graph


updateView

public void updateView()
Do a global redraw of the entire canvas


getRootGraph

public RootGraph getRootGraph()
Returns:
the root graph of the GraphPerspective that we are actually a view on

getNodeViewsIterator

public java.util.Iterator getNodeViewsIterator()
nodeViewsIterator only returns the NodeViews that are explicitly associated with this GraphView


getNodeViewCount

public int getNodeViewCount()
Returns:
the number of node views present

getEdgeViewCount

public int getEdgeViewCount()
Returns:
the number of EdgeViews present

getNodeView

public NodeView getNodeView(Node node)
Parameters:
node - The Node whose view is requested
Returns:
The NodeView of the given Node

getNodeView

public NodeView getNodeView(int index)
Parameters:
index - the index of the node whose view is requested
Returns:
The NodeView of the given Node

getEdgeViewsList

public java.util.List getEdgeViewsList()
Return all of the EdgeViews in this GraphView


getEdgeViewsList

public java.util.List getEdgeViewsList(Node oneNode,
                                       Node otherNode)
Note that this will return a list of Edge objects, the other one will return indices

Returns:
The list of EdgeViews connecting these two nodes. Possibly null.

getEdgeViewsList

public java.util.List getEdgeViewsList(int from_node_index,
                                       int to_node_index,
                                       boolean include_undirected_edges)
Returns:
a List of indicies

getEdgeView

public EdgeView getEdgeView(int edge_index)
Returns:
the EdgeView that corresponds to the given index

getEdgeViewsIterator

public java.util.Iterator getEdgeViewsIterator()
Return all of the EdgeViews in this GraphView


getEdgeView

public EdgeView getEdgeView(Edge edge)
Returns:
the EdgeView that corresponds to the given Edge

edgeCount

public int edgeCount()
Returns:
the number of edges

nodeCount

public int nodeCount()
Returns:
The number of Nodes, same number as the perspective

hideGraphObject

public boolean hideGraphObject(java.lang.Object object)
use this to hide a node or edge


showGraphObject

public boolean showGraphObject(java.lang.Object object)
use this to show a node or edge


hideGraphObjects

public boolean hideGraphObjects(java.util.List objects)
Warning!!!!!!!
Only to be used for homogenous groups!!!!


showGraphObjects

public boolean showGraphObjects(java.util.List objects)
Warning!!!!!!!
Only to be used for homogenous groups!!!!


getContextMethods

public java.lang.Object[] getContextMethods(java.lang.String class_name,
                                            boolean plus_superclass)
Context Menu Support


getContextMethods

public java.lang.Object[] getContextMethods(java.lang.String class_name,
                                            java.lang.Object[] methods)
Context Menu Support


addContextMethod

public boolean addContextMethod(java.lang.String class_name,
                                java.lang.String method_class_name,
                                java.lang.String method_name,
                                java.lang.Object[] args,
                                java.lang.ClassLoader loader)
Context Menu Support


setAllNodePropertyData

public void setAllNodePropertyData(int node_index,
                                   java.lang.Object[] data)
Set All Data For a NOde Big Bold Faced Warning
Talk to rowan before using.


getAllNodePropertyData

public java.lang.Object[] getAllNodePropertyData(int node_index)

setAllEdgePropertyData

public void setAllEdgePropertyData(int edge_index,
                                   java.lang.Object[] data)
Set All Data For an Edge
Big Bold Faced Warning
Talk to rowan before using.


getAllEdgePropertyData

public java.lang.Object[] getAllEdgePropertyData(int edge_index)

getNodeObjectProperty

public java.lang.Object getNodeObjectProperty(int node_index,
                                              int property)
Return the stored value for the node for the given property

Parameters:
node_index - The Node Index to be queried
property - the property to be accessed

setNodeObjectProperty

public boolean setNodeObjectProperty(int node_index,
                                     int property,
                                     java.lang.Object value)
Parameters:
property - the property to be accessed
value - the new value for this property

getEdgeObjectProperty

public java.lang.Object getEdgeObjectProperty(int edge_index,
                                              int property)
Return the stored value for the edge for the given property

Parameters:
edge_index - The Edge Index to be queried
property - the property to be accessed

setEdgeObjectProperty

public boolean setEdgeObjectProperty(int edge_index,
                                     int property,
                                     java.lang.Object value)
Parameters:
edge_index - The Edge Index to be queried
property - the property to be accessed
value - the new value for this property

getNodeDoubleProperty

public double getNodeDoubleProperty(int node_index,
                                    int property)
Parameters:
node_index - The Node Index to be queried
property - the property to be accessed

setNodeDoubleProperty

public boolean setNodeDoubleProperty(int node_index,
                                     int property,
                                     double value)
Parameters:
node_index - The Node Index to be queried
property - the property to be accessed
value - the new value for this property

getEdgeDoubleProperty

public double getEdgeDoubleProperty(int edge_index,
                                    int property)

setEdgeDoubleProperty

public boolean setEdgeDoubleProperty(int edge_index,
                                     int property,
                                     double value)
Parameters:
edge_index - The Edge Index to be queried
property - the property to be accessed
value - the new value for this property

getNodeFloatProperty

public float getNodeFloatProperty(int node_index,
                                  int property)

setNodeFloatProperty

public boolean setNodeFloatProperty(int node_index,
                                    int property,
                                    float value)
Parameters:
node_index - The Node Index to be queried
property - the property to be accessed
value - the new value for this property

getEdgeFloatProperty

public float getEdgeFloatProperty(int edge_index,
                                  int property)

setEdgeFloatProperty

public boolean setEdgeFloatProperty(int edge_index,
                                    int property,
                                    float value)
Parameters:
edge_index - The Edge Index to be queried
property - the property to be accessed
value - the new value for this property

getNodeBooleanProperty

public boolean getNodeBooleanProperty(int node_index,
                                      int property)

setNodeBooleanProperty

public boolean setNodeBooleanProperty(int node_index,
                                      int property,
                                      boolean value)
Parameters:
node_index - The Node Index to be queried
property - the property to be accessed
value - the new value for this property

getEdgeBooleanProperty

public boolean getEdgeBooleanProperty(int edge_index,
                                      int property)

setEdgeBooleanProperty

public boolean setEdgeBooleanProperty(int edge_index,
                                      int property,
                                      boolean value)
Parameters:
edge_index - The Edge Index to be queried
property - the property to be accessed
value - the new value for this property

getNodeIntProperty

public int getNodeIntProperty(int node_index,
                              int property)

setNodeIntProperty

public boolean setNodeIntProperty(int node_index,
                                  int property,
                                  int value)
Parameters:
node_index - The Node Index to be queried
property - the property to be accessed
value - the new value for this property

getEdgeIntProperty

public int getEdgeIntProperty(int edge_index,
                              int property)

setEdgeIntProperty

public boolean setEdgeIntProperty(int edge_index,
                                  int property,
                                  int value)
Parameters:
edge_index - The Edge Index to be queried
property - the property to be accessed
value - the new value for this property