Venice 0.751beta

nz.org.venice.chart
Class ChartTracking

java.lang.Object
  extended bynz.org.venice.chart.ChartTracking
All Implemented Interfaces:
java.util.EventListener, ModuleListener

public class ChartTracking
extends java.lang.Object
implements ModuleListener


Constructor Summary
ChartTracking(ChartModule chartModule, Chart chart, TrackedQuoteModule table, Symbol symbol)
          Construct a new ChartTracking object to manage the interface between the chartmodule and trackedquote module.
 
Method Summary
 Coordinate getCoordinate()
           
 boolean isActive()
           
 void moduleAdded(ModuleEvent moduleEvent)
          Called when a module has been added
 void moduleRemoved(ModuleEvent moduleEvent)
          Listen for when the quotemodule or chart module are closed so that either the tracker can be removed or the quote module closed.
 void moduleRenamed(ModuleEvent moduleEvent)
          Called when a module has been renamed
 void remove()
          Remove the tracker from the chart.
 void setActive(boolean active)
          Activate or deactivate the tracker.
 void setCoordinate(Coordinate coordinate)
          Set the cursor coordinate.
 void setCursorCoord(java.lang.Comparable x, java.lang.Double y, java.lang.Integer absY)
          Record the cursor's new coordinate value.
 void setCursorCoord(java.lang.Comparable x, java.lang.Double y, java.lang.Integer absY, boolean keyInput)
          Record the cursor's new coordinate value.
 void setPosition(int position)
          When a new row in the table is selected, move the tracker to the quote at the selected position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartTracking

public ChartTracking(ChartModule chartModule,
                     Chart chart,
                     TrackedQuoteModule table,
                     Symbol symbol)
Construct a new ChartTracking object to manage the interface between the chartmodule and trackedquote module.

Parameters:
chartModule - The chartModule which contains the chart.
chart - The chart which displays the cursor
table - The TrackedQuoteModule which displays the quote under the cursor.
symbol - The symbol being graphed.
Method Detail

setActive

public void setActive(boolean active)
Activate or deactivate the tracker.

Parameters:
active - Set to true to activate the tracker

isActive

public boolean isActive()
Returns:
true if the tracker is activated.

setPosition

public void setPosition(int position)
When a new row in the table is selected, move the tracker to the quote at the selected position.

Parameters:
position - The selected row in the TrackedQuoteModule

setCursorCoord

public void setCursorCoord(java.lang.Comparable x,
                           java.lang.Double y,
                           java.lang.Integer absY,
                           boolean keyInput)
Record the cursor's new coordinate value.

Parameters:
x - The data value
y - The y value relative to the level
absY - The absolute value of the coordinate on the screen
keyInput - Whether the coordinate was passed by keyboard or mouse

setCursorCoord

public void setCursorCoord(java.lang.Comparable x,
                           java.lang.Double y,
                           java.lang.Integer absY)
Record the cursor's new coordinate value.

Parameters:
x - The data value
y - The y value relative to the level
absY - The absolute value of the coordinate on the screen

setCoordinate

public void setCoordinate(Coordinate coordinate)
Set the cursor coordinate.

Parameters:
coordinate - The coordinate value of the cursor

getCoordinate

public Coordinate getCoordinate()
Returns:
The cursor coordinate.

moduleAdded

public void moduleAdded(ModuleEvent moduleEvent)
Description copied from interface: ModuleListener
Called when a module has been added

Specified by:
moduleAdded in interface ModuleListener
Parameters:
moduleEvent - the module event

moduleRenamed

public void moduleRenamed(ModuleEvent moduleEvent)
Description copied from interface: ModuleListener
Called when a module has been renamed

Specified by:
moduleRenamed in interface ModuleListener
Parameters:
moduleEvent - the module event

moduleRemoved

public void moduleRemoved(ModuleEvent moduleEvent)
Listen for when the quotemodule or chart module are closed so that either the tracker can be removed or the quote module closed.

Specified by:
moduleRemoved in interface ModuleListener
Parameters:
moduleEvent - Contains the module which was removed

remove

public void remove()
Remove the tracker from the chart.


Venice 0.751beta