Example usage for weka.gui GenericArrayEditor GenericArrayEditor

List of usage examples for weka.gui GenericArrayEditor GenericArrayEditor

Introduction

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

Prototype

public GenericArrayEditor() 

Source Link

Usage

From source file:adams.flow.source.WekaSelectObjects.java

License:Open Source License

/**
 * Initializes the interactive dialog with the 
 *///from  www.j  a va 2 s  .com
@Override
protected void initializeDialog() {
    List current;
    Object obj;
    Object array;
    int i;

    if (m_Dialog == null) {
        m_Dialog = new ApprovalDialog(null, ModalityType.DOCUMENT_MODAL);
        if (m_ShortTitle)
            m_Dialog.setTitle(getName());
        else
            m_Dialog.setTitle(getFullName());
        m_ArrayEditor = new GenericArrayEditor();
        m_Dialog.getContentPane().add(m_ArrayEditor.getCustomEditor(), BorderLayout.CENTER);
        m_Dialog.setSize(GUIHelper.getDefaultSmallDialogDimension());
        m_Dialog.setLocationRelativeTo(getActualParentComponent());
    }

    current = new ArrayList();
    for (BaseString initial : m_InitialObjects) {
        obj = commandlineToObject(initial.getValue());
        if (obj == null)
            getLogger().warning("Failed to convert commandline: " + initial);
        current.add(obj);
    }
    array = Array.newInstance(getItemClass(), current.size());
    for (i = 0; i < current.size(); i++)
        Array.set(array, i, current.get(i));
    m_ArrayEditor.setValue(array);
}