Class RMShapeUtils

java.lang.Object
com.inductiveautomation.rm.shape.RMShapeUtils

public class RMShapeUtils extends Object
Some shape utility methods.
  • Constructor Details

    • RMShapeUtils

      public RMShapeUtils()
  • Method Details

    • repaint

      public static void repaint(List<? extends RMShape> theShapes)
      Convenience to mark a whole list of shapes for repaint.
    • getBoundsOfChildren

      public static RMRect getBoundsOfChildren(RMShape aShape, List<? extends RMShape> aList)
      Returns the bounds of a given subset of this shape's children.
    • groupShapes

      public static RMParentShape groupShapes(List<? extends RMShape> theShapes, RMParentShape groupShape)
      Adds the subset of children in given list into a given group shape, which is then added back to receiver.
    • getCombinedPathsShape

      public static RMPolygonShape getCombinedPathsShape(List<RMShape> theShapes)
      Returns a polygon shape by combining paths of given shapes.
    • getCombinedPath

      public static RMPath getCombinedPath(List<RMShape> theShapes)
      Returns the combined path from given shapes.
    • getSubtractedPathsShape

      public static RMPolygonShape getSubtractedPathsShape(List<RMShape> theShapes, int anInset)
      Returns a polygon shape by combining paths of given shapes.
    • getSubtractedPath

      public static RMPath getSubtractedPath(List<RMShape> theShapes, int anInset)
      Returns the combined path from given shapes.
    • getHoverTimer

      public static RMShapeUtils.HoverTimer getHoverTimer()
      Returns the shared hover timer.
    • setHoverTimer

      public static void setHoverTimer(RMShapeUtils.HoverTimer aTimer)
      Sets the hover timer.
    • getHoverTimer

      public static RMShapeUtils.HoverTimer getHoverTimer(RMShapeMouseEvent anEvent)
      Returns the hover timer, creating it if missing.
    • getHoverShape

      public static RMShape getHoverShape()
      Returns the hover shape.
    • resizeToFit

      public static void resizeToFit(RMShape boundingShape, RMShape targetShape)
      For a given boundingShape and targetShape, resize the targetShape to fit within the boundingShape.
    • setRelativeLocation

      public static void setRelativeLocation(RMShape boundingShape, RMPoint point, RMShape targetShape)
      For a give boundingShape, point, and targetShape, set the location of the shape to be centered around the point, or centered on the page if the image covers 75% of the page or more.