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 java.util.logging.Logger |
LOG
logger
|
insets, 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.
|
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.
|
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.
|
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, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, hasFocus, hidden, hide, highlighted, ignoreAction, insets, isCurrent, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChange, refresh, registerWidgetStateListener, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, unrealize, updateSizeWorker, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
defaultMousePtr, enforceDefaultMousePtr, getLegacyWidget, isDirectManipulable, isDroppable, maySwitchFocus, requestFocus
protected static final java.util.logging.Logger 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
- 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 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 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()