JClass DesktopViews 6.3.0 API
Documentation

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

java.lang.Object
  |
  +--com.klg.jclass.chart3d.j2d.actions.BaseAction
All Implemented Interfaces:
JCAction, Serializable
Direct Known Subclasses:
CancelAction, CustomizeAction, EditAction, PickAction, ResetAction, RotateAction, ScaleAction, SwitchRotateAnyAction, SwitchRotateEyeAction, SwitchRotateXAction, SwitchRotateYAction, SwitchRotateZAction, TranslateAction, ZoomAction

public abstract class BaseAction
extends Object
implements JCAction, Serializable

BaseAction is an abstract base class for the Java2D 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.JCChart3dArea chart3dArea
          Parent object on which the action occurs.
protected  boolean enabled
          Is this action enabled
static int NONE
           
static int START
           
protected  int status
           
 
Constructor Summary
BaseAction()
          Constructs an action handler.
 
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 drawPreview(double scale, double horizShift, double vertShift, double xRotation, double yRotation, double zRotation, int axisId, int x, int y, boolean isRotation)
          Draws either the preview cube or the full chart 3D depending on the value of the viewport's preview method.
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 with which this action handler is associated.
 com.klg.jclass.chart3d.JCChart3dArea getChart3dArea()
          Returns the parent JCChart3dArea object
 void initialize(Object object)
          Called by JCChart3dArea when the action is initialized.
 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
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

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 an action handler. 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?

drawPreview

protected void drawPreview(double scale,
                           double horizShift,
                           double vertShift,
                           double xRotation,
                           double yRotation,
                           double zRotation,
                           int axisId,
                           int x,
                           int y,
                           boolean isRotation)
Draws either the preview cube or the full chart 3D depending on the value of the viewport's preview method.

Parameters:
scale - The scale of the preview cube
horizShift - The horizontal shift of the preview cube
vertShift - The vertical shift of the preview cube
xRotation - The x rotation angle to draw the preview cube
yRotation - The y rotation angle to draw the preview cube
zRotation - The z rotation angle to draw the preview cube
axisId - The type of rotation
x - The current mouse x position (needed for EYE rotations)
y - The current mouse y position (needed for EYE rotations)
isRotation - Is the current action a rotation?

initialize

public void initialize(Object object)
Description copied from interface: JCAction
Called by JCChart3dArea when the action is initialized.

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 event for the 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 event for the 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 event for the 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 with which this action handler is associated.

Returns:
The parent JCChart3d object

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