JClass DesktopViews 6.3.0 API
Documentation

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

java.lang.Object
  |
  +--com.klg.jclass.chart3d.j2d.actions.BaseAction
        |
        +--com.klg.jclass.chart3d.j2d.actions.ScaleAction
All Implemented Interfaces:
JCAction, Serializable

public class ScaleAction
extends BaseAction

Handler object for scale actions within JClass Chart 3D Java2D. When a scale action is started, JCChart3dArea will create an instance of ScaleAction and call start(), animate() and end() at appropriate points. A mapping from event to action type is stored the chart's JCActionTable.

See Also:
JCAction, JCActionTable, BaseAction, Serialized Form

Field Summary
protected  Point first
          Point at which the scale action started
protected  double horizontalShift
          The current horizontal shift value for this action
protected  Point last
          Last point used to do scaling
protected  double origHorizontalShift
          The original horizontal shift value in case this action is cancelled
protected  double origScale
          The original scale value in case this action is cancelled
protected  double origVerticalShift
          The original vertical shift in case this action is cancelled
protected  double scale
          The current scale value for this action
protected  double verticalShift
          The current vertical shift value for this action
 
Fields inherited from class com.klg.jclass.chart3d.j2d.actions.BaseAction
ANIMATING, chart3dArea, enabled, NONE, START, status
 
Constructor Summary
ScaleAction()
          Default constructor
 
Method Summary
 void animate(InputEvent event, int x, int y)
          Called by JCChart3dArea when the action is to be animated.
 void cancel()
          Called by JCChart3dArea when the action is cancelled
 void end(InputEvent event, int x, int y)
          Called by JCChar3dArea when the action is over.
 void reanimate(int x, int y)
          Called by JCChart3dArea when the chart area has been refreshed and the animation must be redrawn.
 void start(InputEvent event, int x, int y)
          Called by JCChart3dArea when the action is started.
 
Methods inherited from class com.klg.jclass.chart3d.j2d.actions.BaseAction
drawPreview, getChart3d, getChart3dArea, initialize, isEnabled, setChart3dArea, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

first

protected Point first
Point at which the scale action started


last

protected Point last
Last point used to do scaling


scale

protected double scale
The current scale value for this action


horizontalShift

protected double horizontalShift
The current horizontal shift value for this action


verticalShift

protected double verticalShift
The current vertical shift value for this action


origScale

protected double origScale
The original scale value in case this action is cancelled


origHorizontalShift

protected double origHorizontalShift
The original horizontal shift value in case this action is cancelled


origVerticalShift

protected double origVerticalShift
The original vertical shift in case this action is cancelled

Constructor Detail

ScaleAction

public ScaleAction()
Default constructor

Method Detail

start

public void start(InputEvent event,
                  int x,
                  int y)
Called by JCChart3dArea when the action is started. For the scale action, this method saves the start point as the anchor for the scale rectangle.

Specified by:
start in interface JCAction
Specified by:
start in class BaseAction
Parameters:
event - The InputEvent that triggered this action
x - The x pixel position where scaling is starting
y - The y pixel position where scaling is starting

animate

public void animate(InputEvent event,
                    int x,
                    int y)
Called by JCChart3dArea when the action is to be animated. For the scale action, the user can control the size of the plotCube view mouse actions.

Specified by:
animate in interface JCAction
Specified by:
animate in class BaseAction
Parameters:
event - The InputEvent that triggered this action
x - The x pixel position where animation is happening
y - The y pixel position where animation is happening

reanimate

public 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
Specified by:
reanimate in class BaseAction
Parameters:
x - The x pixel position where reanimation is happening
y - The y pixel position where reanimation is happening

end

public void end(InputEvent event,
                int x,
                int y)
Called by JCChar3dArea when the action is over. For the scale action, this method takes the start point and the current point and uses them to scale along the horizontal and vertical action axes.

Specified by:
end in interface JCAction
Specified by:
end in class BaseAction
Parameters:
x - The x pixel position where the user finished scaling
y - The y pixel position where the user finished scaling
event - The event for the action

cancel

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

Specified by:
cancel in interface JCAction
Specified by:
cancel in class BaseAction

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