当前位置: 首页>>代码示例>>Java>>正文


Java ResultDisplayTools类代码示例

本文整理汇总了Java中com.rapidminer.gui.processeditor.results.ResultDisplayTools的典型用法代码示例。如果您正苦于以下问题:Java ResultDisplayTools类的具体用法?Java ResultDisplayTools怎么用?Java ResultDisplayTools使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResultDisplayTools类属于com.rapidminer.gui.processeditor.results包,在下文中一共展示了ResultDisplayTools类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startVisualization

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
@Override
public void startVisualization(Object id) {
	int index = 0;
	if (id instanceof String) {
		String idString = (String) id;
		index = Integer.parseInt(idString.substring(0, idString.indexOf("(")).trim());
	} else {
		index = ((Double) id).intValue();
	}
	AggregationIndividual individual = lastPopulation.get(index);
	ExampleSet es = null;
	try {
		es = individual.createExampleSet(originalExampleSet, allAttributes, generator);
	} catch (GenerationException e) {
		throw new RuntimeException("Cannot visualize individual '" + index + "': " + e.getMessage());
	}
	Component visualizationComponent = ResultDisplayTools.createVisualizationComponent(es, null, es.getName());
	JFrame frame = new JFrame();
	frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	frame.getContentPane().setLayout(new BorderLayout());
	frame.getContentPane().add(new ExtendedJScrollPane(visualizationComponent), BorderLayout.CENTER);
	frame.setSize(600, 400);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:26,代码来源:AggregationPopulationPlotter.java

示例2: getVisualizationComponent

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
	DataTable dataTable = getDataTable(renderable, ioContainer, true);
	if (dataTable != null) {
		DataTableViewerTable resultTable = new DataTableViewerTable(dataTable, isSortable(), isColumnMovable(),
				isAutoresize());
		resultTable.setRowHeight(PropertyPanel.VALUE_CELL_EDITOR_HEIGHT);
		resultTable.setRowHighlighting(true);
		resultTable.setCellColorProvider(getCellColorProvider(resultTable, renderable));

		ExtendedJScrollPane scrollPane = new ExtendedJScrollPane(resultTable);
		scrollPane.setBorder(BorderFactory.createEmptyBorder(42, 10, 15, 10));
		scrollPane.setBackground(Colors.WHITE);
		scrollPane.getViewport().setBackground(Colors.WHITE);

		JPanel component = new JPanel(new BorderLayout());
		component.add(scrollPane, BorderLayout.CENTER);
		return component;
	} else {
		return ResultDisplayTools.createErrorComponent("No visualization possible for table.");
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:23,代码来源:AbstractDataTableTableRenderer.java

示例3: getVisualizationComponent

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
	TableModel tableModel = getTableModel(renderable, ioContainer, false);
	if (tableModel != null) {
		ExtendedJTable table = new ExtendedJTable(getTableModel(renderable, ioContainer, false), isSortable(),
				isColumnMovable(), isAutoresize());
		table.setRowHighlighting(true);
		table.setRowHeight(PropertyPanel.VALUE_CELL_EDITOR_HEIGHT);
		table.getTableHeader().putClientProperty(RapidLookTools.PROPERTY_TABLE_HEADER_BACKGROUND, Colors.WHITE);
		((TableHeaderUI) table.getTableHeader().getUI()).installDefaults();

		JScrollPane sp = new ExtendedJScrollPane(table);
		sp.setBorder(BorderFactory.createEmptyBorder(42, 10, 10, 10));
		sp.setBackground(Colors.WHITE);
		sp.getViewport().setBackground(Colors.WHITE);

		JPanel panel = new JPanel(new BorderLayout());
		panel.add(sp, BorderLayout.CENTER);
		return panel;
	} else {
		return ResultDisplayTools.createErrorComponent("No visualization possible for table.");
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:24,代码来源:AbstractTableModelTableRenderer.java

示例4: startVisualization

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
public void startVisualization(Object id) {
	int index = 0;
	if (id instanceof String) {
		String idString = (String) id;
		index = Integer.parseInt(idString.substring(0, idString.indexOf("(")).trim());
	} else
		index = ((Double) id).intValue();
	AggregationIndividual individual = lastPopulation.get(index);
	ExampleSet es = null;
	try {
		es = individual.createExampleSet(originalExampleSet, allAttributes, generator);
	} catch (GenerationException e) {
		throw new RuntimeException("Cannot visualize individual '" + index + "': " + e.getMessage());
	}
	Component visualizationComponent = ResultDisplayTools.createVisualizationComponent(es, null, es.getName());
	JFrame frame = new JFrame();
	frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	frame.getContentPane().setLayout(new BorderLayout());
	frame.getContentPane().add(new ExtendedJScrollPane(visualizationComponent), BorderLayout.CENTER);
	frame.setSize(600, 400);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:24,代码来源:AggregationPopulationPlotter.java

示例5: getVisualizationComponent

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
	GraphCreator<String, String> graphCreator = getGraphCreator(renderable, ioContainer);
	if (graphCreator != null) {
		return new GraphViewer<>(graphCreator);
	} else {
		return ResultDisplayTools.createErrorComponent("No data for graph creation.");
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:10,代码来源:AbstractGraphRenderer.java

示例6: AverageVectorViewer

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
public AverageVectorViewer(AverageVector vector, IOContainer container) {
	setLayout(new GridLayout(1, 1));
	this.vector = vector;

	JPanel mainPanel = new JPanel();
	GridBagLayout layout = new GridBagLayout();
	mainPanel.setLayout(layout);
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.BOTH;
	c.insets = new Insets(11, 11, 11, 11);
	c.gridwidth = GridBagConstraints.REMAINDER;
	c.weightx = 1.0d;
	c.weighty = 0.0d;

	JLabel mainLabel = new JLabel("<html><h2>" + getName() + " (" + vector.size() + ")</h2></html>");
	layout.setConstraints(mainLabel, c);
	mainPanel.add(mainLabel);

	for (int i = 0; i < vector.size(); i++) {
		Averagable avg = vector.getAveragable(i);
		Component visualizationComponent = ResultDisplayTools.createVisualizationComponent(avg, container, "Averagable");
		layout.setConstraints(visualizationComponent, c);
		mainPanel.add(visualizationComponent);

	}
	ExtendedJScrollPane scrollPane = new ExtendedJScrollPane(mainPanel);
	scrollPane.setBorder(null);
	add(scrollPane);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:30,代码来源:AverageVectorViewer.java

示例7: calculateANOVA

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
private void calculateANOVA() throws SignificanceCalculationException {
	double alpha = -1;
	String alphaString = alphaField.getText();
	try {
		alpha = Double.parseDouble(alphaString);
	} catch (NumberFormatException e) {
		SwingTools.showVerySimpleErrorMessage("sign_lvl_between_0_1");
	}

	if ((alpha < 0) || (alpha > 1)) {
		SwingTools.showVerySimpleErrorMessage("sign_lvl_between_0_1");			
	} else {
		this.calculator.clearGroups();
		this.calculator.setAlpha(alpha);
		for (int i = 0; i < tableModel.getRowCount(); i++) {
			double mean = ((Double) tableModel.getValueAt(i, 0)).doubleValue();
			double variance = ((Double) tableModel.getValueAt(i, 1)).doubleValue();
			int number = ((Integer) tableModel.getValueAt(i, 2)).intValue();
			calculator.addGroup(number, mean, variance);
		}
		if (tableModel.getRowCount() < 2) {
			SwingTools.showVerySimpleErrorMessage("two_rows_to_calc_anova_test");
			return;
		}

		SignificanceTestResult result = calculator.performSignificanceTest();
		SwingTools.showResultsDialog("anova", ResultDisplayTools.createVisualizationComponent(result, null, "ANOVA Result"));
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:30,代码来源:AnovaCalculatorDialog.java

示例8: getVisualizationComponent

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
	DelegationModel model = (DelegationModel) renderable;
	JPanel result = new JPanel();
	result.setLayout(new BorderLayout());
	String info = model.getShortInfo();
	if (info != null)
		result.add(new JLabel(info), BorderLayout.NORTH);
	result.add(ResultDisplayTools.createVisualizationComponent(model.getBaseModel(), ioContainer, model.getBaseModel().getName()), BorderLayout.CENTER);
	return result;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:12,代码来源:DelegationModelRenderer.java

示例9: AverageVectorViewer

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
public AverageVectorViewer(AverageVector vector, IOContainer container) {
	setLayout(new GridLayout(1, 1));
	this.vector = vector;

	JPanel mainPanel = new JPanel();
	GridBagLayout layout = new GridBagLayout();
	mainPanel.setLayout(layout);
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.BOTH;
	c.insets = new Insets(11,11,11,11);
	c.gridwidth = GridBagConstraints.REMAINDER;
	c.weightx = 1.0d;
	c.weighty = 0.0d;

	JLabel mainLabel = new JLabel("<html><h2>" + getName() + " (" + vector.size() + ")</h2></html>");
	layout.setConstraints(mainLabel, c);
	mainPanel.add(mainLabel);

	for (int i = 0; i < vector.size(); i++) {
		Averagable avg = vector.getAveragable(i);
		Component visualizationComponent = ResultDisplayTools.createVisualizationComponent(avg, container, "Averagable"); 
		layout.setConstraints(visualizationComponent, c);
		mainPanel.add(visualizationComponent);

	}
	add(new ExtendedJScrollPane(mainPanel));
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:28,代码来源:AverageVectorViewer.java

示例10: getVisualizationComponent

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
	DelegationModel model = (DelegationModel) renderable;
	return ResultDisplayTools.createVisualizationComponent(model.getBaseModel(), ioContainer, model.getBaseModel()
			.getName());
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:7,代码来源:DelegationModelRenderer.java

示例11: PerformanceVectorViewer

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
public PerformanceVectorViewer(final PerformanceVector performanceVector, final IOContainer container) {
	setLayout(new BorderLayout());

	// all criteria
	final CardLayout cardLayout = new CardLayout();
	final JPanel mainPanel = new JPanel(cardLayout);
	add(mainPanel, BorderLayout.CENTER);
	List<String> criteriaNameList = new LinkedList<>();
	for (int i = 0; i < performanceVector.getSize(); i++) {
		PerformanceCriterion criterion = performanceVector.getCriterion(i);
		criteriaNameList.add(criterion.getName());
		JPanel component = ResultDisplayTools.createVisualizationComponent(criterion, container,
				"Performance Criterion", false);
		JScrollPane criterionPane = new ExtendedJScrollPane(component);
		criterionPane.setBorder(null);
		criterionPane.setBackground(Colors.WHITE);
		mainPanel.add(criterionPane, criterion.getName());
	}
	if (criteriaNameList.isEmpty()) {
		remove(mainPanel);
		add(new ResourceLabel("result_view.no_criterions"));
		return;
	}
	String[] criteriaNames = new String[criteriaNameList.size()];
	criteriaNameList.toArray(criteriaNames);

	// selection list
	final JList<String> criteriaList = new JList<String>(criteriaNames) {

		private static final long serialVersionUID = 3031125186920370793L;

		@Override
		public Dimension getPreferredSize() {
			Dimension dim = super.getPreferredSize();
			dim.width = Math.max(150, dim.width);
			return dim;
		}
	};
	criteriaList.setCellRenderer(new CriterionListCellRenderer());
	criteriaList.setOpaque(false);

	criteriaList.setBorder(BorderFactory.createTitledBorder("Criterion"));
	criteriaList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

	criteriaList.addListSelectionListener(new ListSelectionListener() {

		@Override
		public void valueChanged(ListSelectionEvent e) {
			String selected = criteriaList.getSelectedValue();
			cardLayout.show(mainPanel, selected);
		}
	});

	JScrollPane listScrollPane = new ExtendedJScrollPane(criteriaList);
	listScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 2));
	add(listScrollPane, BorderLayout.WEST);

	// select first criterion
	criteriaList.setSelectedIndices(new int[] { 0 });
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:61,代码来源:PerformanceVectorViewer.java

示例12: AssociationRuleTableViewer

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
public AssociationRuleTableViewer(AssociationRules rules) {
	if (rules != null && rules.getNumberOfRules() > 0) {
		this.model = new AssociationRuleTableModel(rules);
		setLayout(new BorderLayout());
		JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
		splitPane.setBorder(null);

		// conclusion list
		AssociationRuleFilter filter = new AssociationRuleFilter(rules);
		filter.addAssociationRuleFilterListener(this);
		filter.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 5));
		splitPane.add(filter, 0);

		// main panel
		{
			JPanel mainPanel = new JPanel();
			mainPanel.setOpaque(true);
			mainPanel.setBackground(Colors.WHITE);
			GridBagLayout layout = new GridBagLayout();
			mainPanel.setLayout(layout);
			GridBagConstraints c = new GridBagConstraints();
			c.fill = GridBagConstraints.BOTH;
			c.weightx = 1;
			c.weighty = 1;
			c.gridwidth = GridBagConstraints.REMAINDER;
			c.insets = new Insets(15, 10, 10, 10);

			table.setModel(model);
			table.setRowHeight(PropertyPanel.VALUE_CELL_EDITOR_HEIGHT);
			table.setRowHighlighting(true);
			JScrollPane tablePane = new ExtendedJScrollPane(table);
			tablePane.setBorder(null);
			tablePane.setBackground(Colors.WHITE);
			tablePane.getViewport().setBackground(Colors.WHITE);
			layout.setConstraints(tablePane, c);
			mainPanel.add(tablePane);

			setColumnSizes();

			splitPane.add(mainPanel, 1);
		}
		filter.triggerFilter();

		add(splitPane, BorderLayout.CENTER);
	} else {
		add(ResultDisplayTools.createErrorComponent("No rules found"), BorderLayout.CENTER);
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:49,代码来源:AssociationRuleTableViewer.java

示例13: AssociationRuleTableViewer

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
public AssociationRuleTableViewer(AssociationRules rules) {
	if (rules != null && rules.getNumberOfRules() > 0) {
		this.model = new AssociationRuleTableModel(rules);
		setLayout(new BorderLayout());
		JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
		splitPane.setBorder(null);

		// conclusion list
		AssociationRuleFilter filter = new AssociationRuleFilter(rules);
		filter.addAssociationRuleFilterListener(this);
		filter.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 5));
		splitPane.add(filter, 0);

		// main panel
		{
			JPanel mainPanel = new JPanel();
			mainPanel.setOpaque(true);
			mainPanel.setBackground(Colors.WHITE);
			GridBagLayout layout = new GridBagLayout();
			mainPanel.setLayout(layout);
			GridBagConstraints c = new GridBagConstraints();
			c.fill = GridBagConstraints.BOTH;
			c.weightx = 1;
			c.weighty = 1;
			c.gridwidth = GridBagConstraints.REMAINDER;
			c.insets = new Insets(15, 10, 10, 10);

			table.setModel(model);
			table.setRowHeight(PropertyPanel.VALUE_CELL_EDITOR_HEIGHT);
			table.setRowHighlighting(true);
			table.setAutoResizeMode(ExtendedJTable.AUTO_RESIZE_OFF);
			JScrollPane tablePane = new ExtendedJScrollPane(table);
			tablePane.setBorder(null);
			tablePane.setBackground(Colors.WHITE);
			tablePane.getViewport().setBackground(Colors.WHITE);
			layout.setConstraints(tablePane, c);
			mainPanel.add(tablePane);

			setColumnSizes();

			splitPane.add(mainPanel, 1);
			table.getTableHeader().setBackground(Colors.WHITE);
			table.getTableHeader().putClientProperty(RapidLookTools.PROPERTY_TABLE_HEADER_BACKGROUND, Colors.WHITE);
		}
		filter.triggerFilter();

		add(splitPane, BorderLayout.CENTER);
	} else {
		add(ResultDisplayTools.createErrorComponent("No rules found"), BorderLayout.CENTER);
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:52,代码来源:AssociationRuleTableViewer.java

示例14: PerformanceVectorViewer

import com.rapidminer.gui.processeditor.results.ResultDisplayTools; //导入依赖的package包/类
public PerformanceVectorViewer(final PerformanceVector performanceVector, final IOContainer container) {
	setLayout(new BorderLayout());

	// all criteria
	final CardLayout cardLayout = new CardLayout();
	final JPanel mainPanel = new JPanel(cardLayout);
	add(mainPanel, BorderLayout.CENTER);
	List<String> criteriaNameList = new LinkedList<String>();
	for (int i = 0; i < performanceVector.getSize(); i++) {
		PerformanceCriterion criterion = performanceVector.getCriterion(i);
		criteriaNameList.add(criterion.getName());
		Component component = ResultDisplayTools.createVisualizationComponent(criterion, container, "Performance Criterion");
		JScrollPane criterionPane = new ExtendedJScrollPane(component);
		criterionPane.setBorder(null);
		mainPanel.add(criterionPane, criterion.getName());
	}
	String[] criteriaNames = new String[criteriaNameList.size()];
	criteriaNameList.toArray(criteriaNames);
	final JList criteriaList = new JList(criteriaNames) {

		private static final long serialVersionUID = 3031125186920370793L;

		@Override
		public Dimension getPreferredSize() {
			Dimension dim = super.getPreferredSize();
			dim.width = Math.max(150, dim.width);
			return dim;
		}
	};


	// selection list
	criteriaList.setBorder(BorderFactory.createTitledBorder("Criterion Selector"));
	criteriaList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

	criteriaList.addListSelectionListener(new ListSelectionListener() {
		public void valueChanged(ListSelectionEvent e) {
			String selected = (String)criteriaList.getSelectedValue();
			cardLayout.show(mainPanel, selected);
		}
	});

	JScrollPane listScrollPane = new ExtendedJScrollPane(criteriaList);
	listScrollPane.setBorder(null);
	add(listScrollPane, BorderLayout.WEST);

	// select first criterion
	criteriaList.setSelectedIndices(new int[] { 0 });
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:50,代码来源:PerformanceVectorViewer.java


注:本文中的com.rapidminer.gui.processeditor.results.ResultDisplayTools类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。