Package ca.spatial.mapview
Class ChoroplethTheme
java.lang.Object
javax.swing.table.AbstractTableModel
ca.spatial.mapview.Theme
ca.spatial.mapview.ChoroplethTheme
- All Implemented Interfaces:
Visibility
,EditableTableModel
,Serializable
,Comparator
,TableModel
- Direct Known Subclasses:
DefaultTheme
,DitherTheme
,NumericTheme
,UniqueValueTheme
This is the parent theme for symbolizing spatial layers
containing features or grid layers.
Other more specialized themes will inherit from this class.
- See Also:
- Serialized Form
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement(ThemeElement te, String keys)
void
Add a row to the table using default values.void
Add a row to the table.clone(ChoroplethTheme newTheme)
int
void
compile(Layer layer, AttributeStore store, String fieldname)
Prepare the theme for use with this layer.abstract void
generateSymbols(String fieldname, Window owner, int period, Layer layer)
This method causes the theme information to be recalulated on a new column.getColumnClass(int column)
int
abstract Object
getDataValueAt(int row, int period)
Get the data value for the given object id and period.Return a ThemeEditor component appropriate for the theme type.Get the field that is to be used to classify this theme.Get the color palette being used by this themeint
AbstractTableModel and EditableTableModel interfacesGet the selected object symbol for this themeabstract ThemeEditor
getSubEditor(Layer layer)
Retrive an editor object that will cusomtize the theme.getSymbol(int row, int period)
Get a symbol for a given object id and period.getSymbol(AttributeStore as, Layer layer, int row, double scale, int period)
Get a symbol for the given layer stateGet a symbol for the key valueint
Get the number of symbols in this themeGet the ThemeElement (label and symbol) used for unclassified or NoData features.boolean
A flag if unclassified values should be mappedgetValueAt(int row, int column)
boolean
isCellEditable(int rowIndex, int columnIndex)
void
moveRow(int from, int to)
Move the specified row to a new locationvoid
removeRow(int row)
Remove the row specified by the row number.void
Deprecated.void
resetStore(GeoRelationalStore store)
Deprecated.void
setColorset(int colorSet)
Set the legacy color set used for this theme.abstract void
setFieldname(String fieldname)
Deprecated.void
setPalette(ColorPalette palette)
Set the color palette to be used for this themevoid
setSelectedSymbol(Symbol selectedSymbol)
Set the symbol to use for selected valuesvoid
Set the ThemeElement to use for unclassified or NoData features (including label and symbol).void
setUseUnclassified(boolean useUnclassified)
Set if unclassified values should be mappedvoid
setValueAt(Object aValue, int rowIndex, int columnIndex)
boolean
Methods inherited from class ca.spatial.mapview.Theme
clone, getAlpha, getCaption, getChipHeight, getChipWidth, getColumnName, getIsScaled, getMaxScale, getMinScale, getReferenceScale, getSymbol, getSymbolType, getThemeName, hasSelectionContext, isDynamic, resetSelectionContext, setAlpha, setCaption, setChipSize, setIsScaled, setMaxScale, setMinScale, setReferenceScale
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener
-
Method Details
-
reset
Deprecated.This method used to reset the classification and symbols. Now each theme will have a specialized generateSymbols method that will perform this function. -
resetStore
Deprecated.This method was used to change the underlying table rendered by the theme. It is now deprecated and does not do anything. Instead create a new layer specifying the data source, theme and column name. -
generateSymbols
public abstract void generateSymbols(String fieldname, Window owner, int period, Layer layer) throws ExceptionThis method causes the theme information to be recalulated on a new column.- Throws:
Exception
-
compile
Prepare the theme for use with this layer. If the theme specified a field or expression then the expression will be compiled, possibly resulting in an Exception.This method will not change the thematic symbols. In order to automatically build a new list of symbols use the generateSymbols method of the appropriate theme.
The symbols for unclassified data values and selected features will be adjusted if the underlying feature type changes (e.g. from Polygon to Line).
- Parameters:
layer
- the parent layerstore
- the attribute table to compile the expression againstfieldname
- the fieldname or expression to use to lookup values for this theme- Throws:
Exception
-
setFieldname
Deprecated.Set the column name or expression that will categorize each feature. This method is deprecated. Associate the fieldname to use with the theme by using theGeoRelLayer(GeoRelationalStore,ChoroplethTheme,String)
constructor. -
getFieldname
Get the field that is to be used to classify this theme. -
getEditor
Description copied from class:Theme
Return a ThemeEditor component appropriate for the theme type. -
getSubEditor
Retrive an editor object that will cusomtize the theme.- Parameters:
layer
- the parent layer
-
getRowCount
public int getRowCount()Description copied from class:Theme
AbstractTableModel and EditableTableModel interfaces- Specified by:
getRowCount
in interfaceTableModel
- Specified by:
getRowCount
in classTheme
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCount
in interfaceTableModel
- Specified by:
getColumnCount
in classTheme
-
getValueAt
- Specified by:
getValueAt
in interfaceTableModel
- Specified by:
getValueAt
in classTheme
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
- Specified by:
setValueAt
in classTheme
-
getColumnClass
- Specified by:
getColumnClass
in interfaceTableModel
- Specified by:
getColumnClass
in classTheme
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex)- Specified by:
isCellEditable
in interfaceTableModel
- Specified by:
isCellEditable
in classTheme
-
removeRow
public void removeRow(int row)Description copied from interface:EditableTableModel
Remove the row specified by the row number.- Specified by:
removeRow
in interfaceEditableTableModel
-
addRow
Description copied from interface:EditableTableModel
Add a row to the table. The number of items in the rowData array must match the number of columns in the table.- Specified by:
addRow
in interfaceEditableTableModel
-
symbolsInitialized
public boolean symbolsInitialized() -
moveRow
public void moveRow(int from, int to)Description copied from interface:EditableTableModel
Move the specified row to a new location- Specified by:
moveRow
in interfaceEditableTableModel
-
addRow
Description copied from interface:EditableTableModel
Add a row to the table using default values. Optionally provide a reference to the parent window in case a dialog needs to be shown.- Specified by:
addRow
in interfaceEditableTableModel
-
addElement
-
getSymbol
Description copied from class:Theme
Get a symbol for a given object id and period. This method only gets the raw symbol type, and is usually called by other methods that will take unclassified values and visibility parameters in to account. -
getSymbol
Description copied from class:Theme
Get a symbol for the key value -
getSymbol
public Symbol getSymbol(AttributeStore as, Layer layer, int row, double scale, int period) throws ExceptionGet a symbol for the given layer state- Parameters:
as
- the underlying attribute tablelayer
- the parent layerrow
- the object idscale
- the world to page scaleperiod
- the period of interest- Throws:
Exception
-
getSelectedSymbol
Description copied from class:Theme
Get the selected object symbol for this theme- Specified by:
getSelectedSymbol
in classTheme
-
setSelectedSymbol
Set the symbol to use for selected values -
setUnclassified
Set the ThemeElement to use for unclassified or NoData features (including label and symbol). -
getUnclassified
Get the ThemeElement (label and symbol) used for unclassified or NoData features. -
getUseUnclassified
public boolean getUseUnclassified()A flag if unclassified values should be mapped -
setUseUnclassified
public void setUseUnclassified(boolean useUnclassified)Set if unclassified values should be mapped -
getSymbolCount
public int getSymbolCount()Get the number of symbols in this theme -
setColorset
public void setColorset(int colorSet)Set the legacy color set used for this theme.This method is deprecated, use the
setPalette(ca.spatial.mapview.symbol.ColorPalette)
method instead. See theColorPalette
class for more information about predefined color palettes. -
setPalette
Set the color palette to be used for this theme -
getPalette
Get the color palette being used by this theme -
getDataValueAt
Get the data value for the given object id and period. Themes may override this method to apply normalization or other adjustments. -
compare
- Specified by:
compare
in interfaceComparator
-
clone
-