Class DefaultGalleryItemRenderer


  • public class DefaultGalleryItemRenderer
    extends AbstractGalleryItemRenderer

    Default item renderer used by the Gallery widget. Supports single line text, image, drop shadows and decorators.

    Decorator images can be set with Widget.setData(String, Object) by using the following keys :

    • org.eclipse.nebula.widget.gallery.bottomLeftOverlay
    • org.eclipse.nebula.widget.gallery.bottomRightOverlay
    • org.eclipse.nebula.widget.gallery.topLeftOverlay
    • org.eclipse.nebula.widget.gallery.topRightOverlay

    Supported types are org.eclipse.swt.Image for one single decorator and org.eclipse.swt.Image[] for multiple decorators.

    NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT.

    • Field Detail

      • dropShadowsColors

        protected java.util.ArrayList<org.eclipse.swt.graphics.Color> dropShadowsColors
        Stores colors used in drop shadows
      • dropShadows

        boolean dropShadows
      • dropShadowsSize

        int dropShadowsSize
      • dropShadowsAlphaStep

        int dropShadowsAlphaStep
      • selectionForegroundColor

        org.eclipse.swt.graphics.Color selectionForegroundColor
      • selectionBackgroundColor

        org.eclipse.swt.graphics.Color selectionBackgroundColor
      • foregroundColor

        org.eclipse.swt.graphics.Color foregroundColor
      • backgroundColor

        org.eclipse.swt.graphics.Color backgroundColor
      • showLabels

        boolean showLabels
      • showRoundedSelectionCorners

        boolean showRoundedSelectionCorners
      • selectionRadius

        int selectionRadius
      • _drawBackground

        private boolean _drawBackground
      • _drawBackgroundColor

        private org.eclipse.swt.graphics.Color _drawBackgroundColor
      • _drawImage

        private org.eclipse.swt.graphics.Image _drawImage
      • _drawForegroundColor

        private org.eclipse.swt.graphics.Color _drawForegroundColor
    • Constructor Detail

      • DefaultGalleryItemRenderer

        public DefaultGalleryItemRenderer()
    • Method Detail

      • isShowLabels

        public boolean isShowLabels()
        Returns current label state : enabled or disabled
        Returns:
        true if labels are enabled.
        See Also:
        setShowLabels(boolean)
      • setShowLabels

        public void setShowLabels​(boolean showLabels)
        Enables / disables labels at the bottom of each item.
        Parameters:
        showLabels -
        See Also:
        isShowLabels()
      • setDropShadowsSize

        public void setDropShadowsSize​(int dropShadowsSize)
      • createColors

        private void createColors()
      • freeDropShadowsColors

        private void freeDropShadowsColors()
      • isDropShadows

        public boolean isDropShadows()
      • setDropShadows

        public void setDropShadows​(boolean dropShadows)
      • getDropShadowsSize

        public int getDropShadowsSize()
      • getFont

        public org.eclipse.swt.graphics.Font getFont()
        Returns the font used for drawing all item labels or null if system font is used.
        Returns:
        the font
      • setFont

        public void setFont​(org.eclipse.swt.graphics.Font font)
        Set the font for drawing all item labels or null to use system font.
        Parameters:
        font - the font to set
      • getForegroundColor

        public org.eclipse.swt.graphics.Color getForegroundColor()
      • setForegroundColor

        public void setForegroundColor​(org.eclipse.swt.graphics.Color foregroundColor)
      • getSelectionForegroundColor

        public org.eclipse.swt.graphics.Color getSelectionForegroundColor()
      • setSelectionForegroundColor

        public void setSelectionForegroundColor​(org.eclipse.swt.graphics.Color selectionForegroundColor)
      • getSelectionBackgroundColor

        public org.eclipse.swt.graphics.Color getSelectionBackgroundColor()
      • setSelectionBackgroundColor

        public void setSelectionBackgroundColor​(org.eclipse.swt.graphics.Color selectionBackgroundColor)
      • getBackgroundColor

        public org.eclipse.swt.graphics.Color getBackgroundColor()
      • setBackgroundColor

        public void setBackgroundColor​(org.eclipse.swt.graphics.Color backgroundColor)
      • isShowRoundedSelectionCorners

        public boolean isShowRoundedSelectionCorners()
      • setShowRoundedSelectionCorners

        public void setShowRoundedSelectionCorners​(boolean showRoundedSelectionCorners)