Package chemaxon.struc.graphics
Class MBracket
- java.lang.Object
-
- chemaxon.struc.MObject
-
- chemaxon.struc.graphics.MPolyline
-
- chemaxon.struc.graphics.MRectangle
-
- chemaxon.struc.graphics.MBracket
-
- All Implemented Interfaces:
Serializable
,Cloneable
@PublicAPI public class MBracket extends MRectangle
Bracket object.- Since:
- Marvin 5.0, 01/09/2007
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static double
ARC_BRACES
The default arc angle of the Braces Rectangle in degrees.static double
ARC_ROUND
The default arc angle of the Rounded Rectangle in degrees.static int
T_BRACES
Braces.static int
T_CHEVRONS
Chevrons.static int
T_DOUBLE
The bracket has two sides.static int
T_ROUND
Round bracket type (parenthesis).static int
T_SINGLE
The bracket has one side.static int
T_SQUARE
Square bracket type.-
Fields inherited from class chemaxon.struc.graphics.MRectangle
P_CENTER, P_E, P_N, P_NE, P_NW, P_S, P_SE, P_SW, P_W, T_NOROT
-
Fields inherited from class chemaxon.struc.graphics.MPolyline
ARROW_BACK_FLAG, ARROW_CROSSED_FLAG, ARROW_CURVED_FLAG, ARROW_DASHED_FLAG, ARROW_EQUILIBRIUM_FLAG, ARROW_GROUP1_MASK, ARROW_GROUP2_MASK, ARROW_HALF_LEFT, ARROW_HALF_MASK, ARROW_HALF_RIGHT, ARROW_RETROSYNTHETIC_FLAG, arrowFlags, CLOSED_FLAG, DEFAULT_ARROW_HEAD_LENGTH, DEFAULT_ARROW_HEAD_WIDTH, DEFAULT_EQUILIBRIUM_HEAD_WIDTH, DEFAULT_MAX_CROSS_SIZE, DEFAULT_RETROSYNTHETIC_HEAD_WIDTH, DEFAULT_THICKNESS, HEAD, points, TAIL, THICKNESS_SET_FLAG
-
Fields inherited from class chemaxon.struc.MObject
TRANSFORM_DISTORT
-
-
Constructor Summary
Constructors Modifier Constructor Description MBracket()
Constructs a bracket.protected
MBracket(MBracket r)
Copy constructor.MBracket(MPoint p1, MPoint p2)
Constructs a bracket with the specified corner points.MBracket(MPoint p1, MPoint p2, Color c)
Constructs a bracket with the specified corner points and color.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttributeKeys(List<String> l)
Adds the attribute names to the specified list.MBracket
clone()
Creates a clone.void
copyProperties(MBracket l)
Copies line properties to another line object.boolean
enclosesPoint(double x, double y)
Checks if a specified point is enclosed by this bracket.String
getAttribute(String s)
Gets the value of an attribute.int
getBracketOrientation()
Gets the orientation of the bracket.List<Shape>
getLeftBracket(CTransform3D transform)
List<Shape>
getRightBracket(CTransform3D transform)
List<Shape>
getShapes(CTransform3D transform)
int
getType()
Gets the bracket type.MPoint
getVisiblePointRef(int index, CTransform3D trot)
Gets an internal selectable point of the rectangle.that is visible when highlighting.int
getVisiblePointRefCount()
Gets the number of internal selectable point references that are visible when highlighting.boolean
hasBackground()
A bracket has no background.void
setAttribute(String s, String v)
Sets the value of an attribute.void
setBracketOrientation(int bracketOrientation)
Sets the orientation of the bracket.void
setType(int t)
Sets the bracket type.void
transform(CTransform3D t, int opts, CTransform3D trot)
Transforms the bracket.void
updateBoundingRect(double[] xyminm, CTransform3D pretrf)
Calculate the bounding rectangle.-
Methods inherited from class chemaxon.struc.graphics.MRectangle
calcCenter, convertTransform, distanceFrom, fixClonedPoints, fixRectanglePointClones, getClip, getPointRef, getPointRefCount, getTCenter, getTOption, removeChild, setCorners, setTCenter, setTOption, transformTo2D
-
Methods inherited from class chemaxon.struc.graphics.MPolyline
checkValidity, containsAtom, copyProperties, finishCloning, fixMidPointClones, getArcAngle, getArcCenter, getArcRadius, getArcRadius, getArrowFlags, getArrowLength, getArrowWidth, getFlags, getLineMiddlePoint, getMidPointLocation, getMirroredArrowFlags, getPoint, getPointCount, getPoints, getSkip, getThickness, hasColor, hasFace, hasLineColor, hasOutline, isArrow, isEmpty, isThicknessSet, removeNotify, replaceAtom, reverse, rotate, setArcAngle, setArrow, setArrowFlags, setArrowLength, setArrowWidth, setFlags, setPoints, setSkip, setThickness, unselectContents
-
Methods inherited from class chemaxon.struc.MObject
addCdataAttributeKeys, addNotify, connectToSgroupOfAtom, containsPoint, distanceFrom, getBackground, getColor, getContainerMObject, getLineColor, isChildOf, isInternalSelectable, isReactionArrow, isSelectableNow, isSelected, isTransformable, makeColor, removeAtom, setBackground, setColor, setLineColor, setSelected, toString, updateBoundingRect
-
-
-
-
Field Detail
-
T_ROUND
public static final int T_ROUND
Round bracket type (parenthesis).- See Also:
- Constant Field Values
-
T_SQUARE
public static final int T_SQUARE
Square bracket type.- See Also:
- Constant Field Values
-
T_BRACES
public static final int T_BRACES
Braces.- See Also:
- Constant Field Values
-
T_CHEVRONS
public static final int T_CHEVRONS
Chevrons.- See Also:
- Constant Field Values
-
T_SINGLE
public static final int T_SINGLE
The bracket has one side.- See Also:
- Constant Field Values
-
T_DOUBLE
public static final int T_DOUBLE
The bracket has two sides.- See Also:
- Constant Field Values
-
ARC_ROUND
public static final double ARC_ROUND
The default arc angle of the Rounded Rectangle in degrees.- See Also:
- Constant Field Values
-
ARC_BRACES
public static final double ARC_BRACES
The default arc angle of the Braces Rectangle in degrees.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 cornerp2
- 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 cornerp2
- the bottom right cornerc
- the color
-
MBracket
protected MBracket(MBracket r)
Copy constructor.- Parameters:
r
- the original bracket
-
-
Method Detail
-
hasBackground
public boolean hasBackground()
A bracket has no background.- Overrides:
hasBackground
in classMPolyline
- 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:
T_SQUARE
,T_ROUND
,T_BRACES
,T_CHEVRONS
-
setType
public void setType(int t)
Sets the bracket type.- Parameters:
t
- the type- See Also:
T_SQUARE
,T_ROUND
,T_BRACES
,T_CHEVRONS
-
clone
public MBracket clone()
Description copied from class:MObject
Creates a clone.- Overrides:
clone
in classMRectangle
- Returns:
- the clone
-
transform
public void transform(CTransform3D t, int opts, CTransform3D trot)
Transforms the bracket.- Overrides:
transform
in classMRectangle
- Parameters:
t
- the transformation matrixopts
- transform options or 0trot
- the viewing transformation or null- See Also:
MObject.TRANSFORM_DISTORT
-
addAttributeKeys
public void addAttributeKeys(List<String> l)
Adds the attribute names to the specified list. CDATA attributes are not added.- Overrides:
addAttributeKeys
in classMRectangle
- Parameters:
l
- the list
-
getAttribute
public String getAttribute(String s)
Gets the value of an attribute.- Overrides:
getAttribute
in classMRectangle
- 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 classMRectangle
- Parameters:
s
- the attribute namev
- the attribute value
-
getBracketOrientation
public int getBracketOrientation()
Gets the orientation of the bracket.
-
setBracketOrientation
public void setBracketOrientation(int bracketOrientation)
Sets the orientation of the bracket.
-
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 testedy
- the y coordinate of the point to be tested- Returns:
- true if the point is enclosed by this bracket, false otherwise.
-
getVisiblePointRefCount
public int getVisiblePointRefCount()
Gets the number of internal selectable point references that are visible when highlighting.- Returns:
- the number of selectable points.
-
getVisiblePointRef
public MPoint getVisiblePointRef(int index, CTransform3D trot)
Gets an internal selectable point of the rectangle.that is visible when highlighting.- Parameters:
index
- the point indextrot
- 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 classMPolyline
- Parameters:
xyminm
- array containing the current minimum x, y and maximum x, y coordinatespretrf
- transformation matrix
-
getLeftBracket
public List<Shape> getLeftBracket(CTransform3D transform)
-
getRightBracket
public List<Shape> getRightBracket(CTransform3D transform)
-
getShapes
public List<Shape> getShapes(CTransform3D transform)
-
-