public class ImageGuiImpl extends Image<GuiOutputManager>
| Modifier and Type | Field and Description |
|---|---|
private GuiColorResolver |
colorResolver
Color resolver
|
protected ImageWrapper<?> |
cutImg
The image object.
|
private GuiDriver |
gd
The graphics driver.
|
protected ImageWrapper<?> |
img
The image object.
|
private boolean |
isIcon
To keep track if this is the window icon or not.
|
protected static CentralLogger |
LOG
logger
|
insets, listeners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
ImageGuiImpl(WidgetId id)
Create a new image widget.
|
ImageGuiImpl(WidgetId id,
boolean isIcon)
Create a new image widget.
|
ImageGuiImpl(WidgetId id,
ImageConfig cfg)
Special constructor used to restore component using given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterConfigUpdate(ImageConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
protected java.lang.Object[] |
calculateDrawingParameters()
Calculates the drawing parameters:
width = (Integer) drawingParameters[0];
height = (Integer) drawingParameters[1];
offsetX = (Integer) drawingParameters[2];
offsetY = (Integer) drawingParameters[3];
transparent = (Boolean) drawingParameters[4];
stretchToFit = (Boolean) drawingParameters[5];
retainShape = (Boolean) drawingParameters[6];
convert3D = (Boolean) drawingParameters[7];
|
void |
clearImage()
Clears the current image and repaint this widget.
|
void |
draw()
Draw this image
|
protected boolean |
drawImage()
Draw this image.
|
ZOrderClass |
getZOrderClass()
Get the Z-Order class
|
double |
height()
Get widget height.
|
int |
heightPixels()
Get widget height in pixels.
|
void |
initialize(WidgetId id,
ImageConfig cfg)
Replacement API for the logic which should exist in the widget's c'tor, but the logic
can't be executed as it depends on the widget being registered into the official registry.
|
boolean |
isIcon()
Checks if the image was icon based.
|
boolean |
isInitialValueLayout()
Reports if the initial height/width of the widget should take precedence in the frame layout
algorithm.
|
protected boolean |
isStretchToFit()
The method returns a value indicating whether this image is supposed to be stretched-to-fit.
|
boolean |
loadImage(java.lang.String fullName)
Loads the new image for given image widget from the client side filesystem.
|
boolean |
loadImage(java.lang.String fullName,
boolean repaint)
Loads the new image for given image widget from the client side filesystem.
|
protected int[] |
mouseActions()
Determine the mouse actions processed by this widget.
|
void |
setColorResolver(GuiColorResolver colorResolver)
Sets a new color resolver.
|
boolean |
setGreyImage(ImageGuiImpl imgInit)
Sets the new image as result of the grey transformation from given image widget.
|
boolean |
setImage(byte[] byteImg)
Sets the new image for given image widget on the client side.
|
boolean |
setImage(byte[] byteImg,
boolean repaint)
Sets the new image for given image widget on the client side.
|
void |
setImage(ImageWrapper imgNew)
Sets the new image for this image widget.
|
double |
width()
Get widget width.
|
int |
widthPixels()
Get widget width in pixels.
|
config, dimension, focusTraversable, minimumSize_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, copyState, createMouseHoverAction, deactivateDirectManipulation, debug, destroy, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, insets, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChanged, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalDimensionInt, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unrealize, unregisterWidgetListener, updateSizeWorker, updateSystemParent, widgetRealized, widgetStateChanged, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptsEscAsAnyKey, acceptTrigger, canMovetoTop, completeTrigger, defaultMousePtr, enforceDefaultMousePtr, getIdForTrigger, getLegacyWidget, getTriggerWidget, getTriggerWidget, hasFocus, ignoreEnable, isCurrent, isDirectManipulable, isDroppable, isLegacyFocus, isProcessProgressEvent, maySwitchFocus, parent, refreshWidget, requestFocus, requestFocus, startTrigger, systemFocusGrabbed, validateDisplayValueprotected static final CentralLogger LOG
protected ImageWrapper<?> img
protected ImageWrapper<?> cutImg
private GuiDriver gd
private boolean isIcon
private GuiColorResolver colorResolver
public ImageGuiImpl(WidgetId id)
id - The widget's ID.public ImageGuiImpl(WidgetId id, boolean isIcon)
id - The widget's ID.isIcon - Flag indicating the image is the window title bar icoon.public ImageGuiImpl(WidgetId id, ImageConfig cfg)
id - The widget's ID.cfg - Configuration data.public void initialize(WidgetId id, ImageConfig cfg)
This API is called after the widget is created and added to the registry.
initialize in interface WidgetWithConfig<ImageConfig>initialize in class Image<GuiOutputManager>id - The widget's ID.cfg - The config used to initialize this widget.public void afterConfigUpdate(ImageConfig beforeUpdate)
afterConfigUpdate in interface ConfigOwner<ImageConfig>afterConfigUpdate in class Image<GuiOutputManager>beforeUpdate - Config reference capturing the config state before
the owner's config was modified.public void draw()
draw in interface Widget<GuiOutputManager>draw in class AbstractWidget<GuiOutputManager>public double height()
height in interface Widget<GuiOutputManager>height in class AbstractWidget<GuiOutputManager>public int heightPixels()
public double width()
width in interface Widget<GuiOutputManager>width in class AbstractWidget<GuiOutputManager>public int widthPixels()
public boolean setImage(byte[] byteImg)
byteImg - A new image array data.TRUE if operation successful FALSE otherwise.public boolean setImage(byte[] byteImg,
boolean repaint)
byteImg - A new image array data.repaint - Need immediate repaint of the new image.TRUE if operation successful FALSE otherwise.public void setImage(ImageWrapper imgNew)
imgNew - A new image data container.public boolean setGreyImage(ImageGuiImpl imgInit)
imgInit - The image widget with original data to transform.TRUE if operation successful FALSE otherwise.public boolean loadImage(java.lang.String fullName)
fullName - The fully qualified file name for the image to be loaded.TRUE if operation successful FALSE otherwise.public boolean loadImage(java.lang.String fullName,
boolean repaint)
fullName - The fully qualified file name for the image to be loaded.repaint - Need immediate repaint of the new image.TRUE if operation successful FALSE otherwise.public void clearImage()
public boolean isIcon()
TRUE if icon assumed, FALSE otherwide.public void setColorResolver(GuiColorResolver colorResolver)
colorResolver - The color resolverpublic boolean isInitialValueLayout()
true if the initial values control layout.public ZOrderClass getZOrderClass()
getZOrderClass in interface Widget<GuiOutputManager>getZOrderClass in class AbstractWidget<GuiOutputManager>protected java.lang.Object[] calculateDrawingParameters()
protected boolean drawImage()
true means the image was requested
to be drawn by the driver, false otherwise.protected int[] mouseActions()
mouseActions in class AbstractWidget<GuiOutputManager>protected boolean isStretchToFit()