com.xj.anylogic.engine.presentation
Class ViewArea

java.lang.Object
  extended by com.xj.anylogic.engine.presentation.ViewArea
All Implemented Interfaces:
com.xj.anylogic.engine.internal.Child, java.io.Serializable

public final class ViewArea
extends java.lang.Object
implements java.io.Serializable, com.xj.anylogic.engine.internal.Child

View area class.
This element references to a particular model animation coordinates of active object/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:
XJ Technologies Company Ltd. www.anylogic.com
See Also:
Serialized Form

Field Summary
static int BOTTOM_LEFT
          Alignment constant.
static int BOTTOM_RIGHT
          Alignment constant.
static int CENTER
          Alignment constant.
static int NONE
          Scaling mode constant.
static int SHRINK_TO_FIT
          Scaling mode constant.
static int SHRINK_TO_HEIGHT
          Scaling mode constant.
static int SHRINK_TO_WIDTH
          Scaling mode constant.
static int SPECIFIED_ZOOM
          Scaling mode constant.
static int TOP_LEFT
          Alignment constant.
static int TOP_RIGHT
          Alignment constant.
static int ZOOM_TO_FIT
          Scaling mode constant.
static int ZOOM_TO_HEIGHT
          Scaling mode constant.
static int ZOOM_TO_WIDTH
          Scaling mode constant.
 
Constructor Summary
ViewArea(Presentable owner, java.lang.String title)
          Constructor, creates new ViewArea with top-left alignment at (0, 0) point and without zoom change.
ViewArea(Presentable owner, java.lang.String title, double x, double y, int alignTo)
          Constructor, creates new ViewArea object referencing to the given coordinates, without zoom change
ViewArea(Presentable owner, java.lang.String title, double x, double y, int alignTo, int scaling, double zoom, double width, double height)
          Constructor, creates new ViewArea with specified parameters
 
Method Summary
 int getAlignTo()
          Returns the view area point alignment
 double getHeight()
          Returns the height of the view area
 int getScaling()
          Returns the scaling type of the view area
 java.lang.String getTitle()
          Returns the title of view area (will be shown in View areas menu)
 double getWidth()
          Returns the width of the view area
 double getX()
          Returns the x coordinate of the view area
 double getY()
          Returns the y coordinate of the view area
 double getZoom()
          Returns the zoom of the view area
 void navigateTo()
          Displays this view area in the model animation panel
 void restoreOwner(java.lang.Object owner)
          This method normally should not be called by user
This method restores owner of this object
The method is used in snapshot saving/loading
 void setAlignTo(int alignTo)
          Sets the view area point alignment
 void setHeight(double height)
          Sets the height of the view area
 void setScaling(int scaling)
          Sets scaling type for this view area
 void setTitle(java.lang.String title)
          Sets the title of view area (will be shown in View areas menu)
 void setWidth(double width)
          Sets the width of the view area
 void setX(double x)
          Sets the x coordinate of the view area
 void setY(double y)
          Sets the y coordinate of the view area
 void setZoom(double zoom)
          Sets the zoom of the view area
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CENTER

public static final int CENTER
Alignment constant.
View area point (x, y) is positioned in the center of the animation panel

See Also:
setAlignTo(int), Constant Field Values

TOP_LEFT

public static final int TOP_LEFT
Alignment constant.
View area point (x, y) is positioned in the top-left corner of the animation panel

See Also:
setAlignTo(int), Constant Field Values

TOP_RIGHT

public static final int TOP_RIGHT
Alignment constant.
View area point (x, y) is positioned in the top-right corner of the animation panel

See Also:
setAlignTo(int), Constant Field Values

BOTTOM_LEFT

public static final int BOTTOM_LEFT
Alignment constant.
View area point (x, y) is positioned in the bottom-left corner of the animation panel

See Also:
setAlignTo(int), Constant Field Values

BOTTOM_RIGHT

public static final int BOTTOM_RIGHT
Alignment constant.
View area point (x, y) is positioned in the bottom-right corner of the animation panel

See Also:
setAlignTo(int), Constant Field Values

NONE

public static final int NONE
Scaling mode constant.
View area near point (x, y), depending on alignTo value, is positioned in the animation panel using current zoom of the animation panel (zoom remains unchanged).

See Also:
setScaling(int), Constant Field Values

SPECIFIED_ZOOM

public static final int SPECIFIED_ZOOM
Scaling mode constant.
View area near point (x, y), depending on alignTo value, is positioned in the animation panel using specified zoom value

See Also:
setScaling(int), Constant Field Values

ZOOM_TO_FIT

public static final int ZOOM_TO_FIT
Scaling mode constant.
The referenced view area (x, y, width, height) is scaled to fit into the animation panel (zoom is reduced or enlarged)

See Also:
setScaling(int), Constant Field Values

ZOOM_TO_WIDTH

public static final int ZOOM_TO_WIDTH
Scaling mode constant.
The referenced view area (x, y, width, height) is scaled to fit into the width of the animation panel (zoom is reduced or enlarged)

See Also:
setScaling(int), Constant Field Values

ZOOM_TO_HEIGHT

public static final int ZOOM_TO_HEIGHT
Scaling mode constant.
The referenced view area (x, y, width, height) is scaled to fit into the height of the animation panel (zoom is reduced or enlarged)

See Also:
setScaling(int), Constant Field Values

SHRINK_TO_FIT

public static final int SHRINK_TO_FIT
Scaling mode constant.
First, zoom is applied to the panel, after that, the referenced view area (x, y, width, height) is scaled down to fit into the animation panel, if needed

See Also:
setScaling(int), Constant Field Values

SHRINK_TO_WIDTH

public static final int SHRINK_TO_WIDTH
Scaling mode constant.
First, zoom is applied to the panel, after that, the referenced view area (x, y, width, height) is scaled down to fit into the width of the animation panel, if needed

See Also:
setScaling(int), Constant Field Values

SHRINK_TO_HEIGHT

public static final int SHRINK_TO_HEIGHT
Scaling mode constant.
First, zoom is applied to the panel, after that, the referenced view area (x, y, width, height) is scaled down to fit into the height of the animation panel, if needed

See Also:
setScaling(int), Constant Field Values
Constructor Detail

ViewArea

public ViewArea(Presentable owner,
                java.lang.String title)
Constructor, creates new ViewArea with top-left alignment at (0, 0) point and without zoom change. Default parameters of created view area:
 x:       0
 y:       0
 alognTo: TOP_LEFT
 scaling: NONE
 zoom:    1.0

Parameters:
owner - the active object or experiment this view area belongs to
title - the title of view area (will be shown in View areas menu)

ViewArea

public ViewArea(Presentable owner,
                java.lang.String title,
                double x,
                double y,
                int alignTo)
Constructor, creates new ViewArea object referencing to the given coordinates, without zoom change

Parameters:
owner - the active object 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
alignTo - the view area point alignment, one of:

ViewArea

public ViewArea(Presentable owner,
                java.lang.String title,
                double x,
                double y,
                int alignTo,
                int scaling,
                double zoom,
                double width,
                double height)
Constructor, creates new ViewArea with specified parameters

Parameters:
owner - the active object 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
alignTo - the view area point alignment, one of:
scaling - the scaling type, one of:
zoom - the zoom level
width - the width of the view area
height - the height of the view area
Method Detail

getTitle

public java.lang.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(java.lang.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

getAlignTo

public int getAlignTo()
Returns the view area point alignment

Returns:
the view area point alignment

setAlignTo

public void setAlignTo(int alignTo)
Sets the view area point alignment

Parameters:
alignTo - the view area point alignment, one of:

getScaling

public int getScaling()
Returns the scaling type of the view area

Returns:
the scaling type of the view area

setScaling

public void setScaling(int scaling)
Sets scaling type for this view area

Parameters:
scaling - the scaling type of the view area, one of:

getZoom

public double getZoom()
Returns the zoom of the view area

Returns:
the zoom of the view area

setZoom

public void setZoom(double zoom)
Sets the zoom of the view area

Parameters:
zoom - the zoom of the view area

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

restoreOwner

public void restoreOwner(java.lang.Object owner)
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.xj.anylogic.engine.internal.Child
Parameters:
owner - owner of this object, usually ActiveObject or Experiment

navigateTo

public void navigateTo()
Displays this view area in the model animation panel



Copyright © 1991-2008 XJ Technlogies. All Rights Reserved.