Example usage for weka.gui.arffviewer ArffTable ArffTable

List of usage examples for weka.gui.arffviewer ArffTable ArffTable

Introduction

In this page you can find the example usage for weka.gui.arffviewer ArffTable ArffTable.

Prototype

public ArffTable(TableModel model) 

Source Link

Document

initializes with the given model

Usage

From source file:meka.gui.modelviewer.renderers.InstancesRenderer.java

License:Open Source License

/**
 * Performs the actual rendering.//from   w w w  .  j  a  v a 2s  .c om
 *
 * @param obj      the object to render
 * @param panel   the panel to render into
 * @return      null if successful, otherwise error message
 */
@Override
protected String doRender(Object obj, JPanel panel) {
    ArffTable table;
    Instances data;

    data = (Instances) obj;
    // bug in weka, cannot render empty dataset
    if (data.numInstances() == 0)
        return new PlainTextRenderer().render(obj, panel);

    table = new ArffTable(new ArffSortedTableModel(data));
    panel.add(new BaseScrollPane(table), BorderLayout.CENTER);

    return null;
}