de.erichseifert.gral
Class PlotArea

java.lang.Object
  extended by de.erichseifert.gral.AbstractDrawable
      extended by de.erichseifert.gral.PlotArea
All Implemented Interfaces:
Drawable, SettingsListener, SettingsStorage
Direct Known Subclasses:
PiePlot.PiePlotArea2D, XYPlot.XYPlotArea2D

public abstract class PlotArea
extends AbstractDrawable
implements SettingsStorage, SettingsListener

Abstract class that represents a canvas for the plot which will be drawn.


Field Summary
static Settings.Key BACKGROUND
          Key for specifying the Paint instance to be used to paint the background of the plot area.
static Settings.Key BORDER
          Key for specifying the Stroke instance to be used to paint the border of the plot area.
static Settings.Key COLOR
          Key for specifying the Paint instance to be used to fill the border of the plot area.
 
Constructor Summary
PlotArea()
          Creates a new PlotArea2D object with default background color and border.
 
Method Summary
<T> T
getSetting(Settings.Key key)
          Returns the setting with the specified key.
<T> void
removeSetting(Settings.Key key)
          Removes the setting with the specified key.
<T> void
removeSettingDefault(Settings.Key key)
          Removes the default setting with the specified key.
<T> void
setSetting(Settings.Key key, T value)
          Sets the setting with the specified key to the specified value.
<T> void
setSettingDefault(Settings.Key key, T value)
          Sets a default value for the setting with the specified key.
 void settingChanged(SettingChangeEvent event)
          Invoked if a setting has changed.
 
Methods inherited from class de.erichseifert.gral.AbstractDrawable
getBounds, getHeight, getPreferredSize, getWidth, getX, getY, setBounds, setBounds
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.erichseifert.gral.Drawable
draw
 

Field Detail

BACKGROUND

public static final Settings.Key BACKGROUND
Key for specifying the Paint instance to be used to paint the background of the plot area.


BORDER

public static final Settings.Key BORDER
Key for specifying the Stroke instance to be used to paint the border of the plot area.


COLOR

public static final Settings.Key COLOR
Key for specifying the Paint instance to be used to fill the border of the plot area.

Constructor Detail

PlotArea

public PlotArea()
Creates a new PlotArea2D object with default background color and border.

Method Detail

getSetting

public <T> T getSetting(Settings.Key key)
Description copied from interface: SettingsStorage
Returns the setting with the specified key. If no setting is available, the default setting will be returned.

Specified by:
getSetting in interface SettingsStorage
Type Parameters:
T - Type of setting.
Parameters:
key - Key.
Returns:
Setting.

setSetting

public <T> void setSetting(Settings.Key key,
                           T value)
Description copied from interface: SettingsStorage
Sets the setting with the specified key to the specified value.

Specified by:
setSetting in interface SettingsStorage
Type Parameters:
T - Type of setting.
Parameters:
key - Key.
value - Value to be set.

removeSetting

public <T> void removeSetting(Settings.Key key)
Description copied from interface: SettingsStorage
Removes the setting with the specified key.

Specified by:
removeSetting in interface SettingsStorage
Type Parameters:
T - Type of setting.
Parameters:
key - Key.

setSettingDefault

public <T> void setSettingDefault(Settings.Key key,
                                  T value)
Description copied from interface: SettingsStorage
Sets a default value for the setting with the specified key.

Specified by:
setSettingDefault in interface SettingsStorage
Type Parameters:
T - Type of setting.
Parameters:
key - Key.
value - Value to be set.

removeSettingDefault

public <T> void removeSettingDefault(Settings.Key key)
Description copied from interface: SettingsStorage
Removes the default setting with the specified key.

Specified by:
removeSettingDefault in interface SettingsStorage
Type Parameters:
T - Type of setting.
Parameters:
key - Key.

settingChanged

public void settingChanged(SettingChangeEvent event)
Description copied from interface: SettingsListener
Invoked if a setting has changed.

Specified by:
settingChanged in interface SettingsListener
Parameters:
event - Event containing information about the changed setting.


Copyright © 2009-2010. All Rights Reserved.