AnyLogic
Expand
Font size
All Implemented Interfaces:
com.anylogic.engine.internal.Child, Locatable2D, Locatable3D, AggregatableAnimationElement, HasLevel, LevelElement, SVGElement, Segment2D, Segment3D, Serializable, Cloneable

public class ShapeArrowLine
extends ShapeLine
A line shape with optional arrows. The arrows may be set at the beginning of the line, at the end, or both. An arrow can optionally be offset from the beginning or end e.g. positioned in the middle. The style and size of the arrows is set up manually and is not automatically adjusted to the line width.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Field Summary

Fields inherited from class com.anylogic.engine.presentation.Shape3D

UNKNOWN_NAME

Constructor Summary

ConstructorDescription
ShapeArrowLine()
Constructs an arrow line with the default attributes (no arrows).
ShapeArrowLine(ShapeDrawMode drawMode, boolean ispublic, double x, double y, double z, Paint color, double dx, double dy, double dz, double width, double zHeight, LineStyle style, LineArrowStyle beginArrowStyle, double beginArrowOffset, double beginArrowLength, double beginArrowWidth, LineArrowStyle endArrowStyle, double endArrowOffset, double endArrowLength, double endArrowWidth)
Constructs an arrow line with specific attributes and arrows.

Method Summary

Modifier and TypeMethodDescription
floatgetBeginArrowLength()
Returns the begin arrow length.
floatgetBeginArrowOffset()
Returns the begin arrow offset, 0..1.
LineArrowStylegetBeginArrowStyle()
Returns the begin arrow style, one of LineArrowStyle.
floatgetBeginArrowWidth()
Returns the begin arrow width.
floatgetEndArrowLength()
Returns the end arrow length.
floatgetEndArrowOffset()
Returns the end arrow offset, 0..1.
LineArrowStylegetEndArrowStyle()
Returns the end arrow style, one of LineArrowStyle.
floatgetEndArrowWidth()
Returns the end arrow width.
voidsetBeginArrowLength(double beginArrowLength)
Sets the begin arrow length.
voidsetBeginArrowOffset(double beginArrowOffset)
Sets the offset of the begin arrow from the beginning of the line in the form of a fraction of the line length.
voidsetBeginArrowStyle(LineArrowStyle beginArrowStyle)
Sets the begin arrow style.
voidsetBeginArrowWidth(double beginArrowWidth)
Sets the end arrow width.
voidsetEndArrowLength(double endArrowLength)
Sets the end arrow length.
voidsetEndArrowOffset(double endArrowOffset)
Sets the offset of the end arrow from the beginning of the line in the form of a fraction of the line length.
voidsetEndArrowStyle(LineArrowStyle endArrowStyle)
Sets the end arrow style.
voidsetEndArrowWidth(double endArrowWidth)
Sets the end arrow width.

Methods inherited from class com.anylogic.engine.presentation.Shape3D

canHandleClick, getDrawMode, getScaleZ, getZ, setDrawMode, setPos, setPos, setPos, setRotation, setScale, setScale, setScaleZ, setZ

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, postInitialize

Methods inherited from interface com.anylogic.engine.Segment2D

getX, getY

Methods inherited from interface com.anylogic.engine.Segment3D

getZ

Constructor Details

ShapeArrowLine

public ShapeArrowLine()
Constructs an arrow line with the default attributes (no arrows).

ShapeArrowLine

public ShapeArrowLine(ShapeDrawMode drawMode,
 boolean ispublic,
 double x,
 double y,
 double z,
 Paint color,
 double dx,
 double dy,
 double dz,
 double width,
 double zHeight,
 LineStyle style,
 LineArrowStyle beginArrowStyle,
 double beginArrowOffset,
 double beginArrowLength,
 double beginArrowWidth,
 LineArrowStyle endArrowStyle,
 double endArrowOffset,
 double endArrowLength,
 double endArrowWidth)
Constructs an arrow line with specific attributes and arrows.
Parameters:
drawMode - where to draw this shape: 2D, 3D or 2D+3D
ispublic - if true, the shape is visible on container's presentation
x - the x coordinate of the line start point
y - the y coordinate of the line start point
z - the z coordinate of the line start point
color - color (or Texture) of the line
dx - the difference of x coordinates of the line end and start points
dy - the difference of y coordinates of the line end and start points
dz - the difference of z coordinates of the line end and start points
width - the line width
zHeight - the height of a line along Z-axis
style - the line stroke style (only solid is supported)
beginArrowStyle - the style of the start arrow, default value is ARROW_NONE
beginArrowOffset - the offset of the start arrow (0..1, where 0=start of line), default value is 0
beginArrowLength - the length factor of the start arrow, it is multiplied by line width to obtain arrow figure length, default value is 4
beginArrowWidth - the width factor of the start arrow, it is multiplied by line width to obtain arrow figure width, default value is 3
endArrowStyle - the style of the start arrow, default value is ARROW_NONE
endArrowOffset - the offset of the start arrow (0..1, where 0=start of line), default value is 0
endArrowLength - the length factor of the start arrow, it is multiplied by line width to obtain arrow figure length, default value is 4
endArrowWidth - the width factor of the start arrow, it is multiplied by line width to obtain arrow figure width, default value is 3

Method Details

setBeginArrowStyle

public void setBeginArrowStyle(LineArrowStyle beginArrowStyle)
Sets the begin arrow style.
Overrides:
setBeginArrowStyle in class ShapeLine
Parameters:
beginArrowStyle - one of LineArrowStyle

setBeginArrowOffset

public void setBeginArrowOffset(double beginArrowOffset)
Sets the offset of the begin arrow from the beginning of the line in the form of a fraction of the line length. The direction of the arrow will be towards the beginning of the line regardless the offset.
Overrides:
setBeginArrowOffset in class ShapeLine
Parameters:
beginArrowOffset - the offset, 0..1

setBeginArrowLength

public void setBeginArrowLength(double beginArrowLength)
Sets the begin arrow length. If the total line length is less than the arrow length, the arrow is not drawn.
Overrides:
setBeginArrowLength in class ShapeLine
Parameters:
beginArrowLength - the begin arrow length.

setBeginArrowWidth

public void setBeginArrowWidth(double beginArrowWidth)
Sets the end arrow width.
Overrides:
setBeginArrowWidth in class ShapeLine
Parameters:
endArrowWidth - the end arrow width.

setEndArrowStyle

public void setEndArrowStyle(LineArrowStyle endArrowStyle)
Sets the end arrow style.
Overrides:
setEndArrowStyle in class ShapeLine
Parameters:
endArrowStyle - one of LineArrowStyle

setEndArrowOffset

public void setEndArrowOffset(double endArrowOffset)
Sets the offset of the end arrow from the beginning of the line in the form of a fraction of the line length. The direction of the arrow will be towards the end of the line regardless the offset.
Overrides:
setEndArrowOffset in class ShapeLine
Parameters:
endArrowOffset - the offset, 0..1

setEndArrowLength

public void setEndArrowLength(double endArrowLength)
Sets the end arrow length. If the total line length is less than the arrow length, the arrow is not drawn.
Overrides:
setEndArrowLength in class ShapeLine
Parameters:
endArrowLength - the end arrow length.

setEndArrowWidth

public void setEndArrowWidth(double endArrowWidth)
Sets the end arrow width.
Overrides:
setEndArrowWidth in class ShapeLine
Parameters:
endArrowWidth - the end arrow width.

getBeginArrowStyle

public LineArrowStyle getBeginArrowStyle()
Returns the begin arrow style, one of LineArrowStyle.
Overrides:
getBeginArrowStyle in class ShapeLine
Returns:
the begin arrow style

getBeginArrowOffset

public float getBeginArrowOffset()
Returns the begin arrow offset, 0..1.
Overrides:
getBeginArrowOffset in class ShapeLine
Returns:
the begin arrow offset

getBeginArrowLength

public float getBeginArrowLength()
Returns the begin arrow length.
Overrides:
getBeginArrowLength in class ShapeLine
Returns:
the begin arrow length

getBeginArrowWidth

public float getBeginArrowWidth()
Returns the begin arrow width.
Overrides:
getBeginArrowWidth in class ShapeLine
Returns:
the begin arrow width

getEndArrowStyle

public LineArrowStyle getEndArrowStyle()
Returns the end arrow style, one of LineArrowStyle.
Overrides:
getEndArrowStyle in class ShapeLine
Returns:
the end arrow style

getEndArrowOffset

public float getEndArrowOffset()
Returns the end arrow offset, 0..1.
Overrides:
getEndArrowOffset in class ShapeLine
Returns:
the end arrow offset

getEndArrowLength

public float getEndArrowLength()
Returns the end arrow length.
Overrides:
getEndArrowLength in class ShapeLine
Returns:
the end arrow length

getEndArrowWidth

public float getEndArrowWidth()
Returns the end arrow width.
Overrides:
getEndArrowWidth in class ShapeLine
Returns:
the end arrow width