|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
com.rapidminer.gui.new_plotter.templates.style.PlotterStyleProvider
com.rapidminer.gui.new_plotter.templates.style.DefaultPlotterStyleProvider
public class DefaultPlotterStyleProvider
The default PlotterStyleProvider
. Lets the user choose a font
for the axes, title and legend, and lets him choose a color scheme for the plot.
Field Summary | |
---|---|
static int |
FONT_SIZE_DEFAULT
the font size for the font buttons |
Fields inherited from class com.rapidminer.gui.new_plotter.templates.style.PlotterStyleProvider |
---|
STYLE_ELEMENT |
Constructor Summary | |
---|---|
DefaultPlotterStyleProvider()
Creates a new DefaultPlotterStyleProvider . |
Method Summary | |
---|---|
void |
addColorScheme(ColorScheme colorScheme)
Appends the given ColorScheme to the list of available ColorScheme s. |
void |
addColorScheme(ColorScheme colorScheme,
int index)
Adds the given ColorScheme to the list of available ColorScheme s at the specified index. |
void |
copySettingsFromPlotterStyleProvider(PlotterStyleProvider provider)
Uses all settings from the given PlotterStyleProvider to overwrite his own settings. |
org.w3c.dom.Element |
createXML(org.w3c.dom.Document document)
Creates an Element which contains all PlotterStyleProvider settings. |
java.awt.Font |
getAxesFont()
Returns the Font which the user chose for the axes. |
ColorScheme |
getColorScheme()
Returns a ColorScheme instance which will be used to color the plot(s). |
java.util.List<ColorScheme> |
getColorSchemes()
Returns the list of available ColorScheme s. |
ColorScheme.ColorRGB |
getFrameBackgroundColor()
Returns the ColorScheme.ColorRGB of the background frame of the chart. |
java.awt.Font |
getLegendFont()
Returns the Font which the user chose for the legend. |
ColorScheme.ColorRGB |
getPlotBackgroundColor()
Returns the ColorScheme.ColorRGB of the plot background. |
int |
getSelectedColorSchemeIndex()
Returns the index of the currently selected ColorScheme . |
javax.swing.JPanel |
getStyleProviderPanel()
Return the JPanel where the user can change the color/font settings. |
java.awt.Font |
getTitleFont()
Returns the Font which the user chose for the title. |
java.lang.String |
getTitleText()
Returns the String which the user chose as the chart title. |
boolean |
isShowLegend()
Returns true when the legend should be shown; false otherwise. |
void |
loadFromXML(org.w3c.dom.Element styleElement)
Loads all PlotterStyleProvider settings from the given Element . |
void |
removeColorScheme(ColorScheme colorScheme)
Removes the given ColorScheme . |
void |
removeColorScheme(int index)
Removes the given ColorScheme with the given index. |
void |
setAxesFont(java.awt.Font axesFont)
Sets the axes Font . |
void |
setFrameBackgroundColor(ColorScheme.ColorRGB frameBackgroundColor)
Sets the ColorScheme.ColorRGB for the frame background around the chart. |
void |
setLegendFont(java.awt.Font legendFont)
Sets the legend Font . |
void |
setPlotBackgroundColor(ColorScheme.ColorRGB plotBackgroundColor)
Sets the ColorScheme.ColorRGB for the chart background. |
void |
setSelectedColorScheme(ColorScheme colorScheme)
Sets the selected ColorScheme . |
void |
setSelectedColorSchemeIndex(int index)
Set the index of the currently selected ColorScheme . |
void |
setShowLegend(boolean showLegend)
Set whether the legend should be shown or not. |
void |
setTitleFont(java.awt.Font titleFont)
Sets the title Font . |
void |
setTitleText(java.lang.String title)
Set the chart title. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FONT_SIZE_DEFAULT
Constructor Detail |
---|
public DefaultPlotterStyleProvider()
DefaultPlotterStyleProvider
.
Method Detail |
---|
public javax.swing.JPanel getStyleProviderPanel()
PlotterStyleProvider
JPanel
where the user can change the color/font settings.
getStyleProviderPanel
in class PlotterStyleProvider
public java.lang.String getTitleText()
PlotterStyleProvider
String
which the user chose as the chart title.
getTitleText
in class PlotterStyleProvider
public boolean isShowLegend()
PlotterStyleProvider
true
when the legend should be shown; false
otherwise.
isShowLegend
in class PlotterStyleProvider
public void setTitleText(java.lang.String title)
title
- public void setShowLegend(boolean showLegend)
showLegend
- if true
, shows the legend; otherwise hides itpublic java.awt.Font getAxesFont()
PlotterStyleProvider
Font
which the user chose for the axes.
getAxesFont
in class PlotterStyleProvider
public void setAxesFont(java.awt.Font axesFont)
Font
.
axesFont
- public java.awt.Font getLegendFont()
PlotterStyleProvider
Font
which the user chose for the legend.
getLegendFont
in class PlotterStyleProvider
public void setLegendFont(java.awt.Font legendFont)
Font
.
legendFont
- public java.awt.Font getTitleFont()
PlotterStyleProvider
Font
which the user chose for the title.
getTitleFont
in class PlotterStyleProvider
public void setTitleFont(java.awt.Font titleFont)
Font
.
titleFont
- public void setFrameBackgroundColor(ColorScheme.ColorRGB frameBackgroundColor)
ColorScheme.ColorRGB
for the frame background around the chart.
frameBackgroundColor
- public void setPlotBackgroundColor(ColorScheme.ColorRGB plotBackgroundColor)
ColorScheme.ColorRGB
for the chart background.
plotBackgroundColor
- public ColorScheme.ColorRGB getFrameBackgroundColor()
PlotterStyleProvider
ColorScheme.ColorRGB
of the background frame of the chart.
getFrameBackgroundColor
in class PlotterStyleProvider
public ColorScheme.ColorRGB getPlotBackgroundColor()
PlotterStyleProvider
ColorScheme.ColorRGB
of the plot background.
getPlotBackgroundColor
in class PlotterStyleProvider
public void setSelectedColorSchemeIndex(int index)
ColorScheme
.
index
- public void setSelectedColorScheme(ColorScheme colorScheme)
ColorScheme
. If the given ColorScheme
is not in the current list of schemes,
it will be appended at the end.
colorScheme
- the newly selected ColorScheme
public int getSelectedColorSchemeIndex()
ColorScheme
.
public java.util.List<ColorScheme> getColorSchemes()
ColorScheme
s. Notice that this list is a copy
so direct modification of the DefaultPlotterStyleProvider
is not possible.
public void addColorScheme(ColorScheme colorScheme)
ColorScheme
to the list of available ColorScheme
s.
Duplicates are not allowed and will result in an IllegalArgumentException
.
colorScheme
- public void addColorScheme(ColorScheme colorScheme, int index)
ColorScheme
to the list of available ColorScheme
s at the specified index.
Note that inserting before the default ColorSchemes is not supported and will result in an IllegalArgumentException
.
Duplicates are not allowed and will result in an IllegalArgumentException
.
colorScheme
- public void removeColorScheme(int index)
ColorScheme
with the given index.
Will throw an IllegalArgumentException
if trying to remove a default ColorScheme
.
index
- public void removeColorScheme(ColorScheme colorScheme)
ColorScheme
.
Will throw an IllegalArgumentException
if trying to remove a default ColorScheme
.
colorScheme
- public ColorScheme getColorScheme()
PlotterStyleProvider
ColorScheme
instance which will be used to color the plot(s).
Each plot will use one of the colors in the order provided, if more plots than
colors exist, it will start from the beginning.
getColorScheme
in class PlotterStyleProvider
public org.w3c.dom.Element createXML(org.w3c.dom.Document document)
PlotterStyleProvider
Element
which contains all PlotterStyleProvider
settings.
createXML
in class PlotterStyleProvider
document
- the Document
where the Element
will be written to
Element
public void loadFromXML(org.w3c.dom.Element styleElement)
PlotterStyleProvider
PlotterStyleProvider
settings from the given Element
.
loadFromXML
in class PlotterStyleProvider
styleElement
- the Element
where all settings are loaded frompublic void copySettingsFromPlotterStyleProvider(PlotterStyleProvider provider)
PlotterStyleProvider
PlotterStyleProvider
to overwrite his own settings.
Does not overwrite the title text.
copySettingsFromPlotterStyleProvider
in class PlotterStyleProvider
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |