com.gwtext.client.widgets
Class Shadow

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.gwtext.client.widgets.BaseExtWidget
              extended by com.gwtext.client.widgets.Shadow
All Implemented Interfaces:
com.google.gwt.user.client.EventListener

public class Shadow
extends BaseExtWidget

Simple class that can provide a shadow effect for any element. Note that the element MUST be absolutely positioned, and the shadow does not provide any shimming. This should be used only in simple cases -- for more advanced functionality that can also provide the same shadow effect, see the Layer class.


Nested Class Summary
static class Shadow.Type
           
 
Field Summary
static Shadow.Type DROP
          Shadow on bottom right.
static Shadow.Type FRAME
          For 4-way shadow
static Shadow.Type SIDES
          Shadow on sides (default)
 
Fields inherited from class com.gwtext.client.widgets.BaseExtWidget
jsObj
 
Constructor Summary
Shadow(java.lang.String mode, java.lang.String offset)
          Create a new Shadow.
 
Method Summary
 void hide()
          Hides this shadow.
 boolean isVisible()
          Returns true if the shadow is visible, else false.
 void realign(int left, int top, int width, int height)
          Direct alignment when values are already available.
 void setZIndex(int zindex)
          Adjust the z-index of this shadow.
 void show(com.google.gwt.user.client.Element element)
          Displays the shadow under the target element.
 void show(java.lang.String id)
          Displays the shadow under the target element.
 
Methods inherited from class com.gwtext.client.widgets.BaseExtWidget
equals, getEl, getElement, getJsObj, getOffsetHeight, getOffsetWidth, getTitle, hashCode, onAttach, onLoad, purgeListeners, setHeight, setJsObj, setTitle, setVisible, setWidth, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
doAttachChildren, doDetachChildren, getParent, isAttached, onBrowserEvent, onDetach, onUnload, removeFromParent, setElement
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, removeStyleName, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SIDES

public static Shadow.Type SIDES
Shadow on sides (default)


FRAME

public static Shadow.Type FRAME
For 4-way shadow


DROP

public static Shadow.Type DROP
Shadow on bottom right.

Constructor Detail

Shadow

public Shadow(java.lang.String mode,
              java.lang.String offset)
Create a new Shadow.

Parameters:
mode - The shadow display mode. Supports the following options: sides: Shadow displays on both sides and bottom only, frame: Shadow displays equally on all four sides, drop: Traditional bottom-right drop shadow (default)
offset - the number of pixels to offset the shadow from the element (defaults to 4)
Method Detail

hide

public void hide()
Hides this shadow.


isVisible

public boolean isVisible()
Returns true if the shadow is visible, else false.

Overrides:
isVisible in class BaseExtWidget
Returns:
true if shadow visible

realign

public void realign(int left,
                    int top,
                    int width,
                    int height)
Direct alignment when values are already available. show(java.lang.String) must be called at least once before calling this method to ensure it is initialized.

Parameters:
left - The target element left position
top - The target element top position
width - The target element width
height - The target element height

setZIndex

public void setZIndex(int zindex)
Adjust the z-index of this shadow.

Parameters:
zindex - The new z-index

show

public void show(java.lang.String id)
Displays the shadow under the target element.

Parameters:
id - the element ID

show

public void show(com.google.gwt.user.client.Element element)
Displays the shadow under the target element.

Parameters:
element - the element