AnyLogic
Expand
Font size
All Implemented Interfaces:
com.anylogic.engine.internal.Child, Locatable2D, Locatable3D, AggregatableAnimationElement, HasLevel, LevelElement, SVGElement, Serializable, 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

ConstructorDescription
ShapeAgentGroup_xjal(Agent presentable)
Constructs an empty group with default attributes.

Method Summary

Modifier and TypeMethodDescription
voidadd(int shape)
Deprecated.
This function is deprecated and will be removed in the next release
voidadd(Agent a) 
voidadd(Camera3D camera)
Deprecated.
voidadd(Light3D light)
Deprecated.
voidadd(ReplicatedShape<?> rshape)
Deprecated.
voidadd(Shape shape)
Deprecated.
voidclear()
Removes all shapes from the group.
SVGElementfindSVGElement(long svgId)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Objectget(int i)
Deprecated.
com.anylogic.engine.presentation.DynamicSEOPget(Agent a)
Returns the embedded presentation shape shape of the given agent.
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
intindexOf(Object shape)
Deprecated.
voidinitialize_xjal(Object... contents)
Deprecated.
voidinsert(int index, int shape)
Deprecated.
This function is deprecated and will be removed in the next release
voidinsert(int index, ReplicatedShape<?> rshape)
Deprecated.
voidinsert(int index, Shape shape)
Deprecated.
booleanremove(int shape)
Deprecated.
This function is deprecated and will be removed in the next release
booleanremove(Agent a)
Tries to remove an agent from the group, returns false if the agent was not contained.
booleanremove(Camera3D camera)
Deprecated.
booleanremove(Light3D light)
Deprecated.
booleanremove(ReplicatedShape<?> rshape)
Deprecated.
booleanremove(Shape shape)
Deprecated.
voidresetSVGState()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
intsize()
Returns the number of shapes in the group.
booleanupdateDynamicPropertiesStructural(boolean publicOnly) 

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 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 Details

ShapeAgentGroup_xjal

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

Method Details

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 com.anylogic.engine.presentation.DynamicSEOP 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 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(Object... contents)
Deprecated.

get

@Deprecated
public 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(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