Class Index

Classes


Namespace motigon.figure.Line

Defines a basic line.

Line

Inherited method Summary
void
addDirtyCallback(callback)
Adds a dirty state callback. Dirty state callback receive an event when the style dirty state has been changed. Dirty state changes when changes has been made to the style.
void
Assign the default style to this figure.
void
Copies all properties from an another figure.
Figure
Creates a clone of this figure.
double
Gets the transparency alpha. A value of 0 gives a completely transparent element, while a value of 1 gives a completely opaque figure.
Rectangle
Gets the bounds.
double
Gets the closest offset on the line to the given position.
Point
Gets the closest position on the line to the given position.
Context
Gets the context.
double
Gets the horizontal corner radius.
double
Gets the vertical corner radius.
Connection
Gets the end connection.
Endpoint
Gets the end endpoint.
String
Gets the end endpoint name.
double
Gets the end horizontal position.
double
Gets the end vertical position.
String
Gets the fill color.
String
Gets the gradient color.
Point
Gets the gradient end position.
double
Gets the gradient end radius.
Point
Gets the gradient start position.
double
Gets the gradient start radius.
String
Gets the gradient type.
double
Gets the height.
String
Gets the element current hover type.
String
Gets the hyperlink.
String
Gets the hyperlink title.
String
Gets the line type.
Point
Gets the local position from the provided figure container screen position.
Point
getOffsetPoint(offset)
Gets the position at the given offset.
double
Gets the rotation in degrees.
Rectangle
Gets the screen bounds. This method calculates the figure bounds relative to the figure container.
Point
Gets the figure container screen position from the provided local position.
double
Gets the shadow blur.
String
Gets the shadow color.
double
Gets the shadow horizontal offset.
double
Gets the shadow vertical offset.
Connection
Gets the start connection.
Endpoint
Gets the start endpoint.
String
Gets the start endpoint name.
double
Gets the start horizontal position.
double
Gets the start vertical position.
String
Gets the stroke color.
String
Gets the stroke style.
double
Gets the stroke width.
Text
Gets the text object.
String
Gets the tooltip.
String
getTypeAt(x, y)
Gets the type at given position.
double
Gets the width.
double
getX()
Gets the left position.
double
getY()
Gets the top position.
boolean
Checks if this element has fill.
boolean
Checks if this element has gradient.
boolean
Checks if this element has a hyperlink.
boolean
Checks if this element has a hyperlink title.
boolean
Checks if this element has shadow.
boolean
Checks if this element has stroke.
boolean
Checks if a text is available.
boolean
Checks if the element has a tooltip.
boolean
Checks if transparency is available.
boolean
Checks if the figure has been modified.
boolean
isHit(x, y)
Checks if is the provided position is within this bounds.
boolean
isNull()
Checks if this is a null line. A line is considered to be a null line if it is so short that is is deemed to be insignificant. Null lines will be removed when drawn using the line tool.
boolean
Checks if is the figure is in read only mode.
boolean
Checks if this element is selectable.
void
Removes the line from its connections. The line will no longer be updated when the figure with its connections are moved.
void
Resets the dirty state of this figure.
Point
resize(dx, dy)
Resize the figure by the given amount. This method will add or subtract the provided values rather than multiplying them.
void
setAlpha(alpha)
Sets the transparency alpha. A value of 0 gives a completely transparent element, while a value of 1 gives a completely opaque figure.
void
Sets up the gradient parameters using automatic rules. The current fill color is transformed into the gradient color by finding the color between the fill color and pure white.
void
setBounds(x, y, width, height)
Sets the bounds using simple types.
void
setContext(context)
Sets the context.
void
setCornerRadius(rx, ry)
Sets the corner radius.
void
Sets the dirty state.
void
setDirty(updateDrawState)
Sets the dirty state.
void
setEnd(x, y)
Sets the end position.
void
setEndConnection(connection)
Sets the end connection.
void
Sets the end endpoint name.
void
setEndX(x)
Sets the end horizontal position.
void
setEndY(y)
Sets the end vertical position.
void
setFillColor(color)
Sets the fill color.
void
setGradientColor(gradientColor)
Sets the gradient color.
void
setGradientEndPoint(gradientEndPoint)
Sets the gradient end position.
void
setGradientEndRadius(gradientEndRadius)
Sets the gradient end radius.
void
setGradientStartPoint(gradientStartPoint)
Sets the gradient start position.
void
setGradientStartRadius(gradientStartRadius)
Sets the gradient start radius.
void
setGradientType(gradientType)
Sets the gradient type.
void
setHeight(height)
Sets the height.
void
setHoverType(hoverType)
Sets the element current hover type.
void
setHyperlink(hyperlink)
Sets the hyperlink.
void
setHyperlinkTitle(hyperlinkTitle)
Sets the hyperlink title.
void
setLineType(lineType)
Sets the line type.
void
setReadOnly(readOnly)
Sets the read only state.
void
setRotation(angle)
Sets the rotation in degrees.
void
setShadow(shadow)
Sets the shadow state.
void
setShadowBlur(shadowBlur)
Sets the shadow blur.
void
setShadowColor(shadowColor)
Sets the shadow color.
void
setShadowOffsetX(shadowOffsetX)
Sets the shadow horizontal offset.
void
setShadowOffsetY(shadowOffsetY)
Sets the shadow vertical offset.
void
setStart(x, y)
Sets the start position.
void
setStartConnection(connection)
Sets the start connection.
void
Sets the start endpoint name.
void
Sets the start horizontal position.
void
Sets the start vertical position.
void
Sets the stroke color.
void
Sets the stroke style.
void
Sets the stroke width.
void
setTooltip(tooltip)
Sets the tooltip.
void
setWidth(width)
Sets the width.
void
setX(x)
Sets the left position.
void
setY(y)
Sets the top position.
void
translate(dx, dy)
Translate (move) the figure by the given amount.
void
translateEnd(dx, dy)
Translates the end position.
void
translateStart(dx, dy)
Translates the start position.
void
Update line position from connections. Looks at the connections assigned to this line, and moves the line endpoints according to the current position of the connections.
Inherited method Detail
addDirtyCallback(callback)
Adds a dirty state callback. Dirty state callback receive an event when the style dirty state has been changed. Dirty state changes when changes has been made to the style.
Parameters:
{function()} callback
the callback
Returns:
{void}

assignDefaultStyle()
Assign the default style to this figure.
Returns:
{void}

assignProperties(figure)
Copies all properties from an another figure.
Parameters:
{Figure} figure
the source figure
Returns:
{void}

cloneFigure()
Creates a clone of this figure.
Returns:
{Figure}

getAlpha()
Gets the transparency alpha. A value of 0 gives a completely transparent element, while a value of 1 gives a completely opaque figure.
Returns:
{double}

getBounds()
Gets the bounds.
Returns:
{Rectangle}

getClosestOffset(x, y)
Gets the closest offset on the line to the given position.
Parameters:
{double} x
the horizontal position
{double} y
the vertical position
Returns:
{double}

getClosestPoint(x, y)
Gets the closest position on the line to the given position.
Parameters:
{double} x
the horizontal position
{double} y
the vertical position
Returns:
{Point}

getContext()
Gets the context.
Returns:
{Context}

getCornerRadiusX()
Gets the horizontal corner radius.
Returns:
{double}

getCornerRadiusY()
Gets the vertical corner radius.
Returns:
{double}

getEndConnection()
Gets the end connection.
Returns:
{Connection}

getEndEndpoint()
Gets the end endpoint.
Returns:
{Endpoint}

getEndEndpointName()
Gets the end endpoint name.
Returns:
{String}

getEndX()
Gets the end horizontal position.
Returns:
{double}

getEndY()
Gets the end vertical position.
Returns:
{double}

getFillColor()
Gets the fill color.
Returns:
{String}

getGradientColor()
Gets the gradient color.
Returns:
{String}

getGradientEndPoint()
Gets the gradient end position.
Returns:
{Point}

getGradientEndRadius()
Gets the gradient end radius.
Returns:
{double}

getGradientStartPoint()
Gets the gradient start position.
Returns:
{Point}

getGradientStartRadius()
Gets the gradient start radius.
Returns:
{double}

getGradientType()
Gets the gradient type.
Returns:
{String}

getHeight()
Gets the height.
Returns:
{double}

getHoverType()
Gets the element current hover type.
Returns:
{String}

getHyperlink()
Gets the hyperlink.
Returns:
{String}

getHyperlinkTitle()
Gets the hyperlink title.
Returns:
{String}

getLineType()
Gets the line type.
Returns:
{String}

getLocalPointFromScreen(x, y)
Gets the local position from the provided figure container screen position.
Parameters:
{double} x
the horizontal position
{double} y
the vertical position
Returns:
{Point}

getOffsetPoint(offset)
Gets the position at the given offset.
Parameters:
{double} offset
the offset
Returns:
{Point}

getRotation()
Gets the rotation in degrees.
Returns:
{double}

getScreenBounds()
Gets the screen bounds. This method calculates the figure bounds relative to the figure container.
Returns:
{Rectangle}

getScreenPointFromLocal(x, y)
Gets the figure container screen position from the provided local position.
Parameters:
{double} x
the horizontal position
{double} y
the vertical position
Returns:
{Point}

getShadowBlur()
Gets the shadow blur.
Returns:
{double}

getShadowColor()
Gets the shadow color.
Returns:
{String}

getShadowOffsetX()
Gets the shadow horizontal offset.
Returns:
{double}

getShadowOffsetY()
Gets the shadow vertical offset.
Returns:
{double}

getStartConnection()
Gets the start connection.
Returns:
{Connection}

getStartEndpoint()
Gets the start endpoint.
Returns:
{Endpoint}

getStartEndpointName()
Gets the start endpoint name.
Returns:
{String}

getStartX()
Gets the start horizontal position.
Returns:
{double}

getStartY()
Gets the start vertical position.
Returns:
{double}

getStrokeColor()
Gets the stroke color.
Returns:
{String}

getStrokeStyle()
Gets the stroke style.
Returns:
{String}

getStrokeWidth()
Gets the stroke width.
Returns:
{double}

getText()
Gets the text object.
Returns:
{Text}

getTooltip()
Gets the tooltip.
Returns:
{String}

getTypeAt(x, y)
Gets the type at given position.
Parameters:
{double} x
the horizontal position
{double} y
the vertical position
Returns:
{String}

getWidth()
Gets the width.
Returns:
{double}

getX()
Gets the left position.
Returns:
{double}

getY()
Gets the top position.
Returns:
{double}

hasFill()
Checks if this element has fill.
Returns:
{boolean}

hasGradient()
Checks if this element has gradient.
Returns:
{boolean}

hasHyperlink()
Checks if this element has a hyperlink.
Returns:
{boolean}

hasHyperlinkTitle()
Checks if this element has a hyperlink title.
Returns:
{boolean}

hasShadow()
Checks if this element has shadow.
Returns:
{boolean}

hasStroke()
Checks if this element has stroke.
Returns:
{boolean}

hasText()
Checks if a text is available.
Returns:
{boolean}

hasTooltip()
Checks if the element has a tooltip.
Returns:
{boolean}

hasTransparency()
Checks if transparency is available.
Returns:
{boolean}

isDirty()
Checks if the figure has been modified.
Returns:
{boolean}

isHit(x, y)
Checks if is the provided position is within this bounds.
Parameters:
{double} x
the horizontal position
{double} y
the vertical position
Returns:
{boolean}

isNull()
Checks if this is a null line. A line is considered to be a null line if it is so short that is is deemed to be insignificant. Null lines will be removed when drawn using the line tool.
Returns:
{boolean}

isReadOnly()
Checks if is the figure is in read only mode.
Returns:
{boolean}

isSelectable()
Checks if this element is selectable.
Returns:
{boolean}

removeFromConnections()
Removes the line from its connections. The line will no longer be updated when the figure with its connections are moved.
Returns:
{void}

resetDirty()
Resets the dirty state of this figure.
Returns:
{void}
See:
motigon.FigureContainer #resetDirty

resize(dx, dy)
Resize the figure by the given amount. This method will add or subtract the provided values rather than multiplying them.
Parameters:
{double} dx
the horizontal delta
{double} dy
the vertical delta
Returns:
{Point}

setAlpha(alpha)
Sets the transparency alpha. A value of 0 gives a completely transparent element, while a value of 1 gives a completely opaque figure.
Parameters:
{double} alpha
the new transparency alpha
Returns:
{void}

setAutoGradient()
Sets up the gradient parameters using automatic rules. The current fill color is transformed into the gradient color by finding the color between the fill color and pure white.
Returns:
{void}

setBounds(x, y, width, height)
Sets the bounds using simple types.
Parameters:
{double} x
the left position
{double} y
the top position
{double} width
the width
{double} height
the height
Returns:
{void}

setContext(context)
Sets the context.
Parameters:
{Context} context
the new context
Returns:
{void}

setCornerRadius(rx, ry)
Sets the corner radius.
Parameters:
{double} rx
the horizontal corner radius
{double} ry
the vertical corner radius
Returns:
{void}

setDirty()
Sets the dirty state.
Returns:
{void}

setDirty(updateDrawState)
Sets the dirty state.
Parameters:
{boolean} updateDrawState
also update draw dirty state
Returns:
{void}

setEnd(x, y)
Sets the end position.
Parameters:
{double} x
the horizontal position
{double} y
the vertical position
Returns:
{void}

setEndConnection(connection)
Sets the end connection.
Parameters:
{Connection} connection
the new end connection
Returns:
{void}

setEndEndpointName(name)
Sets the end endpoint name.
Parameters:
{String} name
the new end endpoint name
Returns:
{void}

setEndX(x)
Sets the end horizontal position.
Parameters:
{double} x
the new end horizontal position
Returns:
{void}

setEndY(y)
Sets the end vertical position.
Parameters:
{double} y
the new end vertical position
Returns:
{void}

setFillColor(color)
Sets the fill color.
Parameters:
{String} color
the new fill color
Returns:
{void}

setGradientColor(gradientColor)
Sets the gradient color.
Parameters:
{String} gradientColor
the new gradient color
Returns:
{void}

setGradientEndPoint(gradientEndPoint)
Sets the gradient end position.
Parameters:
{Point} gradientEndPoint
the new gradient end position
Returns:
{void}

setGradientEndRadius(gradientEndRadius)
Sets the gradient end radius.
Parameters:
{double} gradientEndRadius
the new gradient end radius
Returns:
{void}

setGradientStartPoint(gradientStartPoint)
Sets the gradient start position.
Parameters:
{Point} gradientStartPoint
the new gradient start position
Returns:
{void}

setGradientStartRadius(gradientStartRadius)
Sets the gradient start radius.
Parameters:
{double} gradientStartRadius
the new gradient start radius
Returns:
{void}

setGradientType(gradientType)
Sets the gradient type.
Parameters:
{String} gradientType
the new gradient type
Returns:
{void}

setHeight(height)
Sets the height.
Parameters:
{double} height
the new height
Returns:
{void}

setHoverType(hoverType)
Sets the element current hover type.
Parameters:
{String} hoverType
the new hover type
Returns:
{void}

setHyperlink(hyperlink)
Sets the hyperlink.
Parameters:
{String} hyperlink
the new hyperlink
Returns:
{void}

setHyperlinkTitle(hyperlinkTitle)
Sets the hyperlink title.
Parameters:
{String} hyperlinkTitle
the new hyperlink title
Returns:
{void}

setLineType(lineType)
Sets the line type.
Parameters:
{String} lineType
the new line type
Returns:
{void}

setReadOnly(readOnly)
Sets the read only state.
Parameters:
{boolean} readOnly
the new read only state
Returns:
{void}

setRotation(angle)
Sets the rotation in degrees.
Parameters:
{double} angle
the angle
Returns:
{void}

setShadow(shadow)
Sets the shadow state.
Parameters:
{boolean} shadow
the new shadow state
Returns:
{void}

setShadowBlur(shadowBlur)
Sets the shadow blur.
Parameters:
{double} shadowBlur
the new shadow blur
Returns:
{void}

setShadowColor(shadowColor)
Sets the shadow color.
Parameters:
{String} shadowColor
the new shadow color
Returns:
{void}

setShadowOffsetX(shadowOffsetX)
Sets the shadow horizontal offset.
Parameters:
{double} shadowOffsetX
the new shadow horizontal offset
Returns:
{void}

setShadowOffsetY(shadowOffsetY)
Sets the shadow vertical offset.
Parameters:
{double} shadowOffsetY
the new shadow vertical offset
Returns:
{void}

setStart(x, y)
Sets the start position.
Parameters:
{double} x
the horizontal position
{double} y
the vertical position
Returns:
{void}

setStartConnection(connection)
Sets the start connection.
Parameters:
{Connection} connection
the new start connection
Returns:
{void}

setStartEndpointName(name)
Sets the start endpoint name.
Parameters:
{String} name
the new start endpoint name
Returns:
{void}

setStartX(x)
Sets the start horizontal position.
Parameters:
{double} x
the new start horizontal position
Returns:
{void}

setStartY(y)
Sets the start vertical position.
Parameters:
{double} y
the new start vertical position
Returns:
{void}

setStrokeColor(color)
Sets the stroke color.
Parameters:
{String} color
the new stroke color
Returns:
{void}

setStrokeStyle(style)
Sets the stroke style.
Parameters:
{String} style
the new stroke style
Returns:
{void}

setStrokeWidth(width)
Sets the stroke width.
Parameters:
{double} width
the new stroke width
Returns:
{void}

setTooltip(tooltip)
Sets the tooltip.
Parameters:
{String} tooltip
the new tooltip
Returns:
{void}

setWidth(width)
Sets the width.
Parameters:
{double} width
the new width
Returns:
{void}

setX(x)
Sets the left position.
Parameters:
{double} x
the new left position
Returns:
{void}

setY(y)
Sets the top position.
Parameters:
{double} y
the new top position
Returns:
{void}

translate(dx, dy)
Translate (move) the figure by the given amount.
Parameters:
{double} dx
the horizontal delta
{double} dy
the vertical delta
Returns:
{void}

translateEnd(dx, dy)
Translates the end position.
Parameters:
{double} dx
the horizontal delta
{double} dy
the vertical delta
Returns:
{void}

translateStart(dx, dy)
Translates the start position.
Parameters:
{double} dx
the horizontal delta
{double} dy
the vertical delta
Returns:
{void}

updateFromConnections()
Update line position from connections. Looks at the connections assigned to this line, and moves the line endpoints according to the current position of the connections.
Returns:
{void}