public class JDLine extends JDObject implements JDRotatable
Here is an example of few JDLine:

| Modifier and Type | Field and Description |
|---|---|
static int |
ARROW_NONE
No arrow.
|
static int |
ARROW1_BOTH
Left and right arrow type 1.
|
static int |
ARROW1_CENTER
center arrow type 1.
|
static int |
ARROW1_LEFT
Left arrow type 1.
|
static int |
ARROW1_RIGHT
right arrow type 1.
|
static int |
ARROW2_BOTH
Left and right arrow type 2.
|
static int |
ARROW2_CENTER
center arrow type 2.
|
static int |
ARROW2_LEFT
Left arrow type 2.
|
static int |
ARROW2_RIGHT
right arrow type 2.
|
FILL_STYLE_DOT_PATTERN_1, FILL_STYLE_DOT_PATTERN_2, FILL_STYLE_DOT_PATTERN_3, FILL_STYLE_GRADIENT, FILL_STYLE_LARGE_CROSS_HATCH, FILL_STYLE_LARGE_LEFT_HATCH, FILL_STYLE_LARGE_RIGHT_HATCH, FILL_STYLE_NONE, FILL_STYLE_SMALL_CROSS_HATCH, FILL_STYLE_SMALL_LEFT_HATCH, FILL_STYLE_SMALL_RIGHT_HATCH, FILL_STYLE_SOLID, LINE_STYLE_DASH, LINE_STYLE_DASH_DOT, LINE_STYLE_DOT, LINE_STYLE_LONG_DASH, LINE_STYLE_SOLID, VALUE_CHANGE_ON_XDRAG_LEFT, VALUE_CHANGE_ON_XDRAG_RIGHT, VALUE_CHANGE_ON_YDRAG_BOTTOM, VALUE_CHANGE_ON_YDRAG_TOP, VALUE_INC_ON_CLICK, VALUE_INC_ON_PRESSRELEASE| Constructor and Description |
|---|
JDLine(java.lang.String objectName,
int x1,
int y1,
int x2,
int y2)
Construct a JDLine.
|
| Modifier and Type | Method and Description |
|---|---|
JDObject |
copy(int x,
int y)
Returns a copy of this object at the specified location.
|
int |
getArrow()
Returns the current arrow of this line.
|
int |
getArrowSize()
Returns the current arrow width.
|
boolean |
hasShadow()
Returns false, Line cannot be shadowed.
|
boolean |
isInsideObject(int x,
int y)
Determines whether the specified point is inside this object.
|
void |
moveSummit(int id,
double x,
double y)
Moves the specifed summit to the specified position.
|
void |
paint(JDrawEditor parent,
java.awt.Graphics g)
Paints this object.
|
void |
rotate(double angle,
double xCenter,
double yCenter)
Rotates this object.
|
void |
setArrow(int arrow)
Sets the arrow for this line.
|
void |
setArrowSize(int s)
Sets the arrow size.
|
void |
setLineWidth(int width)
Sets the line width of this object.
|
addExtension, addMouseListener, addValueListener, centerOrigin, clearMouseListener, clearValueListener, getBackground, getBackgroundMapper, getBoundRect, getExtendedParam, getExtendedParam, getExtendedParamDesc, getExtendedParamIndex, getExtendedParamName, getExtendedParamNumber, getFillStyle, getForeground, getForegroundMapper, getHTranslationMapper, getInitValue, getInvertShadowMapper, getLineStyle, getLineWidth, getMaxValue, getMinValue, getName, getObjectsByName, getOrigin, getShadowWidth, getSummit, getSummitNumber, getValue, getValueChangeMode, getVisibilityMapper, getVTranslationMapper, hasBackgroundMapper, hasExtendedParam, hasForegroundMapper, hasHTranslationMapper, hasInverseShadow, hasInvertShadowMapper, hasVisibilityMapper, hasVTranslationMapper, isAntiAliased, isDisabled, isFixedExtendedParam, isInteractive, isProgrammed, isVisible, moveSummitH, moveSummitV, preRefresh, refresh, removeExtension, removeMouseListener, removeValueListener, restoreTransform, rotate90, saveTransform, scale, scaleTranslate, setAntiAlias, setBackground, setBackgroundMapper, setDisabled, setExtendedParam, setExtendedParam, setExtensionList, setFillStyle, setForeground, setForegroundMapper, setGradientFillParam, setHTranslationMapper, setInitValue, setInteractive, setInverseShadow, setInvertShadowMapper, setLineStyle, setMaxValue, setMinValue, setName, setOrigin, setShadow, setShadowWidth, setValue, setValueChangeMode, setVisibilityMapper, setVisible, setVTranslationMapper, toString, translatepublic static final int ARROW_NONE
public static final int ARROW1_LEFT
public static final int ARROW1_RIGHT
public static final int ARROW1_BOTH
public static final int ARROW1_CENTER
public static final int ARROW2_LEFT
public static final int ARROW2_RIGHT
public static final int ARROW2_BOTH
public static final int ARROW2_CENTER
public JDLine(java.lang.String objectName,
int x1,
int y1,
int x2,
int y2)
objectName - Line namex1 - X position First pointy1 - Y position First pointx2 - X position Second pointy2 - Y position Second pointpublic JDObject copy(int x, int y)
JDObjectpublic void setArrow(int arrow)
arrow - Arrow modeARROW1_LEFT,
ARROW1_RIGHT,
ARROW1_BOTH,
ARROW1_CENTER,
ARROW2_LEFT,
ARROW2_RIGHT,
ARROW2_BOTH,
ARROW2_CENTERpublic int getArrow()
setArrow(int)public void setArrowSize(int s)
s - Arrow size.public int getArrowSize()
setArrowSize(int)public void paint(JDrawEditor parent, java.awt.Graphics g)
JDObjectpublic boolean hasShadow()
public void moveSummit(int id,
double x,
double y)
JDObjectmoveSummit in class JDObjectid - Summit indexx - Absolute X positiony - Absolute Y positionJDObject.refresh()public boolean isInsideObject(int x,
int y)
JDObjectisInsideObject in class JDObjectx - X coordinate (pixel)y - Y coordinate (pixel)public void setLineWidth(int width)
JDObjectsetLineWidth in class JDObjectwidth - Line width (pixel)public void rotate(double angle,
double xCenter,
double yCenter)
JDRotatablerotate in interface JDRotatableangle - Angle valuexCenter - Rotation center vertical posyCenter - Rotation center horizontal pos