public class SymbolSelectorListModel extends AbstractListModel implements ListModel, Disposable
listenerList
Constructor and Description |
---|
SymbolSelectorListModel(File dir,
SelectorFilter filter,
String fileExtension)
Creates a new instance of the model for the list in the Symbol Selector
window where the symbols are stored in the dir (root directory)
param.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
accepts(ISymbol symbol) |
void |
add(Object o)
Appends the specified element to the end of this Vector
|
void |
dispose()
Disposes the current object, to allow it to close and dispose any used
resources.
|
Object |
getElementAt(int index) |
Vector<ISymbol> |
getObjects()
Obtains the objects that are in the model
|
int |
getSize() |
void |
insertAt(int i,
Object o)
Inserts the specified element at the specified position in this Vector.
|
Object |
remove(int i)
Removes the element at the specified position in this Vector. shifts any
subsequent elements to the left (subtracts one from their indices).
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListDataListener, removeListDataListener
public SymbolSelectorListModel(File dir, SelectorFilter filter, String fileExtension)
Creates a new instance of the model for the list in the Symbol Selector
window where the symbols are stored in the dir (root directory)
param.
The filter is a user defined filter used to know which elements in
the folder are accepted or rejected for this list and it is used to avoid
mixing marker symbols for polygons for example.
fileExtension param defines the extension of the file to be parsed. This is like that to enable inheritance of this class to other file selector such as StyleSelector.
dir
- , the root dir where symbols are located.filter
- , the filter used to show or hide some elements.fileExtension
- , file extension used for the files to be parsed.public void dispose()
Disposable
NOTE:After calling this method, the object may not be usable anymore.
dispose
in interface Disposable
public Object remove(int i) throws ArrayIndexOutOfBoundsException
ListModel
i
- Índice del elemento que se quiere eliminarArrayIndexOutOfBoundsException
- Si el índice está fuera del arraypublic void insertAt(int i, Object o)
ListModel
i
- index at which the specified element is to be inserted.o
- element to be inserted.protected boolean accepts(ISymbol symbol)
public void add(Object o)
ListModel
o
- element to be appended to this Vectorpublic Vector<ISymbol> getObjects()
ListModel
public Object getElementAt(int index)
getElementAt
in interface ListModel