Class PolygonShape
- java.lang.Object
- 
- com.inductiveautomation.vision.api.client.components.shapes.ShapeDelegate
- 
- com.inductiveautomation.factorypmi.application.components.shapes.PolygonShape
 
 
- 
 public class PolygonShape extends ShapeDelegate 
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringTOOL_KEY
 - 
Constructor SummaryConstructors Constructor Description PolygonShape()PolygonShape(boolean star, int vertices, float radius, double startingAngle, float starRadius, double starStartingAngle, java.awt.geom.Point2D center)Sets all polygon props and then creates the shape.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanalterShape(java.awt.geom.Rectangle2D newRect)Directly modify the shape's frame so that it fits tightly within the new framing rectangle.java.awt.geom.GeneralPathconvertToPath()Convert this shape to a GeneralPathjava.awt.geom.Point2DgetCenter()java.awt.geom.Point2DgetCenterpoint(java.awt.geom.Rectangle2D bounds, java.awt.geom.Point2D rv)floatgetRadius()java.awt.ShapegetShape()The AWT shape this delegate producesfloatgetStarRadius()java.awt.geom.Point2DgetStarRadiusPoint()doublegetStarStartingAngle()doublegetStartingAngle()java.awt.geom.Point2DgetTipPoint()java.lang.StringgetToolKey()intgetVertices()booleanisRotatable()Some shape delegates prefer to handle rotation themselves, instead of having the PathBasedVisionShape parent rotate their shape after the fact.booleanisStar()booleanisSymmetric()voidrotate(double angle, java.awt.geom.Point2D anchor)voidsetByCenter(java.awt.geom.Point2D center)voidsetCenter(java.awt.geom.Point2D center)voidsetRadius(float radius)voidsetStar(boolean star)voidsetStarRadius(float starRadius)voidsetStarStartingAngle(double starStartingAngle)voidsetStartingAngle(double startingAngle)voidsetVertices(int vertices)voidtranslateShape(double dX, double dY)Move the shape using the provided offsets.voidupdateShape()- 
Methods inherited from class com.inductiveautomation.vision.api.client.components.shapes.ShapeDelegatecreateArea, getBounds2D
 
- 
 
- 
- 
- 
Field Detail- 
TOOL_KEYpublic static final java.lang.String TOOL_KEY - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getToolKeypublic java.lang.String getToolKey() - Specified by:
- getToolKeyin class- ShapeDelegate
 
 - 
isSymmetricpublic boolean isSymmetric() - Specified by:
- isSymmetricin class- ShapeDelegate
 
 - 
getShapepublic java.awt.Shape getShape() Description copied from class:ShapeDelegateThe AWT shape this delegate produces- Specified by:
- getShapein class- ShapeDelegate
 
 - 
getCenterpointpublic java.awt.geom.Point2D getCenterpoint(java.awt.geom.Rectangle2D bounds, java.awt.geom.Point2D rv)- Overrides:
- getCenterpointin class- ShapeDelegate
 
 - 
alterShapepublic boolean alterShape(java.awt.geom.Rectangle2D newRect) Description copied from class:ShapeDelegateDirectly modify the shape's frame so that it fits tightly within the new framing rectangle.- Specified by:
- alterShapein class- ShapeDelegate
- Parameters:
- newRect- The new bounding rectangle for the shape.
- Returns:
- false if the shape was unable to alter itself into the given rectangle.
 
 - 
updateShapepublic void updateShape() 
 - 
translateShapepublic void translateShape(double dX, double dY)Description copied from class:ShapeDelegateMove the shape using the provided offsets. Default implementation calls alterShape.- Overrides:
- translateShapein class- ShapeDelegate
 
 - 
convertToPathpublic java.awt.geom.GeneralPath convertToPath() Description copied from class:ShapeDelegateConvert this shape to a GeneralPath- Overrides:
- convertToPathin class- ShapeDelegate
 
 - 
getCenterpublic java.awt.geom.Point2D getCenter() 
 - 
setCenterpublic void setCenter(java.awt.geom.Point2D center) 
 - 
getRadiuspublic float getRadius() 
 - 
setRadiuspublic void setRadius(float radius) 
 - 
getStarRadiuspublic float getStarRadius() 
 - 
setStarRadiuspublic void setStarRadius(float starRadius) 
 - 
getStarStartingAnglepublic double getStarStartingAngle() 
 - 
setStarStartingAnglepublic void setStarStartingAngle(double starStartingAngle) 
 - 
getStartingAnglepublic double getStartingAngle() 
 - 
setStartingAnglepublic void setStartingAngle(double startingAngle) 
 - 
isStarpublic boolean isStar() 
 - 
setStarpublic void setStar(boolean star) 
 - 
getVerticespublic int getVertices() 
 - 
setVerticespublic void setVertices(int vertices) 
 - 
getTipPointpublic java.awt.geom.Point2D getTipPoint() 
 - 
getStarRadiusPointpublic java.awt.geom.Point2D getStarRadiusPoint() 
 - 
setByCenterpublic void setByCenter(java.awt.geom.Point2D center) 
 - 
isRotatablepublic boolean isRotatable() Description copied from class:ShapeDelegateSome 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:
- isRotatablein class- ShapeDelegate
 
 - 
rotatepublic void rotate(double angle, java.awt.geom.Point2D anchor)- Overrides:
- rotatein class- ShapeDelegate
 
 
- 
 
-