Difference between revisions of "Notes on the Display of AttributeTables"

From OpenJUMP Wiki
Jump to navigation Jump to search
(Created page with 'I wanted to jot down some notes on the code involved in displaying the attributes for features in a layer. Here is a basic run down of the series of method calls when the user c…')
 
Line 1: Line 1:
 
I wanted to jot down some notes on the code involved in displaying the attributes for features in a layer.
 
I wanted to jot down some notes on the code involved in displaying the attributes for features in a layer.
 +
 +
 +
== ViewAttributesPlugIn ==
  
 
Here is a basic run down of the series of method calls when the user calls up the attribute table for a layer:
 
Here is a basic run down of the series of method calls when the user calls up the attribute table for a layer:
Line 5: Line 8:
 
* ViewAttributesPlugIn defines the public static innner class ViewAttributesFrame. A new instance of this class is created when the execute method of the ViewAttributesPlugIn is called.
 
* ViewAttributesPlugIn defines the public static innner class ViewAttributesFrame. A new instance of this class is created when the execute method of the ViewAttributesPlugIn is called.
 
* The constructor of the ViewAttributesFrame class creates a new OneLayerAttributeTab. The constructor of an AttributeTab class creates a new AttributePanel class.
 
* The constructor of the ViewAttributesFrame class creates a new OneLayerAttributeTab. The constructor of an AttributeTab class creates a new AttributePanel class.
 +
[[File:ViewAttributesFrame.png]]
 
* The AttributePanel class defines a layerAdded method that calls the addTablePanel method that is also defined in the AttributePanel class.
 
* The AttributePanel class defines a layerAdded method that calls the addTablePanel method that is also defined in the AttributePanel class.
 
* The addTablePanel method creates a new AttributeTablePanel using the provided LayerTableModel.
 
* The addTablePanel method creates a new AttributeTablePanel using the provided LayerTableModel.
 
* The AttributeTablePanel contains an inner class named MyTable that extends JTable.
 
* The AttributeTablePanel contains an inner class named MyTable that extends JTable.
 +
 +
== FeatureInfoPlugIn ==
 +
 +
== Common Components ==
  
 
The AttributeTablePanel class looks like it could be a package itself. It contains three (3) inner classes and one inner interface. These include:
 
The AttributeTablePanel class looks like it could be a package itself. It contains three (3) inner classes and one inner interface. These include:

Revision as of 12:42, 11 December 2011

I wanted to jot down some notes on the code involved in displaying the attributes for features in a layer.


ViewAttributesPlugIn

Here is a basic run down of the series of method calls when the user calls up the attribute table for a layer:

  • ViewAttributesPlugIn defines the public static innner class ViewAttributesFrame. A new instance of this class is created when the execute method of the ViewAttributesPlugIn is called.
  • The constructor of the ViewAttributesFrame class creates a new OneLayerAttributeTab. The constructor of an AttributeTab class creates a new AttributePanel class.

ViewAttributesFrame.png

  • The AttributePanel class defines a layerAdded method that calls the addTablePanel method that is also defined in the AttributePanel class.
  • The addTablePanel method creates a new AttributeTablePanel using the provided LayerTableModel.
  • The AttributeTablePanel contains an inner class named MyTable that extends JTable.

FeatureInfoPlugIn

Common Components

The AttributeTablePanel class looks like it could be a package itself. It contains three (3) inner classes and one inner interface. These include:

  • MyTable
  • FeatureEditor
  • GeometryCellRenderer
  • SelectionModelRenderer

The AttributeTablePanel class is definitely one of the most complex I've seen in OpenJUMP.

The LayerTableModel class extends the ColumnTableModel class. ColumnTableModel implements the Swing TableModel interface. A LayerTableModel is passed to the AttributeTable so the attribute values of Feature objects in a layer can be displayed.