chemaxon.struc.graphics
Class MBracket

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.MBracket
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class MBracket
extends MRectangle

Bracket object.

Since:
Marvin 5.0, 01/09/2007
Version:
5.0, 09/20/2007
Author:
Peter Csizmadia
See Also:
Serialized Form

Field Summary
static int T_BRACES
          Braces.
static int T_CHEVRONS
          Chevrons.
static int T_ROUND
          Round bracket type (parenthesis).
static int T_SQUARE
          Square bracket type.
 
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_HALF_LEFT, ARROW_HALF_MASK, ARROW_HALF_RIGHT, arrowFlags, CLOSED_FLAG, DEFAULT_ARROW_HEAD_LENGTH, DEFAULT_ARROW_HEAD_WIDTH, DEFAULT_THICKNESS, HEAD, TAIL, THICKNESS_SET_FLAG
 
Fields inherited from class chemaxon.struc.MObject
PAINT_ANTIALIAS, PAINT_FOCUSED, TRANSFORM_DISTORT
 
Constructor Summary
  MBracket()
          Contructs a bracket.
protected MBracket(MBracket r)
          Copy constructor.
  MBracket(MPoint p1, MPoint p2)
          Contructs a bracket with the specified corner points.
  MBracket(MPoint p1, MPoint p2, java.awt.Color c)
          Contructs a bracket with the specified corner points.
 
Method Summary
 void addAttributeKeys(java.util.Vector v)
          Adds the attribute names to the specified vector.
 java.lang.Object clone()
          Creates a clone.
 void copyProperties(MBracket l)
          Copies line properties to another line object.
 java.lang.String getAttribute(java.lang.String s)
          Gets the value of an attribute.
 int getType()
          Gets the bracket type.
 boolean hasBackground()
          A bracket has no background.
 void paint(java.awt.Graphics2D g, CTransform3D t, int f, java.awt.Color c, java.awt.Color selc, java.awt.Color focusc)
          Paints the object.
 void setAttribute(java.lang.String s, java.lang.String v)
          Sets the value of an attribute.
 void setType(int t)
          Sets the bracket type.
 void transform(CTransform3D t, int opts, CTransform3D trot)
          Transforms the bracket.
 
Methods inherited from class chemaxon.struc.graphics.MRectangle
calcCenter, convertTransform, distanceFrom, fixRectanglePointClones, getClip, getPointRef, getPointRefCount, getTCenter, getTOption, removeChild, setCorners, setTCenter, setTOption, transformTo2D
 
Methods inherited from class chemaxon.struc.graphics.MPolyline
calcArrowHeads, checkValidity, connect, containsAtom, copyProperties, drawArc, finishCloning, fixMidPointClones, getArcAngle, getArcCenter, getArcRadius, getArrowFlags, getArrowLength, getArrowWidth, getFlags, getMidPointLocation, getMirroredArrowFlags, getPoint, getPointCount, getPoints, getSkip, getThickness, hasColor, hasFace, hasLineColor, hasOutline, isArrow, isEmpty, isThicknessSet, paintEndPointHilights, paintHilight, replaceAtom, reverse, setArcAngle, setArrow, setArrowFlags, setArrowLength, setArrowWidth, setFlags, setPoints, setSkip, setThickness, shiftEndPoint, unselectContents, updateBoundingRect
 
Methods inherited from class chemaxon.struc.MObject
addCdataAttributeKeys, addNotify, distanceFrom, getBackground, getColor, getLineColor, isChildOf, isInternalSelectable, isReactionArrow, isSelectableNow, isSelected, isTransformable, makeColor, removeNotify, setBackground, setColor, setLineColor, setSelected, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

T_ROUND

public static final int T_ROUND
Round bracket type (parenthesis).

See Also:
Constant Field Values

T_SQUARE

public static final int T_SQUARE
Square bracket type.

See Also:
Constant Field Values

T_BRACES

public static final int T_BRACES
Braces.

See Also:
Constant Field Values

T_CHEVRONS

public static final int T_CHEVRONS
Chevrons.

See Also:
Constant Field Values
Constructor Detail

MBracket

public MBracket()
Contructs a bracket.


MBracket

public MBracket(MPoint p1,
                MPoint p2)
Contructs a bracket with the specified corner points.

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

MBracket

public MBracket(MPoint p1,
                MPoint p2,
                java.awt.Color c)
Contructs a bracket with the specified corner points.

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

MBracket

protected MBracket(MBracket r)
Copy constructor.

Parameters:
r - the original bracket
Method Detail

hasBackground

public boolean hasBackground()
A bracket has no background.

Overrides:
hasBackground in class MPolyline
Returns:
false

copyProperties

public void copyProperties(MBracket l)
Copies line properties to another line object.

Parameters:
l - the other line

getType

public int getType()
Gets the bracket type.

Returns:
the type

setType

public void setType(int t)
Sets the bracket type.

Parameters:
t - the type

clone

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

Overrides:
clone in class MRectangle
Returns:
the clone

paint

public void paint(java.awt.Graphics2D g,
                  CTransform3D t,
                  int f,
                  java.awt.Color c,
                  java.awt.Color selc,
                  java.awt.Color focusc)
Paints the object.

Overrides:
paint in class MRectangle
Parameters:
g - the graphics context
t - the transformation matrix
f - flags
c - the color to use or null
selc - the selection color
focusc - the focus color

transform

public void transform(CTransform3D t,
                      int opts,
                      CTransform3D trot)
Transforms the bracket.

Overrides:
transform in class MRectangle
Parameters:
t - the transformation matrix
opts - transform options or 0
trot - the viewing transformation or null
See Also:
MObject.TRANSFORM_DISTORT

addAttributeKeys

public void addAttributeKeys(java.util.Vector v)
Description copied from class: MRectangle
Adds the attribute names to the specified vector. CDATA attributes are not added.

Overrides:
addAttributeKeys in class MRectangle
Parameters:
v - the vector

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