Package com._1c.g5.lwt.controls
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 Summary
Constructors Constructor Description LightImage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.graphics.Point
computeSize(org.eclipse.swt.graphics.GC gc, int width, int height, boolean flushCache)
Computes the size of this control.void
dispose()
Disposes this control.org.eclipse.swt.graphics.Image
getDisabledImage()
Returns disabled image.org.eclipse.swt.graphics.Image
getImage()
Gets the displayed image.org.eclipse.swt.graphics.Point
getImageOffset()
Returns image offset.void
paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)
Paints the given rectangle of this control.void
setDisabledImage(org.eclipse.swt.graphics.Image disabledImage)
Sets the disabled image.void
setImage(org.eclipse.swt.graphics.Image image)
Sets the image to display.void
setImageOffset(org.eclipse.swt.graphics.Point imageOffset)
Sets the image offset from the control center.void
setMargins(org.eclipse.swt.graphics.Point margins)
Sets the image horizontal and the vertical margins.-
Methods inherited from class com._1c.g5.lwt.AbstractLightControl
addControlListener, getBounds, getCursor, getData, getLayoutData, getOverlay, getParent, getTooltip, getVisibleBounds, handleEvent, invalidate, invalidate, isDisposed, isEnabled, isFocused, isVisible, removeControlListener, setBounds, setCursor, setData, setEnabled, setFocus, setFocusable, setLayoutData, setOverlay, setParent, setTooltip, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.lwt.ILightControl
initialize
-
-
-
-
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 benull
.
-
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 benull
.
-
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 interfaceILightControl
- Overrides:
computeSize
in classAbstractLightControl
- 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
- theGC
to paint on.rectangle
- the rectangle to paint.
-
dispose
public void dispose()
Description copied from interface:ILightControl
Disposes this control.- Specified by:
dispose
in interfaceILightControl
- Overrides:
dispose
in classAbstractLightControl
-
-