|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.touchgraph.graphlayout.Node
org.ceryle.graph.GraphNode
org.ceryle.graph.SubGraph
public class SubGraph
Extends GraphNode, drawing a subgraph as an invisible node that displays a boundary around a group of nodes connected to it by GraphEdges.
The GraphEdges used are weak attractors and invisible. Bezier paths are used to bound the area, with the boundary's outer distance from the nodes setable, as well as line or fill mode, fill color, and line stroke.
GraphNode,
GraphEdge| Field Summary | |
|---|---|
protected boolean |
as_subgraph
Display mode, either as single node or as a bounded subgraph. |
double |
BEZIER_DIST
The ratio controlling the distance from the quadratic bezier control point to the bisecting line connecting the outermost points of the enclosing angle. |
double |
BOUNDARY_DIST
Boundary separation distance, the distance between the bounding node and the drawn line. |
static Color |
COLOR_SUBGRAPH
The default color of the subgraph boundary. |
static Color |
COLOR_SUBGRAPH_AXIS
The default color of the subgraph axes. |
static Color |
COLOR_SUBGRAPH_NODE
The default color of the subgraph node. |
static Color |
COLOR_SUBGRAPH_TEXT
The default color of the subgraph text. |
static BasicStroke |
STROKE_DASHED
The stroke used to draw the subgraph axis. |
static BasicStroke |
STROKE_SUBGRAPH
The stroke used to draw the subgraph boundary. |
static int |
STYLE_CURVE
A constant indicating the SubGraph is to be draw using curved forms. |
static int |
STYLE_RECTANGLE
A constant indicating the SubGraph is to be draw using a rectangle. |
| Fields inherited from class com.touchgraph.graphlayout.Node |
|---|
BACK_DEFAULT_COLOR, BACK_FIXED_COLOR, BACK_HILIGHT_COLOR, BACK_SELECT_COLOR, backColor, BORDER_DRAG_COLOR, BORDER_INACTIVE_COLOR, BORDER_MOUSE_OVER_COLOR, DEFAULT_TYPE, drawx, drawy, dx, dy, edges, fixed, font, justMadeLocal, lbl, markedForRemoval, massfade, repulsion, simpleDraw, SMALL_TAG_FONT, TEXT_COLOR, TEXT_FONT, textColor, typ, TYPE_CIRCLE, TYPE_ELLIPSE, TYPE_RECTANGLE, TYPE_ROUNDRECT, visible, visibleEdgeCnt, x, y |
| Constructor Summary | |
|---|---|
SubGraph(int type,
String id,
String label,
Color color,
Set members,
GraphLayoutPanel glpanel)
Constructor for a SubGraph of int type, with Strings for ID id and label, and optional Color and Set of member GraphNodes. |
|
SubGraph(int type,
String id,
String label,
GraphLayoutPanel glpanel)
Constructor for a SubGraph of int type with Strings for ID id and label, using default for Color. |
|
SubGraph(String id,
String label,
GraphLayoutPanel glpanel)
Constructor for a curved SubGraph with Strings for ID id and label, using default for Color. |
|
| Method Summary | |
|---|---|
void |
addMember(GraphNode member)
Add a new member to the set of GraphNodes within this SubGraph. |
void |
addMembers(Set members)
Add a Set of new members to the set of GraphNodes within this SubGraph. |
protected void |
drawMemberPoints(Graphics g)
Paints points at each member node, to better identify set membership. |
protected void |
extendPoint(Point2D.Double p1,
Point2D.Double p2,
double ratio)
Extends the Point2D p2 from Point2D p1 by a ratio based on BOUNDARY_DIST. |
Iterator |
getMembers()
Returns an Iterator over the GraphNodes within this SubGraph. |
Color |
getPaintBackColor(TGPanel graphpanel)
Returns the background color of the SubGraph node, dependent on context. |
Color |
getPaintBorderColor(TGPanel graphpanel)
Returns the border color of the SubGraph node, which is always transparent. |
protected void |
paintCurve1(Graphics g,
TGPanel graphpanel)
Paints a subgraph when there is one member. |
protected void |
paintCurve2(Graphics g,
TGPanel graphpanel)
Paints a subgraph when member count equals two. |
protected void |
paintCurveN(Graphics g,
TGPanel graphpanel)
Paints a subgraph when member count is greater than two. |
void |
paintNodeBody(Graphics g,
TGPanel graphpanel)
Overrides GraphNode's method when in subgraph mode. |
protected void |
paintRect(Graphics g,
TGPanel graphpanel)
Paints a subgraph using a rectangular form. |
void |
paintSmallTag(Graphics g,
TGPanel graphpanel,
int tagX,
int tagY,
Color backCol,
Color textCol,
char character)
Overrides GraphNode's method to not paint the small tag when the subgraph is displayed. |
void |
removeMember(GraphNode member)
Remove the node member from the set of GraphNodes within this SubGraph. |
protected double |
setControlPoint(Point2D.Double p1,
Point2D.Double p2,
Point2D.Double cp)
Sets the (x,y) values of the bisector point bp based upon Points p1 and p2. |
void |
setFixed(boolean fixed)
Overrides setFixed(boolean), disabling node fixation, since SubGraph nodes need to float free in order to display properly. |
void |
setMembers(Set members)
Set the set of GraphNodes within this SubGraph to members. |
void |
setVisible(boolean visible)
Overrides setVisible(boolean) to disable visibility setting. |
void |
showSubGraph(boolean asSubGraph)
Sets the drawing mode to subgraph when true, normal node when not. |
| Methods inherited from class org.ceryle.graph.GraphNode |
|---|
compareTo, getDefaultNodeFont, getHeight, getHilight, getID, getLabel, getMouseListener, getNodeFont, getVerticalTweak, getVerticalTweak, getWidth, isHidden, isProvisional, jubble, paint, paintProvisional, paintSimple, setAlternateFont, setFixed, setHidden, setHilight, setMargin, setMaximumLabelLength, setMouseListener, setNodeTagFont, setNodeTextFont, setProvisional, setSize, setVerticalTweak, toString |
| Methods inherited from class com.touchgraph.graphlayout.Node |
|---|
addEdge, containsPoint, containsPoint, deleteEdges, edgeAt, edgeCount, edgeNum, getBackColor, getEdges, getFixed, getFont, getLocation, getPaintTextColor, getTextColor, getType, hasEdge, intersects, isFixed, isVisible, removeEdge, setBackColor, setFont, setID, setLabel, setLocation, setLocation, setNodeBackDefaultColor, setNodeBackFixedColor, setNodeBackHilightColor, setNodeBackSelectColor, setNodeBorderDragColor, setNodeBorderInactiveColor, setNodeBorderMouseOverColor, setNodeTextColor, setNodeType, setTextColor, setType, visibleEdgeCount |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
public static final int STYLE_CURVE
public static final int STYLE_RECTANGLE
protected boolean as_subgraph
public static Color COLOR_SUBGRAPH
public static Color COLOR_SUBGRAPH_AXIS
public static Color COLOR_SUBGRAPH_NODE
public static Color COLOR_SUBGRAPH_TEXT
public double BOUNDARY_DIST
public double BEZIER_DIST
It may serve to alter this based on the number of connected nodes. Smaller numbers on larger sets should produce rounder curves. (This value is not used on cubic curves, used when there are only two members.)
public static final BasicStroke STROKE_DASHED
public static final BasicStroke STROKE_SUBGRAPH
| Constructor Detail |
|---|
public SubGraph(String id,
String label,
GraphLayoutPanel glpanel)
throws GraphException
setMembers(Set).
GraphException
public SubGraph(int type,
String id,
String label,
GraphLayoutPanel glpanel)
throws GraphException
setMembers(Set).
GraphException
public SubGraph(int type,
String id,
String label,
Color color,
Set members,
GraphLayoutPanel glpanel)
throws GraphException
STYLE_CURVE and STYLE_RECTANGLE.
GraphException| Method Detail |
|---|
public void setMembers(Set members)
throws GraphException
GraphExceptionpublic void addMember(GraphNode member)
public void addMembers(Set members)
public void removeMember(GraphNode member)
public void setVisible(boolean visible)
setVisible in class Nodepublic Iterator getMembers()
public void showSubGraph(boolean asSubGraph)
public Color getPaintBorderColor(TGPanel graphpanel)
getPaintBorderColor in class GraphNodepublic Color getPaintBackColor(TGPanel graphpanel)
getPaintBackColor in class GraphNodepublic void setFixed(boolean fixed)
setFixed in class Node
public void paintNodeBody(Graphics g,
TGPanel graphpanel)
paintNodeBody in class GraphNode
protected void paintCurveN(Graphics g,
TGPanel graphpanel)
paintNodeBody(Graphics,TGPanel) when in subgraph drawing mode.
protected void paintCurve2(Graphics g,
TGPanel graphpanel)
paintNodeBody(Graphics,TGPanel) when in subgraph drawing mode.
protected void paintCurve1(Graphics g,
TGPanel graphpanel)
paintNodeBody(Graphics,TGPanel) when in subgraph drawing mode.
protected void extendPoint(Point2D.Double p1,
Point2D.Double p2,
double ratio)
BOUNDARY_DIST. Point p1's position does not change.
protected double setControlPoint(Point2D.Double p1,
Point2D.Double p2,
Point2D.Double cp)
protected void drawMemberPoints(Graphics g)
protected void paintRect(Graphics g,
TGPanel graphpanel)
paintNodeBody(Graphics,TGPanel) when in subgraph drawing mode.
public void paintSmallTag(Graphics g,
TGPanel graphpanel,
int tagX,
int tagY,
Color backCol,
Color textCol,
char character)
paintSmallTag in class GraphNode
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||