TPTP 4.6.0 Platform Project
Public API Specification

org.eclipse.hyades.ui.widgets.grapher
Class APIExample

java.lang.Object
  extended by org.eclipse.hyades.ui.widgets.grapher.APIExample
All Implemented Interfaces:
java.util.EventListener, ZoomSliderListener

public class APIExample
extends java.lang.Object
implements ZoomSliderListener

A sample implementation of the grapher and zoomslider apis. The sample displays a cosine and a sine line graph on a graph canvas, along with x and y sliders.


Constructor Summary
APIExample()
           
 
Method Summary
 void createGrapher()
          Intialize the Graphing.
 GraphSource createGraphSource(int type)
          Create a new Test Graph Source.
static void main(java.lang.String[] args)
          Run this Graphing example.
 void newGraphShell()
          Create the Graph Shell
 void setupComposite(org.eclipse.swt.widgets.Composite parent)
          Setup the graph composite.
 void zoomSliderChanged(ZoomSliderEvent event)
          A change in the zoom slider has occured.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

APIExample

public APIExample()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Run this Graphing example.

Parameters:
args - standard command line parameters, not currently used
Throws:
java.lang.Exception - if the graphing fails

setupComposite

public void setupComposite(org.eclipse.swt.widgets.Composite parent)
                    throws java.lang.Exception
Setup the graph composite.

Parameters:
parent - the parent composite
Throws:
java.lang.Exception - if the setup fails

createGrapher

public void createGrapher()
Intialize the Graphing. Create the graph colours, graph sources, line graphs and add these to the canvas.


createGraphSource

public GraphSource createGraphSource(int type)
Create a new Test Graph Source. This graph source provides the data that will be graphed by a particular graph.

Parameters:
type - the type of graph source TestGraphSource.SINE_WAVE or TestGraphSource.COSINE_WAVE
Returns:
the test Graph Source

newGraphShell

public void newGraphShell()
                   throws java.lang.Exception
Create the Graph Shell

Throws:
java.lang.Exception - if the graphing

zoomSliderChanged

public void zoomSliderChanged(ZoomSliderEvent event)
Description copied from interface: ZoomSliderListener
A change in the zoom slider has occured. Changes can be of a zoom or transpose type, as defined in the ZoomSliderEvent.

Specified by:
zoomSliderChanged in interface ZoomSliderListener
Parameters:
event - the ZoomSliderEvent associated with this change
See Also:
ZoomSliderEvent

TPTP 4.6.0 Platform Project
Public API Specification