Class LightImage

    • Constructor Detail

      • LightImage

        public LightImage()
    • Method Detail

      • getImage

        public org.eclipse.swt.graphics.Image getImage()
        Gets the displayed image.
        Returns:
        the image or null if no image assigned.
      • setImage

        public void setImage​(org.eclipse.swt.graphics.Image image)
        Sets the image to display.
        Parameters:
        image - the new image.
      • setDisabledImage

        public void setDisabledImage​(org.eclipse.swt.graphics.Image disabledImage)
        Sets the disabled image.
        Parameters:
        disabledImage - the new disabled image.
      • getDisabledImage

        public org.eclipse.swt.graphics.Image getDisabledImage()
        Returns disabled image.
        Returns:
        disabled image, can return null.
      • setImageOffset

        public void setImageOffset​(org.eclipse.swt.graphics.Point imageOffset)
        Sets the image offset from the control center. Use it to fine-tune the image position inside this control.
        Parameters:
        imageOffset - the image offset to set, should not be null.
      • getImageOffset

        public org.eclipse.swt.graphics.Point getImageOffset()
        Returns image offset.
        Returns:
        image offset, cannot return null.
      • setMargins

        public void setMargins​(org.eclipse.swt.graphics.Point margins)
        Sets the image horizontal and the vertical margins. Use it to fine-tune this control size.
        Parameters:
        margins - the margins to set, should not be null.
      • computeSize

        public org.eclipse.swt.graphics.Point computeSize​(org.eclipse.swt.graphics.GC gc,
                                                          int width,
                                                          int height,
                                                          boolean flushCache)
        Description copied from interface: ILightControl
        Computes the size of this control.
        Specified by:
        computeSize in interface ILightControl
        Overrides:
        computeSize in class AbstractLightControl
        Parameters:
        gc - the GC to do measurements with.
        width - the width hint, SWT.DEFAULT to compute the preferred width.
        height - the height hint, SWT.DEFAULT to compute the preferred height.
        flushCache - the flush cache flag, instructs the associated layout to reset all its caches, if any.
        Returns:
        the computed size.
      • paint

        public void paint​(org.eclipse.swt.graphics.GC gc,
                          org.eclipse.swt.graphics.Rectangle rectangle)
        Description copied from interface: ILightControl
        Paints the given rectangle of this control.
        Parameters:
        gc - the GC to paint on.
        rectangle - the rectangle to paint.