|
|||||||||
| 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
public class 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. |
protected int[] |
arrowFlags
Arrow flags. |
static int |
CLOSED_FLAG
Closed flag. |
static double |
DEFAULT_ARROW_HEAD_LENGTH
Default arrow head length. |
static double |
DEFAULT_ARROW_HEAD_WIDTH
Default arrow head width. |
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. |
protected DPoint3[] |
calcArrowHeads(DPoint3 p1orig,
DPoint3 p2orig,
double scale,
double angle,
DPoint3[] q1,
DPoint3[] q2,
double[] arw,
double[] angle1,
double[] ct)
Calculate arrow coordinates. |
void |
calcCenter(DPoint3 p,
CTransform3D trot)
Calculates the geometrical center. |
boolean |
checkValidity(MDocument doc,
java.util.Collection invec)
Is it a valid object in the document? |
java.lang.Object |
clone()
Creates a clone. |
protected void |
connect(java.awt.Graphics2D g,
CTransform3D t,
int i1,
int i2,
DPoint3 p1,
DPoint3 p2,
java.awt.Stroke arrowstroke,
double strokew)
|
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. |
protected static void |
drawArc(java.awt.Graphics2D g,
DPoint3 p1,
DPoint3 p2,
double angle)
|
void |
finishCloning(MDocument olddoc,
MDocument newdoc)
Finish cloning a document. |
static void |
fixMidPointClones(MObject[] objarr0,
MObject[] objarr)
Fixes the parents of the cloned MMidPoints. |
double |
getArcAngle()
Gets the central angle of the arc. |
static DPoint3 |
getArcCenter(DPoint3 p1,
DPoint3 p2,
double angle)
Returns the arc center. |
double |
getArcRadius(CTransform3D t)
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. |
DPoint3 |
getMidPointLocation(int i,
CTransform3D t)
Gets the middle point of the arc. |
protected int |
getMirroredArrowFlags(int i)
Mirror transformation for arrow heads. |
MPoint |
getPoint(int i)
Gets a point of the line. |
int |
getPointCount()
Gets the number of points. |
MPoint |
getPointRef(int i,
CTransform3D trot)
Gets a reference to a point or midpoint in the polyline. |
int |
getPointRefCount()
Gets the number of point references. |
MPoint[] |
getPoints()
Gets the points. |
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.Graphics2D g,
CTransform3D t,
int f,
java.awt.Color c,
java.awt.Color selc,
java.awt.Color focusc)
Paints the object. |
void |
paintEndPointHilights(java.awt.Graphics2D g,
CTransform3D t,
int f,
java.awt.Color c,
java.awt.Color selc,
java.awt.Color focusc)
|
void |
paintHilight(java.awt.Graphics2D g,
CTransform3D t,
int f,
java.awt.Color c,
java.awt.Color selc,
java.awt.Color focusc)
|
void |
removeChild(MObject o)
Removes a child object. |
void |
replaceAtom(MolAtom orig,
MolAtom a)
Replaces a contained atom with another one. |
void |
reverse()
Reverses the order of points. |
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. |
protected double |
shiftEndPoint(double skip,
DPoint3 p1o,
DPoint3 p2o,
DPoint3 p1,
DPoint3 p2,
int i,
DPoint3 pfront,
DPoint3 pback,
double sign)
|
void |
transform(CTransform3D t,
int opts,
CTransform3D trot)
Transforms all points, scales the arrow head widths and lengths. |
void |
unselectContents()
Unselects the points. |
void |
updateBoundingRect(double[] xyminm,
CTransform3D pretrf)
Calculate the bounding rectangle. |
| 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 |
|---|
public static double DEFAULT_THICKNESS
public static final double DEFAULT_ARROW_HEAD_LENGTH
public static final double DEFAULT_ARROW_HEAD_WIDTH
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
protected transient int[] arrowFlags
| 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(CTransform3D t)
t - the transformation matrix
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[] getPoints()
public MPoint getPoint(int i)
getPoint in class MObjecti - the point index
public int getPointRefCount()
getPointRefCount in class MObject
public MPoint getPointRef(int i,
CTransform3D trot)
getPointRef in class MObjecti - the point indextrot - the viewing transformation or null
public static void fixMidPointClones(MObject[] objarr0,
MObject[] objarr)
objarr0 - the original object arrayobjarr - the cloned object array
public void transform(CTransform3D t,
int opts,
CTransform3D trot)
transform in class MObjectt - the transformation matrixopts - transform options or 0trot - the viewing transformation or nullMObject.TRANSFORM_DISTORTpublic void reverse()
public void updateBoundingRect(double[] xyminm,
CTransform3D pretrf)
updateBoundingRect in class MObjectxyminm - array containing the current minimum x, y and
maximum x, y coordinatespretrf - transformation matrixpublic void unselectContents()
unselectContents in class MObject
public void calcCenter(DPoint3 p,
CTransform3D trot)
calcCenter in class MObjectp - store the coordinates heretrot - the viewing transformation or null
public DPoint3 getMidPointLocation(int i,
CTransform3D t)
i - the polyline point indext - the transformation matrix or null
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.Graphics2D 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 void paintHilight(java.awt.Graphics2D g,
CTransform3D t,
int f,
java.awt.Color c,
java.awt.Color selc,
java.awt.Color focusc)
public void paintEndPointHilights(java.awt.Graphics2D g,
CTransform3D t,
int f,
java.awt.Color c,
java.awt.Color selc,
java.awt.Color focusc)
protected void connect(java.awt.Graphics2D g,
CTransform3D t,
int i1,
int i2,
DPoint3 p1,
DPoint3 p2,
java.awt.Stroke arrowstroke,
double strokew)
protected DPoint3[] calcArrowHeads(DPoint3 p1orig,
DPoint3 p2orig,
double scale,
double angle,
DPoint3[] q1,
DPoint3[] q2,
double[] arw,
double[] angle1,
double[] ct)
p1orig - original starting pointp2orig - original end pointscale - transformation's scale factorangle - the angleq1 - two-element output array, the starting point of the arrow
tail and head will be stored hereq2 - two-element output array, the end point of the arrow
tail and head will be stored herearw - two-element output array, it will contain the arrow
head and tail widthsangle1 - one-element output array, it will contain the arc anglect - two-element output array, it will contain half of the
with/height ratios of the head and tail
protected double shiftEndPoint(double skip,
DPoint3 p1o,
DPoint3 p2o,
DPoint3 p1,
DPoint3 p2,
int i,
DPoint3 pfront,
DPoint3 pback,
double sign)
protected static void drawArc(java.awt.Graphics2D g,
DPoint3 p1,
DPoint3 p2,
double angle)
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.Collection invec)
checkValidity in class MObjectdoc - the documentinvec - collection of invalid atoms or null
public void finishCloning(MDocument olddoc,
MDocument newdoc)
finishCloning in class MObjectprotected int getMirroredArrowFlags(int i)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||