com.steema.teechart
Class Zoom

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.ZoomScroll
          extended by com.steema.teechart.Zoom
All Implemented Interfaces:
java.io.Serializable

public class Zoom
extends ZoomScroll

Title: Zoom class

Description: Used at tChart1.Zoom property, determines mouse zoom attributes.

Copyright (c) 2005-2013 by Steema Software SL. All Rights Reserved.

Company: Steema Software

See Also:
Serialized Form

Nested Class Summary
static class Zoom.ZoomResetStyle
          Active for use when ZoomStyle = ZoomStyle.INCHART_MULTI
Use with ZoomReset property to control which touch
action that resets chart zoom
static class Zoom.ZoomStyle
           
 
Nested classes/interfaces inherited from class com.steema.teechart.ZoomScroll
ZoomScroll.ZoomSnapshot
 
Field Summary
 double animatedFactor
          Controls the animated zoom "speed" (inertia)
protected  ChartPen pen
           
protected  java.util.Vector<ZoomScroll.ZoomSnapshot> zoomAxesHist
           
protected  int zoomCounter
           
protected  boolean zoomed
           
 
Fields inherited from class com.steema.teechart.ZoomScroll
x0, x1, y0, y1
 
Fields inherited from class com.steema.teechart.TeeBase
chart, InternalUse
 
Constructor Summary
Zoom(IBaseChart c)
          Creates a new Zoom instance.
 
Method Summary
 java.util.Vector<ZoomScroll.ZoomSnapshot> addZoomSnapshot()
           
protected  void calcZoomPoints()
           
 void clearZoomHistory()
           
 Rectangle ClipZoomReversibleRectangle()
           
 void draw()
          Displays rectangle while dragging Chart for zoom operation.
 boolean getAllow()
          Allows runtime Zoom by dragging the mouse when true.
 boolean getAnimated()
          Animates Zoom in sequenced steps when true.
 int getAnimatedSteps()
          Determines the number of steps of the animated zooming sequence.
 ChartBrush getBrush()
          Brush used to fill mousedragged zoom area.
 ZoomDirections getDirection()
          The direction of the zoom on a selected area.
 boolean getHistory()
           
 java.util.Vector<ZoomScroll.ZoomSnapshot> getHistorySteps()
           
 int getKeyMask()
          The keyboard button as an extra condition to initiate the zoom.
 int getMinPixels()
          The minimum number of pixels to actuate zoom action.
 int getMouseButton()
          The mousebutton to use for the zoom action.
 ChartPen getPen()
          Pen used to draw surrounding rectangle of zoom area.
 boolean getZoomed()
          Determines if Chart axis scales fit all Chart points or not.
 Zoom.ZoomResetStyle getZoomReset()
          Active for use when ZoomStyle = ZoomStyle.INCHART_MULTI
Gets/Sets the touch action that resets the chart
zoom/scroll.
 Zoom.ZoomStyle getZoomStyle()
           
 java.util.Vector<ZoomScroll.ZoomSnapshot> removeZoomSnapshot()
           
 void setAllow(boolean value)
          Allows runtime Zoom by dragging the mouse when true.
 void setAnimated(boolean value)
          Animates Zoom in sequenced steps when true.
 void setAnimatedSteps(int value)
          Sets the number of steps of the animated zooming sequence.
 void setChart(IBaseChart c)
          Overrides base SetChart method to adjust pen and brush chart properties.
 void setDirection(ZoomDirections value)
          Sets the direction of the zoom on a selected area.
 void setHistory(boolean value)
           
 void setHistorySteps(java.util.Vector<ZoomScroll.ZoomSnapshot> value)
           
 void setKeyMask(int value)
          Sets a keyboard button as an extra condition to initiate the zoom.
 void setMinPixels(int value)
          Sets minimum number of pixels to actuate zoom action.
 void setMouseButton(int value)
          Sets the mousebutton to use for the zoom action.
 void setZoomed(boolean value)
          Set the Chart axis scales to fit all Chart points when true.
 void setZoomReset(Zoom.ZoomResetStyle value)
           
 void setZoomStyle(Zoom.ZoomStyle value)
           
 void undo()
          Rescales the Chart Axis to their Maximum and Minimum values.
 void zoomBackOne()
           
 void zoomPercent(double percentZoom)
          Applies the specified PercentZoom Zoom In/Out to the current Axis scales.
 void zoomRect(Rectangle r)
          Zooms the Chart rectangle.
 
Methods inherited from class com.steema.teechart.ZoomScroll
activate, activate, check, getActive, setActive
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pen

protected ChartPen pen

zoomed

protected boolean zoomed

zoomAxesHist

protected java.util.Vector<ZoomScroll.ZoomSnapshot> zoomAxesHist

zoomCounter

protected int zoomCounter

animatedFactor

public double animatedFactor
Controls the animated zoom "speed" (inertia)

Constructor Detail

Zoom

public Zoom(IBaseChart c)
Creates a new Zoom instance.

Parameters:
c - IBaseChart
Method Detail

addZoomSnapshot

public java.util.Vector<ZoomScroll.ZoomSnapshot> addZoomSnapshot()

clearZoomHistory

public void clearZoomHistory()

removeZoomSnapshot

public java.util.Vector<ZoomScroll.ZoomSnapshot> removeZoomSnapshot()

zoomBackOne

public void zoomBackOne()

getHistory

public boolean getHistory()

setHistory

public void setHistory(boolean value)

getHistorySteps

public java.util.Vector<ZoomScroll.ZoomSnapshot> getHistorySteps()

setHistorySteps

public void setHistorySteps(java.util.Vector<ZoomScroll.ZoomSnapshot> value)

getAllow

public boolean getAllow()
Allows runtime Zoom by dragging the mouse when true.
Default value: true

Returns:
boolean

setAllow

public void setAllow(boolean value)
Allows runtime Zoom by dragging the mouse when true.
Default value: true

Parameters:
value - boolean

getAnimated

public boolean getAnimated()
Animates Zoom in sequenced steps when true.
Default value: false

Returns:
boolean

setAnimated

public void setAnimated(boolean value)
Animates Zoom in sequenced steps when true.
Default value: false

Parameters:
value - boolean

getBrush

public ChartBrush getBrush()
Brush used to fill mousedragged zoom area.

Returns:
ChartBrush

getDirection

public ZoomDirections getDirection()
The direction of the zoom on a selected area.

Example. Horizontal will zoom only on a horizontal plane although the mouse is dragged across a vertical and horizontal plane.
Default value: Both

Returns:
ZoomDirections

setDirection

public void setDirection(ZoomDirections value)
Sets the direction of the zoom on a selected area.

Default value: Both

Parameters:
value - ZoomDirections

getAnimatedSteps

public int getAnimatedSteps()
Determines the number of steps of the animated zooming sequence.
Large number of steps can delay zooming. The Animated property should be true.
Default value: 8

Returns:
int

setAnimatedSteps

public void setAnimatedSteps(int value)
Sets the number of steps of the animated zooming sequence.
Large number of steps can delay zooming. The Animated property should be true.
Default value: 8

Parameters:
value - int

getKeyMask

public int getKeyMask()
The keyboard button as an extra condition to initiate the zoom.
Default value: None

Returns:
int

setKeyMask

public void setKeyMask(int value)
Sets a keyboard button as an extra condition to initiate the zoom.
Default value: None

Parameters:
value - int

getMinPixels

public int getMinPixels()
The minimum number of pixels to actuate zoom action.
Default value: 16

Returns:
int

setMinPixels

public void setMinPixels(int value)
Sets minimum number of pixels to actuate zoom action.
Default value: 16

Parameters:
value - int

getMouseButton

public int getMouseButton()
The mousebutton to use for the zoom action.
Note that Scroll action uses the right (Right) mousebutton as default.
Default value: Left

Returns:
int

setMouseButton

public void setMouseButton(int value)
Sets the mousebutton to use for the zoom action.
Default value: Left

Parameters:
value - int

getZoomReset

public Zoom.ZoomResetStyle getZoomReset()
Active for use when ZoomStyle = ZoomStyle.INCHART_MULTI
Gets/Sets the touch action that resets the chart
zoom/scroll.
Default value: ZoomResetStyle.DOUBLETAP


setZoomReset

public void setZoomReset(Zoom.ZoomResetStyle value)

getPen

public ChartPen getPen()
Pen used to draw surrounding rectangle of zoom area.

Returns:
ChartPen

zoomRect

public void zoomRect(Rectangle r)
Zooms the Chart rectangle. Units pixels.

Parameters:
r - Rectangle

ClipZoomReversibleRectangle

public Rectangle ClipZoomReversibleRectangle()

calcZoomPoints

protected void calcZoomPoints()

draw

public void draw()
Displays rectangle while dragging Chart for zoom operation.


setChart

public void setChart(IBaseChart c)
Overrides base SetChart method to adjust pen and brush chart properties.

Overrides:
setChart in class TeeBase
Parameters:
c - IBaseChart

undo

public void undo()
Rescales the Chart Axis to their Maximum and Minimum values.


getZoomed

public boolean getZoomed()
Determines if Chart axis scales fit all Chart points or not.
Run-time only.
It is set to true when users's apply zoom or scroll to the Chart using the mouse at run-time.
The Zoom.Undo method sets the Zoomed property to false and resets the axis scales to fit all Series points.
The default value is true, meaning no zoom or scroll has been applied to the chart after it has been displayed for first time.

Default value: false

Returns:
boolean

setZoomed

public void setZoomed(boolean value)
Set the Chart axis scales to fit all Chart points when true.
Default value: false

Parameters:
value - boolean

zoomPercent

public void zoomPercent(double percentZoom)
Applies the specified PercentZoom Zoom In/Out to the current Axis scales.
When PercentZoom is greater than 100%, Zoom Out is performed.
When PercentZoom is lower than 100%, Zoom In is performed.
The Animated property controls if Zoom is done directly in only o ne step or by multiple zooms thus giving an animation effect.

Parameters:
percentZoom - double

getZoomStyle

public Zoom.ZoomStyle getZoomStyle()

setZoomStyle

public void setZoomStyle(Zoom.ZoomStyle value)