com.xj.anylogic.engine.presentation
Class ShapeWindow3D

java.lang.Object
  extended by com.xj.anylogic.engine.presentation.Shape
      extended by com.xj.anylogic.engine.presentation.ShapeControl
          extended by com.xj.anylogic.engine.presentation.ShapeWindow3D
All Implemented Interfaces:
com.xj.anylogic.engine.internal.Child, com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal, Locatable2D, java.io.Serializable, java.lang.Cloneable

public class ShapeWindow3D
extends ShapeControl
implements com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal

The window showing 3D world on the model animation.
This is a shape like any control which is located on the model animation canvas. It draws the 3D scene from the field of view of selected camera.
3D window has custom context popup menu with additional items:

Window may be locked with the camera - in this case the point of window follows the camera changes.
Window has several navigation modes:

Author:
XJ Technologies Company Ltd. www.anylogic.com
See Also:
Serialized Form

Field Summary
static int NAVIGATION_FULL
          Navigation is fully allowed
static int NAVIGATION_LIMITED_TO_Z_ABOVE_ZERO
          Navigation is only allowed above Z=0 plane
static int NAVIGATION_NONE
          Navigation is prohibited.
static int NAVIGATION_ROTATION_ONLY
          Navigation mode where user is able to rotate view only.
 
Fields inherited from class com.xj.anylogic.engine.presentation.ShapeControl
TYPE_DOUBLE, TYPE_INT, TYPE_STRING
 
Fields inherited from class com.xj.anylogic.engine.presentation.Shape
UNKNOWN_NAME
 
Constructor Summary
ShapeWindow3D(Presentable p, boolean ispublic, int x, int y, int width, int height, int navigationMode)
          Creates a (persistent) 3d scene window control.
 
Method Summary
 void action()
          Does nothing since 3D Window has no action.
 Camera3D createCamera()
          Returns new instance of Camera3D having camera parameters currently used in this 3D Window
 Element3D_xjal get3DElement_xjal()
          This method is internal and shouldn't be accessed by user.
 javax.swing.JComponent getJComponent()
          Returns the embedded JPanel.
 void set3DElement_xjal(Element3D_xjal element3D)
          This method is internal and shouldn't be accessed by user.
 void setCamera(Camera3D camera)
          Sets the 3D Window to the given camera (and doesn't follow the camera)
 void setCamera(Camera3D camera, boolean follow)
          Sets the 3D Window to the given camera and optionally starts following it.
 void setCamera(Camera3D camera, boolean follow, long transitionTimeout)
          Sets the 3D Window to the given camera and optionally starts following it.
 void setNavigationMode(int mode)
          Sets the navigation mode (the freedom level of camera manipulation using mouse).
 void setValueToDefault()
          Does nothing since window has no default value.
 
Methods inherited from class com.xj.anylogic.engine.presentation.ShapeControl
clone, contains, draw, getHeight, getPresentable, getWidth, isEnabled, onClickAt, restoreOwner, setEnabled, setHeight, setWidth, update
 
Methods inherited from class com.xj.anylogic.engine.presentation.Shape
canHandleClick, getGroup, getName, getRotation, getScaleX, getScaleY, getX, getY, isVisible, onClick, setPos, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAVIGATION_NONE

public static final int NAVIGATION_NONE
Navigation is prohibited.
Default when window is linked with camera.

See Also:
Constant Field Values

NAVIGATION_FULL

public static final int NAVIGATION_FULL
Navigation is fully allowed

See Also:
Constant Field Values

NAVIGATION_LIMITED_TO_Z_ABOVE_ZERO

public static final int NAVIGATION_LIMITED_TO_Z_ABOVE_ZERO
Navigation is only allowed above Z=0 plane

See Also:
Constant Field Values

NAVIGATION_ROTATION_ONLY

public static final int NAVIGATION_ROTATION_ONLY
Navigation mode where user is able to rotate view only.
Can be used when window is linked with camera.

See Also:
Constant Field Values
Constructor Detail

ShapeWindow3D

public ShapeWindow3D(Presentable p,
                     boolean ispublic,
                     int x,
                     int y,
                     int width,
                     int height,
                     int navigationMode)
Creates a (persistent) 3d scene window control.

Parameters:
p - the presentable object owning this control
ispublic - if true, the control is visible on container's presentation
x - the x coordinate
y - the y coordinate
width - the width
height - the height
navigationMode - the navigation mode (the freedom level of camera manipulation using mouse). Supported modes are:
Method Detail

action

public final void action()
Does nothing since 3D Window has no action.

Specified by:
action in class ShapeControl

getJComponent

public javax.swing.JComponent getJComponent()
Returns the embedded JPanel.

Specified by:
getJComponent in class ShapeControl

setValueToDefault

public final void setValueToDefault()
Does nothing since window has no default value.

Overrides:
setValueToDefault in class ShapeControl

setNavigationMode

public void setNavigationMode(int mode)
Sets the navigation mode (the freedom level of camera manipulation using mouse). Supported modes are: If the window is linked with camera (see setCamera(Camera3D, boolean)) and navigation mode isn't supported, the latter will be set to NAVIGATION_NONE

Parameters:
mode - the navigation mode

setCamera

public void setCamera(Camera3D camera)
Sets the 3D Window to the given camera (and doesn't follow the camera)

Parameters:
camera - the camera for the 3D Window

setCamera

public void setCamera(Camera3D camera,
                      boolean follow)
Sets the 3D Window to the given camera and optionally starts following it.

Parameters:
camera - the camera for the 3D Window
follow - if true this window will track camera movements. 'Follow' mode supports only 2 navigation modes: NAVIGATION_NONE and NAVIGATION_ROTATION_ONLY. If navigation mode is not supported, it will be set to NAVIGATION_NONE

setCamera

public void setCamera(Camera3D camera,
                      boolean follow,
                      long transitionTimeout)
Sets the 3D Window to the given camera and optionally starts following it.

Parameters:
camera - the camera for the 3D Window
follow - if true this window will track camera movements. 'Follow' mode supports only 2 navigation modes: NAVIGATION_NONE and NAVIGATION_ROTATION_ONLY. If navigation mode is not supported, it will be set to NAVIGATION_NONE
transitionTimeout - if non-zero, then the current camera position and orientation will evolve to the given camera during the given timeout of real milliseconds (i.e. not model-time units)

createCamera

public Camera3D createCamera()
Returns new instance of Camera3D having camera parameters currently used in this 3D Window

Returns:
new instance on each call

get3DElement_xjal

public Element3D_xjal get3DElement_xjal()
Description copied from interface: com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal
This method is internal and shouldn't be accessed by user.
It is public due to technical reasons.

Specified by:
get3DElement_xjal in interface com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal

set3DElement_xjal

public void set3DElement_xjal(Element3D_xjal element3D)
Description copied from interface: com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal
This method is internal and shouldn't be accessed by user.
It is public due to technical reasons.

Specified by:
set3DElement_xjal in interface com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal


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