org.grinvin.worksheet

Class ConjecturingComboBoxModel

Implemented Interfaces:
ComboBoxModel, InvariantListModelListener, ListDataListener

public class ConjecturingComboBoxModel
extends AbstractListModel
implements ComboBoxModel, InvariantListModelListener

Combo box model for the conjecturing window. Keeps track of an ordered list of invariants, and only shows those that are accepted by the associated engine.

Constructor Summary

ConjecturingComboBoxModel(Engine engine, WorksheetModel worksheetModel)

Method Summary

void
add(Invariant invariant)
Add an invariant to the combobox.
void
contentsChanged(ListDataEvent e)
Invariant
getElementAt(int index)
Engine
getEngine()
int
getSelectedIndex()
Returns the internal index of the selected item.
Invariant
getSelectedItem()
int
getSize()
int
indexOf(Invariant invariant)
Return the index of the given invariant in the internal list.
void
intervalAdded(ListDataEvent e)
void
intervalRemoved(ListDataEvent e)

Constructor Details

ConjecturingComboBoxModel

public ConjecturingComboBoxModel(Engine engine,
                                 WorksheetModel worksheetModel)

Method Details

add

public void add(Invariant invariant)
Add an invariant to the combobox. Only adds the invariant when this is allowed by the engine.

contentsChanged

public void contentsChanged(ListDataEvent e)

getElementAt

public Invariant getElementAt(int index)

getEngine

public Engine getEngine()

getSelectedIndex

public int getSelectedIndex()

getSelectedItem

public Invariant getSelectedItem()

getSize

public int getSize()

indexOf

public int indexOf(Invariant invariant)
Return the index of the given invariant in the internal list.

intervalAdded

public void intervalAdded(ListDataEvent e)

intervalRemoved

public void intervalRemoved(ListDataEvent e)