Class MBracket

All Implemented Interfaces:
Serializable, Cloneable

@PublicApi public class MBracket extends MRectangle
Bracket object.
Since:
Marvin 5.0, 01/09/2007
See Also:
  • Field Details

    • T_ROUND

      public static final int T_ROUND
      Round bracket type (parenthesis).
      See Also:
    • T_SQUARE

      public static final int T_SQUARE
      Square bracket type.
      See Also:
    • T_BRACES

      public static final int T_BRACES
      Braces.
      See Also:
    • T_CHEVRONS

      public static final int T_CHEVRONS
      Chevrons.
      See Also:
    • T_SINGLE

      public static final int T_SINGLE
      The bracket has one side.
      See Also:
    • T_DOUBLE

      public static final int T_DOUBLE
      The bracket has two sides.
      See Also:
    • ARC_ROUND

      public static final double ARC_ROUND
      The default arc angle of the Rounded Rectangle in degrees.
      See Also:
    • ARC_BRACES

      public static final double ARC_BRACES
      The default arc angle of the Braces Rectangle in degrees.
      See Also:
  • Constructor Details

    • MBracket

      public MBracket()
      Constructs a bracket.
    • MBracket

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

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

      protected MBracket(MBracket r)
      Copy constructor.
      Parameters:
      r - the original bracket
  • Method Details

    • hasBackground

      public boolean hasBackground()
      A bracket has no background.
      Overrides:
      hasBackground in class MPolyline
      Returns:
      false
    • copyProperties

      public void copyProperties(MBracket l)
      Copies line properties to another line object.
      Parameters:
      l - the other line
    • getType

      public int getType()
      Gets the bracket type.
      Returns:
      the type
      See Also:
    • setType

      public void setType(int t)
      Sets the bracket type.
      Parameters:
      t - the type
      See Also:
    • clone

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

      public void transform(CTransform3D t, int opts, CTransform3D trot)
      Transforms the bracket.
      Overrides:
      transform in class MRectangle
      Parameters:
      t - the transformation matrix
      opts - transform options or 0
      trot - the viewing transformation or null
      See Also:
    • addAttributeKeys

      public void addAttributeKeys(List<String> l)
      Adds the attribute names to the specified list. CDATA attributes are not added.
      Overrides:
      addAttributeKeys in class MRectangle
      Parameters:
      l - the list
    • 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
    • getBracketOrientation

      public int getBracketOrientation()
      Gets the orientation of the bracket.
      Returns:
      the orientation of the bracket
      See Also:
    • setBracketOrientation

      public void setBracketOrientation(int bracketOrientation)
      Sets the orientation of the bracket.
      See Also:
    • enclosesPoint

      public boolean enclosesPoint(double x, double y)
      Checks if a specified point is enclosed by this bracket.
      Parameters:
      x - the x coordinate of the point to be tested
      y - the y coordinate of the point to be tested
      Returns:
      true if the point is enclosed by this bracket, false otherwise.
    • getVisiblePointRefCount

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public int getVisiblePointRefCount()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the number of internal selectable point references that are visible when highlighting.
      Returns:
      the number of selectable points.
    • getVisiblePointRef

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public MPoint getVisiblePointRef(int index, CTransform3D trot)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets an internal selectable point of the rectangle.that is visible when highlighting.
      Parameters:
      index - the point index
      trot - the viewing transformation or null
      Returns:
      the point's reference
    • updateBoundingRect

      public void updateBoundingRect(double[] xyminm, CTransform3D pretrf)
      Description copied from class: MPolyline
      Calculate the bounding rectangle.
      Overrides:
      updateBoundingRect in class MPolyline
      Parameters:
      xyminm - array containing the current minimum x, y and maximum x, y coordinates
      pretrf - transformation matrix
    • getLeftBracket

      public List<Shape> getLeftBracket(CTransform3D transform)
    • getRightBracket

      public List<Shape> getRightBracket(CTransform3D transform)
    • getShapes

      public List<Shape> getShapes(CTransform3D transform)