JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d.j3d.actions
Class BaseAction

java.lang.Object
  |
  +--com.klg.jclass.chart3d.j3d.actions.BaseAction
All Implemented Interfaces:
JCAction, Serializable
Direct Known Subclasses:
CustomizeAction, EditAction, PickAction, RotateAction, ScaleAction, TranslateAction

public abstract class BaseAction
extends Object
implements JCAction, Serializable

BaseAction is an abstract base class for the Java3D actions of JCChart 3D. It implements the JCAction interface used for JCChart 3D actions. It defines methods for starting, animating, ending and cancelling an action. JCChart3dArea will create an instance of the appropriate JCAction when an action is started, and will call start(), animate() and end() during mouseDown(), mouseDrag() and mouseUp() respectively. The appropriate JCAction is dependent on the event. A mapping from event to action type is stored the chart's JCActionTable

See Also:
JCAction, JCActionTable, Serialized Form

Field Summary
static int ANIMATING
           
protected  com.klg.jclass.chart3d.j3d.JCChart3dJava3d chart3d
           
protected  com.klg.jclass.chart3d.JCChart3dArea chart3dArea
          Parent object on which the action occurs.
protected  Transform3D currXform
           
protected  boolean enabled
          Is this action enabled
protected  boolean invert
           
protected  Point last
           
static int NONE
           
protected  com.sun.j3d.utils.picking.PickCanvas pickCanvas
           
protected  com.klg.jclass.chart3d.j3d.JCPlotCubeJava3d plotCube
           
static int START
           
protected  int status
           
protected  com.klg.jclass.chart3d.j3d.ActionTransformGroup transformGroup
           
protected  Transform3D transformX
           
protected  Transform3D transformY
           
protected  Vector3d translation
           
protected  TransformGroup ViewerTG
           
protected  com.klg.jclass.chart3d.j3d.JC3DUniverse virtualUniverse
           
protected  double x_factor
           
protected  double y_factor
           
protected  double z_factor
           
 
Constructor Summary
BaseAction()
          Constructs a BaseAction.
 
Method Summary
abstract  void animate(InputEvent event, int x, int y)
          Called by JCChart3dArea when the action is to be animated.
abstract  void cancel()
          Called by JCChart3dArea when the action is cancelled
protected  void doEnd(InputEvent event, int x, int y)
           
protected  void doStart(InputEvent event, int x, int y)
           
abstract  void end(InputEvent event, int x, int y)
          Called by JCChart3dArea when the action is over.
 com.klg.jclass.chart3d.JCChart3d getChart3d()
          Return the JClass Chart 3D object witch which this action handler is associated.
 com.klg.jclass.chart3d.JCChart3dArea getChart3dArea()
          Returns the parent JCChart3dArea object
 double getScaleFactorX()
           
 double getScaleFactorY()
           
 double getScaleFactorZ()
           
 void initialize(Object object)
          Initialize the action with the objects need to carry out the action, such as the chart area, virtualUniverse, plotCube, etc.
 boolean isEnabled()
          Is this action handler enabled?
abstract  void reanimate(int x, int y)
          Called by JCChart3dArea when the chart area has been refreshed and the animation must be redrawn.
 void setChart3dArea(com.klg.jclass.chart3d.JCChart3dArea chart3dArea)
          Sets the parent JCChart3dArea object
 void setEnabled(boolean enabled)
          Sets whether this action handler is enabled
 void setScaleFactorX(double scalefactor)
           
 void setScaleFactorY(double scalefactor)
           
 void setScaleFactorZ(double scalefactor)
           
abstract  void start(InputEvent event, int x, int y)
          Called by JCChart3dArea when the action is started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
See Also:
Constant Field Values

START

public static final int START
See Also:
Constant Field Values

ANIMATING

public static final int ANIMATING
See Also:
Constant Field Values

pickCanvas

protected com.sun.j3d.utils.picking.PickCanvas pickCanvas

transformGroup

protected com.klg.jclass.chart3d.j3d.ActionTransformGroup transformGroup

transformX

protected Transform3D transformX

transformY

protected Transform3D transformY

currXform

protected Transform3D currXform

ViewerTG

protected TransformGroup ViewerTG

last

protected Point last

x_factor

protected double x_factor

y_factor

protected double y_factor

z_factor

protected double z_factor

invert

protected boolean invert

translation

protected Vector3d translation

virtualUniverse

protected com.klg.jclass.chart3d.j3d.JC3DUniverse virtualUniverse

chart3d

protected com.klg.jclass.chart3d.j3d.JCChart3dJava3d chart3d

plotCube

protected com.klg.jclass.chart3d.j3d.JCPlotCubeJava3d plotCube

chart3dArea

protected com.klg.jclass.chart3d.JCChart3dArea chart3dArea
Parent object on which the action occurs.


enabled

protected boolean enabled
Is this action enabled


status

protected int status
Constructor Detail

BaseAction

public BaseAction()
Constructs a BaseAction. Note that it nees to be connected to a JCChart3dArea instance so this needs to be set later.

Method Detail

setChart3dArea

public void setChart3dArea(com.klg.jclass.chart3d.JCChart3dArea chart3dArea)
Sets the parent JCChart3dArea object

Specified by:
setChart3dArea in interface JCAction
Parameters:
chart3dArea - The new JCChart3dArea object

getChart3dArea

public com.klg.jclass.chart3d.JCChart3dArea getChart3dArea()
Returns the parent JCChart3dArea object

Specified by:
getChart3dArea in interface JCAction
Returns:
The current JCChart3dArea object

setEnabled

public void setEnabled(boolean enabled)
Sets whether this action handler is enabled

Parameters:
enabled - Is this action handler enabled?

isEnabled

public boolean isEnabled()
Is this action handler enabled?

Returns:
Is this action handler enabled?

initialize

public void initialize(Object object)
Initialize the action with the objects need to carry out the action, such as the chart area, virtualUniverse, plotCube, etc. These are store in an ActionHandlerParams object.

Specified by:
initialize in interface JCAction
Parameters:
object - Initialization parameters

start

public abstract void start(InputEvent event,
                           int x,
                           int y)
Called by JCChart3dArea when the action is started.

Specified by:
start in interface JCAction
Parameters:
event - The InputEvent that triggered this action
x - The x position to start the action
y - The y position to start the action

animate

public abstract void animate(InputEvent event,
                             int x,
                             int y)
Called by JCChart3dArea when the action is to be animated.

Specified by:
animate in interface JCAction
Parameters:
event - The InputEvent that triggered this action
x - The current x position to animate the action
y - The current y position to animate the action

reanimate

public abstract void reanimate(int x,
                               int y)
Called by JCChart3dArea when the chart area has been refreshed and the animation must be redrawn.

Specified by:
reanimate in interface JCAction
Parameters:
x - The x position to re-animate the action
y - The y position to re-animate the action

end

public abstract void end(InputEvent event,
                         int x,
                         int y)
Called by JCChart3dArea when the action is over.

Specified by:
end in interface JCAction
Parameters:
event - The InputEvent that triggered this action
x - The x position to end the action
y - The y position to end the action

cancel

public abstract void cancel()
Called by JCChart3dArea when the action is cancelled

Specified by:
cancel in interface JCAction

getChart3d

public com.klg.jclass.chart3d.JCChart3d getChart3d()
Return the JClass Chart 3D object witch which this action handler is associated.

Returns:
The part JCChart3d object

setScaleFactorX

public void setScaleFactorX(double scalefactor)

setScaleFactorY

public void setScaleFactorY(double scalefactor)

setScaleFactorZ

public void setScaleFactorZ(double scalefactor)

getScaleFactorX

public double getScaleFactorX()

getScaleFactorY

public double getScaleFactorY()

getScaleFactorZ

public double getScaleFactorZ()

doStart

protected void doStart(InputEvent event,
                       int x,
                       int y)

doEnd

protected void doEnd(InputEvent event,
                     int x,
                     int y)

Copyright © 2004 Quest Software Inc..
All rights reserved.