public class MRectangle extends MPolyline
Modifier and Type | Field and Description |
---|---|
static int |
P_CENTER
Central point ID.
|
static int |
P_E
Middle point on right edge.
|
static int |
P_N
Middle point on top edge.
|
static int |
P_NE
Top-right corner index.
|
static int |
P_NW
Top-left corner index.
|
static int |
P_S
Middle point on bottom edge.
|
static int |
P_SE
Botton-right corner index.
|
static int |
P_SW
Bottom-left corner index.
|
static int |
P_W
Middle point on left edge.
|
static int |
T_NOROT
Disable rotation.
|
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
PAINT_ANTIALIAS, PAINT_FOCUSED, TRANSFORM_DISTORT
Modifier | Constructor and Description |
---|---|
|
MRectangle()
Constructs a rectangle.
|
|
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.
|
protected |
MRectangle(MRectangle r)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeKeys(List<String> l)
Adds the attribute names to the specified list.
|
void |
calcCenter(DPoint3 p,
CTransform3D t)
Calculates the geometrical center.
|
MRectangle |
clone()
Creates a clone.
|
CTransform3D |
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.
|
String |
getAttribute(String s)
Gets the value of an attribute.
|
Shape |
getClip(CTransform3D t)
Gets the clipping rectangle.
|
MPoint |
getPointRef(int i,
CTransform3D trot)
Gets an internal selectable point of the rectangle.
|
int |
getPointRefCount()
Gets the number of internal selectable point references.
|
int |
getTCenter()
Gets the transformed point.
|
int |
getTOption()
Gets the transformation options.
|
void |
removeChild(MObject o)
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 |
transformTo2D()
Rotate to the XY plane.
|
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
addCdataAttributeKeys, addNotify, addNotify, connectToSgroupOfAtom, containsPoint, distanceFrom, getBackground, getColor, getLineColor, isChildOf, isInternalSelectable, isReactionArrow, isSelectableNow, isSelected, isTransformable, makeColor, removeAtom, removeNotify, setBackground, setColor, setLineColor, setSelected, toString
public static final int T_NOROT
public static final int P_NW
public static final int P_NE
public static final int P_SE
public static final int P_SW
public static final int P_CENTER
public static final int P_N
public static final int P_E
public static final int P_S
public static final int P_W
public MRectangle()
public MRectangle(MPoint p1, MPoint p2)
p1
- the top left cornerp2
- the bottom right cornerpublic MRectangle(MPoint p1, MPoint p2, Color c, Color bg)
p1
- the top left cornerp2
- the bottom right cornerc
- the colorbg
- the background colorprotected MRectangle(MRectangle r)
r
- the original rectanglepublic void calcCenter(DPoint3 p, CTransform3D t)
calcCenter
in class MPolyline
p
- store the coordinates heret
- the transformation matrix or nullpublic void transform(CTransform3D t, int opts, CTransform3D trot)
transform
in class MPolyline
t
- the transformation matrixopts
- transform options or 0trot
- the viewing transformation or nullMObject.TRANSFORM_DISTORT
public void transformTo2D()
public CTransform3D convertTransform(CTransform3D t, boolean paint)
public void addAttributeKeys(List<String> l)
addAttributeKeys
in class MPolyline
l
- the listpublic String getAttribute(String s)
getAttribute
in class MPolyline
s
- the attribute namepublic void setAttribute(String s, String v)
setAttribute
in class MPolyline
s
- the attribute namev
- the attribute valuepublic double distanceFrom(double x, double y, CTransform3D t)
distanceFrom
in class MPolyline
x
- the x coordinatey
- the y coordinatet
- transformation or nullpublic void setCorners(MPoint p1, MPoint p2)
p1
- the top left cornerp2
- the bottom right cornerpublic int getTOption()
public void setTOption(int opts)
opts
- the optionsT_NOROT
public int getTCenter()
public void setTCenter(int t)
public MRectangle clone()
MObject
public void removeChild(MObject o)
MObject
removeChild
in class MPolyline
o
- the childpublic int getPointRefCount()
getPointRefCount
in class MPolyline
public MPoint getPointRef(int i, CTransform3D trot)
getPointRef
in class MPolyline
i
- the point indextrot
- the viewing transformation or nullpublic static void fixRectanglePointClones(MObject[] objarr0, MObject[] objarr)
objarr0
- the original object arrayobjarr
- the cloned object arraypublic void fixClonedPoints(MObject[] objarr0, MObject[] objarr, int i)
MObject
fixClonedPoints
in class MPolyline
objarr0
- the new object listobjarr
- the old object listi
- the corresponding index from the old object listpublic final Shape getClip(CTransform3D t)
t
- the transformation matrix