chemaxon.struc.graphics
Class MRoundedRectangle

java.lang.Object
  extended by chemaxon.struc.MObject
      extended by chemaxon.struc.graphics.MPolyline
          extended by chemaxon.struc.graphics.MRectangle
              extended by chemaxon.struc.graphics.MRoundedRectangle
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class MRoundedRectangle
extends MRectangle

Rounded rectangle object.

Since:
Marvin 5.3,
Version:
5.3, /2009
Author:
Eva Hollo
See Also:
Serialized Form

Field Summary
 
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_THICKNESS, HEAD, points, TAIL, THICKNESS_SET_FLAG
 
Fields inherited from class chemaxon.struc.MObject
PAINT_ANTIALIAS, PAINT_FOCUSED, TRANSFORM_DISTORT
 
Constructor Summary
  MRoundedRectangle()
          Constructs a rounded rectangle
  MRoundedRectangle(MPoint p1, MPoint p2)
          Constructs a rounded rectangle with the specified corner points.
  MRoundedRectangle(MPoint p1, MPoint p2, java.awt.Color c)
          Constructs a rounded rectangle with the specified corner points and color.
  MRoundedRectangle(MPoint p1, MPoint p2, double aw, double ah)
          Constructs a rounded rectangle with the specified corner points.
  MRoundedRectangle(MPoint p1, MPoint p2, double aw, double ah, java.awt.Color c)
          Constructs a rounded rectangle with the specified corner points and color.
protected MRoundedRectangle(MRoundedRectangle rr)
          Copy constructor.
 
Method Summary
 void addAttributeKeys(java.util.List<java.lang.String> l)
          Adds the attribute names to the specified vector.
 java.lang.Object clone()
          Creates a clone.
 boolean containsPoint(DPoint3 p, CTransform3D trot)
           
 void correctCornersRadius(double aw, double ah)
           
 double getArcHeight()
           
 double getArcWidth()
           
 java.lang.String getAttribute(java.lang.String s)
          Gets the value of an attribute.
 MPoint getInnerPointRef(int i, CTransform3D trot)
           
 MPoint getPointRef(int i, CTransform3D trot)
          Gets an internal selectable point of the rectangle.
 int getPointRefCount()
          Gets the number of internal selectable point references.
 void setArcHeight(double ah)
           
 void setArcWidth(double aw)
           
 void setAttribute(java.lang.String s, java.lang.String v)
          Sets the value of an attribute.
 void setCornersRadius(double aw, double ah)
           
 
Methods inherited from class chemaxon.struc.graphics.MRectangle
calcCenter, convertTransform, distanceFrom, fixClonedPoints, fixRectanglePointClones, getClip, getTCenter, getTOption, removeChild, setCorners, setTCenter, setTOption, transform, transformTo2D
 
Methods inherited from class chemaxon.struc.graphics.MPolyline
checkValidity, containsAtom, copyProperties, finishCloning, fixMidPointClones, getArcAngle, getArcCenter, getArcRadius, getArcRadius, getArrowFlags, getArrowLength, getArrowWidth, getFlags, getMidPointLocation, getMirroredArrowFlags, getPoint, getPointCount, getPoints, getSkip, getThickness, hasBackground, hasColor, hasFace, hasLineColor, hasOutline, isArrow, isEmpty, isThicknessSet, replaceAtom, reverse, rotate, setArcAngle, setArrow, setArrowFlags, setArrowLength, setArrowWidth, setFlags, setPoints, setSkip, setThickness, unselectContents, updateBoundingRect
 
Methods inherited from class chemaxon.struc.MObject
addCdataAttributeKeys, addNotify, distanceFrom, getBackground, getColor, getLineColor, isChildOf, isInternalSelectable, isReactionArrow, isSelectableNow, isSelected, isTransformable, makeColor, removeAtom, removeNotify, setBackground, setColor, setLineColor, setSelected, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MRoundedRectangle

public MRoundedRectangle()
Constructs a rounded rectangle


MRoundedRectangle

public MRoundedRectangle(MPoint p1,
                         MPoint p2)
Constructs a rounded rectangle with the specified corner points.

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

MRoundedRectangle

public MRoundedRectangle(MPoint p1,
                         MPoint p2,
                         double aw,
                         double ah)
Constructs a rounded rectangle with the specified corner points.

Parameters:
p1 - the top left corner
p2 - the bottom right corner
aw - the width of the corner's ellipse
ah - the height of the corner's ellipse

MRoundedRectangle

public MRoundedRectangle(MPoint p1,
                         MPoint p2,
                         java.awt.Color c)
Constructs a rounded rectangle with the specified corner points and color.

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

MRoundedRectangle

public MRoundedRectangle(MPoint p1,
                         MPoint p2,
                         double aw,
                         double ah,
                         java.awt.Color c)
Constructs a rounded rectangle with the specified corner points and color.

Parameters:
p1 - the top left corner
p2 - the bottom right corner
aw - the width of the corner's ellipse
ah - the height of the corner's ellipse
c - the color

MRoundedRectangle

protected MRoundedRectangle(MRoundedRectangle rr)
Copy constructor.

Parameters:
rr - the original rounded rectangle
Method Detail

clone

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

Overrides:
clone in class MRectangle
Returns:
the clone

setArcWidth

public void setArcWidth(double aw)

setArcHeight

public void setArcHeight(double ah)

getArcWidth

public double getArcWidth()

getArcHeight

public double getArcHeight()

setCornersRadius

public void setCornersRadius(double aw,
                             double ah)

correctCornersRadius

public void correctCornersRadius(double aw,
                                 double ah)

addAttributeKeys

public void addAttributeKeys(java.util.List<java.lang.String> l)
Adds the attribute names to the specified vector.

Overrides:
addAttributeKeys in class MRectangle
Parameters:
l - the list of attributes

getAttribute

public java.lang.String getAttribute(java.lang.String s)
Gets the value of an attribute.

Overrides:
getAttribute in class MRectangle
Parameters:
s - the attribute name
Returns:
the value or null

setAttribute

public void setAttribute(java.lang.String s,
                         java.lang.String v)
Sets the value of an attribute.

Overrides:
setAttribute in class MRectangle
Parameters:
s - the attribute name
v - the attribute value

containsPoint

public boolean containsPoint(DPoint3 p,
                             CTransform3D trot)
Overrides:
containsPoint in class MObject

getPointRefCount

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

Overrides:
getPointRefCount in class MRectangle
Returns:
8

getPointRef

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

Overrides:
getPointRef in class MRectangle
Parameters:
i - the point index
trot - the viewing transformation or null
Returns:
the point's reference

getInnerPointRef

public MPoint getInnerPointRef(int i,
                               CTransform3D trot)