Class TagTableModel

    • Field Detail

      • m_Tags

        protected List<Tag> m_Tags
        the underlying tags.
    • Constructor Detail

      • TagTableModel

        public TagTableModel()
        Default constructor.
      • TagTableModel

        public TagTableModel​(Tag[] tags)
        Initializes the model with the provided tags.
        Parameters:
        tags - the tags to use
      • TagTableModel

        public TagTableModel​(List<Tag> tags)
        Initializes the model with the provided tags.
        Parameters:
        tags - the tags to use
    • Method Detail

      • clear

        public void clear()
        Removes all tags.
      • add

        public void add​(Tag tag)
        Adds the tag.
        Parameters:
        tag - the tag to add
      • addAll

        public void addAll​(Tag[] tags)
        Adds all the tags.
        Parameters:
        tags - the tags to add
      • addAll

        public void addAll​(List<Tag> tags)
        Adds all the tags.
        Parameters:
        tags - the tags to add
      • remove

        public Tag remove​(int rowIndex)
        Removes the tag at the specified index.
        Parameters:
        rowIndex - the index to remove
        Returns:
        the removed tag
      • get

        public Tag get​(int rowIndex)
        Returns the tag at the specified location.
        Parameters:
        rowIndex - the index of the tag
        Returns:
        the associated tag
      • set

        public void set​(int rowIndex,
                        Tag tag)
        Updates the tag.
        Parameters:
        rowIndex - the index of the tag
        tag - the new tag
      • isEmpty

        public boolean isEmpty()
        Returns whether there are no tags present.
        Returns:
        true if empty
      • getRowCount

        public int getRowCount()
        Returns the number of rows in the model. A JTable uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.
        Returns:
        the number of rows in the model
        See Also:
        getColumnCount()
      • getColumnCount

        public int getColumnCount()
        Returns the number of columns in the model. A JTable uses this method to determine how many columns it should create and display by default.
        Returns:
        the number of columns in the model
        See Also:
        getRowCount()
      • getValueAt

        public Object getValueAt​(int rowIndex,
                                 int columnIndex)
        Returns the value for the cell at columnIndex and rowIndex.
        Parameters:
        rowIndex - the row whose value is to be queried
        columnIndex - the column whose value is to be queried
        Returns:
        the value Object at the specified cell
      • toArray

        public Tag[] toArray()
        Returns the underlying tags as array.
        Returns:
        the array