EchoPoint
1.0

echopoint
Class ChartPanel

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Container
          extended byechopoint.EchoPointComponent
              extended byechopoint.ChartPanel
All Implemented Interfaces:
MouseCursorable, ReflectionSetter, java.io.Serializable, ToolTipPopUpSupport, nextapp.echo.ToolTipSupport

public class ChartPanel
extends EchoPointComponent
implements nextapp.echo.ToolTipSupport

A component which integrates JFreeChart with Echo. A JFreeChart object is rendered inside the ChartPanel.

The ChartPanel will raise an ActionEvent if the chart is clicked on and the ActionCommand is non null.

Also if the ChartEventGenerator is set to a non null value, the the user will be able to click on a specific "part" of the chart and ActionEvents will then be raised.

See Also:
Serialized Form

Nested Class Summary
static class ChartPanel.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static java.lang.String ACTION_GENERATOR_CHANGED_PROPERTY
           
static java.lang.String CHART_CHANGED_PROPERTY
           
static java.lang.String HEIGHT_CHANGED_PROPERTY
           
static java.lang.String STYLE_HEIGHT
          A style constant for the Height property.
static java.lang.String STYLE_WIDTH
          A style constant for the Width property.
static java.lang.String WIDTH_CHANGED_PROPERTY
           
 
Fields inherited from class echopoint.EchoPointComponent
STYLE_TOOL_TIP_TEXT, TOOL_TIP_TEXT_CHANGED_PROPERTY, toolTipPopUp
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface nextapp.echo.ToolTipSupport
TOOL_TIP_TEXT_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.MouseCursorable
borderStyleSymbolics, CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI
 
Constructor Summary
ChartPanel()
          Creates a ChartPanel component that is not linked to a JFreeChart.
ChartPanel(org.jfree.chart.JFreeChart chart)
          Creates a ChartPanel component to view the specified JFreeChart with default width and height.
ChartPanel(org.jfree.chart.JFreeChart chart, int width, int height)
          Creates a ChartPanel component to view the specified JFreeChart with the specified width and height.
 
Method Summary
 void addActionListener(nextapp.echo.event.ActionListener l)
          Adds an ActionListener to the chart.
 void applyStyle(nextapp.echo.Style style)
          Applies the provided style to the component.
 void fireActionPerformed(nextapp.echo.event.ActionEvent e)
          Notifies all listeners that have registered for this event type.
 java.lang.String getActionCommand()
          Returns the action command for this chart.
 org.jfree.chart.JFreeChart getChart()
          Returns the chart.
 ChartEventGenerator getChartActionEventGenerator()
          Returns the ChartEventGenerator for the ChartPanel
 int getHeight()
          Returns the height.
 int getWidth()
          Returns the width.
 void removeActionListener(nextapp.echo.event.ActionListener l)
          Removes an ActionListener from the chart.
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setActionCommand(java.lang.String actionCommand)
          Sets the chart's action command.
 void setChart(org.jfree.chart.JFreeChart newValue)
          Sets the JFreeChart to be displayed.
 void setChartActionEventGenerator(ChartEventGenerator newValue)
          Returns the ChartEventGenerator for the ChartPanel.
 void setHeight(int newValue)
          Sets the height of the displayed chart.
 void setWidth(int newValue)
          Sets the width of the displayed chart.
 
Methods inherited from class echopoint.EchoPointComponent
getMouseCursor, getMouseCursorURI, getToolTipPopUp, getToolTipText, set, set, set, set, set, set, set, set, set, setEnabledAllChildren, setMouseCursor, setMouseCursorURI, setToolTipText, validate
 
Methods inherited from class nextapp.echo.Component
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nextapp.echo.ToolTipSupport
getToolTipText, setToolTipText
 

Field Detail

STYLE_HEIGHT

public static final java.lang.String STYLE_HEIGHT
A style constant for the Height property. Values of this key must be of type int

See Also:
Constant Field Values

STYLE_WIDTH

public static final java.lang.String STYLE_WIDTH
A style constant for the Width property. Values of this key must be of type int

See Also:
Constant Field Values

CHART_CHANGED_PROPERTY

public static final java.lang.String CHART_CHANGED_PROPERTY
See Also:
Constant Field Values

HEIGHT_CHANGED_PROPERTY

public static final java.lang.String HEIGHT_CHANGED_PROPERTY
See Also:
Constant Field Values

WIDTH_CHANGED_PROPERTY

public static final java.lang.String WIDTH_CHANGED_PROPERTY
See Also:
Constant Field Values

ACTION_GENERATOR_CHANGED_PROPERTY

public static final java.lang.String ACTION_GENERATOR_CHANGED_PROPERTY
See Also:
Constant Field Values
Constructor Detail

ChartPanel

public ChartPanel()
Creates a ChartPanel component that is not linked to a JFreeChart.


ChartPanel

public ChartPanel(org.jfree.chart.JFreeChart chart)
Creates a ChartPanel component to view the specified JFreeChart with default width and height.


ChartPanel

public ChartPanel(org.jfree.chart.JFreeChart chart,
                  int width,
                  int height)
Creates a ChartPanel component to view the specified JFreeChart with the specified width and height.

Method Detail

addActionListener

public void addActionListener(nextapp.echo.event.ActionListener l)
Adds an ActionListener to the chart.

Parameters:
l - The ActionListener to be added.

applyStyle

public void applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. The base nextapp.echo.Component style names can be used as well.

Specified by:
applyStyle in interface MouseCursorable
Overrides:
applyStyle in class EchoPointComponent
See Also:
Component.applyStyle(nextapp.echo.Style)

fireActionPerformed

public void fireActionPerformed(nextapp.echo.event.ActionEvent e)
Notifies all listeners that have registered for this event type.

Parameters:
e - The ActionEvent to send.

getActionCommand

public java.lang.String getActionCommand()
Returns the action command for this chart.

Returns:
The action command for this chart.

getChart

public org.jfree.chart.JFreeChart getChart()
Returns the chart.

Returns:
The chart.

getHeight

public int getHeight()
Returns the height.

Returns:
The height.

getWidth

public int getWidth()
Returns the width.

Returns:
The Width.

removeActionListener

public void removeActionListener(nextapp.echo.event.ActionListener l)
Removes an ActionListener from the chart.

Parameters:
l - The ActionListener to be removed.

setActionCommand

public void setActionCommand(java.lang.String actionCommand)
Sets the chart's action command.

Parameters:
actionCommand - The new action command for this chart.

setChart

public void setChart(org.jfree.chart.JFreeChart newValue)
Sets the JFreeChart to be displayed.

Parameters:
newValue - The default chart.

setHeight

public void setHeight(int newValue)
Sets the height of the displayed chart.

Parameters:
newValue - The height.

setWidth

public void setWidth(int newValue)
Sets the width of the displayed chart.

Parameters:
newValue - The width.

getChartActionEventGenerator

public ChartEventGenerator getChartActionEventGenerator()
Returns the ChartEventGenerator for the ChartPanel

Returns:
a ChartEventGenerator

setChartActionEventGenerator

public void setChartActionEventGenerator(ChartEventGenerator newValue)
Returns the ChartEventGenerator for the ChartPanel. If this is set to a non null value, then the user will be able to click on specific "parts" of the chart and ActionEvents will be raised.

Parameters:
newValue - - the new ChartEventGenerator
See Also:
ChartEventGenerator

set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Parameters:
field - - the field to be set
newValue - - the new value to be set
Returns:
the oldValue of the field
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0