public class ArrowPNode
extends edu.umd.cs.piccolo.PNode
Modifier and Type | Field and Description |
---|---|
static int |
ADJACENT |
private static java.awt.Color |
ADJACENTCOLOR |
private java.awt.geom.Line2D.Double |
arrow |
private double |
arrowHeadLength |
private float |
arrowHeadScale |
private double |
arrowHeadWidth |
static int |
CLUSTER |
private static java.awt.Color |
CLUSTERCOLOR |
private java.awt.Color |
color |
private InputCorrections.CreationType |
creationType |
private java.awt.Polygon |
endHead |
static int |
MAXARROWWIDTH |
static int |
OUTLIER |
private static java.awt.Color |
OUTLIERCOLOR |
private boolean |
selectionVisibility |
private static long |
serialVersionUID |
private boolean |
showEndHead |
private boolean |
showStartHead |
static int |
STABLE |
private static java.awt.Color |
STABLECOLOR |
private java.awt.Polygon |
startHead |
private java.awt.BasicStroke |
stroke |
private edu.umd.cs.piccolo.PNode |
tooltipNode |
private int |
type |
private boolean |
typeVisibility |
private double |
x1 |
private double |
x2 |
private double |
y1 |
private double |
y2 |
PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE
Constructor and Description |
---|
ArrowPNode(double x1,
double y1,
double x2,
double y2)
Constructor that takes arrow coordinates
|
ArrowPNode(InputCorrections.CreationType creationType,
java.lang.String[][] attributes,
java.lang.String tooltip,
java.awt.Color color,
double width,
double height,
java.awt.Point pointBegin,
java.awt.Point pointEnd) |
ArrowPNode(java.awt.Point start,
java.awt.Point end,
double offsetX,
double offsetY) |
Modifier and Type | Method and Description |
---|---|
private void |
calculateArrow()
Calculate the coordinates for the 3 points defining each arrowhead (the arrowhead is a triangle) and generate
polygon objects with these points.
|
static ArrowPNode |
createInputCorrectionArrow(InputCorrections.InputCorrection c,
InputCorrections.CreationType creationType,
GeneralUnitPNode sourceUnitNode,
GeneralUnitPNode targetUnitNode) |
InputCorrections.CreationType |
getCreationType() |
int |
getType() |
boolean |
getVisible()
Is the visibility of this ArrowPNode currently set to true?
|
protected void |
paint(edu.umd.cs.piccolo.util.PPaintContext paintContext)
Paints the arrow line with given color and stroke, adding arrowheads as applicable
|
void |
setArrow(double x1,
double y1,
double x2,
double y2)
(Re)sets the coordinates of the arrow to (x1, y1) (x2, y2); produces a line and appropriate arrowheads and resets
the Node's bounding box to hold the new arrow
|
void |
setArrowHeadScale(float scale) |
boolean |
setBounds(double x,
double y,
double w,
double h)
Set the bounds of this PNode object.
|
void |
setColor(java.awt.Color color) |
void |
setLineWidth(double width) |
void |
setProportionalWidth(double propWidth) |
void |
setSelectionVisibility(boolean selectionVisibility) |
void |
setType(int type) |
void |
setTypeVisibility(boolean typeVisibility) |
void |
setVisible(boolean visibility) |
void |
showEndArrowHead(boolean state)
Show the arrowhead at the (x2,y2)-end of the line?
|
void |
showStartArrowHead(boolean state)
Show the arrowhead at the (x1,y1)-end of the line?
|
addActivity, addAttribute, addChild, addChild, addChildren, addClientProperty, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientProperty, getClientPropertyKeysEnumeration, getClientPropertyKeysIterator, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, internalUpdateBounds, intersects, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, moveInBackOf, moveInFrontOf, moveToBack, moveToFront, offset, paintAfterChildren, paramString, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, position, print, print, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toString, transformBy, translate, validateFullBounds, validateFullPaint
private static final long serialVersionUID
private double x1
private double y1
private double x2
private double y2
private java.awt.geom.Line2D.Double arrow
private boolean typeVisibility
private boolean selectionVisibility
private boolean showStartHead
private boolean showEndHead
private edu.umd.cs.piccolo.PNode tooltipNode
private double arrowHeadLength
private double arrowHeadWidth
private java.awt.Polygon startHead
private java.awt.Polygon endHead
private java.awt.Color color
private static final java.awt.Color OUTLIERCOLOR
private static final java.awt.Color STABLECOLOR
private static final java.awt.Color ADJACENTCOLOR
private static final java.awt.Color CLUSTERCOLOR
private java.awt.BasicStroke stroke
private int type
private InputCorrections.CreationType creationType
private float arrowHeadScale
public static final int OUTLIER
public static final int STABLE
public static final int ADJACENT
public static final int CLUSTER
public static final int MAXARROWWIDTH
public ArrowPNode(java.awt.Point start, java.awt.Point end, double offsetX, double offsetY)
public ArrowPNode(double x1, double y1, double x2, double y2)
public ArrowPNode(InputCorrections.CreationType creationType, java.lang.String[][] attributes, java.lang.String tooltip, java.awt.Color color, double width, double height, java.awt.Point pointBegin, java.awt.Point pointEnd)
public void showStartArrowHead(boolean state)
state
- arrowhead "on" or "off"?public void setArrowHeadScale(float scale)
public void showEndArrowHead(boolean state)
state
- arrowhead "on" or "off"?private void calculateArrow()
public void setArrow(double x1, double y1, double x2, double y2)
public boolean setBounds(double x, double y, double w, double h)
setBounds
in class edu.umd.cs.piccolo.PNode
PNode.setBounds(double, double, double, double)
protected void paint(edu.umd.cs.piccolo.util.PPaintContext paintContext)
paint
in class edu.umd.cs.piccolo.PNode
PNode.paint(edu.umd.cs.piccolo.util.PPaintContext)
public boolean getVisible()
getVisible
in class edu.umd.cs.piccolo.PNode
public int getType()
public InputCorrections.CreationType getCreationType()
public void setType(int type)
public void setLineWidth(double width)
public void setProportionalWidth(double propWidth)
public void setSelectionVisibility(boolean selectionVisibility)
public void setTypeVisibility(boolean typeVisibility)
public void setVisible(boolean visibility)
setVisible
in class edu.umd.cs.piccolo.PNode
public void setColor(java.awt.Color color)
public static ArrowPNode createInputCorrectionArrow(InputCorrections.InputCorrection c, InputCorrections.CreationType creationType, GeneralUnitPNode sourceUnitNode, GeneralUnitPNode targetUnitNode)