Class MRoundedRectangle

All Implemented Interfaces:
Serializable, Cloneable

@PublicApi public class MRoundedRectangle extends MRectangle
Rounded rectangle object.
Since:
Marvin 5.3,
See Also:
  • Constructor Details

    • MRoundedRectangle

      public MRoundedRectangle()
      Constructs a rounded rectangle
    • MRoundedRectangle

      public MRoundedRectangle(MPoint p1, MPoint p2)
      Constructs a rounded rectangle with the specified corner points.
      Parameters:
      p1 - the top left corner
      p2 - the bottom right corner
    • MRoundedRectangle

      public MRoundedRectangle(MPoint p1, MPoint p2, double aw, double ah)
      Constructs a rounded rectangle with the specified corner points.
      Parameters:
      p1 - the top left corner
      p2 - the bottom right corner
      aw - the width of the corner's ellipse
      ah - the height of the corner's ellipse
    • MRoundedRectangle

      public MRoundedRectangle(MPoint p1, MPoint p2, Color c)
      Constructs a rounded rectangle with the specified corner points and color.
      Parameters:
      p1 - the top left corner
      p2 - the bottom right corner
      c - the color
    • MRoundedRectangle

      public MRoundedRectangle(MPoint p1, MPoint p2, double aw, double ah, Color c)
      Constructs a rounded rectangle with the specified corner points and color.
      Parameters:
      p1 - the top left corner
      p2 - the bottom right corner
      aw - the width of the corner's ellipse
      ah - the height of the corner's ellipse
      c - the color
    • MRoundedRectangle

      protected MRoundedRectangle(MRoundedRectangle rr)
      Copy constructor.
      Parameters:
      rr - the original rounded rectangle
  • Method Details

    • clone

      public MRoundedRectangle clone()
      Description copied from class: MObject
      Creates a clone.
      Overrides:
      clone in class MRectangle
      Returns:
      the clone
    • setArcWidth

      public void setArcWidth(double aw)
    • setArcHeight

      public void setArcHeight(double ah)
    • getArcWidth

      public double getArcWidth()
    • getArcHeight

      public double getArcHeight()
    • setCornersRadius

      public void setCornersRadius(double aw, double ah)
    • correctCornersRadius

      public void correctCornersRadius(double aw, double ah)
    • addAttributeKeys

      public void addAttributeKeys(List<String> l)
      Adds the attribute names to the specified vector.
      Overrides:
      addAttributeKeys in class MRectangle
      Parameters:
      l - the list of attributes
    • getAttribute

      public String getAttribute(String s)
      Gets the value of an attribute.
      Overrides:
      getAttribute in class MRectangle
      Parameters:
      s - the attribute name
      Returns:
      the value or null
    • setAttribute

      public void setAttribute(String s, String v)
      Sets the value of an attribute.
      Overrides:
      setAttribute in class MRectangle
      Parameters:
      s - the attribute name
      v - the attribute value
    • containsPoint

      public boolean containsPoint(DPoint3 p, CTransform3D trot)
      Overrides:
      containsPoint in class MObject
    • getPointRefCount

      public int getPointRefCount()
      Gets the number of internal selectable point references.
      Overrides:
      getPointRefCount in class MRectangle
      Returns:
      8
    • getPointRef

      public MPoint getPointRef(int i, CTransform3D trot)
      Gets an internal selectable point of the rectangle.
      Overrides:
      getPointRef in class MRectangle
      Parameters:
      i - the point index
      trot - the viewing transformation or null
      Returns:
      the point's reference
    • getInnerPointRef

      public MPoint getInnerPointRef(int i, CTransform3D trot)