JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d
Class JCViewport

java.lang.Object
  |
  +--com.klg.jclass.chart3d.ParentTrackChange
        |
        +--com.klg.jclass.chart3d.JCViewport
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JCViewportJava3d

public class JCViewport
extends ParentTrackChange

The JCViewport class stores information concerning the viewport through which the user views the plotcube. The default viewport is determined by JClass Chart 3D. The user can modify this default by scaling it and translating it within the JCChart3dArea.

See Also:
Serialized Form

Field Summary
protected  double horizontalShift
          Horizontal shift as a multiple of the original viewport size.
static double MAX_VIEW_SCALE
          Maximum scale at which you can zoom the data.
static double MIN_VIEW_SCALE
          Minimum scale at which you can zoom the data.
protected  boolean normalized
          Queries if the viewport is normalized (for example, scale = 1, and shifts = 0).
static int PREVIEW_CUBE
          Does rotation action by drawing a wireframe preview cube (fast drawing).
static int PREVIEW_FULL
          Does rotation action by drawing the full 3D chart.
protected  int previewMethod
          Preview method.
protected  double scale
          Zoom factor.
protected  double verticalShift
          Vertical shift as a multiple of the original viewport size.
 
Fields inherited from class com.klg.jclass.chart3d.ParentTrackChange
parents
 
Constructor Summary
JCViewport()
          No args constructor.
JCViewport(boolean normalized, double scale, double horizontalShift, double verticalShift)
          Constructor that supplies values for normalized, scale, horizontal, and vertical shift.
 
Method Summary
 double getHorizontalShift()
          Returns the horizontal shift as a multiple of the original viewport size.
 int getPreviewMethod()
          Returns the preview method.
 double getScale()
          Gets the scale zoom factor.
 double getVerticalShift()
          Returns the vertical shift as a multiple of the original viewport size.
 boolean isNormalized()
          Asks if the viewport is normalized (for example, scale = 1, and shifts = 0).
 void setHorizontalShift(double horizontalShift)
          Sets the horizontal shift as a multiple of the original viewport size.
 void setNormalized(boolean normalized)
          Sets the normalized value.
 void setPreviewMethod(int previewMethod)
          Sets the preview method.
 void setScale(double scale)
          Sets the zoom factor.
 void setVerticalShift(double verticalShift)
          Sets the vertical shift as a multiple of the original viewport size.
 void setViewport(double scale, double horizontalShift, double verticalShift)
          Set the scale, horizontalShift, and verticalShift in one call.
 
Methods inherited from class com.klg.jclass.chart3d.ParentTrackChange
addParent, clearParents, removeParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREVIEW_CUBE

public static final int PREVIEW_CUBE
Does rotation action by drawing a wireframe preview cube (fast drawing). Applies only to the 2D version of JClass Chart 3D.

See Also:
Constant Field Values

PREVIEW_FULL

public static final int PREVIEW_FULL
Does rotation action by drawing the full 3D chart.

See Also:
Constant Field Values

MAX_VIEW_SCALE

public static final double MAX_VIEW_SCALE
Maximum scale at which you can zoom the data.

See Also:
Constant Field Values

MIN_VIEW_SCALE

public static final double MIN_VIEW_SCALE
Minimum scale at which you can zoom the data.

See Also:
Constant Field Values

normalized

protected boolean normalized
Queries if the viewport is normalized (for example, scale = 1, and shifts = 0).


scale

protected double scale
Zoom factor.


horizontalShift

protected double horizontalShift
Horizontal shift as a multiple of the original viewport size.


verticalShift

protected double verticalShift
Vertical shift as a multiple of the original viewport size.


previewMethod

protected int previewMethod
Preview method. Either a wireframe cube or the complete chart (surface, bar, and so on).

Constructor Detail

JCViewport

public JCViewport()
No args constructor. Values at their default.


JCViewport

public JCViewport(boolean normalized,
                  double scale,
                  double horizontalShift,
                  double verticalShift)
Constructor that supplies values for normalized, scale, horizontal, and vertical shift.
Note: If the supplied normalized value is true, the other three values will not take effect.

Parameters:
normalized - Is the viewport normalized (for example, scale = 1, and shifts = 0)
scale - zoom factor
horizontalShift - horizontal shift as a multiple of the original viewport size
verticalShift - vertical shift as a multiple of the original viewport size
Method Detail

setNormalized

public void setNormalized(boolean normalized)
Sets the normalized value. If normalized is true, the scale, horizontal shift, and vertical shift will be set to their default values. If false, these values can be set to non-default values.

Parameters:
normalized - the new normalized value

isNormalized

public boolean isNormalized()
Asks if the viewport is normalized (for example, scale = 1, and shifts = 0).

Returns:
whether the viewport is normalized or not

setScale

public void setScale(double scale)
Sets the zoom factor. A value less than one means a viewport smaller than the default. A value greater than one means a viewport greater than the default (the graph image will be clipped by the JCChart3dArea).

Parameters:
scale - the new scale zoom factor

getScale

public double getScale()
Gets the scale zoom factor.

Returns:
the current scale zoom factor

setHorizontalShift

public void setHorizontalShift(double horizontalShift)
Sets the horizontal shift as a multiple of the original viewport size.

Parameters:
horizontalShift - the new horizontal shift

getHorizontalShift

public double getHorizontalShift()
Returns the horizontal shift as a multiple of the original viewport size.

Returns:
the current horizontal shift

setVerticalShift

public void setVerticalShift(double verticalShift)
Sets the vertical shift as a multiple of the original viewport size.

Parameters:
verticalShift - the new vertical shift

getVerticalShift

public double getVerticalShift()
Returns the vertical shift as a multiple of the original viewport size.

Returns:
the current vertical shift

setViewport

public void setViewport(double scale,
                        double horizontalShift,
                        double verticalShift)
Set the scale, horizontalShift, and verticalShift in one call.

Parameters:
scale - the new scale
horizontalShift - the new horizontal shift
verticalShift - the new vertical shift

setPreviewMethod

public void setPreviewMethod(int previewMethod)
Sets the preview method. This controls what is drawn as the user rotates the cube interactively. This can either be PREVIEW_CUBE (display a wireframe cube) or PREVIEW_FULL (display the entire surface).

Parameters:
previewMethod - the new preview method

getPreviewMethod

public int getPreviewMethod()
Returns the preview method. This controls what is drawn as the user rotates the cube interactively. This can either be PREVIEW_CUBE (display a wireframe cube) or PREVIEW_FULL (display the entire surface).

Returns:
the current preview method

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