Class PathShape

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String TOOL_KEY  
    • Constructor Summary

      Constructors 
      Constructor Description
      PathShape()
      Deprecated.
      PathShape​(java.awt.geom.GeneralPath path)  
    • 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 GeneralPath
      java.awt.geom.GeneralPath getPath()  
      java.awt.Shape getShape()
      The AWT shape this delegate produces
      java.lang.String getToolKey()  
      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 setPath​(java.awt.geom.GeneralPath path)  
      void transform​(java.awt.geom.AffineTransform transform)  
      void translateShape​(double dX, double dY)
      Move the shape using the provided offsets.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PathShape

        @Deprecated
        public PathShape()
        Deprecated.
        For serialization clean copy
      • PathShape

        public PathShape​(java.awt.geom.GeneralPath path)
    • Method Detail

      • getShape

        public java.awt.Shape getShape()
        Description copied from class: ShapeDelegate
        The AWT shape this delegate produces
        Specified by:
        getShape in class ShapeDelegate
      • getPath

        public java.awt.geom.GeneralPath getPath()
      • setPath

        public void setPath​(java.awt.geom.GeneralPath path)
      • transform

        public void transform​(java.awt.geom.AffineTransform transform)
      • 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 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.
      • 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 class ShapeDelegate
      • 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 class ShapeDelegate
      • rotate

        public void rotate​(double angle,
                           java.awt.geom.Point2D anchor)
        Overrides:
        rotate in class ShapeDelegate
      • convertToPath

        public java.awt.geom.GeneralPath convertToPath()
        Description copied from class: ShapeDelegate
        Convert this shape to a GeneralPath
        Overrides:
        convertToPath in class ShapeDelegate