public abstract class GNode extends GraphObject
GraphObject.Kind, GraphObject.ObjectIDComparator
Modifier and Type | Field and Description |
---|---|
static float |
borderOutlineWidth
If "outlines" are selected (i.e., turn on Hub.showBorders) this is how
wide the border should be
|
protected static float[] |
dashpattern |
protected ArrayList |
descriptors
Some reference that helps describe this node.
|
(package private) GMark |
mark |
protected ArrayList |
myedges
List of GEdges by which this GNode is attached to other nodes.
|
(package private) static Font |
showBoringDebugInfoFont |
(package private) String |
typeLabel |
backColor, defaultDim, defaultSelectColor, defaultWrapColumns, defaultWrapLabels, displayRect3D, foreColor, highlightColor, history, isSelected, labelFont, myKind, objectID, objectMargin, ownerGraph, TerritorialLimit, textLabel, textLabelLowerLeftPt
Constructor and Description |
---|
GNode() |
Modifier and Type | Method and Description |
---|---|
void |
abandonObject()
Disconnects itself from any other GNodes, by telling each of its edges to
erase itself.
|
void |
adjustEdges()
Adjust all this node's connecting edges so that they are positioned
correctly.
|
void |
attachGEdge(GEdge ge)
Includes the already-allocated GEdge in the target node
|
protected String |
CGIFStringGNodeEdges()
Handles the translation necessary for providing links to a CGIF form.
|
void |
clearDescriptors() |
void |
deleteGEdge(GEdge ge)
Removes the GEdge from the node to which it is attached.
|
void |
draw(Graphics2D g,
boolean printing)
Handles generic drawing for all nodes, and usually invokes the node's
class method "draw"
|
void |
drawActivated(Graphics2D g)
Swap the fore and background, draw again, then restore fore and back
|
void |
drawBorder(Graphics2D g,
Color borderColor)
Highlights the border of the object
|
void |
drawDebuggingInfo(Graphics2D g) |
protected void |
finalize() |
Rectangle2D.Double |
getDisplayRect()
Gets the display rectangle of this object on the canvas, without any scaling
information.
|
ArrayList |
getEdges()
Returns the GEdges associated with this GNode.
|
ArrayList<GNode> |
getLinkedNodes()
A convenience method to get all linked nodes, regardless
of whether they are "input" or "output".
|
ArrayList<GNode> |
getLinkedNodes(GEdge.Direction direction)
Returns a list of GNodes depending on whether they are "from" or "to"
the calling node.
|
Dimension |
getSize() |
AbstractTypeDescriptor |
getTypeDescriptor()
Convenience method to return the first type descriptor.
|
AbstractTypeDescriptor[] |
getTypeDescriptors() |
String |
getTypeLabel()
Get just the type label portion of the concept's text label.
|
boolean |
isActive()
Does the marker indicate an active input concept to an actor?
|
boolean |
isChanged()
Does the marker indicate object has changed?
|
void |
setActive(boolean b)
Used when activating CG actors to mark this node as active in a sequence
of firings.
|
void |
setCenter()
Sets the position of this node to be its center.
|
void |
setCenter(Point2D.Double p)
Sets the position of a node and makes the rest of its dimensions
consistent.
|
void |
setChanged(boolean b)
Sets this node's mark to indicate that it's been changed.
|
void |
setTypeDescriptor(AbstractTypeDescriptor o)
Sets the first type descriptor of this node.
|
void |
setTypeDescriptors(AbstractTypeDescriptor[] ds) |
void |
setTypeLabel(String s) |
void |
setTypeLabel(String label,
boolean resize)
Sets a type label for the target node.
|
addHistoryRecord, adjustCustomDisplayRect, commitToKnowledgeBase, findDominantContext, forceMove, forgetObject, getBestFontMetrics, getCenter, getColor, getDepth, getDim, getDisplayRect3D, getHistory, getLabelFont, getMinimumContentSize, getObjectLocator, getOutermostGraph, getOwnerFrame, getOwnerGraph, getShape, getShapeForDrawing, getTextLabel, getTextLabelSize, getUpperLeft, getWrapColumns, getWrapLabels, isNegated, isNegativelyNested, listToString, listToStringXML, putInCorrectContext, putInCorrectContext, resizeIfNecessary, resizeIfNecessary, selfCleanup, setBackground, setCenterOnly, setColor, setColor, setDepth, setDim, setDim, setDisplayRect, setDisplayRect, setDisplayRect3D, setForeground, setLabelFont, setNegated, setOwnerGraph, setTextLabel, setTextLabel, setTextLabel, setUpperLeft, setUpperLeft, toString, unCommitFromKnowledgeBase
static Font showBoringDebugInfoFont
protected ArrayList myedges
protected static float[] dashpattern
public static float borderOutlineWidth
GMark mark
String typeLabel
protected ArrayList descriptors
charger.obj.AbstractTypeDescriptor
public boolean isChanged()
public boolean isActive()
public void setChanged(boolean b)
b
- whether to tell the mark that the node is changed or not.GMark.setChanged(boolean)
public void setActive(boolean b)
b
- public ArrayList getEdges()
public ArrayList<GNode> getLinkedNodes(GEdge.Direction direction)
direction
- either GEdge.Direction.FROM
(for nodes linked with
arrows directed toward this node, or GEdge.Direction.TO
(for
nodes linked with arrows directed away from this node).GEdge.Direction
public ArrayList<GNode> getLinkedNodes()
protected String CGIFStringGNodeEdges()
public void setCenter()
setCenter()
public void setCenter(Point2D.Double p)
setCenter
in class GraphObject
p
- the new center point, although internally the top left corner is
saved as the position.public void adjustEdges()
public void abandonObject()
abandonObject
in class GraphObject
protected void finalize() throws Throwable
finalize
in class GraphObject
Throwable
public void attachGEdge(GEdge ge)
ge
- the allocated and set-up GEdgepublic void deleteGEdge(GEdge ge)
public void draw(Graphics2D g, boolean printing)
draw
in class GraphObject
g
- Graphics context on which the object is to be renderedprinting
- Whether to pretty-print the objectpublic void drawBorder(Graphics2D g, Color borderColor)
GraphObject
drawBorder
in class GraphObject
g
- Graphics context on which the object is to be renderedborderColor
- the color to drawpublic void drawActivated(Graphics2D g)
public void drawDebuggingInfo(Graphics2D g)
public Dimension getSize()
public Rectangle2D.Double getDisplayRect()
GraphObject
getDisplayRect
in class GraphObject
public String getTypeLabel()
public void setTypeLabel(String label, boolean resize)
label
- The type label to setresize
- Shether to resize if necessary.public void setTypeLabel(String s)
public AbstractTypeDescriptor[] getTypeDescriptors()
public void clearDescriptors()
public void setTypeDescriptors(AbstractTypeDescriptor[] ds)
public AbstractTypeDescriptor getTypeDescriptor()
public void setTypeDescriptor(AbstractTypeDescriptor o)