chemaxon.struc.graphics
Class MRectangle

java.lang.Object
  extended bychemaxon.struc.MObject
      extended bychemaxon.struc.graphics.MPolyline
          extended bychemaxon.struc.graphics.MRectangle
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
MTextBox

public class MRectangle
extends MPolyline

Rectangle object.

Since:
Marvin 3.3, 10/17/2003
Version:
3.3, 01/04/2004
Author:
Peter Csizmadia
See Also:
Serialized Form

Field Summary
 
Fields inherited from class chemaxon.struc.graphics.MPolyline
ARROW_BACK_FLAG, ARROW_HALF_LEFT, ARROW_HALF_MASK, ARROW_HALF_RIGHT, CLOSED_FLAG, DEFAULT_THICKNESS, HEAD, TAIL, THICKNESS_SET_FLAG
 
Fields inherited from class chemaxon.struc.MObject
PAINT_ANTIALIAS, PAINT_FOCUSED, TRANSFORM_DISTORT
 
Constructor Summary
  MRectangle()
          Contructs a rectangle.
  MRectangle(MPoint p1, MPoint p2, java.awt.Color c, java.awt.Color bg)
          Contructs a rectangle with the specified corner points.
protected MRectangle(MRectangle r)
          Copy constructor.
 
Method Summary
 java.lang.Object clone()
          Creates a clone.
protected  java.lang.Object getClipObject(CTransform3D t)
          Gets the clipping rectangle.
 MPoint getPointRef(int i)
          Gets an internal selectable point of the rectangle.
 int getPointRefCount()
          Gets the number of internal selectable point references.
 void removeChild(MObject o)
          Removes a child object.
 void setCorners(MPoint p1, MPoint p2)
          Sets the corners.
 
Methods inherited from class chemaxon.struc.graphics.MPolyline
addAttributeKeys, calcCenter, checkValidity, containsAtom, copyProperties, distanceFrom, finishCloning, getArcAngle, getArcCenter, getArcRadius, getArrowFlags, getArrowLength, getArrowWidth, getAttribute, getFlags, getPoint, getPointCount, getSkip, getThickness, hasBackground, hasColor, hasFace, hasLineColor, hasOutline, isArrow, isEmpty, isThicknessSet, paint, replaceAtom, setArcAngle, setArrow, setArrowFlags, setArrowLength, setArrowWidth, setAttribute, setFlags, setPoints, setSkip, setThickness, transform, unselectContents
 
Methods inherited from class chemaxon.struc.MObject
addCdataAttributeKeys, addNotify, distanceFrom, getBackground, getColor, getLineColor, isChildOf, isInternalSelectable, isSelectableNow, isSelected, isTransformable, makeColor, makeColorString, removeNotify, setBackground, setColor, setLineColor, setSelected
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MRectangle

public MRectangle()
Contructs a rectangle.


MRectangle

public MRectangle(MPoint p1,
                  MPoint p2,
                  java.awt.Color c,
                  java.awt.Color bg)
Contructs a rectangle with the specified corner points.

Parameters:
p1 - the top left corner
p2 - the bottom right corner
c - the color
bg - the background color

MRectangle

protected MRectangle(MRectangle r)
Copy constructor.

Parameters:
r - the original rectangle
Method Detail

setCorners

public void setCorners(MPoint p1,
                       MPoint p2)
Sets the corners.

Parameters:
p1 - the top left corner
p2 - the bottom right corner

clone

public java.lang.Object clone()
Description copied from class: MObject
Creates a clone.

Overrides:
clone in class MPolyline

removeChild

public void removeChild(MObject o)
Description copied from class: MObject
Removes a child object.

Overrides:
removeChild in class MPolyline

getPointRefCount

public int getPointRefCount()
Gets the number of internal selectable point references.

Overrides:
getPointRefCount in class MPolyline
Returns:
8

getPointRef

public MPoint getPointRef(int i)
Gets an internal selectable point of the rectangle.

Overrides:
getPointRef in class MPolyline
Parameters:
i - the point index
Returns:
the point's reference

getClipObject

protected final java.lang.Object getClipObject(CTransform3D t)
Gets the clipping rectangle.

Parameters:
t - the transformation matrix
Returns:
the clipping rectangle