public class StyleSelectorListModel extends java.lang.Object implements ListModel
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Vector<IStyle> |
elements |
protected java.io.FileFilter |
fFilter |
protected java.lang.String |
fileExt |
protected java.io.File |
folder |
protected SelectorFilter |
sFilter |
static java.lang.String |
STYLE_FILE_EXTENSION |
| Constructor and Description |
|---|
StyleSelectorListModel(java.io.File dir,
SelectorFilter filter,
java.lang.String fileExtension)
Creates a new instance of the model for the list in the Style Selector window
where the styles are stored in the dir (root directory) param.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Object o)
Appends the specified element to the end of this Vector
|
void |
addListDataListener(javax.swing.event.ListDataListener l) |
java.lang.Object |
getElementAt(int index) |
java.util.Vector<IStyle> |
getObjects()
TODO: use the new Persistence API.
|
int |
getSize() |
void |
insertAt(int i,
java.lang.Object o)
Inserts the specified element at the specified position in this Vector.
|
java.lang.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).
|
void |
removeListDataListener(javax.swing.event.ListDataListener l) |
public static final java.lang.String STYLE_FILE_EXTENSION
protected java.util.Vector<IStyle> elements
protected java.io.File folder
protected java.io.FileFilter fFilter
protected SelectorFilter sFilter
protected java.lang.String fileExt
public StyleSelectorListModel(java.io.File dir,
SelectorFilter filter,
java.lang.String fileExtension)
Creates a new instance of the model for the list in the Style Selector window
where the styles are stored in the dir (root directory) param.
The currentElement defines which element is pre-selected.
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 styles 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 styles are located.currentElemet, - the element to be pre-selected.filter, - the filter used to show or hide some elements.fileExtension, - file extension used for the files to be parsed.public java.util.Vector<IStyle> getObjects()
public void add(java.lang.Object o)
ListModelo - element to be appended to this Vectorpublic int getSize()
getSize in interface javax.swing.ListModelpublic java.lang.Object getElementAt(int index)
getElementAt in interface javax.swing.ListModelpublic void addListDataListener(javax.swing.event.ListDataListener l)
addListDataListener in interface javax.swing.ListModelpublic void removeListDataListener(javax.swing.event.ListDataListener l)
removeListDataListener in interface javax.swing.ListModelpublic java.lang.Object remove(int i)
throws java.lang.ArrayIndexOutOfBoundsException
ListModeli - Índice del elemento que se quiere eliminarjava.lang.ArrayIndexOutOfBoundsException - Si el índice está fuera del arraypublic void insertAt(int i,
java.lang.Object o)
ListModeli - index at which the specified element is to be inserted.o - element to be inserted.