|
||||||||||
| 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 endpoint
public MPolyline(MPoint p1,
MPoint p2,
java.awt.Color c,
java.awt.Color bg)
p1 - the starting pointp2 - the endpointc - the colorbg - the background color
protected 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 polyline
public MPolyline(MPolyline l,
MPoint p)
l - the starting polylinep - the new endpoint| Method 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 MObjectpublic int getFlags()
CLOSED_FLAG,
THICKNESS_SET_FLAGpublic void setFlags(int f)
CLOSED_FLAG,
THICKNESS_SET_FLAGpublic 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 TAILd - the skip valuepublic boolean hasColor()
hasColor in class MObjectpublic boolean hasLineColor()
hasLineColor in class MObjectpublic boolean hasBackground()
hasBackground in class MObjectpublic boolean isThicknessSet()
DEFAULT_THICKNESSpublic 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 TAILl - the head lengthpublic double getArrowWidth(int i)
i - HEAD or TAIL
public void setArrowWidth(int i,
double l)
i - HEAD or TAILl - the head widthpublic int getPointCount()
getPointCount in class MObjectpublic MPoint getPoint(int i)
getPoint in class MObjecti - the point index
public int getPointRefCount()
getPointRefCount in class MObjectgetPointCount()
function)public MPoint getPointRef(int i)
getPointRef in class MObjecti - the point index
public void transform(CTransform3D t,
int opts)
transform in class MObjectt - the transformation matrixopts - transform options or 0MObject.TRANSFORM_DISTORTpublic void unselectContents()
unselectContents in class MObjectpublic void calcCenter(DPoint3 p)
calcCenter in class MObjectp - store the coordinates here
public double distanceFrom(double x,
double y,
CTransform3D t)
distanceFrom in class MObjectx - the x coordinatey - the y coordinatet - transformation or null
public 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 MObjectg - the graphics contextt - the transformation matrixf - flagsc - the color to use or nullselc - the selection colorfocusc - the focus color
public 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 MObjectpublic boolean hasOutline()
public boolean hasFace()
public void removeChild(MObject o)
MObject
removeChild in class MObjecto - the childpublic void addAttributeKeys(java.util.Vector v)
addAttributeKeys in class MObjectv - the vectorpublic java.lang.String getAttribute(java.lang.String s)
getAttribute in class MObjects - the attribute name
public void setAttribute(java.lang.String s,
java.lang.String v)
setAttribute in class MObjects - the attribute namev - the attribute valuepublic boolean containsAtom(MolAtom a)
containsAtom in class MObject
public void replaceAtom(MolAtom orig,
MolAtom a)
replaceAtom in class MObjectorig - the original atoma - the new atom
public boolean checkValidity(MDocument doc,
java.util.Vector invec)
checkValidity in class MObjectdoc - 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 | |||||||||