public final class ShapeModelElementsGroup extends ShapeGroup
UNKNOWN_NAME
Constructor and Description |
---|
ShapeModelElementsGroup(Presentable presentable,
ModelElementDescriptor[] elementDescriptors,
java.lang.Object... iconShapes)
Constructs a top-level presentation group with specific attributes
and possibly with some content
|
Modifier and Type | Method and Description |
---|---|
void |
add(Camera3D camera)
Adds a camera to the group.
|
void |
add(Light3D light3d)
Adds a light to the group.
|
void |
add(ReplicatedShape<?> rshape)
Adds a replicated shape to the group.
|
void |
add(Shape shape)
Adds a persistent shape to the group.
|
void |
addInspect(double x,
double y,
Presentable p,
java.lang.String name)
Creates a new ShapeInspect on an object that belongs to a given arbitrary
Presentable (not necessarily the one this shape belongs to), and adds it to this group.
|
void |
addInspect(double x,
double y,
java.lang.String name)
Creates a new ShapeInspect and adds it to this group.
|
static void |
addInspect(ShapeEmbeddedObjectIcon icon)
Is called when a (responsive) custom icon of the EO is being clicked.
|
void |
clear()
Removes all shapes from the group.
|
java.lang.Object |
get(int i)
Returns the shape with the given index.
|
double |
getIconOffsetX() |
double |
getIconOffsetY() |
ShapeEmbeddedObjectIcon |
getOwner()
Returns the owner of this presentation if this is an agent
presentation and it is embedded to another agent
This method returns null in case the agent
is not embedded anywhere or if this is an experiment presentation |
java.util.List<java.lang.Object> |
getShapes()
Returns the collection of shapes in the group (not a copy).
|
int |
indexOf(java.lang.Object shape)
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. |
void |
initialize_xjal(ModelElementDescriptor[] elementDescriptors,
boolean replaceAlways,
boolean replaceWithNotEmpty,
java.lang.Object... contents)
This method is internal and shouldn't be called by user.
|
void |
insert(int index,
ReplicatedShape<?> rshape)
Adds a replicated shape to the group at the specified index (which
defines z-order of shape in 2D animation).
|
void |
insert(int index,
Shape shape)
Adds a persistent shape to the group at the specified index (which
defines z-order of shape in 2D animation).
|
boolean |
remove(Camera3D camera)
Tries to remove a camera from the group,
returns
false if the camera was not contained. |
boolean |
remove(Light3D light3d)
Tries to remove a light from the group,
returns
false if the light was not contained. |
boolean |
remove(ReplicatedShape<?> rshape)
Tries to remove a replicated shape from the group,
returns
false if the shape was not contained. |
boolean |
remove(Shape shape)
Tries to remove a persistent shape from the group,
returns
false if the shape was not contained. |
void |
removeInspect(java.lang.String name) |
void |
setIconOffsets(double x,
double y) |
void |
setOwner_xjal(ShapeEmbeddedObjectIcon owner)
This method shouldn't be called by user.
|
int |
size()
Returns the number of shapes in the group.
|
void |
updateDynamicProperties()
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
|
clone, contains, findSVGElement, getPresentable, getRotation, getRotationX, getRotationY, getRotationZ, initialize_xjal, onDraw, postSVGShapeSpecificAttributes, resetSVGState, restoreOwner, setRotation, setRotationX, setRotationY, setRotationZ, setVisible, updateDynamicPropertiesStructural
canHandleClick, getDrawMode, getScaleZ, getZ, getZOffset, setDrawMode, setPos, setPos, setPos, setScale, setScale, setScaleZ, setZ
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, updateSVGProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getX, getY
initializeInternal, postInitialize
public ShapeModelElementsGroup(Presentable presentable, ModelElementDescriptor[] elementDescriptors, java.lang.Object... iconShapes)
presentable
- the presentable object owning this shapeispublic
- if true
, the shape is visible on container's presentationx
- the x coordinate of groupy
- the y coordinate of groupz
- the z coordinate of grouprotationXY
- the rotation of the group in radianscontents
- the (possibly, empty) initial set of shapes (Shape objects, int ids, ReplicatedShape or Light3D objects)@AnyLogicInternalCodegenAPI public void initialize_xjal(ModelElementDescriptor[] elementDescriptors, boolean replaceAlways, boolean replaceWithNotEmpty, java.lang.Object... contents)
public ShapeEmbeddedObjectIcon getOwner()
null
in case the agent
is not embedded anywhere or if this is an experiment presentation@AnyLogicInternalAPI public void setOwner_xjal(ShapeEmbeddedObjectIcon owner)
@AnyLogicInternalCodegenAPI public void setIconOffsets(double x, double y)
@AnyLogicInternalAPI public double getIconOffsetX()
@AnyLogicInternalAPI public double getIconOffsetY()
public java.util.List<java.lang.Object> getShapes()
ShapeGroup
getShapes
in class ShapeGroup
public int size()
ShapeGroup
size
in class ShapeGroup
public java.lang.Object get(int i)
ShapeGroup
get
in class ShapeGroup
i
- the index of the shapepublic int indexOf(java.lang.Object shape)
ShapeGroup
-1
if this group does not
contain the shape.i
such that
get( i ) == shape
, or -1
if
there is no such index.indexOf
in class ShapeGroup
shape
- the shape to find index of-1
public void add(Shape shape)
ShapeGroup
add
in class ShapeGroup
shape
- the shape to addpublic void add(ReplicatedShape<?> rshape)
ShapeGroup
add
in class ShapeGroup
rshape
- the replicated shape to addpublic void insert(int index, Shape shape)
ShapeGroup
insert
in class ShapeGroup
index
- index at which the specified shape is to be inserted
(from 0
to size()
, inclusive)shape
- the shape to addpublic void insert(int index, ReplicatedShape<?> rshape)
ShapeGroup
insert
in class ShapeGroup
index
- index at which the specified shape is to be inserted
(from 0
to size()
, inclusive)rshape
- the replicated shape to addpublic boolean remove(Shape shape)
ShapeGroup
false
if the shape was not contained.remove
in class ShapeGroup
shape
- the shape to removetrue
if the group contained the shape, false
otherwisepublic boolean remove(ReplicatedShape<?> rshape)
ShapeGroup
false
if the shape was not contained.remove
in class ShapeGroup
rshape
- the replicated shape to removetrue
if the group contained the shape, false
otherwisepublic void clear()
ShapeGroup
clear
in class ShapeGroup
@AnyLogicInternalAPI public void add(Camera3D camera)
ShapeGroup
add
in class ShapeGroup
camera
- the camera to add@AnyLogicInternalAPI public void add(Light3D light3d)
ShapeGroup
add
in class ShapeGroup
light3d
- the light to add@AnyLogicInternalAPI public boolean remove(Camera3D camera)
ShapeGroup
false
if the camera was not contained.remove
in class ShapeGroup
camera
- the camera to removetrue
if the group contained the camera,
false
otherwise@AnyLogicInternalAPI public boolean remove(Light3D light3d)
ShapeGroup
false
if the light was not contained.remove
in class ShapeGroup
light3d
- the light to removetrue
if the group contained the light,
false
otherwisepublic void addInspect(double x, double y, java.lang.String name)
x
- the x coordinate of the ShapeInspecty
- the y coordinate of the ShapeInspectname
- the name of the object being inspectedpublic void addInspect(double x, double y, Presentable p, java.lang.String name)
x
- the x coordinate of the ShapeInspecty
- the y coordinate of the ShapeInspectp
- the Presentable (experiment or agent) where the object belongs toname
- the name of the object being inspectedpublic static void addInspect(ShapeEmbeddedObjectIcon icon)
icon
- the icon being clickedpublic void removeInspect(java.lang.String name)
public void updateDynamicProperties()
Shape
updateDynamicProperties
in class Shape
Copyright © AnyLogic North America, LLC. All Rights Reserved.