Package ca.spatial.mapview
Class GradientTheme
java.lang.Object
javax.swing.table.AbstractTableModel
ca.spatial.mapview.Theme
ca.spatial.mapview.ChoroplethTheme
ca.spatial.mapview.NumericTheme
ca.spatial.mapview.GradientTheme
- All Implemented Interfaces:
Visibility
,EditableTableModel
,Serializable
,Comparator
,TableModel
The GradientTheme class provides a continuous color gradient rendering
of values. Several stretching methods are provided to map data values
to the continuous color ramp.
- See Also:
- Serialized Form
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int
Histogram equalization provides a non-linear mapping to approximate an equal number of elements in each color gradientstatic int
Minimum-Maximum uses a linear mapping of values from the actual range of data to fit the color rampstatic int
The NONE stretch method assumes 8-bit values in the range 0-255static int
Percent clip sets performs a linear interpolation with clipping of the low and upper percent of valuesstatic int
The default number of colors used to estimate a continuous rangestatic int
Standard Deviation uses a linear mapping between the lower and upper standard deviation limits.Fields inherited from class ca.spatial.mapview.NumericTheme
ARITHMETRIC, EQUAL_AREA, EQUAL_INTERVAL, GEOMETRIC, NATURAL_BREAKS, THEMENAMES
-
Constructor Summary
ConstructorsConstructorDescriptionGradientTheme(String fieldname)
Deprecated.GradientTheme(String fieldname, String normalize)
Deprecated. -
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()
Return a deep copy of the object as appropriate for each theme typevoid
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, double p1, double p2)
This method causes the theme information to be recalulated on a new column.double
getP1()
double
getP2()
getSubEditor(Layer lle)
Retrive an editor object that will cusomtize the theme.Get a symbol for a specific key.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
setClipPercent(double low, double high)
void
setMethod(int method)
void
setPalette(ColorPalette palette)
Set the color palette to be used for this themevoid
setStdDevLimits(double limit)
void
setValueAt(Object aValue, int rowIndex, int columnIndex)
void
Methods inherited from class ca.spatial.mapview.NumericTheme
clone, generateSymbols, getColumnName, getDataValueAt, getIntervals, getMax, getMethod, getMin, getNDec, getNormalize, hasSelectionContext, isDynamic, resetSelectionContext, setFieldname, setIntervals, setNDec, setNormalize, setStats
Methods inherited from class ca.spatial.mapview.ChoroplethTheme
clone, compare, getColumnClass, getColumnCount, getEditor, getFieldname, getPalette, getRowCount, getSelectedSymbol, getSymbol, getSymbol, getSymbol, getSymbolCount, getUnclassified, getUseUnclassified, getValueAt, isCellEditable, reset, resetStore, setColorset, setSelectedSymbol, setUnclassified, setUseUnclassified, 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
-
RAMP_SIZE
public static final int RAMP_SIZEThe default number of colors used to estimate a continuous range- See Also:
- Constant Field Values
-
NONE
public static final int NONEThe NONE stretch method assumes 8-bit values in the range 0-255- See Also:
- Constant Field Values
-
MINIMUM_MAXIMUM
public static final int MINIMUM_MAXIMUMMinimum-Maximum uses a linear mapping of values from the actual range of data to fit the color ramp- See Also:
- Constant Field Values
-
STANDARD_DEVIATION
public static final int STANDARD_DEVIATIONStandard Deviation uses a linear mapping between the lower and upper standard deviation limits.- See Also:
- Constant Field Values
-
PERCENT_CLIP
public static final int PERCENT_CLIPPercent clip sets performs a linear interpolation with clipping of the low and upper percent of values- See Also:
- Constant Field Values
-
HISTOGRAM_EQUALIZATION
public static final int HISTOGRAM_EQUALIZATIONHistogram equalization provides a non-linear mapping to approximate an equal number of elements in each color gradient- See Also:
- Constant Field Values
-
-
Constructor Details
-
GradientTheme
public GradientTheme() -
GradientTheme
Deprecated. -
GradientTheme
Deprecated.
-
-
Method Details
-
getP1
public double getP1() -
getP2
public double getP2() -
setStdDevLimits
public void setStdDevLimits(double limit) -
setClipPercent
public void setClipPercent(double low, double high) -
setMethod
public void setMethod(int method)- Overrides:
setMethod
in classNumericTheme
-
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.- Overrides:
getSymbol
in classNumericTheme
- Parameters:
key
- the key value used to look up the appropriate symbol
-
getSubEditor
Description copied from class:ChoroplethTheme
Retrive an editor object that will cusomtize the theme.- Overrides:
getSubEditor
in classNumericTheme
- Parameters:
lle
- the parent layer
-
setPalette
Description copied from class:ChoroplethTheme
Set the color palette to be used for this theme- Overrides:
setPalette
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 classNumericTheme
- 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 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 classification parameters.- Overrides:
generateSymbols
in classNumericTheme
- Throws:
Exception
-
generateSymbols
public void generateSymbols(String fieldname, Window owner, int period, Layer layer, int method, double p1, double p2) 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 classification parameters.- Throws:
Exception
-
updateKeys
public void updateKeys()- Overrides:
updateKeys
in classNumericTheme
-
clone
Description copied from class:Theme
Return a deep copy of the object as appropriate for each theme type- Overrides:
clone
in classNumericTheme
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classChoroplethTheme
-
addElement
- Overrides:
addElement
in classChoroplethTheme
-
removeRow
public void removeRow(int row)Description copied from interface:EditableTableModel
Remove the row specified by the row number.- Specified by:
removeRow
in interfaceEditableTableModel
- Overrides:
removeRow
in classChoroplethTheme
-
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
- Overrides:
addRow
in classChoroplethTheme
-
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
- Overrides:
addRow
in classChoroplethTheme
-
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
- Overrides:
moveRow
in classChoroplethTheme
-