|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchemaxon.struc.MObject
chemaxon.struc.graphics.MPolyline
Polyline object.
Field Summary | |
static int |
ARROW_BACK_FLAG
Arrow points back. |
static int |
ARROW_HALF_LEFT
Only the left half of the arrow head is drawn. |
static int |
ARROW_HALF_MASK
Unshifted mask of the half arrow option bits in flags. |
static int |
ARROW_HALF_RIGHT
Only the right half of the arrow head is drawn. |
static int |
CLOSED_FLAG
Closed flag. |
static double |
DEFAULT_THICKNESS
Default line thickness. |
static int |
HEAD
Arrow head. |
static int |
TAIL
Arrow tail (feather). |
static int |
THICKNESS_SET_FLAG
Thickness is set flag. |
Fields inherited from class chemaxon.struc.MObject |
PAINT_ANTIALIAS, PAINT_FOCUSED, TRANSFORM_DISTORT |
Constructor Summary | |
|
MPolyline()
Contructs an empty line. |
protected |
MPolyline(boolean closed,
java.awt.Color c,
java.awt.Color bg)
Creates a closed polyline. |
|
MPolyline(MPoint p1,
MPoint p2)
Contructs a line with the specified endpoints. |
|
MPolyline(MPoint p1,
MPoint p2,
java.awt.Color c,
java.awt.Color bg)
Contructs a line with the specified endpoints. |
protected |
MPolyline(MPolyline l)
Copy constructor. |
|
MPolyline(MPolyline l,
MPoint p)
Contructs a polyline from the specified starting polyline and endpoint. |
Method Summary | |
void |
addAttributeKeys(java.util.Vector v)
Adds the attribute names to the specified vector. |
void |
calcCenter(DPoint3 p)
Calculates the geometrical center. |
boolean |
checkValidity(MDocument doc,
java.util.Vector invec)
Is it a valid object in the document? |
java.lang.Object |
clone()
Creates a clone. |
boolean |
containsAtom(MolAtom a)
Checks if the atom set contains the specified atom object. |
void |
copyProperties(MPolyline l)
Copies line properties to another line object. |
double |
distanceFrom(double x,
double y,
CTransform3D t)
Gets the 2D distance from the specified point. |
void |
finishCloning(MDocument olddoc,
MDocument newdoc)
Finish cloning a document. |
double |
getArcAngle()
Gets the central angle of the arc. |
static DPoint3 |
getArcCenter(DPoint3 p1,
DPoint3 p2,
double angle)
Returns the arc center. |
double |
getArcRadius()
Gets the arc radius. |
int |
getArrowFlags(int i)
Gets the arrow flags. |
double |
getArrowLength(int i)
Gets the arrow head length. |
double |
getArrowWidth(int i)
Gets the arrow head width. |
java.lang.String |
getAttribute(java.lang.String s)
Gets the value of an attribute. |
int |
getFlags()
Gets the flags. |
MPoint |
getPoint(int i)
Gets a point of the line. |
int |
getPointCount()
Gets the number of points. |
MPoint |
getPointRef(int i)
Gets a point of the line. |
int |
getPointRefCount()
Gets the number of point references. |
double |
getSkip(int i)
Gets the distance of the (visible) head or tail from the corresponding line end point. |
double |
getThickness()
Gets the line thickness. |
boolean |
hasBackground()
A polyline has a background only if it is closed. |
boolean |
hasColor()
A polyline does not have a non-line, non-background color. |
boolean |
hasFace()
Is it 2 dimensional? |
boolean |
hasLineColor()
A polyline have a line color always. |
boolean |
hasOutline()
Does it have an outline? |
boolean |
isArrow()
Checks if it is an arrow. |
boolean |
isEmpty()
A polyline becomes empty if it has less than 2 points. |
boolean |
isThicknessSet()
Checks if the line thickness is set. |
void |
paint(java.awt.Graphics g,
CTransform3D t,
int f,
java.awt.Color c,
java.awt.Color selc,
java.awt.Color focusc)
Paints the object. |
void |
removeChild(MObject o)
Removes a child object. |
void |
replaceAtom(MolAtom orig,
MolAtom a)
Replaces a contained atom with another one. |
void |
setArcAngle(double phi)
Sets the central angle of the arc. |
void |
setArrow(boolean v)
Sets or unsets arrow mode. |
void |
setArrowFlags(int i,
int f)
Sets the flags. |
void |
setArrowLength(int i,
double l)
Sets the arrow head length. |
void |
setArrowWidth(int i,
double l)
Sets the arrow head width. |
void |
setAttribute(java.lang.String s,
java.lang.String v)
Sets the value of an attribute. |
void |
setFlags(int f)
Sets the flags. |
void |
setPoints(MPoint[] p)
Sets the points. |
void |
setSkip(int i,
double d)
Sets the distance of the (visible) head or tail from the corresponding line end point. |
void |
setThickness(double w)
Sets the line thickness. |
void |
transform(CTransform3D t,
int opts)
Transforms all points, scales the arrow head widths and lengths. |
void |
unselectContents()
Unselects the points. |
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 |
Field Detail |
public static double DEFAULT_THICKNESS
public static int TAIL
getArrowLength(int)
,
getArrowWidth(int)
public static int HEAD
getArrowLength(int)
,
getArrowWidth(int)
public static int CLOSED_FLAG
public static int THICKNESS_SET_FLAG
public static int ARROW_BACK_FLAG
public static int ARROW_HALF_MASK
public static int ARROW_HALF_LEFT
public static int ARROW_HALF_RIGHT
Constructor Detail |
public MPolyline()
public MPolyline(MPoint p1, MPoint p2)
p1
- the starting pointp2
- the endpointpublic MPolyline(MPoint p1, MPoint p2, java.awt.Color c, java.awt.Color bg)
p1
- the starting pointp2
- the endpointc
- the colorbg
- the background colorprotected MPolyline(boolean closed, java.awt.Color c, java.awt.Color bg)
closed
- the polyline is closed if true, open otherwisec
- the colorbg
- the background colorprotected MPolyline(MPolyline l)
l
- the original polylinepublic MPolyline(MPolyline l, MPoint p)
l
- the starting polylinep
- the new endpointMethod Detail |
public void copyProperties(MPolyline l)
l
- the other linepublic boolean isArrow()
public void setArrow(boolean v)
v
- true
to make an arrow from the line,
false
to remove arrow propertiespublic void setPoints(MPoint[] p)
p
- the pointspublic java.lang.Object clone()
MObject
clone
in class MObject
public int getFlags()
CLOSED_FLAG
,
THICKNESS_SET_FLAG
public void setFlags(int f)
CLOSED_FLAG
,
THICKNESS_SET_FLAG
public int getArrowFlags(int i)
public void setArrowFlags(int i, int f)
public double getSkip(int i)
i
- HEAD
or TAIL
public void setSkip(int i, double d)
i
- HEAD
or TAIL
d
- the skip valuepublic boolean hasColor()
hasColor
in class MObject
public boolean hasLineColor()
hasLineColor
in class MObject
public boolean hasBackground()
hasBackground
in class MObject
public boolean isThicknessSet()
DEFAULT_THICKNESS
public double getThickness()
public void setThickness(double w)
w
- thickness value or 0 to use defaultpublic double getArcAngle()
public void setArcAngle(double phi)
phi
- the central angle of the arc, zero makes the line linearpublic double getArcRadius()
public double getArrowLength(int i)
i
- HEAD
or TAIL
public void setArrowLength(int i, double l)
i
- HEAD
or TAIL
l
- the head lengthpublic double getArrowWidth(int i)
i
- HEAD
or TAIL
public void setArrowWidth(int i, double l)
i
- HEAD
or TAIL
l
- the head widthpublic int getPointCount()
getPointCount
in class MObject
public MPoint getPoint(int i)
getPoint
in class MObject
i
- the point index
public int getPointRefCount()
getPointRefCount
in class MObject
getPointCount()
function)public MPoint getPointRef(int i)
getPointRef
in class MObject
i
- the point index
public void transform(CTransform3D t, int opts)
transform
in class MObject
t
- the transformation matrixopts
- transform options or 0MObject.TRANSFORM_DISTORT
public void unselectContents()
unselectContents
in class MObject
public void calcCenter(DPoint3 p)
calcCenter
in class MObject
p
- store the coordinates herepublic double distanceFrom(double x, double y, CTransform3D t)
distanceFrom
in class MObject
x
- the x coordinatey
- the y coordinatet
- transformation or nullpublic void paint(java.awt.Graphics g, CTransform3D t, int f, java.awt.Color c, java.awt.Color selc, java.awt.Color focusc)
paint
in class MObject
g
- the graphics contextt
- the transformation matrixf
- flagsc
- the color to use or nullselc
- the selection colorfocusc
- the focus colorpublic static DPoint3 getArcCenter(DPoint3 p1, DPoint3 p2, double angle)
p1
- the first arc endpointp2
- the second arc endpointangle
- the arc angle (degrees)
public boolean isEmpty()
isEmpty
in class MObject
public boolean hasOutline()
public boolean hasFace()
public void removeChild(MObject o)
MObject
removeChild
in class MObject
o
- the childpublic void addAttributeKeys(java.util.Vector v)
addAttributeKeys
in class MObject
v
- the vectorpublic java.lang.String getAttribute(java.lang.String s)
getAttribute
in class MObject
s
- the attribute name
public void setAttribute(java.lang.String s, java.lang.String v)
setAttribute
in class MObject
s
- the attribute namev
- the attribute valuepublic boolean containsAtom(MolAtom a)
containsAtom
in class MObject
public void replaceAtom(MolAtom orig, MolAtom a)
replaceAtom
in class MObject
orig
- the original atoma
- the new atompublic boolean checkValidity(MDocument doc, java.util.Vector invec)
checkValidity
in class MObject
doc
- the documentinvec
- vector for invalid atoms or null
public void finishCloning(MDocument olddoc, MDocument newdoc)
finishCloning
in class MObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |