Package chemaxon.struc.graphics
Class MRectangle
java.lang.Object
chemaxon.struc.MObject
chemaxon.struc.graphics.MPolyline
chemaxon.struc.graphics.MRectangle
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
MBracket
,MEllipse
,MRoundedRectangle
,MTextBox
Rectangle object.
- Since:
- Marvin 3.3, 10/17/2003
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Central point ID.static final int
Middle point on right edge.static final int
Middle point on top edge.static final int
Top-right corner index.static final int
Top-left corner index.static final int
Middle point on bottom edge.static final int
Botton-right corner index.static final int
Bottom-left corner index.static final int
Middle point on left edge.static final int
Disable rotation.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
ModifierConstructorDescriptionConstructs a rectangle.protected
Copy constructor.MRectangle
(MPoint p1, MPoint p2) Constructs a rectangle with the specified corner points.MRectangle
(MPoint p1, MPoint p2, Color c, Color bg) Constructs a rectangle with the specified corner points. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the attribute names to the specified list.void
calcCenter
(DPoint3 p, CTransform3D t) Calculates the geometrical center.clone()
Creates a clone.convertTransform
(CTransform3D t, boolean paint) double
distanceFrom
(double x, double y, CTransform3D t) Gets the 2D distance from the specified point.void
fixClonedPoints
(MObject[] objarr0, MObject[] objarr, int i) Sets the parent object for this object.static void
fixRectanglePointClones
(MObject[] objarr0, MObject[] objarr) Fixes the parents of the cloned MRectanglePoints.Gets the value of an attribute.final Shape
Gets the clipping rectangle.getPointRef
(int i, CTransform3D trot) Gets an internal selectable point of the rectangle.int
Gets the number of internal selectable point references.int
Gets the transformed point.int
Gets the transformation options.void
Removes a child object.void
setAttribute
(String s, String v) Sets the value of an attribute.void
setCorners
(MPoint p1, MPoint p2) Sets the corners.void
setTCenter
(int t) Sets the transformed point.void
setTOption
(int opts) Sets the transformation options.void
transform
(CTransform3D t, int opts, CTransform3D trot) Transforms the rectangle.void
Rotate to the XY plane.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, hasBackground, hasColor, hasFace, hasLineColor, hasOutline, isArrow, isEmpty, isThicknessSet, removeNotify, replaceAtom, reverse, rotate, setArcAngle, setArrow, setArrowFlags, setArrowLength, setArrowWidth, setFlags, setPoints, setSkip, setThickness, unselectContents, updateBoundingRect
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 Details
-
T_NOROT
public static final int T_NOROTDisable rotation.- Since:
- Marvin 4.1, 01/23/2006
- See Also:
-
P_NW
public static final int P_NWTop-left corner index.- Since:
- Marvin 4.1, 01/23/2006
- See Also:
-
P_NE
public static final int P_NETop-right corner index.- Since:
- Marvin 4.1, 01/23/2006
- See Also:
-
P_SE
public static final int P_SEBotton-right corner index.- Since:
- Marvin 4.1, 01/23/2006
- See Also:
-
P_SW
public static final int P_SWBottom-left corner index.- Since:
- Marvin 4.1, 01/23/2006
- See Also:
-
P_CENTER
public static final int P_CENTERCentral point ID.- Since:
- Marvin 4.1, 01/23/2006
- See Also:
-
P_N
public static final int P_NMiddle point on top edge.- Since:
- Marvin 4.1, 01/25/2006
- See Also:
-
P_E
public static final int P_EMiddle point on right edge.- Since:
- Marvin 4.1, 01/25/2006
- See Also:
-
P_S
public static final int P_SMiddle point on bottom edge.- Since:
- Marvin 4.1, 01/25/2006
- See Also:
-
P_W
public static final int P_WMiddle point on left edge.- Since:
- Marvin 4.1, 01/25/2006
- See Also:
-
-
Constructor Details
-
MRectangle
public MRectangle()Constructs a rectangle. -
MRectangle
Constructs a rectangle with the specified corner points.- Parameters:
p1
- the top left cornerp2
- the bottom right corner- Since:
- Marvin 4.1, 03/07/2006
-
MRectangle
Constructs a rectangle with the specified corner points.- Parameters:
p1
- the top left cornerp2
- the bottom right cornerc
- the colorbg
- the background color
-
MRectangle
Copy constructor.- Parameters:
r
- the original rectangle
-
-
Method Details
-
calcCenter
Calculates the geometrical center.- Overrides:
calcCenter
in classMPolyline
- Parameters:
p
- store the coordinates heret
- the transformation matrix or null- Since:
- Marvin 4.1, 04/28/2006
-
transform
Transforms the rectangle. -
transformTo2D
public void transformTo2D()Rotate to the XY plane.- Since:
- Marvin 4.1, 01/27/2006
-
convertTransform
-
addAttributeKeys
Adds the attribute names to the specified list. CDATA attributes are not added.- Overrides:
addAttributeKeys
in classMPolyline
- Parameters:
l
- the list
-
getAttribute
Gets the value of an attribute.
Supported attributes:- transformOption: NOROT (only scaling transformations are allowed)
- centralPoint: NE (north-east corner), NW, (north-west corner), SW (south-west corner), SE (south-east corner) or CENTER (geometrical center)
- Overrides:
getAttribute
in classMPolyline
- Parameters:
s
- the attribute name- Returns:
- the value or null
-
setAttribute
Sets the value of an attribute.
Supported attributes:- transformOption: NOROT (only scaling transformations are allowed)
- centralPoint: NE (north-east corner), NW, (north-west corner), SW (south-west corner), SE (south-east corner) or CENTER (geometrical center)
- Overrides:
setAttribute
in classMPolyline
- Parameters:
s
- the attribute namev
- the attribute value
-
distanceFrom
Gets the 2D distance from the specified point.- Overrides:
distanceFrom
in classMPolyline
- Parameters:
x
- the x coordinatey
- the y coordinatet
- transformation or null- Since:
- 4.1, 01/25/2006
-
setCorners
Sets the corners.- Parameters:
p1
- the top left cornerp2
- the bottom right corner
-
getTOption
public int getTOption()Gets the transformation options.- Returns:
- the options
- Since:
- Marvin 4.1, 01/23/2006
-
setTOption
public void setTOption(int opts) Sets the transformation options.- Parameters:
opts
- the options- Since:
- Marvin 4.1, 01/23/2006
- See Also:
-
getTCenter
public int getTCenter()Gets the transformed point.- Returns:
- the transformed point index (if it is a corner point) or ID
- Since:
- Marvin 4.1, 01/23/2006
-
setTCenter
public void setTCenter(int t) Sets the transformed point. -
clone
Description copied from class:MObject
Creates a clone. -
removeChild
Description copied from class:MObject
Removes a child object.- Overrides:
removeChild
in classMPolyline
- Parameters:
o
- the child
-
getPointRefCount
public int getPointRefCount()Gets the number of internal selectable point references.- Overrides:
getPointRefCount
in classMPolyline
- Returns:
- 8
-
getPointRef
Gets an internal selectable point of the rectangle.- Overrides:
getPointRef
in classMPolyline
- Parameters:
i
- the point indextrot
- the viewing transformation or null- Returns:
- the point's reference
-
fixRectanglePointClones
Fixes the parents of the cloned MRectanglePoints.- Parameters:
objarr0
- the original object arrayobjarr
- the cloned object array- Since:
- Marvin 4.1, 03/06/2006
-
fixClonedPoints
Description copied from class:MObject
Sets the parent object for this object. Should only be called by the copy constructor.- Overrides:
fixClonedPoints
in classMPolyline
- Parameters:
objarr0
- the new object listobjarr
- the old object listi
- the corresponding index from the old object list
-
getClip
Gets the clipping rectangle.- Parameters:
t
- the transformation matrix- Returns:
- the clipping rectangle
-