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
Light image control, displays the image.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.swt.graphics.PointcomputeSize(org.eclipse.swt.graphics.GC gc, int width, int height, boolean flushCache) Computes the size of this control.voiddispose()Disposes this control.org.eclipse.swt.graphics.ImageReturns disabled image.org.eclipse.swt.graphics.ImagegetImage()Gets the displayed image.org.eclipse.swt.graphics.PointReturns image offset.voidpaint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle) Paints the given rectangle of this control.voidsetDisabledImage(org.eclipse.swt.graphics.Image disabledImage) Sets the disabled image.voidsetImage(org.eclipse.swt.graphics.Image image) Sets the image to display.voidsetImageOffset(org.eclipse.swt.graphics.Point imageOffset) Sets the image offset from the control center.voidsetMargins(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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com._1c.g5.lwt.ILightControl
initialize
-
Constructor Details
-
LightImage
public LightImage()
-
-
Method Details
-
getImage
public org.eclipse.swt.graphics.Image getImage()Gets the displayed image.- Returns:
- the image or
nullif 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:ILightControlComputes the size of this control.- Specified by:
computeSizein interfaceILightControl- Overrides:
computeSizein classAbstractLightControl- Parameters:
gc- the GC to do measurements with.width- the width hint,SWT.DEFAULTto compute the preferred width.height- the height hint,SWT.DEFAULTto 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:ILightControlPaints the given rectangle of this control.- Parameters:
gc- theGCto paint on.rectangle- the rectangle to paint.
-
dispose
public void dispose()Description copied from interface:ILightControlDisposes this control.- Specified by:
disposein interfaceILightControl- Overrides:
disposein classAbstractLightControl
-