Package com.anylogic.engine.markup
- Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- getName
- getSpace
- remove
- getDrawMode
- setVisible
- isVisible
- isPublic
- initializeInternal
- onAggregatorInitialized
- onAggregatorVisibilityChanged
- updateDynamicProperties
- updateDynamicPropertiesStructural
- error
- getSVGId
- getOrGenerateUSDId
- updateSVGProperties
- resetSVGState
- findSVGElement
- executeUserAction
- discardOwner
- removeSVGFromOwner
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkup
- All Implemented Interfaces:
AggregatableAnimationElement
,SVGElement
,UsdElement
,Serializable
- Direct Known Subclasses:
GISMarkupElement
,MarkupShape
@AnyLogicInternalAPI public abstract class AbstractMarkup extends Object implements Serializable, SVGElement, UsdElement, AggregatableAnimationElement
- See Also:
- Serialized Form
Constructor | Description |
---|---|
AbstractMarkup() |
Modifier and Type | Method | Description |
---|---|---|
void | discardOwner() | |
abstract RuntimeException | error | |
void | executeUserAction |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
SVGElement | findSVGElement |
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. |
String | getName() |
If the markup shape is declared as field in an agent class, e.g.
|
long | getOrGenerateUSDId() | |
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. |
final 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.
|
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 |
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 |
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 | |
SVGElement | updateSVGProperties |
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. |
public AbstractMarkup()
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
This method is designed to be used for debug/development purposes only. It has a very inefficient implementation
#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
public abstract Agent getSpace()
Returns the agent where the markup element is defined
- Returns:
- the agent associated with this element
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.
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.
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
public void setVisible(boolean v)
Sets the visibility of the markup element.
- Parameters:
v
- visibility:true
- visible,false
- not
public boolean isVisible()
Returns the visibility of the markup element.
- Returns:
- visibility:
true
- visible,false
- not
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.
@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.
it may be removed/renamed in future.
- Specified by:
initializeInternal
in interfaceAggregatableAnimationElement
@AnyLogicInternalAPI public void onAggregatorInitialized()
@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.
it may be removed/renamed in future.
- Specified by:
onAggregatorVisibilityChanged
in interfaceAggregatableAnimationElement
@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
Method should be overridden for shapes with dynamic properties. Note that you should call super.updateDynamicProperties() at the end of overridden method
- Parameters:
publicOnly
- iftrue
, the shape is only updated if it is public
@AnyLogicInternalAPI public boolean updateDynamicPropertiesStructural(boolean publicOnly)
- Returns:
true
if update was done (usually for visible elements, respecting public flag etc.)
public abstract RuntimeException error(String errorMessage)
@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.
it may be removed/renamed in future.
- Specified by:
getSVGId
in interfaceSVGElement
@AnyLogicInternalAPI public long getOrGenerateUSDId()
- Specified by:
getOrGenerateUSDId
in interfaceUsdElement
@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.
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 interfaceSVGElement
- Parameters:
output
- the list of commands to add todrawMode
- TODOpublicOnly
- drawing context: if true, only shapes that are marked as public only are updatedowner
- the SVG element that serves as a container for this elementelbehind
- 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 givenowner
when the svg element is added to a different place (e.g. GIS map).
@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.
it may be removed/renamed in future.
- Specified by:
resetSVGState
in interfaceSVGElement
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.
it may be removed/renamed in future.
- Specified by:
findSVGElement
in interfaceSVGElement
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.
it may be removed/renamed in future.
- Specified by:
executeUserAction
in interfaceSVGElement
@AnyLogicInternalAPI public void discardOwner()
@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.
it may be removed/renamed in future.
- Specified by:
removeSVGFromOwner
in interfaceSVGElement
- Parameters:
oldOwner
- may benull