Class DitherTheme
- All Implemented Interfaces:
Visibility
,EditableTableModel
,Serializable
,Comparator
,TableModel
For each feature to be symbolized, this theme will read in all of the classification values. The values will be summed, and proportions for each value are determined. A swatch (icon) will be generated that has colors assigned according to the proportions of each value. The pattern of the colors in the swatch are randomly reassigned each time the feature is redrawn.
Use the
addElement(String,Color,String)
method to add
labels, colors and expressions to the classification.
Use the generateSymbols(String,Window,int,Layer)
method
to automatically generate classifications that match a given
column name prefix.
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionThe default constructorDitherTheme(GeoRelationalStore store)
Deprecated.DitherTheme(GeoRelationalStore store, String fieldname)
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement(String name, Color c, String field)
Add an element (row) to the classificationvoid
Add a row to the table using default values.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 prefix, Window owner, int period, Layer layer)
Generate a new dithering classification based on all fields that match the specified prefix.getColumnName(int columnIndex)
getDataValueAt(int row, int period)
Get the data value for the given object id and period.getSubEditor(Layer lle)
Retrive an editor object that will cusomtize the theme.int
Get the size of the swatch that will be generated and used to paint the dithered pattern.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 a specific key.getValueAt(int row, int column)
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
removeRow(int row)
Remove the row specified by the row number.void
Selection contexts can cache results of time consuming selection operations involved in some spatial quary operators.void
setFieldname(String fieldname)
Deprecated.void
setSwatchSize(int size)
Set the size of the swatch that will be generated and used to paint the dithered pattern.void
setValueAt(Object aValue, int rowIndex, int columnIndex)
void
Methods inherited from class ca.spatial.mapview.ChoroplethTheme
addElement, addRow, clone, compare, getColumnClass, getColumnCount, getEditor, getFieldname, getPalette, getRowCount, getSelectedSymbol, getSymbol, getSymbolCount, getUnclassified, getUseUnclassified, isCellEditable, moveRow, reset, resetStore, setColorset, setPalette, 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
-
Constructor Details
-
DitherTheme
public DitherTheme()The default constructor -
DitherTheme
Deprecated.This Constructor assigns the feature table that is the source of the feature to be drawn.This constructor is deprecated. Use the
GeoRelLayer(GeoRelationalStore,ChoroplethTheme,String)
constructor to associate a theme with a feature store.- Parameters:
store
- the default feature table to draw
-
DitherTheme
Deprecated.This Constructor assigns the feature table that is the source of the feature to be drawn, and sets a prefix column.This constructor is deprecated. Use the
GeoRelLayer(GeoRelationalStore,ChoroplethTheme,String)
constructor to associate a theme with a feature store, and use thegenerateSymbols(String,Window,int,Layer)
method to automatically generate classifications that match a given column name prefix.- Parameters:
store
- the default feature table to draw
-
-
Method Details
-
getColumnName
- Specified by:
getColumnName
in interfaceTableModel
- Specified by:
getColumnName
in classTheme
-
setSwatchSize
public void setSwatchSize(int size)Set the size of the swatch that will be generated and used to paint the dithered pattern. -
getSwatchSize
public int getSwatchSize()Get the size of the swatch that will be generated and used to paint the dithered pattern. -
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
-
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
-
updateKeys
public void updateKeys() -
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.- Overrides:
getSymbol
in classChoroplethTheme
- Parameters:
row
- the row number or object id for the feature or grid valueperiod
- the period of interest- Throws:
Exception
-
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
-
getSymbol
public Symbol getSymbol(AttributeStore as, Layer layer, int row, double scale, int period) throws ExceptionDescription copied from class:ChoroplethTheme
Get a symbol for the given layer state- Overrides:
getSymbol
in classChoroplethTheme
- Parameters:
as
- the underlying attribute tablelayer
- the parent layerrow
- the object idscale
- the world to page scaleperiod
- the period of interest- Throws:
Exception
-
getValueAt
- Specified by:
getValueAt
in interfaceTableModel
- Overrides:
getValueAt
in classChoroplethTheme
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
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
-
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
-
setFieldname
Deprecated.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
-
generateSymbols
Generate a new dithering classification based on all fields that match the specified prefix.- Specified by:
generateSymbols
in classChoroplethTheme
- Parameters:
prefix
- the colum name prefix. This will be used to identify all columns having a similar prefix and to add them to the classification.owner
- the window of the controling window, or null if called from a scripting contextperiod
- the period of interestlayer
- the parent layer- Throws:
Exception
-
addElement
Add an element (row) to the classification- Parameters:
name
- a label to use in the legendc
- the color to associate with this fieldfield
- the field or expression to obtain the values for this classification
-
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. -
clone
Description copied from class:Theme
Return a deep copy of the object as appropriate for each theme type -
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
-