Package ca.spatial.mapview
Class Theme
java.lang.Object
javax.swing.table.AbstractTableModel
ca.spatial.mapview.Theme
- All Implemented Interfaces:
Visibility
,EditableTableModel
,Serializable
,TableModel
- Direct Known Subclasses:
ChoroplethTheme
,ImageTheme
- See Also:
- Serialized Form
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Object
clone()
Return a deep copy of the object as appropriate for each theme typegetAlpha()
Get the compositing (transparency) value for this themeGet the caption for this theme.int
Get the width of the preview chipint
Get the width of the preview chipabstract Class
getColumnClass(int column)
abstract int
abstract String
getColumnName(int columnIndex)
abstract ThemeEditor
Return a ThemeEditor component appropriate for the theme type.boolean
Test if the symbology in this theme should be adjusted according to the scaledouble
Get the maximum scale at this this theme will be showndouble
Get the minimum scale at this this theme will be showndouble
abstract int
AbstractTableModel and EditableTableModel interfacesabstract Symbol
Get the selected object symbol for this themeabstract Symbol
getSymbol(int row, int period)
Get a symbol for a given object id and period.abstract Symbol
Get a symbol for a specific key.abstract Symbol
Get a symbol for the key valueint
Get the type of features that are to be represented by this theme (seeSpatialStore
for the type definitions.Get a name that describes the type of this themeabstract Object
getValueAt(int row, int column)
abstract boolean
Ask if theme makes use of cached spatial queries to speed up operations.abstract boolean
isCellEditable(int rowIndex, int columnIndex)
boolean
By default themes are static and do not change over time.abstract void
Selection contexts can cache results of time consuming selection operations involved in some spatial quary operators.setAlpha(AlphaComposite alpha)
Set the compositing (transparency) value for this themevoid
setCaption(String caption)
Set the caption for this themevoid
setChipSize(int width, int height)
Set the size of the symbol preview chip used for this theme.void
setIsScaled(boolean isScaled)
Set that the symbology in this theme should be adjusted according to the scalevoid
setMaxScale(double scale)
Set the maximum scale at which this theme will be shownvoid
setMinScale(double scale)
Set the minimum scale at which this theme will be shownvoid
setReferenceScale(double scale)
abstract void
setValueAt(Object aValue, int rowIndex, int columnIndex)
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 ca.spatial.table.EditableTableModel
addRow, addRow, moveRow, removeRow
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener
-
Field Details
-
themeName
The generic type name of the theme. Specific classes that inherit from Theme will set this value.
-
-
Constructor Details
-
Theme
public Theme()The default constructor
-
-
Method Details
-
getSymbol
Get a symbol for the key value- Parameters:
key
- the lookup valuescale
- the world to page scalelayer
- the parent layer- Throws:
Exception
-
getSelectedSymbol
Get the selected object symbol for this theme -
clone
Return a deep copy of the object as appropriate for each theme type -
getEditor
Return a ThemeEditor component appropriate for the theme type. -
getRowCount
public abstract int getRowCount()AbstractTableModel and EditableTableModel interfaces- Specified by:
getRowCount
in interfaceTableModel
-
getColumnCount
public abstract int getColumnCount()- Specified by:
getColumnCount
in interfaceTableModel
-
getColumnName
- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
getValueAt
- Specified by:
getValueAt
in interfaceTableModel
-
getColumnClass
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
isCellEditable
public abstract boolean isCellEditable(int rowIndex, int columnIndex)- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
-
getSymbol
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.- Parameters:
key
- the key value used to look up the appropriate symbol
-
getSymbol
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.- Parameters:
row
- the row number or object id for the feature or grid valueperiod
- the period of interest- Throws:
Exception
-
getCaption
Get the caption for this theme. This will be used to set the default layer title. -
setCaption
Set the caption for this theme -
setChipSize
public void setChipSize(int width, int height)Set the size of the symbol preview chip used for this theme. The preview chip is used in the legend.- Parameters:
width
- the width of the preview chipheight
- the height of the preview chip
-
getChipWidth
public int getChipWidth()Get the width of the preview chip -
getChipHeight
public int getChipHeight()Get the width of the preview chip -
getThemeName
Get a name that describes the type of this theme -
setMinScale
public void setMinScale(double scale)Set the minimum scale at which this theme will be shown- Specified by:
setMinScale
in interfaceVisibility
-
getMinScale
public double getMinScale()Get the minimum scale at this this theme will be shown- Specified by:
getMinScale
in interfaceVisibility
-
setMaxScale
public void setMaxScale(double scale)Set the maximum scale at which this theme will be shown- Specified by:
setMaxScale
in interfaceVisibility
-
getMaxScale
public double getMaxScale()Get the maximum scale at this this theme will be shown- Specified by:
getMaxScale
in interfaceVisibility
-
setAlpha
Set the compositing (transparency) value for this theme- Specified by:
setAlpha
in interfaceVisibility
-
getAlpha
Get the compositing (transparency) value for this theme- Specified by:
getAlpha
in interfaceVisibility
-
setIsScaled
public void setIsScaled(boolean isScaled)Set that the symbology in this theme should be adjusted according to the scale -
getIsScaled
public boolean getIsScaled()Test if the symbology in this theme should be adjusted according to the scale -
getSymbolType
public int getSymbolType()Get the type of features that are to be represented by this theme (seeSpatialStore
for the type definitions. -
setReferenceScale
public void setReferenceScale(double scale) -
getReferenceScale
public double getReferenceScale() -
isDynamic
public boolean isDynamic()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. -
resetSelectionContext
public abstract void resetSelectionContext()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. -
hasSelectionContext
public abstract boolean hasSelectionContext()Ask if theme makes use of cached spatial queries to speed up operations.
-