AnyLogic AnyLogic
Expand
Font size
  • java.lang.Object
    • com.anylogic.engine.markup.AbstractMarkup
All Implemented Interfaces:
AggregatableAnimationElement, SVGElement, java.io.Serializable
Direct Known Subclasses:
GISMarkupElement, MarkupShape

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

Constructor Summary

Constructors 
AbstractMarkup()  
Constructor Description

Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods 
void discardOwner()  
abstract java.lang.RuntimeException error​(java.lang.String errorMessage)  
void executeUserAction​(java.lang.String value)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
SVGElement findSVGElement​(long svgId)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
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.
java.lang.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.
abstract Agent getSpace()
Returns the agent where the markup element is defined
long getSVGId()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
void initializeInternal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
boolean isPublic()
Tests if the markup is public, i.e. if it should be drawn on the agent's parent animation.
boolean isVisible()
Returns the visibility of the markup element.
void onAggregatorInitialized()  
void onAggregatorVisibilityChanged()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
abstract void remove()
Removes the markup element from the presentation, if it is not a part of the presentation, does nothing.
void removeSVGFromOwner​(Shape oldOwner)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
void resetSVGState()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
void setVisible​(boolean v)
Sets the visibility of the markup element.
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.
boolean updateDynamicPropertiesStructural​(boolean publicOnly)  
SVGElement updateSVGProperties​(java.util.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.
Modifier and Type Method Description

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 Detail

AbstractMarkup

public AbstractMarkup()

Method Detail

getName

public java.lang.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 java.lang.RuntimeException error​(java.lang.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​(java.util.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​(java.lang.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
How can we improve this article?