Package ca.spatial.mapview
Class NumericTheme
java.lang.Object
javax.swing.table.AbstractTableModel
ca.spatial.mapview.Theme
ca.spatial.mapview.ChoroplethTheme
ca.spatial.mapview.NumericTheme
- All Implemented Interfaces:
Visibility
,EditableTableModel
,Serializable
,Comparator
,TableModel
- Direct Known Subclasses:
GradientTheme
This class renders features based on a numeric value classified
based on ranges of values.
- See Also:
- Serialized Form
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int
static int
static int
static int
static int
static int
static String[]
-
Constructor Summary
ConstructorsConstructorDescriptionNumericTheme(GeoRelationalStore store)
Deprecated.NumericTheme(GeoRelationalStore store, String fieldname)
Deprecated.NumericTheme(GeoRelationalStore store, String fieldname, int method, int intervals, int ndec, String normalize)
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Return a deep copy of the object as appropriate for each theme typeclone(NumericTheme uv)
void
compile(Layer layer, AttributeStore store, String fieldname)
Prepare the theme for use with this layer.void
generateSymbols(String fieldname, Window owner, int period, Layer layer)
This method causes the theme information to be recalulated on a new column.void
generateSymbols(String fieldname, Window owner, int period, Layer layer, int method, int intervals, int ndec)
This method causes the theme information to be recalulated on a new column.getColumnName(int columnIndex)
getDataValueAt(int row, int period)
Get the data value for the given object id and period.int
double
getMax()
int
double
getMin()
int
getNDec()
Deprecated.getSubEditor(Layer lle)
Retrive an editor object that will cusomtize the theme.Get a symbol for a specific key.boolean
Ask if theme makes use of cached spatial queries to speed up operations.boolean
By default themes are static and do not change over time.void
Selection contexts can cache results of time consuming selection operations involved in some spatial quary operators.void
setFieldname(String fieldname)
Set the column name or expression that will categorize each feature.void
setIntervals(int intervals)
void
setMethod(int method)
void
setNDec(int ndec)
void
setNormalize(String normalize)
Deprecated.void
setStats(double min, double max, double mean, double stdev)
void
Methods inherited from class ca.spatial.mapview.ChoroplethTheme
addElement, addRow, addRow, clone, compare, getColumnClass, getColumnCount, getEditor, getFieldname, getPalette, getRowCount, getSelectedSymbol, getSymbol, getSymbol, getSymbol, getSymbolCount, getUnclassified, getUseUnclassified, getValueAt, isCellEditable, moveRow, removeRow, reset, resetStore, setColorset, setPalette, setSelectedSymbol, setUnclassified, setUseUnclassified, setValueAt, symbolsInitialized
Methods inherited from class ca.spatial.mapview.Theme
getAlpha, getCaption, getChipHeight, getChipWidth, getIsScaled, getMaxScale, getMinScale, getReferenceScale, getSymbolType, getThemeName, 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
-
Field Details
-
EQUAL_INTERVAL
public static final int EQUAL_INTERVAL- See Also:
- Constant Field Values
-
STANDARD_DEVIATION
public static final int STANDARD_DEVIATION- See Also:
- Constant Field Values
-
ARITHMETRIC
public static final int ARITHMETRIC- See Also:
- Constant Field Values
-
GEOMETRIC
public static final int GEOMETRIC- See Also:
- Constant Field Values
-
EQUAL_AREA
public static final int EQUAL_AREA- See Also:
- Constant Field Values
-
NATURAL_BREAKS
public static final int NATURAL_BREAKS- See Also:
- Constant Field Values
-
THEMENAMES
-
-
Constructor Details
-
NumericTheme
public NumericTheme() -
NumericTheme
@Deprecated public NumericTheme(GeoRelationalStore store, String fieldname, int method, int intervals, int ndec, String normalize)Deprecated. -
NumericTheme
Deprecated. -
NumericTheme
Deprecated.
-
-
Method Details
-
getMethod
public int getMethod() -
setMethod
public void setMethod(int method) -
getNDec
public int getNDec() -
setNDec
public void setNDec(int ndec) -
getIntervals
public int getIntervals() -
setIntervals
public void setIntervals(int intervals) -
getColumnName
- Specified by:
getColumnName
in interfaceTableModel
- Specified by:
getColumnName
in classTheme
-
setStats
public void setStats(double min, double max, double mean, double stdev) -
getMin
public double getMin() -
getMax
public double getMax() -
getSubEditor
Description copied from class:ChoroplethTheme
Retrive an editor object that will cusomtize the theme.- Specified by:
getSubEditor
in classChoroplethTheme
- Parameters:
lle
- the parent layer
-
setFieldname
Description copied from class:ChoroplethTheme
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.- Specified by:
setFieldname
in classChoroplethTheme
-
isDynamic
public boolean isDynamic()Description copied from class:Theme
By default themes are static and do not change over time. Override this method if a change in period should result in the theme being redrawn. -
getNormalize
Deprecated.Normalization fields are deprecated.- See Also:
setNormalize(java.lang.String)
-
setNormalize
Deprecated.Normalization fields are deprecated. Instead use an expression that includes the denominator to be used to scale the value. For examplefeature.Habitat.Marten/area()
-
updateKeys
public void updateKeys() -
getSymbol
Description copied from class:Theme
Get a symbol for a specific key. 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. -
getDataValueAt
Description copied from class:ChoroplethTheme
Get the data value for the given object id and period. Themes may override this method to apply normalization or other adjustments.- Specified by:
getDataValueAt
in classChoroplethTheme
-
compile
Description copied from class:ChoroplethTheme
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).
- Overrides:
compile
in classChoroplethTheme
- 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
-
generateSymbols
public void generateSymbols(String fieldname, Window owner, int period, Layer layer) throws ExceptionDescription copied from class:ChoroplethTheme
This method causes the theme information to be recalulated on a new column.- Specified by:
generateSymbols
in classChoroplethTheme
- Throws:
Exception
-
generateSymbols
public void generateSymbols(String fieldname, Window owner, int period, Layer layer, int method, int intervals, int ndec) throws ExceptionThis method causes the theme information to be recalulated on a new column. This involves rescanning the attribute table to determine the min and max range of the data values, and creating categories based on the calssification parameters. Symbols wil be created using the current palette.- Parameters:
fieldname
- the column name or expression used to classify the symbolsowner
- the window of the calling GUI, or nullperiod
- the period of interestlayer
- the parent layermethod
- the classification methodintervals
- the number of intervals to be used in the classificationndec
- the number of decimals to round the classification ranges at- Throws:
Exception
-
resetSelectionContext
public void resetSelectionContext()Description copied from class:Theme
Selection contexts can cache results of time consuming selection operations involved in some spatial quary operators. This method will release the cached selection values so that the query will be recalculated.- Specified by:
resetSelectionContext
in classTheme
-
hasSelectionContext
public boolean hasSelectionContext()Description copied from class:Theme
Ask if theme makes use of cached spatial queries to speed up operations.- Specified by:
hasSelectionContext
in classTheme
-
clone
Description copied from class:Theme
Return a deep copy of the object as appropriate for each theme type -
clone
-