Class BlockStore

All Implemented Interfaces:
PopupActivationListener, Serializable, Comparable, EventListener, Observer, ListSelectionListener, TableModelListener, TableModel

public final class BlockStore extends AttributeStore implements Observer, TableModelListener
This class provides a table that exposes block attributes. The block attributes consist of:
  • All attributes in the block coverage or shapefile;
  • The join key;
  • The area and offset of the managed and unmanaged portions of the block;
  • Route connections (vertex)
  • All stand attributes
  • Summary accounts
  • Route lengths and haul costs
  • Patch account information
See Also:
Serialized Form
  • Constructor Details

    • BlockStore

      public BlockStore(ca.spatial.patchworks.Forest forest, AttributeStore data)
  • Method Details

    • close

      public void close()
      Description copied from class: AttributeStore
      Close the table and release resources. The table should be used again after this method has been called.

      In many cases you do not need to call this method when you are finished using a table. Most tables will close automatically when they are no longer referenced.

      It is possible that this method will be deprecated or removed in a future release.

      Overrides:
      close in class AttributeStore
    • getRowCount

      public int getRowCount()
      Description copied from class: AttributeStore
      Get the number of rows in this store
      Specified by:
      getRowCount in interface TableModel
      Specified by:
      getRowCount in class AttributeStore
      Returns:
      the number of rows in this store
    • getPeriodCount

      public int getPeriodCount()
      Description copied from class: AttributeStore
      Get the total number of periods that this store supports
      Specified by:
      getPeriodCount in class AttributeStore
      Returns:
      The number of periods in this store
    • getYearForPeriod

      public int getYearForPeriod(int period)
      Description copied from class: AttributeStore
      Get the ending year for a given period.
      Specified by:
      getYearForPeriod in class AttributeStore
      Parameters:
      period - The period of interest
      Returns:
      the year for a given period
    • allowsEditing

      public boolean allowsEditing()
      Description copied from class: AttributeStore
      Query if this layer supports extended editing of features. Extended editing usually means that values can be written out to disk.
      Overrides:
      allowsEditing in class AttributeStore
      Returns:
      true if the store allows editing
    • getShapeData

      public AttributeStore getShapeData()
    • getLabelPos

      public int getLabelPos()
    • getSynchronizer

      public Suspendable getSynchronizer()
      Description copied from class: AttributeStore
      Get the synchronizer object for this table. This object can be used to suspend the scheduling task as a set of calculations are carried out. Most tables will not have a synchronizer object. The only tables that will are tables that provide simulation results.
      Overrides:
      getSynchronizer in class AttributeStore
    • setEditMode

      public void setEditMode(boolean mode) throws IOException
      Description copied from class: AttributeStore
      Enable or disable the extended editing mode.
      Overrides:
      setEditMode in class AttributeStore
      Parameters:
      mode - the editing mode to use
      Throws:
      IOException - if an error occurs while trying to change the edit mode.
    • getEditMode

      public boolean getEditMode()
      Description copied from class: AttributeStore
      Get the status of the extended editing mode.
      Overrides:
      getEditMode in class AttributeStore
      Returns:
      the editing mode in use
    • getValueAt

      public Object getValueAt(int row, int column, int period)
      Description copied from class: AttributeStore
      Get a cell value
      Specified by:
      getValueAt in class AttributeStore
      Parameters:
      row - The row containing the cell
      column - The column containing the cell
      period - The period of interest
      Returns:
      An object containing the cell value.
    • setValueAt

      public void setValueAt(Object object, int row, int column, int period)
      Description copied from class: AttributeStore
      Set the value in a cell and notify listeners that the value has changed.

      Implementing classes that override must call this method to ensure that joins are properly maintained.

      Overrides:
      setValueAt in class AttributeStore
      Parameters:
      object - The value to be set.
      row - The row containing the cell
      column - The column containing the cell
      period - The period of interest
    • update

      public void update(Observable o, Object arg)
      Specified by:
      update in interface Observer
    • tableChanged

      public void tableChanged(TableModelEvent e)
      Propogate table events
      Specified by:
      tableChanged in interface TableModelListener
    • addCellEditors

      public void addCellEditors(JTable jt, int offset)
      Description copied from class: AttributeStore
      This method will be called by components that want to set up custom cell editors on JTables. If your table has custom editing behaviour then you can hook it in using this method.
      Overrides:
      addCellEditors in class AttributeStore
      Parameters:
      jt - A JTable
      offset - the column number in the store that will have a custom cell editor
    • addMenuItems

      public void addMenuItems(JPopupMenu jpm, AttributeStore l, int row, int period)
      Description copied from class: AttributeStore
      Add menu items to be displayed when a popup menu is activated on this table. This method when a popup mouse click happens on a map layer, just before the popup menu appears. Each layer is given an opportunity to add menu items into the popup that are specific to the functionality that the layer provides. The menu items that are added must contain the functionality to perform the requested action.
      Specified by:
      addMenuItems in interface PopupActivationListener
      Overrides:
      addMenuItems in class AttributeStore
      Parameters:
      jpm - The menu that the items should be added into
      l - The main AttributeStore that initiated this request. This may be different than the current AttributeStore if the main table is a RelationalStore composed of a number of parts.
      row - The row in the table that this event applies to
      period - The period that the request applies to.