Example usage for weka.gui JListHelper canMoveDown

List of usage examples for weka.gui JListHelper canMoveDown

Introduction

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

Prototype

public static boolean canMoveDown(JList list) 

Source Link

Document

checks whether the selected items can be moved down

Usage

From source file:meka.gui.experimenter.BasicSetup.java

License:Open Source License

/**
 * Updates the enabled state of the buttons.
 *//*from w  ww.  jav  a 2  s. c o  m*/
protected void updateButtons() {
    boolean present;
    boolean running;
    boolean editable;
    boolean handled;

    super.updateButtons();

    present = (m_Experiment != null);
    running = present && m_Experiment.isRunning();
    handled = !m_PanelUnsupported.isVisible();
    editable = present && !running && handled;

    // classifiers
    m_ButtonAddClassifier.setEnabled(editable);
    m_ButtonRemoveClassifier
            .setEnabled(editable && (m_ListClassifiers.getList().getSelectedIndices().length >= 1));
    m_ButtonRemoveAllClassifiers.setEnabled(editable && (m_ModelClassifiers.getSize() > 0));
    m_ButtonEditClassifier
            .setEnabled(editable && (m_ListClassifiers.getList().getSelectedIndices().length == 1));
    m_ButtonMoveUpClassifier.setEnabled(editable && JListHelper.canMoveUp(m_ListClassifiers.getList()));
    m_ButtonMoveDownClassifier.setEnabled(editable && JListHelper.canMoveDown(m_ListClassifiers.getList()));

    // datasets
    m_ButtonAddDataset.setEnabled(editable);
    m_ButtonRemoveDataset.setEnabled(editable && (m_ListDatasets.getList().getSelectedIndices().length >= 1));
    m_ButtonRemoveAllDatasets.setEnabled(editable && (m_ModelDatasets.getSize() > 0));
    m_ButtonMoveUpDataset.setEnabled(editable && JListHelper.canMoveUp(m_ListDatasets.getList()));
    m_ButtonMoveDownDataset.setEnabled(editable && JListHelper.canMoveDown(m_ListDatasets.getList()));

    // other
    m_ButtonNotes.setEnabled(editable);
}

From source file:meka.gui.experimenter.ExpertSetup.java

License:Open Source License

/**
 * Updates the enabled state of the buttons.
 *//*from   ww w  . j  a  v a  2  s .  co m*/
protected void updateButtons() {
    boolean present;
    boolean running;
    boolean editable;
    boolean handled;

    super.updateButtons();

    present = (m_Experiment != null);
    running = present && m_Experiment.isRunning();
    handled = !m_PanelUnsupported.isVisible();
    editable = present && !running && handled;

    // classifiers
    m_ButtonAddClassifier.setEnabled(editable);
    m_ButtonRemoveClassifier
            .setEnabled(editable && (m_ListClassifiers.getList().getSelectedIndices().length >= 1));
    m_ButtonRemoveAllClassifiers.setEnabled(editable && (m_ModelClassifiers.getSize() > 0));
    m_ButtonEditClassifier
            .setEnabled(editable && (m_ListClassifiers.getList().getSelectedIndices().length == 1));
    m_ButtonMoveUpClassifier.setEnabled(editable && JListHelper.canMoveUp(m_ListClassifiers.getList()));
    m_ButtonMoveDownClassifier.setEnabled(editable && JListHelper.canMoveDown(m_ListClassifiers.getList()));

    // other
    m_ButtonNotes.setEnabled(editable);
}