本文整理汇总了Java中com.rapidminer.gui.viewer.DataTableViewer类的典型用法代码示例。如果您正苦于以下问题:Java DataTableViewer类的具体用法?Java DataTableViewer怎么用?Java DataTableViewer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataTableViewer类属于com.rapidminer.gui.viewer包,在下文中一共展示了DataTableViewer类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startVisualization
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
@Override
public void startVisualization(Object id) {
double[] weights = lastPopulation.get(id);
SimpleDataTable dataTable = new SimpleDataTable("Attribute Weights", new String[] { "Attribute", "Weight" });
int a = 0;
for (Attribute attribute : exampleSet.getAttributes()) {
dataTable
.add(new SimpleDataTableRow(new double[] { dataTable.mapString(0, attribute.getName()), weights[a++] }));
}
Component visualizationComponent = new DataTableViewer(dataTable);
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);
}
示例2: updateDataTables
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
/**
* Update the DataTableViewers. This does not happen on the EDT and is executed asynchronously
* by an {@link UpdateQueue}.
*/
private void updateDataTables() {
final Collection<DataTable> copy = new LinkedList<>(dataTables.values());
// this is time consuming, so execute off EDT
tableUpdateQueue.execute(new Runnable() {
@Override
public void run() {
final Collection<DataTableViewer> viewers = new LinkedList<>();
for (DataTable table : copy) {
viewers.add(new DataTableViewer(table, true, DataTableViewer.PLOT_MODE));
}
installDataTableViewers(viewers);
}
@Override
public String toString() {
return "Update data table list to size " + copy.size();
}
});
}
示例3: updateDataTables
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
/**
* Update the DataTableViewers. This does not happen on the EDT and is executed asynchronously
* by an {@link UpdateQueue}.
*/
private void updateDataTables() {
final Collection<DataTable> copy = new LinkedList<>(dataTables.values());
// this is time consuming, so execute off EDT
tableUpdateQueue.execute(new Runnable() {
@Override
public void run() {
final Collection<DataTableViewer> viewers = new LinkedList<>();
for (DataTable table : copy) {
viewers.add(new DataTableViewer(table, true, DataTableViewer.TABLE_MODE));
}
installDataTableViewers(viewers);
}
@Override
public String toString() {
return "Update data table list to size " + copy.size();
}
});
}
示例4: startVisualization
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
public void startVisualization(Object id) {
double[] weights = lastPopulation.get(id);
SimpleDataTable dataTable = new SimpleDataTable("Attribute Weights", new String[] { "Attribute", "Weight" });
int a = 0;
for (Attribute attribute : exampleSet.getAttributes()) {
dataTable.add(new SimpleDataTableRow(new double[] { dataTable.mapString(0, attribute.getName()), weights[a++] } ));
}
Component visualizationComponent = new DataTableViewer(dataTable);
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);
}
示例5: updateDataTables
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
/** Update the DataTableViewers. This does not happen on the EDT
* and is executed asynchronously by an {@link UpdateQueue}. */
private void updateDataTables(final Collection<DataTable> newTableList) {
final Collection<DataTable> copy = new LinkedList<DataTable>(newTableList);
// this is time consuming, so execute off EDT
tableUpdateQueue.execute(new Runnable() {
public void run() {
final Collection<DataTableViewer> viewers = new LinkedList<DataTableViewer>();
for (DataTable table : copy) {
viewers.add(new DataTableViewer(table, true, DataTableViewer.PLOT_MODE));
}
installDataTableViewers(viewers);
}
@Override
public String toString() {
return "Update data table list to size "+copy.size();
}
});
}
示例6: installDataTableViewers
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
/** Adds the collection of components in the EDT (after removing the old tables. */
private void installDataTableViewers(final Collection<DataTableViewer> viewers) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
for (int i = tabs.getTabCount() - 1; i >= 0; i--) {
Component c = tabs.getComponentAt(i);
if (c instanceof DataTableViewer) {
tabs.removeTabAt(i);
}
}
int pos = 0;
for (DataTableViewer viewer : viewers) {
tabs.insertTab(viewer.getDataTable().getName(), dataTableIcon, viewer, "The data table '"+viewer.getDataTable().getName()+"'.", pos);
pos++;
}
}
});
}
示例7: updateDataTables
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
/** Update the DataTableViewers. This does not happen on the EDT
* and is executed asynchronously by an {@link UpdateQueue}. */
private void updateDataTables() {
final Collection<DataTable> copy = new LinkedList<DataTable>(dataTables.values());
// this is time consuming, so execute off EDT
tableUpdateQueue.execute(new Runnable() {
public void run() {
final Collection<DataTableViewer> viewers = new LinkedList<DataTableViewer>();
for (DataTable table : copy) {
viewers.add(new DataTableViewer(table, true, DataTableViewer.PLOT_MODE));
}
installDataTableViewers(viewers);
}
@Override
public String toString() {
return "Update data table list to size "+copy.size();
}
});
}
示例8: setDataTableViewer
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
public void setDataTableViewer(DataTableViewer viewer) {
if (viewer == this.viewer) {
return;
}
if (this.viewer != null) {
remove(this.viewer);
}
if (viewer != null) {
this.viewer = viewer;
dockKey.setName(viewer.getDataTable().getName());
} else {
this.viewer = makeTableNotRestoredLabel();
}
add(this.viewer, BorderLayout.CENTER);
}
示例9: getDataTable
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
public DataTable getDataTable() {
if (this.viewer != null && viewer instanceof DataTableViewer) {
return ((DataTableViewer) this.viewer).getDataTable();
} else {
return null;
}
}
示例10: setDataTableViewer
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
public void setDataTableViewer(DataTableViewer viewer) {
if (viewer == this.viewer) {
return;
}
if (this.viewer != null) {
remove(this.viewer);
}
if (viewer != null) {
this.viewer = viewer;
dockKey.setName(viewer.getDataTable().getName());
} else {
this.viewer = makeTableNotRestoredLabel();
}
add(this.viewer, BorderLayout.CENTER);
}
示例11: getDataTable
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
public DataTable getDataTable() {
if ((this.viewer != null) && (viewer instanceof DataTableViewer)) {
return ((DataTableViewer)this.viewer).getDataTable();
} else {
return null;
}
}
示例12: clearResults
import com.rapidminer.gui.viewer.DataTableViewer; //导入依赖的package包/类
private void clearResults() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
for (int i = tabs.getTabCount() - 1; i >= 0; i--) {
Component c = tabs.getComponentAt(i);
if (!(c instanceof DataTableViewer)) {
tabs.removeTabAt(i);
}
}
}
});
}