org.kalmeo.kuix.widget
Class Desktop

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

public class Desktop
extends Widget

This class represents the Kuix desktop.

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
Desktop()
          Construct a Desktop
 
Method Summary
 Widget add(Widget widget)
          Add a Widget to this as child
 void addPopup(Widget widget)
          Add a popup widget
protected  void doLayout()
          Layout the widget if its layout is defined.
 Insets getBorder()
           
 FocusManager getCurrentFocusManager()
           
 Screen getCurrentScreen()
           
 Desktop getDesktop()
           
 Widget getDraggedWidget()
           
 FocusManager getFocusManager()
          Used for popup like widgets
 Layout getLayout()
           
 LayoutData getLayoutData()
           
 Insets getMargin()
           
 Insets getPadding()
           
 Widget getWidget(java.lang.String id)
          Returns the Widget witch correspond to the id, or null
 void invalidate(Widget fromWidget)
          Invalidate the widget's size and position and propagate the information to its parent.
protected  void invalidateAppearanceRegion(int x, int y, int width, int height)
          Invalidate a specific region.
 boolean isInWidgetTree()
           
protected  void onChildAdded(Widget widget)
          Event called when the child widjet is added.
protected  void onChildRemoved(Widget widget)
          Event called when the child widjet is removed.
 void paint(Graphics g)
          Paint the widget itself.
 void paintImpl(Graphics g)
          Paint the implementation of the widget (itself and its children).
 void pushPopupFocusManager(FocusManager focusManager)
           
 void removeAll()
          Remove all childs.
 void removeAllPopupFromTag(java.lang.String tag)
          Remove all popup widgets where tag equals tag.
 Widget removeDraggedWidget(boolean restore)
          Remove the dragged widget and returns its instance.
 void removePopupFocusManager(FocusManager focusManager)
          Remove the specified popup focusManager
 void revalidate()
          Revalidate the Desktop
 void setBounds(int x, int y, int width, int height)
          Set the widget's bounds
 void setCurrentScreen(Screen screen)
           
 void setDraggedWidget(Widget widget, int x, int y)
          Define the dragged widget.
 
Methods inherited from class org.kalmeo.kuix.widget.Widget
add, bringNear, bringToFront, catchChildrenFrom, cleanUp, cleanUpChildren, clearCachedStyle, getAlign, getAttribute, getAuthorStyle, getAvailablePseudoClasses, getBackgroundAlign, getBackgroundColor, getBackgroundImage, getBackgroundRepeat, getBorderAlign, getBorderColor, getBorderImage, getBorderStroke, getCachedMetrics, getChild, getColor, getDataProvider, getDefaultStylePropertyValue, getDisplayX, getDisplayY, getGap, getGrayedColor, getHeight, getId, getInheritedTag, getInnerHeight, getInnerWidth, getInsets, getInternalChildInstance, getLastChild, getMinSize, getOtherFocus, getPreferredSize, getSpan, getStyleClasses, getStylePropertyValue, getStyles, getTag, getWeight, getWidgetAt, getWidgetAt, getWidth, getX, getY, hasBindInstruction, hasShortcutKeyCodes, hasShortcuts, invalidate, invalidateAppearance, invalidateStylePropertiesCache, isFocusable, isFocused, isFocusWidgetChild, isIndividualyVisible, isInvalidated, isObjectAttribute, isPseudoClassCompatible, isShortcutKeyCodeCompatible, isVisible, markAsValidate, needToComputePreferredSize, onAdded, onFocus, onLostFocus, onRemoved, paintBackground, paintBorder, paintChildrenImpl, paintMosaicImage, parseAuthorStyle, processActionEvent, processDataBindEvent, processFocusEvent, processItemsModelUpdateEvent, processKeyEvent, processModelUpdateEvent, processPointerEvent, processShortcutKeyEvent, propagateFocusEvent, remove, removeAttributeBindInstruction, requestBackwardFocus, requestFocus, requestForwardFocus, sendToBack, setAttribute, setAttributeBindInstruction, setAuthorStyle, setDataProvider, setId, setObjectAttribute, 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

Desktop

public Desktop()
Construct a Desktop

Method Detail

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Description copied from class: Widget
Set the widget's bounds

Overrides:
setBounds in class Widget

isInWidgetTree

public boolean isInWidgetTree()
Overrides:
isInWidgetTree in class Widget
Returns:
true if the widget is in widget tree of desktop

getDesktop

public Desktop getDesktop()
Overrides:
getDesktop in class Widget
Returns:
The Desktop

getCurrentScreen

public Screen getCurrentScreen()
Returns:
the screen

setCurrentScreen

public void setCurrentScreen(Screen screen)
Parameters:
screen - the screen to set

getWidget

public Widget getWidget(java.lang.String id)
Description copied from class: Widget
Returns the Widget witch correspond to the id, or null

Overrides:
getWidget in class Widget
Returns:
The Widget witch correspond to the id

getFocusManager

public FocusManager getFocusManager()
Description copied from class: Widget
Used for popup like widgets

Overrides:
getFocusManager in class Widget
Returns:
The special FocusManager

getCurrentFocusManager

public FocusManager getCurrentFocusManager()
Returns:
the current focusManager

pushPopupFocusManager

public void pushPopupFocusManager(FocusManager focusManager)
Parameters:
focusManager - the popup focusManager to set

removePopupFocusManager

public void removePopupFocusManager(FocusManager focusManager)
Remove the specified popup focusManager

Parameters:
focusManager -

getLayout

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

getLayoutData

public LayoutData getLayoutData()
Overrides:
getLayoutData in class Widget
Returns:
the layoutData

getMargin

public Insets getMargin()
Overrides:
getMargin in class Widget
Returns:
the margin

getBorder

public Insets getBorder()
Overrides:
getBorder in class Widget
Returns:
the border

getPadding

public Insets getPadding()
Overrides:
getPadding in class Widget
Returns:
the padding

setDraggedWidget

public void setDraggedWidget(Widget widget,
                             int x,
                             int y)
Define the dragged widget.

Parameters:
widget -

getDraggedWidget

public Widget getDraggedWidget()
Returns:
the dragged widget if it exists

removeDraggedWidget

public Widget removeDraggedWidget(boolean restore)
Remove the dragged widget and returns its instance. If restore is true the dragged widget is restor to its original parent.

Parameters:
restore - restore the dragged widget to its original parent
Returns:
the removed dragged widget

addPopup

public void addPopup(Widget widget)
Add a popup widget

Parameters:
widget -
defaultFocusManager -

removeAllPopupFromTag

public void removeAllPopupFromTag(java.lang.String tag)
Remove all popup widgets where tag equals tag.

Parameters:
tag -

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

removeAll

public void removeAll()
Description copied from class: Widget
Remove all childs.
Caution : this method do NOT cleanUp child widgets. It only remove widgets from widget tree.

Overrides:
removeAll in class Widget

invalidate

public void invalidate(Widget fromWidget)
Description copied from class: Widget
Invalidate the widget's size and position and propagate the information to its parent. Calling this method will generate a call to the doLayout() and paint() method on all invalidated widgets.

Overrides:
invalidate in class Widget
Parameters:
fromWidget - the Widget responsible of the invalidation.

revalidate

public void revalidate()
Revalidate the Desktop


doLayout

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

Overrides:
doLayout in class Widget

invalidateAppearanceRegion

protected void invalidateAppearanceRegion(int x,
                                          int y,
                                          int width,
                                          int height)
Description copied from class: Widget
Invalidate a specific region. The given region is translated by this widget x and y coordinates.

Overrides:
invalidateAppearanceRegion in class Widget

paintImpl

public void paintImpl(Graphics g)
Description copied from class: Widget
Paint the implementation of the widget (itself and its children).

Overrides:
paintImpl in class Widget

paint

public void paint(Graphics g)
Description copied from class: Widget
Paint the widget itself.

Overrides:
paint in class Widget

onChildAdded

protected void onChildAdded(Widget widget)
Description copied from class: Widget
Event called when the child widjet is added.

Overrides:
onChildAdded in class Widget
Parameters:
widget - The widget child witch is added

onChildRemoved

protected void onChildRemoved(Widget widget)
Description copied from class: Widget
Event called when the child widjet is removed.

Overrides:
onChildRemoved in class Widget
Parameters:
widget - The widget child witch is removed


Copyright © 2007-2008 Kalmeo. All Rights Reserved.