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.IsWidget
Interface defining a palette selector widget- Author:
- Guy Griffiths
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PaletteSelectorIF.OutOfRangeState
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getAboveMaxString()
String
getBelowMinString()
String
getDisplayScaleRange()
String
getNoDataColour()
int
getNumColorBands()
float
getOpacity()
String
getScaleRange()
String
getSelectedPalette()
String
getSelectedStyle()
boolean
isEnabled()
boolean
isLocked()
boolean
isLogScale()
void
populatePalettes(List<String> availablePalettes)
Populates the list of available palette namesvoid
populateStyles(List<String> availableStyles)
void
selectPalette(String paletteString)
Select the named palette, if availablevoid
selectStyle(String styleString)
Select the named style, if availablevoid
setAboveMax(PaletteSelectorIF.OutOfRangeState state)
Sets the behaviour of values above the maximumvoid
setBelowMin(PaletteSelectorIF.OutOfRangeState state)
Sets the behaviour of values below the minimumvoid
setCategorical(boolean categorical)
void
setEnabled(boolean enabled)
Enables/disables the palette selectorvoid
setExtraAboveMaxColour(String aboveMaxColour)
Sets a colour to use in addition to black/extend/transparent for values above the maximum scale valuevoid
setExtraBelowMinColour(String belowMinColour)
Sets a colour to use in addition to black/extend/transparent for values below the minimum scale valuevoid
setId(String id)
Sets the layer ID which this palette selector is currently active onvoid
setNoDataColour(String noDataColour)
void
setNoPaletteStyles(List<String> noPaletteStyles)
Sets the list of styles which do not use a palette (e.g.void
setNumColorBands(int nBands)
Sets the number of colour bands in the current palettevoid
setOpacity(float opacity)
Sets the opacity of the current paletteboolean
setScaleRange(String scaleRange, Boolean logScale)
Sets the scale rangevoid
setUnitConverter(UnitConverter converter)
Setting this allows thePaletteSelectorIF
to 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:
true
if 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
String
of the form "[min],[max]" which represents the current scale range
-
getDisplayScaleRange
String getDisplayScaleRange()
- Returns:
- A
String
of 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 thePaletteSelectorIF
to 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
- TheUnitConverter
to use for converting display units to the underlying units used on the WMS server. Set tonull
to 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
-
-