Class StyleSelectorListModel

java.lang.Object
org.gvsig.app.gui.styling.StyleSelectorListModel
All Implemented Interfaces:
ListModel, org.gvsig.utils.listManager.ListModel

public class StyleSelectorListModel extends Object implements org.gvsig.utils.listManager.ListModel
Implements a list to select styles.This list has the property that allows the user to stablish a filter to accept or reject elements for it from a directory which is also specified when the StyleSelectorModel is created.
  • Field Details

    • STYLE_FILE_EXTENSION

      public static final String STYLE_FILE_EXTENSION
      See Also:
    • elements

      protected Vector<org.gvsig.fmap.mapcontext.rendering.symbols.styles.IStyle> elements
    • folder

      protected File folder
    • fFilter

      protected FileFilter fFilter
    • sFilter

      protected SelectorFilter sFilter
    • fileExt

      protected String fileExt
  • Constructor Details

    • StyleSelectorListModel

      public StyleSelectorListModel(File dir, SelectorFilter filter, 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.

      Parameters:
      dir - , the root dir where styles are located.
      filter - , the filter used to show or hide some elements.
      fileExtension - , file extension used for the files to be parsed.
      currentElemet - , the element to be pre-selected.
  • Method Details

    • getObjects

      public Vector<org.gvsig.fmap.mapcontext.rendering.symbols.styles.IStyle> getObjects()
      TODO: use the new Persistence API.
      Specified by:
      getObjects in interface org.gvsig.utils.listManager.ListModel
    • add

      public void add(Object o)
      Specified by:
      add in interface org.gvsig.utils.listManager.ListModel
    • getSize

      public int getSize()
      Specified by:
      getSize in interface ListModel
    • getElementAt

      public Object getElementAt(int index)
      Specified by:
      getElementAt in interface ListModel
    • addListDataListener

      public void addListDataListener(ListDataListener l)
      Specified by:
      addListDataListener in interface ListModel
    • removeListDataListener

      public void removeListDataListener(ListDataListener l)
      Specified by:
      removeListDataListener in interface ListModel
    • remove

      public Object remove(int i) throws ArrayIndexOutOfBoundsException
      Specified by:
      remove in interface org.gvsig.utils.listManager.ListModel
      Throws:
      ArrayIndexOutOfBoundsException
    • insertAt

      public void insertAt(int i, Object o)
      Specified by:
      insertAt in interface org.gvsig.utils.listManager.ListModel