Class GradientBackgroundPainter

    • Constructor Detail

      • GradientBackgroundPainter

        public GradientBackgroundPainter()
        Creates a GradientBackgroundPainter with a gradient sweeping from left to right.
      • GradientBackgroundPainter

        public GradientBackgroundPainter​(boolean vertical)
        Creates a GradientBackgroundPainter where the sweeping direction can be set.
        Parameters:
        vertical - if true sweeps from top to bottom, else sweeps from left to right. false is default
      • GradientBackgroundPainter

        public GradientBackgroundPainter​(ICellPainter painter,
                                         boolean vertical)
        Creates a GradientBackgroundPainter as wrapper for the given painter where the sweeping direction can be set.
        Parameters:
        painter - The ICellPainter that is wrapped by this GradientBackgroundPainter
        vertical - if true sweeps from top to bottom, else sweeps from left to right. false is default
    • Method Detail

      • getForeGroundColour

        protected org.eclipse.swt.graphics.Color getForeGroundColour​(ILayerCell cell,
                                                                     IConfigRegistry configRegistry)
        Searches the foreground color to be used for gradient sweeping. First checks the ConfigRegistry if there is a value for the attribute CellStyleAttributes.GRADIENT_FOREGROUND_COLOR is registered. If there is one this value will be returned, if not it is checked if there is a value registered for CellStyleAttributes.FOREGROUND_COLOR and returned. If there is no value registered for any of these attributes, null will be returned which will skip the painting.
        Parameters:
        cell - The LayerCell for which the style attributes should be retrieved out of the ConfigRegistry
        configRegistry - The ConfigRegistry to retrieve the attribute values from.
        Returns:
        The Color to use as foreground color of the gradient sweeping or null if none was configured.
      • getBackgroundColour

        protected org.eclipse.swt.graphics.Color getBackgroundColour​(ILayerCell cell,
                                                                     IConfigRegistry configRegistry)
        Searches the background color to be used for gradient sweeping. First checks the ConfigRegistry if there is a value for the attribute CellStyleAttributes.GRADIENT_BACKGROUND_COLOR is registered. If there is one this value will be returned, if not it is checked if there is a value registered for CellStyleAttributes.BACKGROUND_COLOR and returned. If there is no value registered for any of these attributes, null will be returned which will skip the painting.
        Parameters:
        cell - The LayerCell for which the style attributes should be retrieved out of the ConfigRegistry
        configRegistry - The ConfigRegistry to retrieve the attribute values from.
        Returns:
        The Color to use as background color of the gradient sweeping or null if none was configured.
      • isVertical

        public boolean isVertical()
        Returns:
        true if sweeps from top to bottom, else sweeps from left to right. Default is false
        Since:
        1.4
      • setVertical

        public void setVertical​(boolean vertical)
        Parameters:
        vertical - true if should sweep from top to bottom, false if it should sweep from left to right. Default is false
        Since:
        1.4