Example usage for weka.gui.arffviewer ArffSortedTableModel ArffSortedTableModel

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

Introduction

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

Prototype

public ArffSortedTableModel(TableModel model) 

Source Link

Document

initializes the sorter with the given model

Usage

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

License:Open Source License

/**
 * Performs the actual rendering.// w w w  .  j a v  a  2  s .co  m
 *
 * @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;
}