jsynoptic.plugins.jfreechart
Class PieChartShape

java.lang.Object
  extended by simtools.shapes.AbstractShape
      extended by jsynoptic.plugins.jfreechart.ChartShape
          extended by jsynoptic.plugins.jfreechart.PieChartShape
All Implemented Interfaces:
java.awt.Shape, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, ContextualActionProvider, Linkable, DataSourceListener, EndNotificationListener, Resizable, MapperListener, NamedProperties

public class PieChartShape
extends ChartShape
implements ContextualActionProvider, DataSourceListener, EndNotificationListener, MapperListener

A shape to manage JFreeChart Bar Charts

See Also:
Serialized Form

Nested Class Summary
protected static class PieChartShape.CbxEntry
           
 class PieChartShape.PlotPanel
           
 
Nested classes/interfaces inherited from class simtools.shapes.AbstractShape
AbstractShape.AbstractShapePropertiesNames
 
Field Summary
protected  boolean dirty
           
protected  java.util.Vector mappers
           
protected  java.util.Vector mapperSources
           
static java.util.ResourceBundle resources
           
 
Fields inherited from class jsynoptic.plugins.jfreechart.ChartShape
chart, chartRenderingInfo, link
 
Fields inherited from class simtools.shapes.AbstractShape
_h, _ox, _oy, _propertyNames, _w, _x, _y, ANTI_ALIASING, currentDialogBox, FONT_NAMES, listeners, REFRESH_PERIOD
 
Fields inherited from interface jsynoptic.base.ContextualActionProvider
EDITOR_CONTEXT, MOUSE_OUT_CONTEXT, MOUSE_OVER_CONTEXT, MOUSE_PRESSED_CONTEXT, SHAPELIST_CONTEXT, SOURCELIST_CONTEXT
 
Constructor Summary
PieChartShape(JFreeChart chart)
           
PieChartShape(JFreeChart chart, int ox, int oy, int width, int height)
           
 
Method Summary
 boolean canDoAction(double x, double y, java.lang.Object o, java.lang.String action, int context)
          Returns true if, and only if, it is possible to do the action right now
 boolean checkMapperChange(DataSource ds, long index)
           
protected  AbstractShape cloneShape()
          Performs a copy of the shape This method has to be overriden to deal with concrete shapes
 void DataSourceIndexRangeChanged(DataSource ds, long startIndex, long lastIndex)
          Called when the range of valid index changed
 void DataSourceInfoChanged(DataSource ds, DataInfo newInfo)
          Called when the information about the data source changed
 void DataSourceOrderChanged(DataSource ds, int newOrder)
          If defined, called when the order of the source changed.
 void DataSourceReplaced(DataSource oldData, DataSource newData)
          Called when a data source is replaced by another one
 void DataSourceValueChanged(DataSource ds, long minIndex, long maxIndex)
          Called when at least a value changed in the data source.
 void DataSourceValueRangeChanged(DataSource ds)
          Called when the range of possible values changed, if defined.
 boolean doAction(double x, double y, java.lang.Object o, java.lang.String action, javax.swing.undo.CompoundEdit undoableEdit)
          Do one of the actions previously declared by getAction.
 java.lang.String[] getActions(double x, double y, java.lang.Object o, int context)
          Return list of possible actions the contect information may be used, or not.
 void mappingChanged(GenericMapper mapper)
          Called when the mapping of the specified mapper changed
 void notificationEnd(java.lang.Object referer)
          This callback is called after all notifications were processed.
 
Methods inherited from class jsynoptic.plugins.jfreechart.ChartShape
chartChanged, debugContainer, draw, findTab, getLink, removeListener, resize, setLink, validateObject
 
Methods inherited from class simtools.shapes.AbstractShape
addListener, contains, contains, contains, contains, getAnchor, getBounds, getBounds2D, getInnerProperties, getMax, getMaxTranslated, getMin, getPathIterator, getPathIterator, getPropertyNames, getPropertyValue, intersects, intersects, notifyChange, notifyChange, refresh, setAnchor, setAnchor, setProperties, setPropertyValue, translate, wipeOff
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resources

public static java.util.ResourceBundle resources

mappers

protected java.util.Vector mappers

mapperSources

protected transient java.util.Vector mapperSources

dirty

protected transient boolean dirty
Constructor Detail

PieChartShape

public PieChartShape(JFreeChart chart)

PieChartShape

public PieChartShape(JFreeChart chart,
                     int ox,
                     int oy,
                     int width,
                     int height)
Method Detail

getActions

public java.lang.String[] getActions(double x,
                                     double y,
                                     java.lang.Object o,
                                     int context)
Description copied from interface: ContextualActionProvider
Return list of possible actions the contect information may be used, or not.

Specified by:
getActions in interface ContextualActionProvider
Parameters:
x - Coordinate, mouse position in the same unit as contains(x,y)
y - Coordinate, mouse position in the same unit as contains(x,y)
o - Object the actions should work on. Possibly null => default or all actions
context - one of the context defined in the ContextualActionProvider class
Returns:
The list of possible actions, possibly null or an empty array

doAction

public boolean doAction(double x,
                        double y,
                        java.lang.Object o,
                        java.lang.String action,
                        javax.swing.undo.CompoundEdit undoableEdit)
Description copied from interface: ContextualActionProvider
Do one of the actions previously declared by getAction.

Specified by:
doAction in interface ContextualActionProvider
Parameters:
x - Coordinate, for example mouse position
y - Coordinate, for example mouse position
o - Object the action should work on.
action - An action returned by a previous getActions call with the same x, y, o parameters It may be null, in which case the default action is requested for this x,y,o.
undoableEdit - current edit for undo/redo operation If not null, this action is undoable.
Returns:
true if the action could be performed

canDoAction

public boolean canDoAction(double x,
                           double y,
                           java.lang.Object o,
                           java.lang.String action,
                           int context)
Description copied from interface: ContextualActionProvider
Returns true if, and only if, it is possible to do the action right now

Specified by:
canDoAction in interface ContextualActionProvider
Parameters:
x - Coordinate, for example mouse position
y - Coordinate, for example mouse position
o - Object the action should work on.
action - An action returned by a previous getActions call with the same x, y, o parameters It may be null, in which case the default action is requested for this x,y,o.
context - one of the context defined in the ContextualActionProvider class
Returns:
true if the action can be performed

mappingChanged

public void mappingChanged(GenericMapper mapper)
Description copied from interface: MapperListener
Called when the mapping of the specified mapper changed

Specified by:
mappingChanged in interface MapperListener

checkMapperChange

public boolean checkMapperChange(DataSource ds,
                                 long index)

DataSourceValueChanged

public void DataSourceValueChanged(DataSource ds,
                                   long minIndex,
                                   long maxIndex)
Description copied from interface: DataSourceListener
Called when at least a value changed in the data source. The listener shall then get the values in the given range again, if it is interested by the values in that range.

Specified by:
DataSourceValueChanged in interface DataSourceListener
Parameters:
ds - The data source that changed
minIndex - Lower bound of the range where values changed
maxIndex - Higher bound of the range where values changed

DataSourceIndexRangeChanged

public void DataSourceIndexRangeChanged(DataSource ds,
                                        long startIndex,
                                        long lastIndex)
Description copied from interface: DataSourceListener
Called when the range of valid index changed

Specified by:
DataSourceIndexRangeChanged in interface DataSourceListener
Parameters:
ds - The data source that changed
startIndex - The new start Index
lastIndex - The new last index

DataSourceInfoChanged

public void DataSourceInfoChanged(DataSource ds,
                                  DataInfo newInfo)
Description copied from interface: DataSourceListener
Called when the information about the data source changed

Specified by:
DataSourceInfoChanged in interface DataSourceListener
Parameters:
ds - The data source that changed

DataSourceValueRangeChanged

public void DataSourceValueRangeChanged(DataSource ds)
Description copied from interface: DataSourceListener
Called when the range of possible values changed, if defined.

Specified by:
DataSourceValueRangeChanged in interface DataSourceListener
Parameters:
ds - The data source that changed

DataSourceOrderChanged

public void DataSourceOrderChanged(DataSource ds,
                                   int newOrder)
Description copied from interface: DataSourceListener
If defined, called when the order of the source changed. See the sortedOrder() in the Datasource class for more information.

Specified by:
DataSourceOrderChanged in interface DataSourceListener
Parameters:
ds - The data source that changed

DataSourceReplaced

public void DataSourceReplaced(DataSource oldData,
                               DataSource newData)
Description copied from interface: DataSourceListener
Called when a data source is replaced by another one

Specified by:
DataSourceReplaced in interface DataSourceListener

notificationEnd

public void notificationEnd(java.lang.Object referer)
Description copied from interface: EndNotificationListener
This callback is called after all notifications were processed. The referer object is the one to decide what the end means. For example, it may be a single data source notifying both a range change and a value change. Or it could be a collection notifying all its sources.

Specified by:
notificationEnd in interface EndNotificationListener

cloneShape

protected AbstractShape cloneShape()
Description copied from class: AbstractShape
Performs a copy of the shape This method has to be overriden to deal with concrete shapes

Overrides:
cloneShape in class ChartShape
Returns:
a copy of the shape