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
FieldsModifier and TypeFieldDescriptionstatic final intCentral point ID.static final intMiddle point on right edge.static final intMiddle point on top edge.static final intTop-right corner index.static final intTop-left corner index.static final intMiddle point on bottom edge.static final intBotton-right corner index.static final intBottom-left corner index.static final intMiddle point on left edge.static final intDisable 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_FLAGFields inherited from class chemaxon.struc.MObject
TRANSFORM_DISTORT -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructs a rectangle.protectedCopy 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 TypeMethodDescriptionvoidAdds the attribute names to the specified list.voidcalcCenter(DPoint3 p, CTransform3D t) Calculates the geometrical center.clone()Creates a clone.convertTransform(CTransform3D t, boolean paint) doubledistanceFrom(double x, double y, CTransform3D t) Gets the 2D distance from the specified point.voidfixClonedPoints(MObject[] objarr0, MObject[] objarr, int i) Sets the parent object for this object.static voidfixRectanglePointClones(MObject[] objarr0, MObject[] objarr) Fixes the parents of the cloned MRectanglePoints.Gets the value of an attribute.final ShapeGets the clipping rectangle.getPointRef(int i, CTransform3D trot) Gets an internal selectable point of the rectangle.intGets the number of internal selectable point references.intGets the transformed point.intGets the transformation options.voidRemoves a child object.voidsetAttribute(String s, String v) Sets the value of an attribute.voidsetCorners(MPoint p1, MPoint p2) Sets the corners.voidsetTCenter(int t) Sets the transformed point.voidsetTOption(int opts) Sets the transformation options.voidtransform(CTransform3D t, int opts, CTransform3D trot) Transforms the rectangle.voidRotate 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, updateBoundingRectMethods inherited from class chemaxon.struc.MObject
addCdataAttributeKeys, addNotify, clearProperties, connectToSgroupOfAtom, containsPoint, containsPropertyKey, distanceFrom, getBackground, getColor, getContainerMObject, getLineColor, getProperty, isChildOf, isInternalSelectable, isReactionArrow, isSelectableNow, isSelected, isTransformable, makeColor, propertyCount, propertyKeySet, propertySet, putProperty, removeAtom, removeProperty, 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:
calcCenterin 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:
addAttributeKeysin 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:
getAttributein 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:
setAttributein classMPolyline- Parameters:
s- the attribute namev- the attribute value
-
distanceFrom
Gets the 2D distance from the specified point.- Overrides:
distanceFromin 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.- Parameters:
t- the transformed point (if it is a corner point) or ID- Since:
- Marvin 4.1, 01/23/2006
- See Also:
-
clone
Description copied from class:MObjectCreates a clone. -
removeChild
Description copied from class:MObjectRemoves a child object.- Overrides:
removeChildin classMPolyline- Parameters:
o- the child
-
getPointRefCount
public int getPointRefCount()Gets the number of internal selectable point references.- Overrides:
getPointRefCountin classMPolyline- Returns:
- 8
-
getPointRef
Gets an internal selectable point of the rectangle.- Overrides:
getPointRefin 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:MObjectSets the parent object for this object. Should only be called by the copy constructor.- Overrides:
fixClonedPointsin 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
-