Package com.anylogic.engine.presentation
          - Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
    - size
- indexOf
- get
- iterator
- stream
- getReplication
- getShapeClass
- createShapeWithStaticProperties_xjal
- setShapeDynamicProperties_xjal
- removeSVGFromOwner
- getGroup
- contains
- updateDynamicPropertiesStructural
- createShapes
- restoreOwner
- clone
- getLevel
- setLevel
- onAggregatorVisibilityChanged
- getSVGId
- getOrGenerateUSDId
- updateSVGProperties
- resetSVGState
- findSVGElement
- executeUserAction
- isOnly3D
- getGroupOrOwner
- getPresentable
- getSVGComponent
 
- java.lang.Object
- com.anylogic.engine.presentation.ReplicatedShape<T>
- All Implemented Interfaces:
- com.anylogic.engine.internal.Child,- AggregatableAnimationElement,- HasLevel,- LevelElement,- SVGElement,- UsdElement,- Serializable,- Cloneable,- Iterable<T>
public abstract class ReplicatedShape<T extends Shape> extends Object implements Serializable, Cloneable, com.anylogic.engine.internal.Child, SVGElement, UsdElement, Iterable<T>, LevelElement
Persistent replicated shape - a container for a number of shapes of the 
 same type but possibly different properties. Both the number of shapes
 and their properties may change dynamically.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
| Constructor | Description | 
|---|---|
| ReplicatedShape() | 
| Modifier and Type | Method | Description | 
|---|---|---|
| final ReplicatedShape<T> | clone() | Creates and returns a copy of this replicated shape (i.e. | 
| boolean | contains | Tests if any of the shapes in this replicated shape contains the point
 with the given coordinates | 
| int | createShapes() | Creates missing and removes redundant shapes so that current number of
 shapes in this replicated shape equals value returned by
  getReplication() | 
| abstract T | createShapeWithStaticProperties_xjal | Creates a new shape with static properties already set. | 
| 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. | 
| T | get | Returns the shape with the given index. Number of shapes is maintained to be equal with getReplication(): shapes are
 created/deleted automatically during frame drawing requests or by explicitcreateShapes()call. | 
| ShapeGroup | getGroup() | Returns the group containing this replicated shape. | 
| Shape | getGroupOrOwner() | |
| Level | getLevel() | Returns the level containing this shape. | 
| long | getOrGenerateUSDId() | |
| Presentable | getPresentable() | |
| abstract int | getReplication() | Returns the current number of shapes in replicated shape. | 
| abstract Class<T> | getShapeClass() | Returns the class of shapes in replicated shape. | 
| com.anylogic.engine.internal.presentation.ISVGComponent | getSVGComponent() | |
| long | getSVGId() | This method is internal and shouldn't be called by user. it may be removed/renamed in future. | 
| int | indexOf | Returns the index of a given shape in this replicated shape. | 
| boolean | isOnly3D() | This method is internal and shouldn't be called by user. it may be removed/renamed in future. | 
| Iterator<T> | iterator() | Returns iterator over shapes created so far. Number of shapes is maintained to be equal with getReplication(): shapes are
 created/deleted automatically during frame drawing requests or by explicitcreateShapes()call. | 
| void | onAggregatorVisibilityChanged() | This method is internal and shouldn't be called by user. it may be removed/renamed in future. | 
| 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 | restoreOwner | Deprecated. | 
| void | setLevel | This method is internal and shouldn't be called by user. it may be removed/renamed in future. | 
| void | setShapeDynamicProperties_xjal | Sets the dynamic properties of a shape with the given index. | 
| int | size() | Returns the current number of shapes, which may not always equal to 
 what is returned by getReplication(). | 
| Stream<T> | stream() | |
| final void | updateDynamicPropertiesStructural | Updates dynamic properties of the replicated shape in a given context, adding and 
 removing the shapes as needed. | 
| 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 ReplicatedShape()
public int size()
Returns the current number of shapes, which may not always equal to 
 what is returned by getReplication().
- Returns:
- the current number of shapes
public int indexOf(T shape) 
Returns the index of a given shape in this replicated shape.
- Parameters:
- shape- the shape
- Returns:
- the index of the shape, -1if the shape is not in this replicated shape
public T get(int i) 
Returns the shape with the given index.
Number of shapes is maintained to be equal with
Number of shapes is maintained to be equal with
getReplication(): shapes are
 created/deleted automatically during frame drawing requests or by explicit
 createShapes() call.- Parameters:
- i- the index
- Returns:
- the shape with the given index
public Iterator<T> iterator()
Returns iterator over shapes created so far.
Number of shapes is maintained to be equal with
Number of shapes is maintained to be equal with
getReplication(): shapes are
 created/deleted automatically during frame drawing requests or by explicit
 createShapes() call.public Stream<T> stream()
public abstract int getReplication()
Returns the current number of shapes in replicated shape. Must be defined
 in a subclass.
public abstract Class<T> getShapeClass()
Returns the class of shapes in replicated shape. Must be defined
 in a subclass.
@AnyLogicInternalCodegenAPI public abstract T createShapeWithStaticProperties_xjal(int index) 
Creates a new shape with static properties already set. Must be defined
 in a subclass.
- Parameters:
- index- the desired shape index
- Returns:
- a new shape
@AnyLogicInternalCodegenAPI public void setShapeDynamicProperties_xjal(T shape, int index) 
Sets the dynamic properties of a shape with the given index. By default
 does nothing.
- Parameters:
- shape- the shape
- index- the shape index
@AnyLogicInternalAPI public void removeSVGFromOwner(Shape oldOwner) 
Description copied from interface: 
SVGElementThis 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:
- removeSVGFromOwnerin interface- SVGElement
public ShapeGroup getGroup()
Returns the group containing this replicated shape.
- Returns:
- the group containing this replicated shape
public boolean contains(double px, double py) 
Tests if any of the shapes in this replicated shape contains the point
 with the given coordinates
- Parameters:
- px- the x coordinate of the click
- py- the y coordinate of the click
- Returns:
- trueif if any of the shapes in this replicated shape contains the point,- falseotherwise
@AnyLogicInternalAPI public final void updateDynamicPropertiesStructural(boolean publicOnly) 
Updates dynamic properties of the replicated shape in a given context, adding and 
 removing the shapes as needed.
- Parameters:
- publicOnly- if- true, the shape is only drawn if it is public
public int createShapes()
Creates missing and removes redundant shapes so that current number of
 shapes in this replicated shape equals value returned by
 
getReplication()- Returns:
- current number of shapes in this replicated shape
@AnyLogicInternalCodegenAPI @Deprecated public void restoreOwner(Object owner) 
Deprecated.
This method normally should not be called by user
This method restores owner of this object
The method is used in snapshot saving/loading
This method restores owner of this object
The method is used in snapshot saving/loading
- Specified by:
- restoreOwnerin interface- com.anylogic.engine.internal.Child
- Parameters:
- owner- owner of this object, usually- Agent,- Experimentor- ShapeGroup
public final ReplicatedShape<T> clone()
Creates and returns a copy of this replicated shape (i.e. new instance).
The returned shape is the object of the same class
All shapes of this replicated shape are cloned respectively
If this shape belongs to some group, its clone will also be added to that group
The clone is created in the context of the same experiment or agent
  
Note that cloning of GIS shape, controls and charts is not supported
The returned shape is the object of the same class
All shapes of this replicated shape are cloned respectively
If this shape belongs to some group, its clone will also be added to that group
The clone is created in the context of the same experiment or agent
Note that cloning of GIS shape, controls and charts is not supported
public Level getLevel()
Returns the level containing this shape.
 The returned value is 
null for shapes in the experiments.@AnyLogicInternalAPI public void setLevel(Level level) 
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. Please use
it may be removed/renamed in future. Please use
Level.add(Shape) instead.- Specified by:
- setLevelin interface- LevelElement
public void onAggregatorVisibilityChanged()
Description copied from interface: 
AggregatableAnimationElementThis 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:
- onAggregatorVisibilityChangedin interface- AggregatableAnimationElement
@AnyLogicInternalAPI public long getSVGId()
Description copied from interface: 
SVGElementThis 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:
- getSVGIdin interface- SVGElement
@AnyLogicInternalAPI public long getOrGenerateUSDId()
- Specified by:
- getOrGenerateUSDIdin interface- UsdElement
@AnyLogicInternalAPI public SVGElement updateSVGProperties(List<SVGCommand> commands, ShapeDrawMode drawMode, boolean publicOnly, SVGElement owner, SVGElement elbehind, boolean isInReplicatedShape) 
Description copied from interface: 
SVGElementThis 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:
- updateSVGPropertiesin interface- SVGElement
- Parameters:
- commands- 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 nullif 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 givenownerwhen the svg element is added to a different place (e.g. GIS map).
@AnyLogicInternalAPI public void resetSVGState(SVGElement elementBeingDeleted, boolean delete, Consumer<SVGCommand> commandOutput) 
Description copied from interface: 
SVGElementThis 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:
- resetSVGStatein interface- SVGElement
@AnyLogicInternalAPI public SVGElement findSVGElement(long svgId) 
Description copied from interface: 
SVGElementThis 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:
- findSVGElementin interface- SVGElement
@AnyLogicInternalAPI public void executeUserAction(String value) 
Description copied from interface: 
SVGElementThis 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:
- executeUserActionin interface- SVGElement
public boolean isOnly3D()
Description copied from interface: 
SVGElementThis 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:
- isOnly3Din interface- SVGElement
@AnyLogicInternalAPI public Shape getGroupOrOwner()
- Specified by:
- getGroupOrOwnerin interface- SVGElement
public Presentable getPresentable()
- Specified by:
- getPresentablein interface- SVGElement
@AnyLogicInternalAPI public com.anylogic.engine.internal.presentation.ISVGComponent getSVGComponent()
- Specified by:
- getSVGComponentin interface- SVGElement