com.steema.teechart.tools
Class DrawLine

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.tools.Tool
          extended by com.steema.teechart.tools.ToolSeries
              extended by com.steema.teechart.tools.DrawLine
All Implemented Interfaces:
java.io.Serializable

public class DrawLine
extends ToolSeries

Title: DrawLine class

Description: Draw Line tool.

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

Company: Steema Software SL

See Also:
Serialized Form

Nested Class Summary
 class DrawLine.DrawLineAdapter
           
static interface DrawLine.DrawLineListener
           
static interface DrawLine.DrawLineSelector
           
 
Field Summary
protected  DrawLine.DrawLineSelector drawLineSelector
           
 java.awt.Point fromPoint
           
protected  DrawLineHandle iHandle
           
 java.awt.Point toPoint
           
 
Fields inherited from class com.steema.teechart.tools.ToolSeries
iSeries
 
Fields inherited from class com.steema.teechart.tools.Tool
bBrush, clickTolerance, listenerList, pPen
 
Fields inherited from class com.steema.teechart.TeeBase
chart
 
Constructor Summary
DrawLine()
           
DrawLine(IBaseChart c)
           
 
Method Summary
 void addDragListener(DragListener l)
           
 void addDrawLineListener(DrawLine.DrawLineListener l)
           
 void addDrawLineSelector(DrawLine.DrawLineSelector selector)
           
 java.awt.Point axisPoint(java.awt.geom.Point2D.Double p)
           
 void chartEvent(ChartDrawEvent ce)
           
 DrawLineItem clicked(int x, int y)
           
 DrawLineItem clicked(java.awt.Point p)
           
protected  void clipDrawingRegion()
           
 void deleteSelected()
           
protected  void fireNew(javax.swing.event.ChangeEvent e)
           
protected  void fireSelected(javax.swing.event.ChangeEvent e)
           
 int getButton()
          The mousebutton to activate the DrawLineTool.
 java.lang.String getDescription()
          Gets descriptive text.
 boolean getEnableDraw()
          Enables/Disables the drawing of lines on the chart by the user.
 boolean getEnableSelect()
          Enables selection of lines for repositioning on the Chart.
 DrawLines getLines()
          Returns the list of lines drawn on the Chart.
 ChartPen getPen()
          Element Pen characteristics.
 DrawLineItem getSelected()
          Returns the line or lines that are currently selected.
 java.lang.String getSummary()
          Gets detailed descriptive text.
 java.awt.Cursor mouseEvent(java.awt.event.MouseEvent e, java.awt.Cursor c)
           
 void removeDragListener(DragListener l)
           
 void removeDrawLineListener(DrawLine.DrawLineListener l)
           
 void removeDrawLineSelector()
           
 java.awt.geom.Point2D.Double screenPoint(java.awt.Point p)
           
 void setButton(int value)
          Defines which mousebutton activates the DrawLineTool.
 void setEnableDraw(boolean value)
          Enables/Disables the drawing of lines on the chart by the user.
 void setEnableSelect(boolean value)
          Enables selection of lines for repositioning on the Chart when true.
 void setSelected(DrawLineItem value)
           
 
Methods inherited from class com.steema.teechart.tools.ToolSeries
getHorizAxis, getSeries, getVertAxis, setSeries
 
Methods inherited from class com.steema.teechart.tools.Tool
addMouseMotionListener, fireChanged, fireClicked, fireDragged, fireDragging, fireMouse, fireResized, getActive, getBitmapEditor, readResolve, removeMouseMotionListener, setActive, setChart, toString
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setColorProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fromPoint

public java.awt.Point fromPoint

toPoint

public java.awt.Point toPoint

iHandle

protected DrawLineHandle iHandle

drawLineSelector

protected transient DrawLine.DrawLineSelector drawLineSelector
Constructor Detail

DrawLine

public DrawLine()

DrawLine

public DrawLine(IBaseChart c)
Method Detail

addDrawLineSelector

public void addDrawLineSelector(DrawLine.DrawLineSelector selector)

removeDrawLineSelector

public void removeDrawLineSelector()

addDragListener

public void addDragListener(DragListener l)

removeDragListener

public void removeDragListener(DragListener l)

addDrawLineListener

public void addDrawLineListener(DrawLine.DrawLineListener l)

removeDrawLineListener

public void removeDrawLineListener(DrawLine.DrawLineListener l)

fireNew

protected void fireNew(javax.swing.event.ChangeEvent e)

fireSelected

protected void fireSelected(javax.swing.event.ChangeEvent e)

getLines

public DrawLines getLines()
Returns the list of lines drawn on the Chart.

Returns:
DrawLines

getButton

public int getButton()
The mousebutton to activate the DrawLineTool.
Default value: MouseButtons.Left

Returns:
int

setButton

public void setButton(int value)
Defines which mousebutton activates the DrawLineTool.
Default value: MouseButtons.Left

Parameters:
value - int

getEnableDraw

public boolean getEnableDraw()
Enables/Disables the drawing of lines on the chart by the user.
All drawn lines are stored in the Lines method.
Default value: true

Returns:
boolean

setEnableDraw

public void setEnableDraw(boolean value)
Enables/Disables the drawing of lines on the chart by the user.
Default value: true

Parameters:
value - boolean

getEnableSelect

public boolean getEnableSelect()
Enables selection of lines for repositioning on the Chart.
Default value: true

Returns:
boolean

setEnableSelect

public void setEnableSelect(boolean value)
Enables selection of lines for repositioning on the Chart when true.
Default value: true

Parameters:
value - boolean

getDescription

public java.lang.String getDescription()
Gets descriptive text.

Overrides:
getDescription in class Tool
Returns:
String

getSummary

public java.lang.String getSummary()
Gets detailed descriptive text.

Overrides:
getSummary in class Tool
Returns:
String

clicked

public DrawLineItem clicked(int x,
                            int y)

clicked

public DrawLineItem clicked(java.awt.Point p)

axisPoint

public java.awt.Point axisPoint(java.awt.geom.Point2D.Double p)

screenPoint

public java.awt.geom.Point2D.Double screenPoint(java.awt.Point p)

deleteSelected

public void deleteSelected()

getSelected

public DrawLineItem getSelected()
Returns the line or lines that are currently selected.

Returns:
DrawLineItem

setSelected

public void setSelected(DrawLineItem value)

getPen

public ChartPen getPen()
Element Pen characteristics.

Returns:
ChartPen

clipDrawingRegion

protected void clipDrawingRegion()

chartEvent

public void chartEvent(ChartDrawEvent ce)
Overrides:
chartEvent in class Tool

mouseEvent

public java.awt.Cursor mouseEvent(java.awt.event.MouseEvent e,
                                  java.awt.Cursor c)
Overrides:
mouseEvent in class Tool