Class PolygonShape
java.lang.Object
com.inductiveautomation.vision.api.client.components.shapes.ShapeDelegate
com.inductiveautomation.factorypmi.application.components.shapes.PolygonShape
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPolygonShape
(boolean star, int vertices, float radius, double startingAngle, float starRadius, double starStartingAngle, Point2D center) Sets all polygon props and then creates the shape. -
Method Summary
Modifier and TypeMethodDescriptionboolean
alterShape
(Rectangle2D newRect) Directly modify the shape's frame so that it fits tightly within the new framing rectangle.Convert this shape to a GeneralPathgetCenterpoint
(Rectangle2D bounds, Point2D rv) float
getShape()
The AWT shape this delegate producesfloat
double
double
int
boolean
Some shape delegates prefer to handle rotation themselves, instead of having the PathBasedVisionShape parent rotate their shape after the fact.boolean
isStar()
boolean
void
void
setByCenter
(Point2D center) void
void
setRadius
(float radius) void
setStar
(boolean star) void
setStarRadius
(float starRadius) void
setStarStartingAngle
(double starStartingAngle) void
setStartingAngle
(double startingAngle) void
setVertices
(int vertices) void
translateShape
(double dX, double dY) Move the shape using the provided offsets.void
Methods inherited from class com.inductiveautomation.vision.api.client.components.shapes.ShapeDelegate
createArea, getBounds2D
-
Field Details
-
TOOL_KEY
- See Also:
-
-
Constructor Details
-
PolygonShape
public PolygonShape() -
PolygonShape
public PolygonShape(boolean star, int vertices, float radius, double startingAngle, float starRadius, double starStartingAngle, Point2D center) Sets all polygon props and then creates the shape. Used by serialization.
-
-
Method Details
-
getToolKey
- Specified by:
getToolKey
in classShapeDelegate
-
isSymmetric
public boolean isSymmetric()- Specified by:
isSymmetric
in classShapeDelegate
-
getShape
Description copied from class:ShapeDelegate
The AWT shape this delegate produces- Specified by:
getShape
in classShapeDelegate
-
getCenterpoint
- Overrides:
getCenterpoint
in classShapeDelegate
-
alterShape
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.
-
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
-
convertToPath
Description copied from class:ShapeDelegate
Convert this shape to a GeneralPath- Overrides:
convertToPath
in classShapeDelegate
-
getCenter
-
setCenter
-
getRadius
public float getRadius() -
setRadius
public void setRadius(float radius) -
getStarRadius
public float getStarRadius() -
setStarRadius
public void setStarRadius(float starRadius) -
getStarStartingAngle
public double getStarStartingAngle() -
setStarStartingAngle
public void setStarStartingAngle(double starStartingAngle) -
getStartingAngle
public double getStartingAngle() -
setStartingAngle
public void setStartingAngle(double startingAngle) -
isStar
public boolean isStar() -
setStar
public void setStar(boolean star) -
getVertices
public int getVertices() -
setVertices
public void setVertices(int vertices) -
getTipPoint
-
getStarRadiusPoint
-
setByCenter
-
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
- Overrides:
rotate
in classShapeDelegate
-