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

@AnyLogicInternalAPI
public class ShapeAgentGroup_xjal
extends ShapeGroup
Persistent group of agents shape. Contains a collection of embedded agent presentation shapes. The user can add or remove agents dynamically.
Persistent shapes contained in a group have reference to that group.
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

Constructors 
ShapeAgentGroup_xjal​(Agent presentable)
Constructs an empty group with default attributes.
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods 
void add​(int shape)
Deprecated.
This function is deprecated and will be removed in the next release
void add​(Agent a)  
void add​(Camera3D camera)
Deprecated.
void add​(Light3D light)
Deprecated.
void add​(ReplicatedShape<?> rshape)
Deprecated.
void add​(Shape shape)
Deprecated.
void clear()
Removes all shapes from the group.
SVGElement findSVGElement​(long svgId)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
java.lang.Object get​(int i)
Deprecated.
S get​(Agent a)
Returns the embedded presentation shape shape of the given agent.
java.util.Collection<Agent> getAgents_xjal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. Returns the unsorted collection of agents - may be inconsistent with the real population state because of shape update sequence
int indexOf​(java.lang.Object shape)
Deprecated.
void initialize_xjal​(java.lang.Object... contents)
Deprecated.
void insert​(int index, int shape)
Deprecated.
This function is deprecated and will be removed in the next release
void insert​(int index, ReplicatedShape<?> rshape)
Deprecated.
void insert​(int index, Shape shape)
Deprecated.
boolean remove​(int shape)
Deprecated.
This function is deprecated and will be removed in the next release
boolean remove​(Agent a)
Tries to remove an agent from the group, returns false if the agent was not contained.
boolean remove​(Camera3D camera)
Deprecated.
boolean remove​(Light3D light)
Deprecated.
boolean remove​(ReplicatedShape<?> rshape)
Deprecated.
boolean remove​(Shape shape)
Deprecated.
void resetSVGState()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
int size()
Returns the number of shapes in the group.
boolean updateDynamicPropertiesStructural​(boolean publicOnly)  
Modifier and Type Method Description

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

clone, contains, getPresentable, getRotation, getRotationX, getRotationY, getRotationZ, getShapes, initialize_xjal, onDraw, postSVGShapeSpecificAttributes, restoreOwner, setRotation, setRotationX, setRotationY, setRotationZ, setVisible

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

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

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

executeUserAction, getGroup, getLevel, getName, getScaleX, getScaleY, getSVGId, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, onAggregatorVisibilityChanged, onClick, randomPointInside, randomPointInside, removeSVGFromOwner, removeSVGImage, setLevel, setPublic_xjal, setScale, setScaleX, setScaleY, setX, setY, updateDynamicProperties, updateSVGProperties

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.internal.Child

restoreOwner

Methods inherited from interface com.anylogic.engine.Locatable2D

getX, getY

Constructor Detail

ShapeAgentGroup_xjal

public ShapeAgentGroup_xjal​(Agent presentable)
Constructs an empty group with default attributes.
Parameters:
presentable - the presentable object owning this shape

Method Detail

add

public void add​(Agent a)

remove

public boolean remove​(Agent a)
Tries to remove an agent from the group, returns false if the agent was not contained.
Parameters:
a - the agent to remove
Returns:
true if the group contained the agent, false otherwise

clear

public void clear()
Removes all shapes from the group.

updateDynamicPropertiesStructural

@AnyLogicInternalAPI
public boolean updateDynamicPropertiesStructural​(boolean publicOnly)
Overrides:
updateDynamicPropertiesStructural in class ShapeGroup
Returns:
true if:
1. update was done (usually for visible elements, respecting public flag etc.)
AND
2. further update of structural changes is applicable

size

public int size()
Returns the number of shapes in the group.
Overrides:
size in class ShapeGroup
Returns:
the number of shapes in the group

get

public S get​(Agent a)
Returns the embedded presentation shape shape of the given agent. Returns null if the given agent isn't contained in this shape.
Parameters:
a - the agent
Returns:
the shape

getAgents_xjal

@AnyLogicInternalAPI
public java.util.Collection<Agent> getAgents_xjal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. Returns the unsorted collection of agents - may be inconsistent with the real population state because of shape update sequence

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
Overrides:
resetSVGState in class ShapeGroup

findSVGElement

@AnyLogicInternalAPI
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
Overrides:
findSVGElement in class ShapeGroup

initialize_xjal

@Deprecated
public void initialize_xjal​(java.lang.Object... contents)
Deprecated.

get

@Deprecated
public java.lang.Object get​(int i)
Deprecated.
Description copied from class: ShapeGroup
Returns the shape with the given index. The result may be a shape, replicated shape, 3D light or camera.
Overrides:
get in class ShapeGroup
Parameters:
i - the index of the shape
Returns:
the shape with the given index

indexOf

@Deprecated
public int indexOf​(java.lang.Object shape)
Deprecated.
Description copied from class: ShapeGroup
Returns the index of the specified shape (either object of class Shape, or object of class ReplicatedShape) in this group, or -1 if this group does not contain the shape.
More formally, returns the index i such that get( i ) == shape, or -1 if there is no such index.
Note that implementation of this method is very inefficient (has linear complexity)
Overrides:
indexOf in class ShapeGroup
Parameters:
shape - the shape to find index of
Returns:
the index of the shape or -1

add

@Deprecated
public void add​(Shape shape)
Deprecated.
Description copied from class: ShapeGroup
Adds a persistent shape to the group. Note that it is your responsibility to remove the shape from the another group, if any!
Overrides:
add in class ShapeGroup
Parameters:
shape - the shape to add

add

@Deprecated
public void add​(int shape)
Deprecated.
This function is deprecated and will be removed in the next release

add

@Deprecated
public void add​(ReplicatedShape<?> rshape)
Deprecated.
Description copied from class: ShapeGroup
Adds a replicated shape to the group. Note that it is your responsibility to remove the shape from the another group, if any!
Overrides:
add in class ShapeGroup
Parameters:
rshape - the replicated shape to add

insert

@Deprecated
public void insert​(int index,
                   Shape shape)
Deprecated.
Description copied from class: ShapeGroup
Adds a persistent shape to the group at the specified index (which defines z-order of shape in 2D animation). Note that it is your responsibility to remove the shape from the another group, if any!
Overrides:
insert in class ShapeGroup
Parameters:
index - index at which the specified shape is to be inserted (from 0 to size(), inclusive)
shape - the shape to add

insert

@Deprecated
public void insert​(int index,
                   int shape)
Deprecated.
This function is deprecated and will be removed in the next release

insert

@Deprecated
public void insert​(int index,
                   ReplicatedShape<?> rshape)
Deprecated.
Description copied from class: ShapeGroup
Adds a replicated shape to the group at the specified index (which defines z-order of shape in 2D animation). Note that it is your responsibility to remove the shape from the another group, if any!
Overrides:
insert in class ShapeGroup
Parameters:
index - index at which the specified shape is to be inserted (from 0 to size(), inclusive)
rshape - the replicated shape to add

remove

@Deprecated
public boolean remove​(Shape shape)
Deprecated.
Description copied from class: ShapeGroup
Tries to remove a persistent shape from the group, returns false if the shape was not contained.
Overrides:
remove in class ShapeGroup
Parameters:
shape - the shape to remove
Returns:
true if the group contained the shape, false otherwise

remove

@Deprecated
public boolean remove​(int shape)
Deprecated.
This function is deprecated and will be removed in the next release

remove

@Deprecated
public boolean remove​(ReplicatedShape<?> rshape)
Deprecated.
Description copied from class: ShapeGroup
Tries to remove a replicated shape from the group, returns false if the shape was not contained.
Overrides:
remove in class ShapeGroup
Parameters:
rshape - the replicated shape to remove
Returns:
true if the group contained the shape, false otherwise

add

@Deprecated
public void add​(Light3D light)
Deprecated.
Description copied from class: ShapeGroup
Adds a light to the group. Note that it is your responsibility to remove the light from the another group, if any!
Overrides:
add in class ShapeGroup
Parameters:
light - the light to add

remove

@Deprecated
public boolean remove​(Light3D light)
Deprecated.
Description copied from class: ShapeGroup
Tries to remove a light from the group, returns false if the light was not contained.
Overrides:
remove in class ShapeGroup
Parameters:
light - the light to remove
Returns:
true if the group contained the light, false otherwise

add

@Deprecated
public void add​(Camera3D camera)
Deprecated.
Description copied from class: ShapeGroup
Adds a camera to the group. Note that it is your responsibility to remove the camera from the another group, if any!
Overrides:
add in class ShapeGroup
Parameters:
camera - the camera to add

remove

@Deprecated
public boolean remove​(Camera3D camera)
Deprecated.
Description copied from class: ShapeGroup
Tries to remove a camera from the group, returns false if the camera was not contained.
Overrides:
remove in class ShapeGroup
Parameters:
camera - the camera to remove
Returns:
true if the group contained the camera, false otherwise
How can we improve this article?