Class LightImage

java.lang.Object
com._1c.g5.lwt.AbstractLightControl
com._1c.g5.lwt.controls.LightImage
All Implemented Interfaces:
ILightControl
Direct Known Subclasses:
LightImageButton

public class LightImage extends AbstractLightControl
Light image control, displays the image.
  • Constructor Details

    • LightImage

      public LightImage()
  • Method Details

    • 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.
    • dispose

      public void dispose()
      Description copied from interface: ILightControl
      Disposes this control.
      Specified by:
      dispose in interface ILightControl
      Overrides:
      dispose in class AbstractLightControl