Class PaletteSelector

  • All Implemented Interfaces:
    com.google.gwt.user.client.ui.IsWidget, PaletteSelectorIF

    public class PaletteSelector
    extends Object
    implements PaletteSelectorIF
    Implementation of PaletteSelectorIF which can be either horizontally or vertically oriented, and contains controls for setting all palette variables
    Author:
    Guy Griffiths
    • Method Detail

      • setId

        public void setId​(String id)
        Description copied from interface: PaletteSelectorIF
        Sets the layer ID which this palette selector is currently active on
        Specified by:
        setId in interface PaletteSelectorIF
        Parameters:
        id - The ID
      • getAboveMaxString

        public String getAboveMaxString()
        Specified by:
        getAboveMaxString in interface PaletteSelectorIF
        Returns:
        The string representation of the colour to display when values are above the maximum
      • setExtraAboveMaxColour

        public void setExtraAboveMaxColour​(String aboveMaxColour)
        Description copied from interface: PaletteSelectorIF
        Sets a colour to use in addition to black/extend/transparent for values above the maximum scale value
        Specified by:
        setExtraAboveMaxColour in interface PaletteSelectorIF
        Parameters:
        aboveMaxColour - The colour to display for values above the maximum scale range
      • getBelowMinString

        public String getBelowMinString()
        Specified by:
        getBelowMinString in interface PaletteSelectorIF
        Returns:
        The string representation of the colour to display when values are below the minimum
      • setExtraBelowMinColour

        public void setExtraBelowMinColour​(String belowMinColour)
        Description copied from interface: PaletteSelectorIF
        Sets a colour to use in addition to black/extend/transparent for values below the minimum scale value
        Specified by:
        setExtraBelowMinColour in interface PaletteSelectorIF
        Parameters:
        belowMinColour - The colour to display for values below the minimum scale range
      • setNoDataColour

        public void setNoDataColour​(String noDataColour)
        Specified by:
        setNoDataColour in interface PaletteSelectorIF
        Parameters:
        noDataColour - The colour to display for missing data
      • selectPalette

        public void selectPalette​(String paletteString)
        Description copied from interface: PaletteSelectorIF
        Select the named palette, if available
        Specified by:
        selectPalette in interface PaletteSelectorIF
        Parameters:
        paletteString - The name of the palette to select
      • setScaleRange

        public boolean setScaleRange​(String scaleRange,
                                     Boolean isLogScale)
        Description copied from interface: PaletteSelectorIF
        Sets the scale range
        Specified by:
        setScaleRange in interface PaletteSelectorIF
        Parameters:
        scaleRange - The desired scale range, of the form [min],[max]
        isLogScale - 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)
      • setScaleLabels

        public void setScaleLabels()
      • getNumColorBands

        public int getNumColorBands()
        Specified by:
        getNumColorBands in interface PaletteSelectorIF
        Returns:
        The number of colour bands in the currently selected palette
      • setLogScale

        public void setLogScale​(boolean isLogScale)
      • isLogScale

        public boolean isLogScale()
        Specified by:
        isLogScale in interface PaletteSelectorIF
        Returns:
        Whether or not this is a logarithmic scale
      • isLocked

        public boolean isLocked()
        Specified by:
        isLocked in interface PaletteSelectorIF
        Returns:
        Whether or not the palette is locked
      • asWidget

        public com.google.gwt.user.client.ui.Widget asWidget()
        Specified by:
        asWidget in interface com.google.gwt.user.client.ui.IsWidget
      • populateStyles

        public void populateStyles​(List<String> availableStyles)
        Specified by:
        populateStyles in interface PaletteSelectorIF
        Parameters:
        availableStyles - The list of available style names
      • setNoPaletteStyles

        public void setNoPaletteStyles​(List<String> noPaletteStyles)
        Description copied from interface: PaletteSelectorIF
        Sets the list of styles which do not use a palette (e.g. contours, arrows)
        Specified by:
        setNoPaletteStyles in interface PaletteSelectorIF
        Parameters:
        noPaletteStyles - The list of styles which do not use a palette
      • selectStyle

        public void selectStyle​(String styleString)
        Description copied from interface: PaletteSelectorIF
        Select the named style, if available
        Specified by:
        selectStyle in interface PaletteSelectorIF
        Parameters:
        styleString - The name of the style to select
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface PaletteSelectorIF
        Returns:
        Whether or not the current palette selector is enabled
      • getOpacity

        public float getOpacity()
        Specified by:
        getOpacity in interface PaletteSelectorIF
        Returns:
        The opacity of the current palette as a float ranging from 0-1
      • setOpacity

        public void setOpacity​(float opacityValue)
        Description copied from interface: PaletteSelectorIF
        Sets the opacity of the current palette
        Specified by:
        setOpacity in interface PaletteSelectorIF
        Parameters:
        opacityValue - The opacity, as a float ranging from 0-1
      • setUnitConverter

        public void setUnitConverter​(UnitConverter converter)
        Description copied from interface: PaletteSelectorIF
        Setting this allows the PaletteSelectorIF 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.
        Specified by:
        setUnitConverter in interface PaletteSelectorIF
        Parameters:
        converter - The UnitConverter to use for converting display units to the underlying units used on the WMS server. Set to null to use the WMS native units
      • setCategorical

        public void setCategorical​(boolean categorical)
        Specified by:
        setCategorical in interface PaletteSelectorIF
        Parameters:
        categorical - Whether or not this palette should retrieve a categorical legend in place of the usual scaling tools