本文整理汇总了Java中com.rapidminer.gui.plotter.PlotterConfigurationSettings类的典型用法代码示例。如果您正苦于以下问题:Java PlotterConfigurationSettings类的具体用法?Java PlotterConfigurationSettings怎么用?Java PlotterConfigurationSettings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlotterConfigurationSettings类属于com.rapidminer.gui.plotter包,在下文中一共展示了PlotterConfigurationSettings类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPlotterSettingsFromHistory
import com.rapidminer.gui.plotter.PlotterConfigurationSettings; //导入依赖的package包/类
public static PlotterConfigurationModel getPlotterSettingsFromHistory(IOObject object, DataTable dataTable, LinkedHashMap<String, Class<? extends Plotter>> plotterSelections) {
List<ProcessingStep> steps = object.getProcessingHistory();
ListIterator<ProcessingStep> iterator = steps.listIterator(steps.size());
PlotterConfigurationModel configurationModel = null;
boolean isFirst = true;
while (iterator.hasPrevious()) {
ProcessingStep step = iterator.previous();
PlotterConfigurationSettings settings = settingsHistory.get(step);
if (settings != null) {
// if it's not the last operator in history: Clone and register for last process step
if (!isFirst) {
settings = settings.clone();
settingsHistory.put(steps.get(steps.size() - 1), settings);
}
configurationModel = new PlotterConfigurationModel(settings, plotterSelections, dataTable);
// then break: Use the last found known step
break;
}
isFirst = false;
}
// if we didn't find anything: Create new settings and add to history
if (configurationModel == null) {
configurationModel = new PlotterConfigurationModel(plotterSelections, dataTable);
if (!steps.isEmpty())
settingsHistory.put(steps.get(steps.size() - 1), configurationModel.getPlotterSettings());
}
return configurationModel;
}
示例2: actionPerformed
import com.rapidminer.gui.plotter.PlotterConfigurationSettings; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
// look up the panel invoking the pop up invoking the action
AttributeStatisticsPanel asp = null;
// the action should only be invoked by AttributePopupMenus
Container parent = ((JComponent) e.getSource()).getParent();
if ((parent instanceof AttributePopupMenu)) {
asp = ((AttributePopupMenu) parent).getAttributeStatisticsPanel();
} else {
asp = (AttributeStatisticsPanel) SwingUtilities.getAncestorOfClass(AttributeStatisticsPanel.class, parent);
if (asp == null) {
// we are not inside a AttributesStatisticPanel
return;
}
}
ButtonBarCardPanel cardPanel = (ButtonBarCardPanel) SwingUtilities.getAncestorOfClass(ButtonBarCardPanel.class, asp);
AbstractAttributeStatisticsModel model = asp.getModel();
// select the plotter view
cardPanel.selectCard("plot_view");
// get the opened plotter
JPanel outerPanel = (JPanel) cardPanel.getShownComponent();
for (Component innerComp : outerPanel.getComponents()) {
if (innerComp instanceof PlotterPanel) {
PlotterPanel plotterPanel = (PlotterPanel) outerPanel.getComponent(0);
PlotterConfigurationModel settings = plotterPanel.getPlotterSettings();
// adjust settings
if (model instanceof NominalAttributeStatisticsModel) {
settings.setPlotter(PlotterConfigurationModel.BAR_CHART);
settings.setParameterAsString(PlotterConfigurationSettings.AXIS_PLOT_COLUMN, model.getAttribute()
.getName());
settings.setParameterAsString(PlotterConfigurationSettings.GROUP_BY_COLUMN, model.getAttribute()
.getName());
} else if (model instanceof NumericalAttributeStatisticsModel
|| model instanceof DateTimeAttributeStatisticsModel) {
settings.setPlotter(PlotterConfigurationModel.HISTOGRAM_PLOT);
settings.setParameterAsString(PlotterConfigurationSettings.NUMBER_OF_BINS, "10");
settings.setParameterAsString(PlotterConfigurationSettings.AXIS_PLOT_COLUMNS, model.getAttribute()
.getName());
}
break;
}
}
}
示例3: getPlotterSettingsFromHistory
import com.rapidminer.gui.plotter.PlotterConfigurationSettings; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static PlotterConfigurationModel getPlotterSettingsFromHistory(IOObject object, DataTable dataTable,
LinkedHashMap<String, Class<? extends Plotter>> plotterSelections) {
List<ProcessingStep> steps = object.getProcessingHistory();
ListIterator<ProcessingStep> iterator = steps.listIterator(steps.size());
PlotterConfigurationModel configurationModel = null;
boolean isFirst = true;
while (iterator.hasPrevious()) {
ProcessingStep step = iterator.previous();
PlotterConfigurationSettings settings = settingsHistory.get(step);
if (settings != null) {
// if it's not the last operator in history: Clone and register for last process
// step
if (!isFirst) {
settings = settings.clone();
settingsHistory.put(steps.get(steps.size() - 1), settings);
}
configurationModel = new PlotterConfigurationModel(settings, plotterSelections, dataTable);
if (object.getUserData(PlotterConfigurationSettings.IOOBJECT_USER_DATA_SETTINGS_KEY) != null) { // check
// for
// user
// specified
// plotter
// settings
configurationModel.addParameters((HashMap<String, String>) object
.getUserData(PlotterConfigurationSettings.IOOBJECT_USER_DATA_SETTINGS_KEY));
}
if (object.getUserData(PlotterConfigurationSettings.IOOBJECT_USER_DATA_PLOTTER_KEY) != null) { // check
// for
// user
// specified
// plotter
String p = (String) object.getUserData(PlotterConfigurationSettings.IOOBJECT_USER_DATA_PLOTTER_KEY);
configurationModel.setPlotter(p);
}
// then break: Use the last found known step
break;
}
isFirst = false;
}
// if we didn't find anything: Create new settings (with default or user specified values)
// and add them to history
if (configurationModel == null) {
configurationModel = new PlotterConfigurationModel(plotterSelections, dataTable);
HeuristicPlotterConfigurator heuristicConfigurator = new HeuristicPlotterConfigurator(configurationModel,
dataTable);
if (object.getUserData(PlotterConfigurationSettings.IOOBJECT_USER_DATA_SETTINGS_KEY) != null) { // check
// for
// user
// specified
// plotter
// settings
configurationModel.addParameters((HashMap<String, String>) object
.getUserData(PlotterConfigurationSettings.IOOBJECT_USER_DATA_SETTINGS_KEY));
} else {
configurationModel.setParameters(heuristicConfigurator.getDefaultSelection(configurationModel
.getParameterSettings()));
}
if (object.getUserData(PlotterConfigurationSettings.IOOBJECT_USER_DATA_PLOTTER_KEY) != null) { // check
// for
// a
// user
// specified
// plotter
configurationModel.setPlotter((String) object
.getUserData(PlotterConfigurationSettings.IOOBJECT_USER_DATA_PLOTTER_KEY));
} else {
configurationModel.setPlotter(heuristicConfigurator.getDefaultPlotter());
}
if (!steps.isEmpty()) {
settingsHistory.put(steps.get(steps.size() - 1), configurationModel.getPlotterSettings());
}
}
return configurationModel;
}
示例4: loggedActionPerformed
import com.rapidminer.gui.plotter.PlotterConfigurationSettings; //导入依赖的package包/类
@Override
public void loggedActionPerformed(ActionEvent e) {
// look up the panel invoking the pop up invoking the action
AttributeStatisticsPanel asp = null;
// the action should only be invoked by AttributePopupMenus
Container parent = ((JComponent) e.getSource()).getParent();
if ((parent instanceof AttributePopupMenu)) {
asp = ((AttributePopupMenu) parent).getAttributeStatisticsPanel();
} else {
asp = (AttributeStatisticsPanel) SwingUtilities.getAncestorOfClass(AttributeStatisticsPanel.class, parent);
if (asp == null) {
// we are not inside a AttributesStatisticPanel
return;
}
}
ButtonBarCardPanel cardPanel = (ButtonBarCardPanel) SwingUtilities.getAncestorOfClass(ButtonBarCardPanel.class, asp);
AbstractAttributeStatisticsModel model = asp.getModel();
// select the plotter view
cardPanel.selectCard("plot_view");
// get the opened plotter
JPanel outerPanel = (JPanel) cardPanel.getShownComponent();
for (Component innerComp : outerPanel.getComponents()) {
if (innerComp instanceof PlotterPanel) {
PlotterPanel plotterPanel = (PlotterPanel) innerComp;
PlotterConfigurationModel settings = plotterPanel.getPlotterSettings();
// adjust settings
if (model instanceof NominalAttributeStatisticsModel) {
settings.setPlotter(PlotterConfigurationModel.BAR_CHART);
settings.setParameterAsString(PlotterConfigurationSettings.AXIS_PLOT_COLUMN,
model.getAttribute().getName());
settings.setParameterAsString(PlotterConfigurationSettings.GROUP_BY_COLUMN,
model.getAttribute().getName());
} else if (model instanceof NumericalAttributeStatisticsModel
|| model instanceof DateTimeAttributeStatisticsModel) {
settings.setPlotter(PlotterConfigurationModel.HISTOGRAM_PLOT);
settings.setParameterAsString(PlotterConfigurationSettings.NUMBER_OF_BINS, "10");
settings.setParameterAsString(PlotterConfigurationSettings.AXIS_PLOT_COLUMNS,
model.getAttribute().getName());
}
break;
}
}
}