|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.ic.doc.automed.p2p.gui.graph.GShape
uk.ac.ic.doc.automed.p2p.gui.graph.GraphComponent
public abstract class GraphComponent
Field Summary | |
---|---|
protected GShape |
atShape
|
private java.util.Vector |
edges
|
protected boolean |
grouped
|
private java.util.Vector |
nodes
|
protected java.awt.Point |
prevPoint
|
private static long |
serialVersionUID
|
Fields inherited from class uk.ac.ic.doc.automed.p2p.gui.graph.GShape |
---|
altDrawer, altDrawing, AUTO_COUNT, bound, brPoint, centrePoint, changed, color, cshape, data, defBound, displayScript, displayShape, enabled, handler, highlighted, hshape, icon, id, label, lblPoint, movable, name, onClick, PREFIX_CTRL, PREFIX_HIL, props, refresh, selectable, tlPoint, type, visible, visibleOnHighlighted, ZEROX |
Constructor Summary | |
---|---|
protected |
GraphComponent()
|
protected |
GraphComponent(java.lang.String label)
|
|
GraphComponent(java.lang.String label,
GShape atShape,
java.awt.Dimension bound,
GNode[] nodes,
java.util.Properties props)
|
|
GraphComponent(java.lang.String label,
GShape atShape,
java.awt.Dimension bound,
java.util.Properties props)
|
|
GraphComponent(java.lang.String label,
java.awt.Point tlPoint,
java.awt.Dimension bound,
GNode[] nodes,
java.util.Properties props)
|
|
GraphComponent(java.lang.String label,
java.awt.Point atPoint,
java.awt.Dimension bound,
java.util.Properties props)
|
|
GraphComponent(java.lang.String label,
java.util.Properties props)
|
Method Summary | |
---|---|
void |
addEdge(GEdge ge)
Add an edge to this component |
void |
addNode(GNode gn)
Add a node to this component |
void |
addNodes(GNode[] nodes,
java.awt.Graphics g)
Add some more nodes to this component |
boolean |
contains(GShape shape)
Check that this component contains this shape |
protected void |
drawAfter(java.awt.Graphics g)
Other drawing after the main drawing is performed |
void |
drawAt(GNode atNode,
java.awt.Graphics g)
Draw this component at a given node on the graph |
protected void |
drawBefore(java.awt.Graphics g)
Drawings that are performed before the main drawing |
protected void |
drawBound(java.awt.Graphics g,
java.util.Collection nodes,
double boundWidth)
Draw a transparent layer which is bounded by a set of nodes |
protected void |
drawMain(java.awt.Graphics g)
The main body of the drawing method |
protected void |
drawOverlay(java.awt.Graphics g,
int[] xs,
int[] ys)
Draw a transparent layer which is bounded by a set of nodes |
void |
drawTo(java.awt.Graphics g,
GShape targetShape)
This method works similar to the native drawMain() except that it operates with the nodes, edges and properties of a different shape rather than those of its own. |
boolean |
equals(java.lang.Object otherShape)
Compare two shapes based on their type and coordinate and bounding box |
protected java.awt.Point |
getBaseCenterPoint()
Return the centre point of the base shape (if one was specified) |
protected java.awt.Point |
getBasePoint()
Return the top-left corner of the base shape (if one was specified) |
boolean |
getBooleanProperty(java.lang.String name)
|
java.awt.Dimension |
getBound()
The bounding box |
java.util.Vector |
getEdges()
|
GEdge[] |
getEdges(GNode n)
Return edges that are linked to a given node |
GEdge[] |
getEdgesArray()
Return all edges |
boolean |
getIsGrouped()
|
java.util.Vector |
getNodes()
|
GNode[] |
getNodesArray()
|
double |
getNumericProperty(java.lang.String name)
|
java.lang.String |
getProperty(java.lang.String name)
|
java.util.Collection |
getShapes()
|
GShape[] |
getShapesArray()
Return all shapes that are contained in this component |
protected java.util.Collection |
getShapesForUpdate()
|
protected void |
init()
Initialise data for this component |
void |
redraw(java.awt.Graphics g)
Redraw a graph component at repaint |
protected void |
redrawMain(java.awt.Graphics g)
The main body of redraw |
java.util.Collection |
removeShape(GShape shape)
|
void |
setEdges(java.util.Collection edges)
|
protected void |
setEdgesArray(GEdge[] edges)
|
void |
setIsChanged(boolean changed)
For a graph component, when it is changed we also set the change status of all of its children |
void |
setIsGrouped(boolean grouped)
|
void |
setIsVisible(boolean visible)
|
void |
setNodes(java.util.Collection nodes)
|
void |
setNodesArray(GNode[] nodes)
|
protected void |
setUp(java.awt.Graphics g,
GShape shape)
Set up the nodes and edges of this shape. |
protected void |
update()
Update the coordinates of all children shapes when a bases shape is moved |
protected void |
updateBound()
|
protected void |
updateControl()
|
protected void |
updateHighlighted()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private java.util.Vector nodes
private java.util.Vector edges
protected GShape atShape
protected java.awt.Point prevPoint
protected boolean grouped
Constructor Detail |
---|
protected GraphComponent()
protected GraphComponent(java.lang.String label)
public GraphComponent(java.lang.String label, java.util.Properties props)
public GraphComponent(java.lang.String label, java.awt.Point atPoint, java.awt.Dimension bound, java.util.Properties props)
public GraphComponent(java.lang.String label, GShape atShape, java.awt.Dimension bound, GNode[] nodes, java.util.Properties props)
public GraphComponent(java.lang.String label, GShape atShape, java.awt.Dimension bound, java.util.Properties props)
public GraphComponent(java.lang.String label, java.awt.Point tlPoint, java.awt.Dimension bound, GNode[] nodes, java.util.Properties props)
Method Detail |
---|
public void setIsGrouped(boolean grouped)
public boolean getIsGrouped()
protected java.awt.Point getBasePoint()
protected java.awt.Point getBaseCenterPoint()
protected void init()
public void drawAt(GNode atNode, java.awt.Graphics g)
atNode
- g
- public java.lang.String getProperty(java.lang.String name)
getProperty
in class GShape
public boolean getBooleanProperty(java.lang.String name)
public double getNumericProperty(java.lang.String name)
protected java.util.Collection getShapesForUpdate()
public java.util.Vector getNodes()
public GNode[] getNodesArray()
public GEdge[] getEdgesArray()
public java.util.Vector getEdges()
public void setIsVisible(boolean visible)
setIsVisible
in class GShape
public GEdge[] getEdges(GNode n)
n
-
public void setEdges(java.util.Collection edges)
public void setNodesArray(GNode[] nodes)
public void setNodes(java.util.Collection nodes)
protected void setEdgesArray(GEdge[] edges)
public java.util.Collection getShapes()
public GShape[] getShapesArray()
public void setIsChanged(boolean changed)
setIsChanged
in class GShape
public java.awt.Dimension getBound()
GShape
getBound
in class GShape
public boolean contains(GShape shape)
shape
-
public java.util.Collection removeShape(GShape shape)
protected void update()
update
in class GShape
protected void updateHighlighted()
updateHighlighted
in class GShape
protected void updateControl()
updateControl
in class GShape
protected void updateBound()
public void redraw(java.awt.Graphics g)
redraw
in class GShape
protected void drawBefore(java.awt.Graphics g)
drawBefore
in class GShape
g
- protected void drawMain(java.awt.Graphics g)
drawMain
in class GShape
g
- protected void redrawMain(java.awt.Graphics g)
redrawMain
in class GShape
g
- protected void drawAfter(java.awt.Graphics g)
drawAfter
in class GShape
g
- protected void drawOverlay(java.awt.Graphics g, int[] xs, int[] ys)
g
- nodes
- protected void drawBound(java.awt.Graphics g, java.util.Collection nodes, double boundWidth)
g
- nodes
- public void addNode(GNode gn)
nodes
- g
- public void addEdge(GEdge ge)
nodes
- g
- public void addNodes(GNode[] nodes, java.awt.Graphics g)
nodes
- g
- public void drawTo(java.awt.Graphics g, GShape targetShape)
drawTo
in class GShape
g
- targetShape
- protected void setUp(java.awt.Graphics g, GShape shape)
g
- shape
- public boolean equals(java.lang.Object otherShape)
GShape
equals
in class GShape
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |