public final class SpenObjectLine extends SpenObjectShapeBase
| Modifier and Type | Class and Description |
|---|---|
static class |
SpenObjectLine.Properties
Properties Class.
This is a utility class for making a candidate path of SpenObjectLine. The path of SpenObjectLine depends on its connector position and connected shape. |
SpenObjectShapeBase.ConnectedInfo| Modifier and Type | Field and Description |
|---|---|
static int |
CONNECTOR_BEGIN
The begin point of line.
|
static int |
CONNECTOR_END
The end Point of line.
|
static int |
TYPE_CURVE
Curve line.
|
static int |
TYPE_ELBOW
Elbow line.
|
static int |
TYPE_STRAIGHT
Straight line.
|
CONNECTION_MODE_LOOSELY_COUPLED, CONNECTION_MODE_TIGHTLY_COUPLEDOBJECT_MINIMUM_SIZE, RESIZE_OPTION_DISABLE, RESIZE_OPTION_FREE, RESIZE_OPTION_KEEP_RATIO, SPEN_INFINITY_FLOAT, SPEN_INFINITY_INT, TYPE_CONTAINER, TYPE_IMAGE, TYPE_LINE, TYPE_NONE, TYPE_SHAPE, TYPE_STROKE, TYPE_TEXT_BOX| Constructor and Description |
|---|
SpenObjectLine(int type,
PointF startPoint,
PointF endPoint)
Creates a SpenObjectLine instance.
|
SpenObjectLine(int type,
PointF startPoint,
PointF endPoint,
boolean isTemplateObject)
Creates a SpenObjectLine instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect(int connector,
SpenObjectShapeBase targetShape,
int indexOfTargetMagneticConnectionPoint)
Connect a specified connector to the magnetic connection point of specified shape.
If the connector is already connected at indexOfTargetMagneticConnectionPoint position, it
doesn't do anything.If the connector is already connected to another object, it should be disconnected first and then connect
to the targetShape. |
void |
copy(SpenObjectBase source)
Copy data from the line object.
|
void |
disconnect(int connector)
Disconnect connected shape from specific connector.
|
SpenObjectShapeBase |
getConnectedObject(int connector)
Get a connected shape with specific connector.
|
PointF |
getConnectorPosition(int connector)
Get a position of the specific connector.
|
PointF |
getConnectorPosition(int connector,
float degree)
Get a position of the specific connector rotated by the specified degree.
|
PointF |
getControlPoint(int index)
Get a current position of the specified control point.
|
PointF |
getControlPoint(int index,
float degree)
Get a current position of the specified control point rotated by the specified degree.
|
int |
getControlPointCount()
Get a number of the control points.
|
int |
getLineType()
Get a line type.
|
SpenPath |
getPath()
Get a path of the line.
|
SpenPath |
getPath(float degree)
Get a path of the line rotated by specified degree.
|
SpenObjectLine.Properties |
getProperties()
Get a properties of the line for making a candidate path.
|
static SpenPath |
makePath(SpenObjectLine.Properties properties)
Get a candidate path with line properties.
|
static SpenPath |
makePath(SpenObjectLine.Properties properties,
float degree)
Get a candidate path with line properties by the specified degree.
|
void |
moveControlPoint(int index,
PointF point)
Move a specified control point.
The line has variable control points according to the shape of the line. |
void |
setConnectorPosition(int connector,
PointF point)
Set a position of the specified connector.
|
void |
setLineType(int type)
Set a line type.
|
getConnectedInfoCount, getConnectionMode, getLineColorEffect, getLineStyleEffect, getMagneticConnectionInfo, getMagneticConnectionPoint, getMagneticConnectionPoint, getMagneticConnectionPointCount, getNearestMagneticConnectionPointIndex, resetLineColorEffect, resetLineStyleEffect, setConnectionMode, setLineColorEffect, setLineStyleEffectattachFile, clearChangedFlag, detachFile, equals, getAttachedFile, getDrawnRect, getExtraDataByteArray, getExtraDataInt, getExtraDataString, getExtraDataStringArray, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getRect, getResizeOption, getRotation, getRuntimeHandle, getSorDataInt, getSorDataString, getSorInfo, getSorPackageLink, getTemplateProperty, getType, getUserId, hasExtraDataByteArray, hasExtraDataInt, hasExtraDataString, hasExtraDataStringArray, hashCode, hasSorDataInt, hasSorDataString, isChanged, isFlipEnabled, isMovable, isOutOfViewEnabled, isRecorded, isRotatable, isSelectable, isVisible, removeExtraDataByteArray, removeExtraDataInt, removeExtraDataString, removeExtraDataStringArray, removeSorDataInt, removeSorDataString, setExtraDataByteArray, setExtraDataInt, setExtraDataString, setExtraDataStringArray, setFlipEnabled, setMaxSize, setMinSize, setMovable, setOutOfViewEnabled, setRecorded, setRect, setResizeOption, setRotatable, setRotation, setSelectable, setSorDataInt, setSorDataString, setSorInfo, setSorPackageLink, setUserId, setVisibilitypublic static final int TYPE_STRAIGHT
setLineType(int),
getLineType(),
Constant Field Valuespublic static final int TYPE_ELBOW
setLineType(int),
getLineType(),
Constant Field Valuespublic static final int TYPE_CURVE
setLineType(int),
getLineType(),
Constant Field Valuespublic static final int CONNECTOR_BEGIN
public static final int CONNECTOR_END
public SpenObjectLine(int type,
PointF startPoint,
PointF endPoint)
type - The line type. One of TYPE_STRAIGHT, TYPE_ELBOW and TYPE_CURVE.startPoint - The start point of line.endPoint - The end point of line.IllegalArgumentException - Thrown if the border type passed is invalid.startPoint or the endPoint is null.TYPE_STRAIGHT,
TYPE_ELBOW,
TYPE_CURVEpublic SpenObjectLine(int type,
PointF startPoint,
PointF endPoint,
boolean isTemplateObject)
type - The line type. One of TYPE_STRAIGHT, TYPE_ELBOW and TYPE_CURVE.startPoint - The start point of line.endPoint - The end point of line.isTemplateObject - Set to true to create a template object, set to false to create a non-template object.IllegalArgumentException - Thrown if the border type passed is invalid.startPoint or the endPoint is null.TYPE_STRAIGHT,
TYPE_ELBOW,
TYPE_CURVEpublic void setLineType(int type)
type - The line type. One of TYPE_STRAIGHT, TYPE_ELBOW and TYPE_CURVEIllegalArgumentException - Thrown if the line type is invalid.TYPE_STRAIGHT,
TYPE_ELBOW,
TYPE_CURVEpublic int getLineType()
TYPE_STRAIGHT,
TYPE_ELBOW,
TYPE_CURVEpublic SpenPath getPath()
public SpenPath getPath(float degree)
degree - The specified degree to get a path.public SpenObjectLine.Properties getProperties()
public static SpenPath makePath(SpenObjectLine.Properties properties)
properties - The properties of the line.IllegalArgumentException - Thrown if the properties is null.getProperties()public static SpenPath makePath(SpenObjectLine.Properties properties, float degree)
properties - The properties of the line.degree - The specified degree to get.IllegalArgumentException - Thrown if the properties is null.getProperties()public void moveControlPoint(int index,
PointF point)
point can be different from getControlPoint(int) return value.index - The index of control point. It starts from 0.point - The position of new control point.IndexOutOfBoundsException - Thrown if the index is negative value or if it is greater than the number of control
points of current line.IllegalArgumentException - Thrown if the point is null.public PointF getControlPoint(int index)
index - The index of control point. It starts from 0.IndexOutOfBoundsException - Thrown if the index is negative value or if it is greater than the number of control
points of current line.public PointF getControlPoint(int index, float degree)
index - The index of control point. It starts from 0.degree - The specified degree to get.IndexOutOfBoundsException - Thrown if the index is negative value or if it is greater than the number of control
points of current line.public int getControlPointCount()
public void setConnectorPosition(int connector,
PointF point)
connector - The connector which is one of CONNECTOR_BEGIN or CONNECTOR_END.point - The position to move.IllegalArgumentException - Thrown if the connector is invalid.point is null.CONNECTOR_BEGIN,
CONNECTOR_ENDpublic PointF getConnectorPosition(int connector)
connector - The connector which is one of CONNECTOR_BEGIN or CONNECTOR_END.IllegalArgumentException - Thrown if the connector is invalid.CONNECTOR_BEGIN,
CONNECTOR_ENDpublic PointF getConnectorPosition(int connector, float degree)
connector - The connector which is one of CONNECTOR_BEGIN or CONNECTOR_END.degree - The specified degree to get.IllegalArgumentException - Thrown if the connector is invalid.CONNECTOR_BEGIN,
CONNECTOR_ENDpublic SpenObjectShapeBase getConnectedObject(int connector)
connector - The connector which is one of CONNECTOR_BEGIN or CONNECTOR_END.null.IllegalArgumentException - Thrown if the connector is invalid.CONNECTOR_BEGIN,
CONNECTOR_ENDpublic void connect(int connector,
SpenObjectShapeBase targetShape,
int indexOfTargetMagneticConnectionPoint)
connector is already connected at indexOfTargetMagneticConnectionPoint position, it
doesn't do anything.connector is already connected to another object, it should be disconnected first and then connect
to the targetShape.
The line can only connect to an object which is appended to the same SpenPageDoc.connector - Connector to connect. It is one of CONNECTOR_BEGIN or CONNECTOR_END.targetShape - Target shape to connect.indexOfTargetMagneticConnectionPoint - Index of the specified magnetic connection point of the target shape.IllegalArgumentException - Thrown if the connector is invalid.targetShape is null.IndexOutOfBoundsException - Thrown if the indexOfTargetMagneticConnectionPoint is negative value or if it is greater
than the number of magnetic connection points of connected shape.IllegalStateException - Thrown if the targetShape isn't appended to the same SpenPageDoc.CONNECTOR_BEGIN,
CONNECTOR_ENDpublic void disconnect(int connector)
connector - Connector to disconnect. It is one of CONNECTOR_BEGIN or CONNECTOR_END.IllegalArgumentException - Thrown if the connector is invalid.CONNECTOR_BEGIN,
CONNECTOR_ENDpublic void copy(SpenObjectBase source)
copy in class SpenObjectShapeBasesource - The source object.IllegalArgumentException - Thrown if the source is null.SpenObjectShapeBase.copy(SpenObjectBase)