public class ImageGuiImpl extends Image<GuiOutputManager>
Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
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 |
---|---|
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 |
draw()
Draw this image
|
protected boolean |
drawImage()
Draw this image.
|
protected int |
getImageHeight()
Get internal image native height in pixels.
|
protected int |
getImageWidth()
Get internal image native width in pixels.
|
Widget.ZOrderClass |
getZOrderClass()
Get the Z-Order class
|
double |
height()
Get widget height.
|
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.
|
afterConfigUpdate, config, dimension, focusTraversable, minimumSize
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, destroy, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidthNative, getVisiblePart, hasFocus, hidden, hide, highlighted, ignoreAction, insets, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, manageSystemActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, unrealize, updateSizeWorker, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
defaultMousePtr, enforceDefaultMousePtr, getLegacyWidget, isDirectManipulable
protected static final java.util.logging.Logger LOG
protected ImageWrapper<?> img
private GuiDriver gd
private boolean isIcon
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 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 double width()
width
in interface Widget<GuiOutputManager>
width
in class AbstractWidget<GuiOutputManager>
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 boolean isIcon()
TRUE
if icon assumed, FALSE
otherwide.public Widget.ZOrderClass getZOrderClass()
getZOrderClass
in interface Widget<GuiOutputManager>
getZOrderClass
in class AbstractWidget<GuiOutputManager>
protected int getImageWidth()
protected int getImageHeight()
protected java.lang.Object[] calculateDrawingParameters()
protected boolean drawImage()
protected int[] mouseActions()
mouseActions
in class AbstractWidget<GuiOutputManager>
protected boolean isStretchToFit()