Package org.geotools.swing.dialog
Class CRSListModel
- All Implemented Interfaces:
Serializable
,ListModel<String>
List model class for
JCRSChooser
. Supports filtering by case-insensitive sub-string matching.- Since:
- 8.0
- Author:
- Michael Bedward
- See Also:
-
Field Summary
Fields inherited from class AbstractListModel
listenerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Searches for the element with the given code.getCodeAt
(int i) Gets the code for the given element index.getElementAt
(int i) int
getSize()
void
Filters the model items by searching for the given sub-string.Methods inherited from class AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Constructor Details
-
CRSListModel
Constructor. Populates the model with available reference systems for the specified authority. Ifauthority
isnull
or empty, it defaults toJCRSChooser.DEFAULT_AUTHORITY
.- Parameters:
authority
- the authority name
-
-
Method Details
-
getSize
public int getSize()- Returns:
- the length of the list with the current filter applied
-
getElementAt
- Returns:
- a
String
of the formreference code: description
-
setFilter
Filters the model items by searching for the given sub-string. Case is ignored for matching.- Parameters:
subStr
- sub-string to filter on; ornull
or empty string for no filtering
-
getCodeAt
Gets the code for the given element index.- Parameters:
i
- the index- Returns:
- the code
-
findCode
Searches for the element with the given code. The search is undertaken on the filtered items.- Parameters:
code
- the code to match; may benull
or empty in which case -1 is returned- Returns:
- index of the matching element or -1 if not found.
-