AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, SVGElement, Serializable
Direct Known Subclasses:
GISMarkupElement, MarkupShape

@AnyLogicInternalAPI
public abstract class AbstractMarkup
extends Object
implements Serializable, SVGElement, AggregatableAnimationElement
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
AbstractMarkup() 

Method Summary

Modifier and TypeMethodDescription
voiddiscardOwner() 
abstract RuntimeExceptionerror(String errorMessage) 
voidexecuteUserAction(String value)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
SVGElementfindSVGElement(long svgId)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
ShapeDrawModegetDrawMode()
Returns the draw mode for this markup element.
Either it is drawn in 2D animation only, or in 3D only, or both in 2D and 3D.
StringgetName()
If the markup shape is declared as field in an agent class, e.g.
abstract AgentgetSpace()
Returns the agent where the markup element is defined
longgetSVGId()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
final voidinitializeInternal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
booleanisPublic()
Tests if the markup is public, i.e.
booleanisVisible()
Returns the visibility of the markup element.
voidonAggregatorInitialized() 
voidonAggregatorVisibilityChanged()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
abstract voidremove()
Removes the markup element from the presentation, if it is not a part of the presentation, does nothing.
voidremoveSVGFromOwner(Shape oldOwner)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
voidresetSVGState()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
voidsetVisible(boolean v)
Sets the visibility of the markup element.
voidupdateDynamicProperties()
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties.
booleanupdateDynamicPropertiesStructural(boolean publicOnly) 
SVGElementupdateSVGProperties(List<SVGCommand> output, ShapeDrawMode drawMode, boolean publicOnly, SVGElement owner, SVGElement elbehind)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Updates SVG properties of the element that are then sent to the rendering client.

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

postInitialize

Constructor Details

AbstractMarkup

public AbstractMarkup()

Method Details

getName

public String getName()
If the markup shape is declared as field in an agent class, e.g. if it was drawn in the graphical editor, returns the name of the field, otherwise returns the string #UNKNOWN_NAME. For replicated shapes returns the name of the field with the index of the shape in square brackets.
This method is designed to be used for debug/development purposes only. It has a very inefficient implementation
Returns:
the name of the corresponding field or #UNKNOWN_NAME

getSpace

public abstract Agent getSpace()
Returns the agent where the markup element is defined
Returns:
the agent associated with this element

remove

public abstract void remove()
Removes the markup element from the presentation, if it is not a part of the presentation, does nothing. Please note that removal from presentation does not necessarily mean removing from the model logic as logical networks and routes may have been created before the removal and survive it.

getDrawMode

public ShapeDrawMode getDrawMode()
Returns the draw mode for this markup element.
Either it is drawn in 2D animation only, or in 3D only, or both in 2D and 3D.
Returns:
the draw mode for this shape

setVisible

public void setVisible(boolean v)
Sets the visibility of the markup element.
Parameters:
v - visibility: true - visible, false - not

isVisible

public boolean isVisible()
Returns the visibility of the markup element.
Returns:
visibility: true - visible, false - not

isPublic

public boolean isPublic()
Tests if the markup is public, i.e. if it should be drawn on the agent's parent animation. If the markup is a part of a network, the markup is public only if both the network and the markup itself are public.
Returns:
true if the markup is public, false otherwise.

initializeInternal

@AnyLogicInternalAPI
public final void initializeInternal()
Description copied from interface: AggregatableAnimationElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
initializeInternal in interface AggregatableAnimationElement

onAggregatorInitialized

@AnyLogicInternalAPI
public void onAggregatorInitialized()

onAggregatorVisibilityChanged

@AnyLogicInternalAPI
public void onAggregatorVisibilityChanged()
Description copied from interface: AggregatableAnimationElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
onAggregatorVisibilityChanged in interface AggregatableAnimationElement

updateDynamicProperties

@AnyLogicInternalCodegenAPI
public void updateDynamicProperties()
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties. Note that you should call super.updateDynamicProperties() at the end of overridden method
Parameters:
publicOnly - if true, the shape is only updated if it is public

updateDynamicPropertiesStructural

@AnyLogicInternalAPI
public boolean updateDynamicPropertiesStructural(boolean publicOnly)
Returns:
true if update was done (usually for visible elements, respecting public flag etc.)

error

public abstract RuntimeException error(String errorMessage)

getSVGId

@AnyLogicInternalAPI
public long getSVGId()
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
getSVGId in interface SVGElement

updateSVGProperties

@AnyLogicInternalAPI
public SVGElement updateSVGProperties(List<SVGCommand> output,
 ShapeDrawMode drawMode,
 boolean publicOnly,
 SVGElement owner,
 SVGElement elbehind)
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Updates SVG properties of the element that are then sent to the rendering client. If the element is not yet in the SVG scene, generates "C" command, if it is there, but some properties are out of date, generates "U" command. If SVG drawing of this element is not needed because of public only settings, or permanently not needed, or not supported yet, returns false and does nothing.
Specified by:
updateSVGProperties in interface SVGElement
Parameters:
output - the list of commands to add to
drawMode - TODO
publicOnly - drawing context: if true, only shapes that are marked as public only are updated
owner - the SVG element that serves as a container for this element
elbehind - the SVG element behind this one, or null if none or if order is irrelevant
Returns:
the actual owner this element has been added to or null if element is not drawn (e.g. drawing of this element is not needed because of public only settings, permanently not needed or not supported - hence SVG id is not set). The actual owner may differ from the given owner when the svg element is added to a different place (e.g. GIS map).

resetSVGState

@AnyLogicInternalAPI
public void resetSVGState()
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
resetSVGState in interface SVGElement

findSVGElement

public SVGElement findSVGElement(long svgId)
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
findSVGElement in interface SVGElement

executeUserAction

public void executeUserAction(String value)
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
executeUserAction in interface SVGElement

discardOwner

@AnyLogicInternalAPI
public void discardOwner()

removeSVGFromOwner

@AnyLogicInternalAPI
public void removeSVGFromOwner(Shape oldOwner)
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
removeSVGFromOwner in interface SVGElement
Parameters:
oldOwner - may be null