org.kalmeo.kuix.widget
Class Picture

java.lang.Object
  extended by org.kalmeo.kuix.widget.Widget
      extended by org.kalmeo.kuix.widget.Picture

public class Picture
extends Widget

This class represents a picture.

For further informations, visit the Kuix widgets reference page.

Author:
bbeaulant

Nested Class Summary
 
Nested classes/interfaces inherited from class org.kalmeo.kuix.widget.Widget
Widget.BindInstruction
 
Field Summary
 
Fields inherited from class org.kalmeo.kuix.widget.Widget
bindInstructions, DEFAULT_ALIGN, DEFAULT_BACKGROUND_ALIGN, DEFAULT_BACKGROUND_REPEAT, DEFAULT_BORDER, DEFAULT_GAP, DEFAULT_MARGIN, DEFAULT_MIN_SIZE, DEFAULT_PADDING, DEFAULT_SPAN, DEFAULT_WEIGHT, next, parent, previous
 
Constructor Summary
Picture()
          Construct a Picture
 
Method Summary
 Widget add(Widget widget)
          Add a Widget to this as child
protected  void doLayout()
          Layout the widget if its layout is defined.
 java.lang.Object getAttribute(java.lang.String name)
          Returns the value of the specified attribute
protected  java.lang.Object getDefaultStylePropertyValue(java.lang.String name)
          Returns the de default style property value for name property, or null.
 Image getImage()
           
 Layout getLayout()
           
 Metrics getPreferredSize(int preferredWidth)
          Returns the prefered size of this Widget
 boolean isObjectAttribute(java.lang.String name)
          Check if the given attribute require an Object value.
protected  void paintChildrenImpl(Graphics g)
          Invoke the paintImpl method on widget's children.
 boolean setAttribute(java.lang.String name, java.lang.String value)
          Set the value to the specified attribute representing by the name
 void setFrameDuration(int frameDuration)
          Set the duration of a frame for animation.
 void setFrameHeight(int frameHeight)
          Set the height of a slice in source image for animation.
 void setFrameSequence(int[] frameSequence)
          Set the sequence of a frame index for animation.
 void setFrameWidth(int frameWidth)
          Set the width of a slice in source image for animation.
 Picture setImage(Image image)
          Define the image data.
 boolean setObjectAttribute(java.lang.String name, java.lang.Object value)
          Set the Object value to the specified attribute representing by the name.
 Picture setSource(java.lang.String source)
          Define the image source.
 void setTransform(int transform)
           
 
Methods inherited from class org.kalmeo.kuix.widget.Widget
add, bringNear, bringToFront, catchChildrenFrom, cleanUp, cleanUpChildren, clearCachedStyle, getAlign, getAuthorStyle, getAvailablePseudoClasses, getBackgroundAlign, getBackgroundColor, getBackgroundImage, getBackgroundRepeat, getBorder, getBorderAlign, getBorderColor, getBorderImage, getBorderStroke, getCachedMetrics, getChild, getColor, getDataProvider, getDesktop, getDisplayX, getDisplayY, getFocusManager, getGap, getGrayedColor, getHeight, getId, getInheritedTag, getInnerHeight, getInnerWidth, getInsets, getInternalChildInstance, getLastChild, getLayoutData, getMargin, getMinSize, getOtherFocus, getPadding, getSpan, getStyleClasses, getStylePropertyValue, getStyles, getTag, getWeight, getWidget, getWidgetAt, getWidgetAt, getWidth, getX, getY, hasBindInstruction, hasShortcutKeyCodes, hasShortcuts, invalidate, invalidate, invalidateAppearance, invalidateAppearanceRegion, invalidateStylePropertiesCache, isFocusable, isFocused, isFocusWidgetChild, isIndividualyVisible, isInvalidated, isInWidgetTree, isPseudoClassCompatible, isShortcutKeyCodeCompatible, isVisible, markAsValidate, needToComputePreferredSize, onAdded, onChildAdded, onChildRemoved, onFocus, onLostFocus, onRemoved, paint, paintBackground, paintBorder, paintImpl, paintMosaicImage, parseAuthorStyle, processActionEvent, processDataBindEvent, processFocusEvent, processItemsModelUpdateEvent, processKeyEvent, processModelUpdateEvent, processPointerEvent, processShortcutKeyEvent, propagateFocusEvent, remove, removeAll, removeAttributeBindInstruction, requestBackwardFocus, requestFocus, requestForwardFocus, sendToBack, setAttributeBindInstruction, setAuthorStyle, setBounds, setDataProvider, setId, setShortcutKeyCodes, setShortcuts, setStyleClass, setStyleClasses, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Picture

public Picture()
Construct a Picture

Method Detail

getLayout

public Layout getLayout()
Overrides:
getLayout in class Widget
Returns:
the layout

setAttribute

public boolean setAttribute(java.lang.String name,
                            java.lang.String value)
Description copied from class: Widget
Set the value to the specified attribute representing by the name

Overrides:
setAttribute in class Widget
Returns:
true if the attribute exists

setObjectAttribute

public boolean setObjectAttribute(java.lang.String name,
                                  java.lang.Object value)
Description copied from class: Widget
Set the Object value to the specified attribute representing by the name.

Overrides:
setObjectAttribute in class Widget
Returns:

isObjectAttribute

public boolean isObjectAttribute(java.lang.String name)
Description copied from class: Widget
Check if the given attribute require an Object value.

Overrides:
isObjectAttribute in class Widget
Returns:
true if the given attribute require an Object value

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Description copied from class: Widget
Returns the value of the specified attribute

Overrides:
getAttribute in class Widget
Returns:
The value of the specified attribute

setSource

public Picture setSource(java.lang.String source)
Define the image source.
Returns the instance of this Picture Useful in this case : Picture picture = new Picture().setSource("img.png");

Parameters:
source - the name of the resource containing the image data in one of the supported image formats
Returns:
The instance of this Picture

getImage

public Image getImage()
Returns:
the associated Image instance.

setImage

public Picture setImage(Image image)
Define the image data. The data is a preloaded Image object instance.

Parameters:
image - the Image instance to use in this Picture.
Returns:
The instance of this Picture

setTransform

public void setTransform(int transform)
Parameters:
transform -

setFrameWidth

public void setFrameWidth(int frameWidth)
Set the width of a slice in source image for animation.

Parameters:
frameWidth -
Since:
1.0.1

setFrameHeight

public void setFrameHeight(int frameHeight)
Set the height of a slice in source image for animation.

Parameters:
frameHeight -
Since:
1.0.1

setFrameSequence

public void setFrameSequence(int[] frameSequence)
Set the sequence of a frame index for animation.

Parameters:
frameSequence -
Since:
1.0.1

setFrameDuration

public void setFrameDuration(int frameDuration)
Set the duration of a frame for animation.

Parameters:
frameDuration -
Since:
1.0.1

getPreferredSize

public Metrics getPreferredSize(int preferredWidth)
Description copied from class: Widget
Returns the prefered size of this Widget

Overrides:
getPreferredSize in class Widget
Returns:
The prefered size of this Widget

getDefaultStylePropertyValue

protected java.lang.Object getDefaultStylePropertyValue(java.lang.String name)
Description copied from class: Widget
Returns the de default style property value for name property, or null.

Overrides:
getDefaultStylePropertyValue in class Widget
Returns:
The de default style property value for name property

add

public Widget add(Widget widget)
Description copied from class: Widget
Add a Widget to this as child

Overrides:
add in class Widget
Parameters:
widget - The Widget to add
Returns:
This Widget

doLayout

protected void doLayout()
Description copied from class: Widget
Layout the widget if its layout is defined.

Overrides:
doLayout in class Widget

paintChildrenImpl

protected void paintChildrenImpl(Graphics g)
Description copied from class: Widget
Invoke the paintImpl method on widget's children.

Overrides:
paintChildrenImpl in class Widget


Copyright © 2007-2008 Kalmeo. All Rights Reserved.