AnyLogic
Expand
Font size
All Implemented Interfaces:
com.anylogic.engine.internal.Child, Serializable

public final class ViewArea
extends Object
implements Serializable, com.anylogic.engine.internal.Child
View area class.
This element references to a particular model animation coordinates of agent/experiment.
Provides ability of fast and convenient animation positioning in the model animation panel (using controls on toolbar or API, see: navigateTo(), Panel#navigateTo(ViewArea)).
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
ViewArea(Presentable owner, String title, double x, double y, double width, double height)
Constructor, creates new ViewArea with specified parameters

Method Summary

Modifier and TypeMethodDescription
doublegetHeight()
Returns the height of the view area
PresentablegetOwner()
Returns agent or experiment object containing this view area.
StringgetTitle()
Returns the title of view area (will be shown in View areas menu)
doublegetWidth()
Returns the width of the view area
doublegetX()
Returns the x coordinate of the view area
doublegetY()
Returns the y coordinate of the view area
voidnavigateTo()
Displays this view area in the model animation panel
voidrestoreOwner(Object owner)
Deprecated.
voidsetHeight(double height)
Sets the height of the view area
voidsetTitle(String title)
Sets the title of view area (will be shown in View areas menu)
voidsetWidth(double width)
Sets the width of the view area
voidsetX(double x)
Sets the x coordinate of the view area
voidsetY(double y)
Sets the y coordinate of the view area

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

ViewArea

public ViewArea(Presentable owner,
 String title,
 double x,
 double y,
 double width,
 double height)
Constructor, creates new ViewArea with specified parameters
Parameters:
owner - the agent or experiment this view area belongs to
title - the title of view area (will be shown in View areas menu)
x - the x coordinate of the view area
y - the x coordinate of the view area
width - the width of the view area
height - the height of the view area

Method Details

getTitle

public String getTitle()
Returns the title of view area (will be shown in View areas menu)
Returns:
the title of view area (will be shown in View areas menu)

setTitle

public void setTitle(String title)
Sets the title of view area (will be shown in View areas menu)
Parameters:
title - the title to set

getX

public double getX()
Returns the x coordinate of the view area
Returns:
the x coordinate of the view area

setX

public void setX(double x)
Sets the x coordinate of the view area
Parameters:
x - the x coordinate to set

getY

public double getY()
Returns the y coordinate of the view area
Returns:
the y coordinate of the view area

setY

public void setY(double y)
Sets the y coordinate of the view area
Parameters:
y - the y coordinate to set

getWidth

public double getWidth()
Returns the width of the view area
Returns:
the width of the view area

setWidth

public void setWidth(double width)
Sets the width of the view area
Parameters:
width - the width of the view area

getHeight

public double getHeight()
Returns the height of the view area
Returns:
the height of the view area

setHeight

public void setHeight(double height)
Sets the height of the view area
Parameters:
height - the height of the view area

getOwner

public Presentable getOwner()
Returns agent or experiment object containing this view area.
Returns:
agent or experiment object containing this view area.
Since:
8.3

restoreOwner

@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
Specified by:
restoreOwner in interface com.anylogic.engine.internal.Child
Parameters:
owner - owner of this object, usually Agent or Experiment