本文整理汇总了Java中com.rapidminer.gui.plotter.PlotterPanel类的典型用法代码示例。如果您正苦于以下问题:Java PlotterPanel类的具体用法?Java PlotterPanel怎么用?Java PlotterPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlotterPanel类属于com.rapidminer.gui.plotter包,在下文中一共展示了PlotterPanel类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVisualizationComponent
import com.rapidminer.gui.plotter.PlotterPanel; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
SOMModelVisualizationResult result = (SOMModelVisualizationResult) renderable;
DataTable table = new DataTableExampleSetAdapter(result.getExampleSet(), null);
PlotterConfigurationModel settings = new PlotterConfigurationModel(
PlotterConfigurationModel.MODEL_PLOTTER_SELECTION, table);
settings.setPlotter("SOM");
PlotterPanel panel = new PlotterPanel(settings);
Plotter plotter = settings.getPlotter();
((SOMModelPlotter) plotter).setExampleSet(result.getExampleSet());
((SOMModelPlotter) plotter).setModel(result.getModel());
return panel;
}
示例2: render
import com.rapidminer.gui.plotter.PlotterPanel; //导入依赖的package包/类
@Override
public void render(Graphics graphics, int width, int height) {
component.setSize(width, height);
if (component instanceof PlotterPanel) {
((PlotterPanel) component).getPlotterSettings().getPlotter().render(graphics, width, height);
} else {
component.paint(graphics);
}
}
示例3: getVisualizationComponent
import com.rapidminer.gui.plotter.PlotterPanel; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
String source = null;
if (renderable instanceof ExampleSet) {
source = ((ExampleSet) renderable).getSource();
}
return new PlotterPanel(PlotterSettingsHistory.getPlotterSettingsFromHistory((IOObject) renderable,
getDataTable(renderable, ioContainer), getPlotterSelection()), source);
}
示例4: getVisualizationComponent
import com.rapidminer.gui.plotter.PlotterPanel; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
SOMModelVisualizationResult result = (SOMModelVisualizationResult) renderable;
DataTable table = new DataTableExampleSetAdapter(result.getExampleSet(), null);
PlotterConfigurationModel settings = new PlotterConfigurationModel(PlotterConfigurationModel.MODEL_PLOTTER_SELECTION, table);
settings.setPlotter("SOM");
PlotterPanel panel = new PlotterPanel(settings);
Plotter plotter = settings.getPlotter();
((SOMModelPlotter)plotter).setExampleSet(result.getExampleSet());
((SOMModelPlotter)plotter).setModel(result.getModel());
return panel;
}
示例5: render
import com.rapidminer.gui.plotter.PlotterPanel; //导入依赖的package包/类
public void render(Graphics graphics, int width, int height) {
component.setSize(width, height);
if (component instanceof PlotterPanel) {
((PlotterPanel)component).getPlotterSettings().getPlotter().render(graphics, width, height);
} else {
component.paint(graphics);
}
}
示例6: DataTableViewer
import com.rapidminer.gui.plotter.PlotterPanel; //导入依赖的package包/类
public DataTableViewer(DataTable dataTable, LinkedHashMap<String, Class<? extends Plotter>> availablePlotters,
boolean showPlotter, String tableMode, boolean autoResize) {
super(new BorderLayout());
// create empty buttonCard
ButtonBarCardPanel bCard = new ButtonBarCardPanel();
// Build table view
this.dataTableViewerTable = new DataTableViewerTable(autoResize);
this.tablePanel = new JPanel(new BorderLayout());
JPanel infoPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
infoPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 5));
infoPanel.add(generalInfo);
infoPanel.setOpaque(true);
infoPanel.setBackground(Colors.WHITE);
tablePanel.add(infoPanel, BorderLayout.NORTH);
JScrollPane tableScrollPane = new ExtendedJScrollPane(dataTableViewerTable);
tableScrollPane.setBorder(BorderFactory.createEmptyBorder(1, 10, 10, 5));
tableScrollPane.setBackground(Colors.WHITE);
tableScrollPane.getViewport().setBackground(Colors.WHITE);
tablePanel.add(tableScrollPane, BorderLayout.CENTER);
// add data table to the result view
bCard.addCard(new ResourceCard("data_view", "result_view.data_view"), tablePanel);
// Add plotters if desired
if (showPlotter) {
this.plotterSettings = new PlotterConfigurationModel(availablePlotters, dataTable);
this.plotterPanel = new PlotterPanel(plotterSettings);
DataTable plotData = plotterSettings.getDataTable();
// preface to create ChartConfigationPanel:
ExampleSet exampleSet = DataTableExampleSetAdapter.createExampleSetFromDataTable(plotData);
Map<DatasetTransformationType, PlotConfiguration> plotConfigurationMap = PlotConfigurationHistory
.getPlotConfigurationMap(exampleSet, plotData);
PlotInstance plotInstance = new PlotInstance(plotConfigurationMap.get(DatasetTransformationType.ORIGINAL),
plotData);
this.advancedPanel = new ChartConfigurationPanel(true, plotInstance, plotData,
plotConfigurationMap.get(DatasetTransformationType.DE_PIVOTED));
// add Plotter to the result view
bCard.addCard(new ResourceCard("plot_view", "result_view.plot_view"), plotterPanel);
// add advanced Charts to the result view
bCard.addCard(new ResourceCard("advanced_charts", "result_view.advanced_charts"), advancedPanel);
} // end if (showPlotter)
// check select desired view
if (PLOT_MODE.equals(tableMode) && showPlotter) {
bCard.selectCard("plot_view");
} else if (ADVANCED_MODE.equals(tableMode) && showPlotter) {
bCard.selectCard("advanced_charts");
}
add(bCard, BorderLayout.CENTER);
setDataTable(dataTable);
}
示例7: getPlotterPanel
import com.rapidminer.gui.plotter.PlotterPanel; //导入依赖的package包/类
public PlotterPanel getPlotterPanel() {
return plotterPanel;
}
示例8: actionPerformed
import com.rapidminer.gui.plotter.PlotterPanel; //导入依赖的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;
}
}
}
示例9: loggedActionPerformed
import com.rapidminer.gui.plotter.PlotterPanel; //导入依赖的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;
}
}
}
示例10: getVisualizationComponent
import com.rapidminer.gui.plotter.PlotterPanel; //导入依赖的package包/类
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
return new PlotterPanel(PlotterSettingsHistory.getPlotterSettingsFromHistory((IOObject) renderable, getDataTable(renderable, ioContainer), getPlotterSelection()));
}