edu.stanford.smi.protegex.owl.ui.navigation
Class NavigationHistoryManager
java.lang.Object
javax.swing.AbstractListModel
javax.swing.DefaultListModel
edu.stanford.smi.protegex.owl.ui.navigation.NavigationHistoryManager
- All Implemented Interfaces:
- ComboBoxModel, edu.stanford.smi.protege.util.Disposable, ListModel, Serializable
- public class NavigationHistoryManager
- extends DefaultListModel
- implements ComboBoxModel, edu.stanford.smi.protege.util.Disposable
An object that manages the navigation history across in a certain context.
This object stores all visited resources in a list so that back and forward
buttons can be used to navigate. It also registers itself as a ModelListener
to the OWLModel to be able to delete entries from the list if they have been deleted.
- Author:
- Holger Knublauch
- See Also:
- Serialized Form
Methods inherited from class javax.swing.DefaultListModel |
add, addElement, capacity, clear, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, getElementAt, getSize, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAllElements, removeElement, removeElementAt, removeRange, set, setElementAt, setSize, size, toArray, toString, trimToSize |
backAction
private ResourceSelectionAction backAction
deleteListener
private ModelListener deleteListener
forwardAction
private ResourceSelectionAction forwardAction
index
private int index
- The index at which the most recent entry was added
listeners
private Set listeners
navigationHistorySelectable
private NavigationHistorySelectable navigationHistorySelectable
owlModel
private OWLModel owlModel
resourcesSet
private Set resourcesSet
selectionListener
private edu.stanford.smi.protege.util.SelectionListener selectionListener
NavigationHistoryManager
public NavigationHistoryManager(NavigationHistorySelectable nhc,
OWLModel owlModel)
- Constructs a new NavigationHistoryManager. Immediately after construction
this should be supplied with an initial entry, using
add
.
- See Also:
add(edu.stanford.smi.protegex.owl.model.RDFResource)
add
public void add(RDFResource resource)
addIndexListener
public void addIndexListener(ActionListener listener)
back
public void back()
dispose
public void dispose()
- Specified by:
dispose
in interface edu.stanford.smi.protege.util.Disposable
forward
public void forward()
getBackAction
public ResourceSelectionAction getBackAction()
getResource
public RDFResource getResource(int index)
getForwardAction
public ResourceSelectionAction getForwardAction()
getSelectedIndex
public int getSelectedIndex()
handleSelectionChanged
private void handleSelectionChanged()
removeResource
private void removeResource(RDFResource resource)
removeResourceByIndex
private void removeResourceByIndex(int index)
setSelectedResourceByCurrentIndex
private void setSelectedResourceByCurrentIndex()
updateActionStatus
private void updateActionStatus()
getSelectedItem
public Object getSelectedItem()
- Specified by:
getSelectedItem
in interface ComboBoxModel
setSelectedItem
public void setSelectedItem(Object anItem)
- Specified by:
setSelectedItem
in interface ComboBoxModel