Class LocatedObjectsTableModel

    • Constructor Detail

      • LocatedObjectsTableModel

        public LocatedObjectsTableModel​(LocatedObjectsTableModel.MetaDataDisplay metaDataDisplay)
        Initializes the table model.
        Parameters:
        metaDataDisplay - how to display the meta-data
      • LocatedObjectsTableModel

        public LocatedObjectsTableModel​(LocatedObjectsTableModel.MetaDataDisplay metaDataDisplay,
                                        LocatedObjects objects)
        Initializes the table model.
        Parameters:
        metaDataDisplay - how to display the meta-data
        objects - the underlying objects, can be null
    • Method Detail

      • initModel

        protected void initModel​(LocatedObjects objects)
        Initializes the model.
        Parameters:
        objects - the objects to initialize with
      • 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()
      • getColumnClass

        public Class<?> getColumnClass​(int columnIndex)
        Returns Object.class regardless of columnIndex.
        Specified by:
        getColumnClass in interface TableModel
        Overrides:
        getColumnClass in class AbstractTableModel
        Parameters:
        columnIndex - the column being queried
        Returns:
        the Object.class
      • 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
      • setObjects

        public void setObjects​(LocatedObjects value)
        Sets the objects to display.
        Parameters:
        value - the objects
      • getObjects

        public LocatedObjects getObjects()
        Returns the underlying located objects.
        Returns:
        the objects
      • indexOf

        public int indexOf​(LocatedObject obj)
        Returns the index of the object in the underlying list.
        Parameters:
        obj - the object to located
        Returns:
        the index, -1 if failed to locate