Interface PaletteSelectorIF
-
- All Superinterfaces:
com.google.gwt.user.client.ui.IsWidget
- All Known Implementing Classes:
PaletteSelector
public interface PaletteSelectorIF extends com.google.gwt.user.client.ui.IsWidgetInterface defining a palette selector widget- Author:
- Guy Griffiths
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPaletteSelectorIF.OutOfRangeState
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAboveMaxString()StringgetBelowMinString()StringgetDisplayScaleRange()StringgetNoDataColour()intgetNumColorBands()floatgetOpacity()StringgetScaleRange()StringgetSelectedPalette()StringgetSelectedStyle()booleanisEnabled()booleanisLocked()booleanisLogScale()voidpopulatePalettes(List<String> availablePalettes)Populates the list of available palette namesvoidpopulateStyles(List<String> availableStyles)voidselectPalette(String paletteString)Select the named palette, if availablevoidselectStyle(String styleString)Select the named style, if availablevoidsetAboveMax(PaletteSelectorIF.OutOfRangeState state)Sets the behaviour of values above the maximumvoidsetBelowMin(PaletteSelectorIF.OutOfRangeState state)Sets the behaviour of values below the minimumvoidsetCategorical(boolean categorical)voidsetEnabled(boolean enabled)Enables/disables the palette selectorvoidsetExtraAboveMaxColour(String aboveMaxColour)Sets a colour to use in addition to black/extend/transparent for values above the maximum scale valuevoidsetExtraBelowMinColour(String belowMinColour)Sets a colour to use in addition to black/extend/transparent for values below the minimum scale valuevoidsetId(String id)Sets the layer ID which this palette selector is currently active onvoidsetNoDataColour(String noDataColour)voidsetNoPaletteStyles(List<String> noPaletteStyles)Sets the list of styles which do not use a palette (e.g.voidsetNumColorBands(int nBands)Sets the number of colour bands in the current palettevoidsetOpacity(float opacity)Sets the opacity of the current palettebooleansetScaleRange(String scaleRange, Boolean logScale)Sets the scale rangevoidsetUnitConverter(UnitConverter converter)Setting this allows thePaletteSelectorIFto work in different units to those used by the server.
-
-
-
Method Detail
-
setId
void setId(String id)
Sets the layer ID which this palette selector is currently active on- Parameters:
id- The ID
-
populatePalettes
void populatePalettes(List<String> availablePalettes)
Populates the list of available palette names
-
getSelectedPalette
String getSelectedPalette()
- Returns:
- The name of the currently selected palette
-
selectPalette
void selectPalette(String paletteString)
Select the named palette, if available- Parameters:
paletteString- The name of the palette to select
-
getAboveMaxString
String getAboveMaxString()
- Returns:
- The string representation of the colour to display when values are above the maximum
-
setAboveMax
void setAboveMax(PaletteSelectorIF.OutOfRangeState state)
Sets the behaviour of values above the maximum
-
setExtraAboveMaxColour
void setExtraAboveMaxColour(String aboveMaxColour)
Sets a colour to use in addition to black/extend/transparent for values above the maximum scale value- Parameters:
aboveMaxColour- The colour to display for values above the maximum scale range
-
getBelowMinString
String getBelowMinString()
- Returns:
- The string representation of the colour to display when values are below the minimum
-
setBelowMin
void setBelowMin(PaletteSelectorIF.OutOfRangeState state)
Sets the behaviour of values below the minimum
-
setExtraBelowMinColour
void setExtraBelowMinColour(String belowMinColour)
Sets a colour to use in addition to black/extend/transparent for values below the minimum scale value- Parameters:
belowMinColour- The colour to display for values below the minimum scale range
-
populateStyles
void populateStyles(List<String> availableStyles)
- Parameters:
availableStyles- The list of available style names
-
setNoPaletteStyles
void setNoPaletteStyles(List<String> noPaletteStyles)
Sets the list of styles which do not use a palette (e.g. contours, arrows)- Parameters:
noPaletteStyles- The list of styles which do not use a palette
-
getSelectedStyle
String getSelectedStyle()
- Returns:
- The name of the currently selected style
-
selectStyle
void selectStyle(String styleString)
Select the named style, if available- Parameters:
styleString- The name of the style to select
-
setScaleRange
boolean setScaleRange(String scaleRange, Boolean logScale)
Sets the scale range- Parameters:
scaleRange- The desired scale range, of the form [min],[max]logScale- Whether we want this to be a log scale or not- Returns:
trueif the operation was successful (may not be if the palette is locked, or we want a negative value in a logarithmic range)
-
getScaleRange
String getScaleRange()
- Returns:
- A
Stringof the form "[min],[max]" which represents the current scale range
-
getDisplayScaleRange
String getDisplayScaleRange()
- Returns:
- A
Stringof the form "[min],[max]" which represents the current scale range displayed. If there is no unit converter set, this will be equivalent togetScaleRange().
-
getNumColorBands
int getNumColorBands()
- Returns:
- The number of colour bands in the currently selected palette
-
setNumColorBands
void setNumColorBands(int nBands)
Sets the number of colour bands in the current palette
-
isLogScale
boolean isLogScale()
- Returns:
- Whether or not this is a logarithmic scale
-
isLocked
boolean isLocked()
- Returns:
- Whether or not the palette is locked
-
setEnabled
void setEnabled(boolean enabled)
Enables/disables the palette selector
-
isEnabled
boolean isEnabled()
- Returns:
- Whether or not the current palette selector is enabled
-
getOpacity
float getOpacity()
- Returns:
- The opacity of the current palette as a float ranging from 0-1
-
setOpacity
void setOpacity(float opacity)
Sets the opacity of the current palette- Parameters:
opacity- The opacity, as a float ranging from 0-1
-
setNoDataColour
void setNoDataColour(String noDataColour)
- Parameters:
noDataColour- The colour to display for missing data
-
getNoDataColour
String getNoDataColour()
- Returns:
- The colour to display for missing data
-
setUnitConverter
void setUnitConverter(UnitConverter converter)
Setting this allows thePaletteSelectorIFto work in different units to those used by the server. For example a client may always want to treat temperatures as degrees Celcius regardless of what the WMS server says.- Parameters:
converter- TheUnitConverterto use for converting display units to the underlying units used on the WMS server. Set tonullto use the WMS native units
-
setCategorical
void setCategorical(boolean categorical)
- Parameters:
categorical- Whether or not this palette should retrieve a categorical legend in place of the usual scaling tools
-
-