All Implemented Interfaces:
ILightControl, IReadOnlyControl, IRoundedRectangleControl, IViewControl<S>
Direct Known Subclasses:
ImageButtonControl

public class ImageControl<S extends ThemeSkin> extends RectangleControl<S>
  • Constructor Details

    • ImageControl

      public ImageControl()
  • Method Details

    • setUseDisabledImagesIfReadOnly

      public void setUseDisabledImagesIfReadOnly(boolean flag)
    • getUseDisabledImagesIfReadOnly

      public boolean getUseDisabledImagesIfReadOnly()
    • setSize

      public void setSize(int width, int height)
    • setAutoSize

      public void setAutoSize()
    • getMargins

      public org.eclipse.swt.graphics.Point getMargins()
      Returns:
      the margins
    • setMargins

      public void setMargins(org.eclipse.swt.graphics.Point margins)
      Parameters:
      margins - the margins to set
    • 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:
      the disabledImage
    • 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:
      the imageOffset
    • computeSize

      public org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.graphics.GC gc, int width, int height, boolean flushCache)
      Specified by:
      computeSize in interface ILightControl
      Overrides:
      computeSize in class AbstractLightControl
    • paint

      public void paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)
      Specified by:
      paint in interface ILightControl
      Overrides:
      paint in class RectangleControl<S extends ThemeSkin>
    • dispose

      public void dispose()
      Specified by:
      dispose in interface ILightControl
      Overrides:
      dispose in class AbstractCustomizationControl<S extends ThemeSkin>
    • getPaintingImage

      protected org.eclipse.swt.graphics.Image getPaintingImage(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)
      Invoked by paint(GC, Rectangle) method to obtain current image to draw.
      Parameters:
      gc -
      rectangle -
      Returns: