Class ArrowShape
- java.lang.Object
-
- com.inductiveautomation.vision.api.client.components.shapes.ShapeDelegate
-
- com.inductiveautomation.factorypmi.application.components.shapes.ArrowShape
-
public class ArrowShape extends ShapeDelegate
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TOOL_KEY
-
Constructor Summary
Constructors Constructor Description ArrowShape()
ArrowShape(java.awt.geom.Point2D origin, float length, float angle, float shaftWidth, float headLength, float headWidth)
ArrowShape(java.awt.geom.Point2D origin, float length, float angle, float shaftWidth, float headLength, float headWidth, boolean doubleSided)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
alterShape(java.awt.geom.Rectangle2D newRect)
Directly modify the shape's frame so that it fits tightly within the new framing rectangle.java.awt.geom.GeneralPath
convertToPath()
Convert this shape to a GeneralPathfloat
getAngle()
float
getHeadLength()
float
getHeadWidth()
float
getLength()
java.awt.geom.Point2D
getOrigin()
float
getShaftWidth()
java.awt.Shape
getShape()
The AWT shape this delegate producesjava.awt.geom.Point2D
getTipPoint()
java.lang.String
getToolKey()
boolean
isDoubleSided()
boolean
isRotatable()
Some shape delegates prefer to handle rotation themselves, instead of having the PathBasedVisionShape parent rotate their shape after the fact.boolean
isSymmetric()
void
rotate(double angle, java.awt.geom.Point2D anchor)
void
setAngle(float angle)
void
setDoubleSided(boolean doubleSided)
void
setHeadLength(float headLength)
void
setHeadWidth(float headWidth)
void
setLength(float length)
void
setOrigin(java.awt.geom.Point2D origin)
void
setShaftWidth(float shaftWidth)
void
translateShape(double dX, double dY)
Move the shape using the provided offsets.void
updateShape()
-
Methods inherited from class com.inductiveautomation.vision.api.client.components.shapes.ShapeDelegate
createArea, getBounds2D, getCenterpoint
-
-
-
-
Field Detail
-
TOOL_KEY
public static final java.lang.String TOOL_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArrowShape
public ArrowShape()
-
ArrowShape
public ArrowShape(java.awt.geom.Point2D origin, float length, float angle, float shaftWidth, float headLength, float headWidth)
-
ArrowShape
public ArrowShape(java.awt.geom.Point2D origin, float length, float angle, float shaftWidth, float headLength, float headWidth, boolean doubleSided)
-
-
Method Detail
-
getToolKey
public java.lang.String getToolKey()
- Specified by:
getToolKey
in classShapeDelegate
-
getShape
public java.awt.Shape getShape()
Description copied from class:ShapeDelegate
The AWT shape this delegate produces- Specified by:
getShape
in classShapeDelegate
-
isSymmetric
public boolean isSymmetric()
- Specified by:
isSymmetric
in classShapeDelegate
-
isRotatable
public boolean isRotatable()
Description copied from class:ShapeDelegate
Some shape delegates prefer to handle rotation themselves, instead of having the PathBasedVisionShape parent rotate their shape after the fact. Delegates that do this should return true from this method, and then handle the rotate method appropriately. Note that all rotations must go through the PathBasedVisionShape so that it can update the angle property.- Overrides:
isRotatable
in classShapeDelegate
-
rotate
public void rotate(double angle, java.awt.geom.Point2D anchor)
- Overrides:
rotate
in classShapeDelegate
-
getTipPoint
public java.awt.geom.Point2D getTipPoint()
-
updateShape
public void updateShape()
-
translateShape
public void translateShape(double dX, double dY)
Description copied from class:ShapeDelegate
Move the shape using the provided offsets. Default implementation calls alterShape.- Overrides:
translateShape
in classShapeDelegate
-
alterShape
public boolean alterShape(java.awt.geom.Rectangle2D newRect)
Description copied from class:ShapeDelegate
Directly modify the shape's frame so that it fits tightly within the new framing rectangle.- Specified by:
alterShape
in classShapeDelegate
- Parameters:
newRect
- The new bounding rectangle for the shape.- Returns:
- false if the shape was unable to alter itself into the given rectangle.
-
convertToPath
public java.awt.geom.GeneralPath convertToPath()
Description copied from class:ShapeDelegate
Convert this shape to a GeneralPath- Overrides:
convertToPath
in classShapeDelegate
-
getOrigin
public java.awt.geom.Point2D getOrigin()
-
setOrigin
public void setOrigin(java.awt.geom.Point2D origin)
-
getLength
public float getLength()
-
setLength
public void setLength(float length)
-
getAngle
public float getAngle()
-
setAngle
public void setAngle(float angle)
-
getShaftWidth
public float getShaftWidth()
-
setShaftWidth
public void setShaftWidth(float shaftWidth)
-
getHeadLength
public float getHeadLength()
-
setHeadLength
public void setHeadLength(float headLength)
-
getHeadWidth
public float getHeadWidth()
-
setHeadWidth
public void setHeadWidth(float headWidth)
-
isDoubleSided
public boolean isDoubleSided()
-
setDoubleSided
public void setDoubleSided(boolean doubleSided)
-
-