public abstract class OverlayNodedObject extends OverlayObject
Modifier and Type | Field and Description |
---|---|
protected static float[][] |
ARC
Computed (X, Y) pairs for top 1/2 of a unit circle.
|
protected static String |
BOUNDS
The names of the statistics this object reports.
|
protected double |
curveLength
Length of curve of a noded object.
|
protected int |
highlightIndex
Index of the highlighted node.
|
protected boolean |
highlightNode
Whether there is a higlighted node.
|
protected static float |
HLT_ALPHA
Alpha value for highlighting.
|
protected static String |
LENGTH |
protected int |
maxNodes
Total number of nodes (real + buffer) nodes in the node array.
|
protected float[][] |
nodes
Node array and associated tracking variables.
|
protected static String |
NODES |
protected Object |
nodesSync
Synchronization object for nodes array.
|
protected int |
numNodes
Number of real nodes in the node array.
|
protected static float |
RADIUS
Radius in pixels of circle indicating a node is selected.
|
protected static String[] |
STAT_TYPES |
color, drawing, filled, GLOW_ALPHA, GLOW_COLOR, GLOW_WIDTH, group, horizGridCount, notes, overlay, selected, text, vertGridCount, x1, x2, xGrid1, xGrid2, xGrid3, xGrid4, y1, y2, yGrid1, yGrid2, yGrid3, yGrid4
Constructor and Description |
---|
OverlayNodedObject(OverlayTransform overlay)
Constructs an uninitialized noded object.
|
OverlayNodedObject(OverlayTransform overlay,
float[][] nodes)
Constructs a noded object from an array of nodes.
|
OverlayNodedObject(OverlayTransform overlay,
float x1,
float y1,
float x2,
float y2)
Constructs a noded object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
areBoundsEditable()
True iff this overlay can be resized using X1, X2, Y1, Y2 entry boxes.
|
boolean |
canBeFilled()
True iff this overlay supports the filled parameter.
|
void |
computeLength()
Computes length of curve.
|
OverlayFreeform |
connectTo(OverlayFreeform f2)
Creates a new freeform by connecting the tail of this freeform to the head
of the freeform supplied.
|
void |
deleteBetween(int i1,
int i2)
Deletes a range of nodes from the node array.
|
void |
deleteNode(int index)
Deletes a node from the node array.
|
double |
getCurveLength()
Gets length of curve.
|
DataImpl |
getData()
Gets VisAD data object representing this overlay.
|
double |
getDistance(double x,
double y)
Compute the shortest distance from this object to the given point.
|
double |
getDistanceToBoundingBox(double x,
double y)
Computes the shortest distance from this object's bounding box to the given
point.
|
int |
getHighlightedNodeIndex()
Returns index of highlighted node.
|
float |
getLastNodeX()
Gets most recent x-coordinate in node array.
|
float |
getLastNodeY()
Gets most recent y-coordinate in node array.
|
double |
getLastSegmentLength()
Determines length of last line segment in this curve.
|
int |
getMaxNodes()
Returns total number of nodes in array.
|
protected double[] |
getNearestNode(float x,
float y)
Gets the nearest node to the given point.
|
float[] |
getNodeCoords(int index)
Returns coordinates of node at given index in the node array.
|
float[][] |
getNodes()
Returns a copy of the node array.
|
int |
getNumNodes()
Returns the number of real nodes in the array.
|
String |
getStat(String name)
Returns a specific statistic of this object.
|
String |
getStatistics()
Retrieves useful statistics about this overlay.
|
static String[] |
getStatTypes()
Returns the names of the statistics this object reports.
|
boolean |
hasData()
Returns whether this object is drawable, i.e., is of nonzero size, area,
length, etc.
|
boolean |
hasEndpoint()
True iff this overlay has an endpoint coordinate pair.
|
boolean |
hasEndpoint2()
True iff this overlay has a second endpoint coordinate pair.
|
void |
insertNode(int index,
float x,
float y,
boolean colocationalOK)
Inserts a node at coordinates provided before the node at the index
provided.
|
boolean |
isHighlightNode()
True iff there is a highlighted node.
|
void |
printNodes()
Prints node array of current freeform.
|
static void |
printThread(String methodName)
Prints current thread plus method name if provided.
|
OverlayFreeform[] |
removeNode(int index)
Deletes a node from the freeform object, creating two new freeforms if the
node deleted is an interior node.
|
protected void |
resizeNodeArray(int newLength)
Resizes the node array, truncating if necessary.
|
void |
reverseNodes()
Reverses the node array (and therefore its internal orientation).
|
void |
setCoords(float x1,
float y1)
Changes coordinates of the overlay's first endpoint.
|
void |
setCurveLength(double len)
Sets length of curve.
|
void |
setHighlightNode(int i)
Highlight a node.
|
void |
setLastNode(float[] c)
Sets coordinates of last node.
|
void |
setLastNode(float x,
float y)
Sets coordinates of last node.
|
void |
setNextNode(float[] c)
Sets next node coordinates.
|
void |
setNextNode(float x,
float y)
Sets next node coordinates.
|
void |
setNodeCoords(int ndx,
float x,
float y)
Sets coordinates of an existing node.
|
void |
setNodes(float[][] nodes)
Sets the node array to that provided--for loading from saved.
|
void |
truncateNodeArray()
Deletes buffer nodes from the tail of the node array.
|
void |
turnOffHighlighting()
Turn off node highlighting.
|
void |
updateBoundingBox()
Updates the coordinates of the bounding box of a noded object by checking
the entire node array.
|
getColor, getGroup, getNotes, getText, getX, getX2, getY, getY2, hasText, isDrawing, isFilled, isScalable, isSelected, rescale, setBoundaries, setColor, setCoords2, setDrawing, setFilled, setGroup, setNotes, setSelected, setText, setX, setX2, setY, setY2
protected static final String BOUNDS
protected static final String NODES
protected static final String LENGTH
protected static final String[] STAT_TYPES
protected static final float[][] ARC
protected static final float HLT_ALPHA
protected static final float RADIUS
protected Object nodesSync
protected float[][] nodes
protected int numNodes
protected int maxNodes
protected double curveLength
protected boolean highlightNode
protected int highlightIndex
public OverlayNodedObject(OverlayTransform overlay)
public OverlayNodedObject(OverlayTransform overlay, float x1, float y1, float x2, float y2)
public OverlayNodedObject(OverlayTransform overlay, float[][] nodes)
public static String[] getStatTypes()
public boolean hasData()
hasData
in class OverlayObject
public DataImpl getData()
getData
in class OverlayObject
public double getDistance(double x, double y)
getDistance
in class OverlayObject
public String getStat(String name)
getStat
in class OverlayObject
public String getStatistics()
getStatistics
in class OverlayObject
public boolean hasEndpoint()
hasEndpoint
in class OverlayObject
public boolean hasEndpoint2()
hasEndpoint2
in class OverlayObject
public boolean canBeFilled()
canBeFilled
in class OverlayObject
public boolean areBoundsEditable()
areBoundsEditable
in class OverlayObject
public boolean isHighlightNode()
public int getHighlightedNodeIndex()
protected double[] getNearestNode(float x, float y)
public double getDistanceToBoundingBox(double x, double y)
public void setHighlightNode(int i)
public void turnOffHighlighting()
public float[] getNodeCoords(int index)
public float[][] getNodes()
public int getNumNodes()
public int getMaxNodes()
public float getLastNodeX()
public float getLastNodeY()
public void setCoords(float x1, float y1)
setCoords
in class OverlayObject
public void setNodes(float[][] nodes)
public void updateBoundingBox()
public double getCurveLength()
public double getLastSegmentLength()
public void setCurveLength(double len)
public void computeLength()
public void setNodeCoords(int ndx, float x, float y)
public void setLastNode(float x, float y)
public void setLastNode(float[] c)
public void setNextNode(float x, float y)
public void setNextNode(float[] c)
public void insertNode(int index, float x, float y, boolean colocationalOK)
public void deleteBetween(int i1, int i2)
public void deleteNode(int index)
public OverlayFreeform[] removeNode(int index)
public OverlayFreeform connectTo(OverlayFreeform f2)
f2
- The freeform to connect to this freeformpublic void reverseNodes()
public void truncateNodeArray()
protected void resizeNodeArray(int newLength)
public void printNodes()
public static void printThread(String methodName)
Copyright © 2015–2022 SciJava. All rights reserved.