com.smartgwt.client.widgets
Class Canvas

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.smartgwt.client.widgets.BaseWidget
              extended by com.smartgwt.client.widgets.Canvas
All Implemented Interfaces:
HasHandlers, com.google.gwt.user.client.EventListener, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasScrolledHandlers, HasShowContextMenuHandlers
Direct Known Subclasses:
Calendar, DateChooser, DetailViewer, DynamicForm, EdgedCanvas, HTMLFlow, Layout, LayoutSpacer, ListGrid, Slider, StatefulCanvas, TabSet, TileLayout, WidgetCanvas

public class Canvas
extends BaseWidget
implements HasDropHandlers, HasResizedHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasKeyPressHandlers, HasKeyDownHandlers, HasRightMouseDownHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasScrolledHandlers, HasFocusChangedHandlers, HasShowContextMenuHandlers

Canvas is the base abstraction for cross-browser DHTML drawing. All DHTML widgets inherit from the Canvas class.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.smartgwt.client.widgets.BaseWidget
config, configOnly, id, isElementSet
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
Canvas()
           
Canvas(com.google.gwt.core.client.JavaScriptObject jsObj)
           
Canvas(java.lang.String id)
           
 
Method Summary
 Canvas addChild(Canvas newChild)
          Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if name argument is provided, and draw the child if this widget has been drawn already.
 Canvas addChild(Canvas newChild, java.lang.String name, boolean autoDraw)
          Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if name argument is provided, and draw the child if this widget has been drawn already.
 void addChild(com.google.gwt.user.client.ui.Widget widget)
          Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if name argument is provided, and draw the child if this widget has been drawn already.
 HandlerRegistration addClickHandler(ClickHandler handler)
          Add a click handler.
 HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
          Add a doubleClick handler.
 HandlerRegistration addDragMoveHandler(DragMoveHandler handler)
          Add a dragMove handler.
 HandlerRegistration addDragRepositionMoveHandler(DragRepositionMoveHandler handler)
          Add a dragRepositionMove handler.
 HandlerRegistration addDragRepositionStartHandler(DragRepositionStartHandler handler)
          Add a dragRepositionStart handler.
 HandlerRegistration addDragRepositionStopHandler(DragRepositionStopHandler handler)
          Add a dragRepositionStop handler.
 HandlerRegistration addDragResizeMoveHandler(DragResizeMoveHandler handler)
          Add a dragResizeMove handler.
 HandlerRegistration addDragResizeStartHandler(DragResizeStartHandler handler)
          Add a dragResizeStart handler.
 HandlerRegistration addDragResizeStopHandler(DragResizeStopHandler handler)
          Add a dragResizeStop handler.
 HandlerRegistration addDragStartHandler(DragStartHandler handler)
          Add a dragStart handler.
 HandlerRegistration addDragStopHandler(DragStopHandler handler)
          Add a dragStop handler.
 HandlerRegistration addDropHandler(DropHandler handler)
          Add a onDrop handler.
 HandlerRegistration addDropMoveHandler(DropMoveHandler handler)
          Add a dropMove handler.
 HandlerRegistration addDropOutHandler(DropOutHandler handler)
          Add a dropOut handler.
 HandlerRegistration addDropOverHandler(DropOverHandler handler)
          Add a dropOver handler.
 HandlerRegistration addFocusChangedHandler(FocusChangedHandler handler)
          Add a focusChanged handler.
 HandlerRegistration addHoverHandler(HoverHandler handler)
          Add a hover handler.
 HandlerRegistration addHoverHiddenHandler(HoverHiddenHandler handler)
          Add a hoverHidden handler.
 HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
          Add a keyDown handler.
 HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
          Add a keyPress handler.
 HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
          Add a mouseDown handler.
 HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
          Add a mouseMove handler.
 HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
          Add a mouseOut handler.
 HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
          Add a mouseOver handler.
 HandlerRegistration addMouseStillDownHandler(MouseStillDownHandler handler)
          Add a mouseStillDown handler.
 HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
          Add a mouseUp handler.
 HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
          Add a mouseWheel handler.
 Canvas addPeer(Canvas newPeer)
          Adds newPeer as a peer of this widget (also making it a child of this widget's parent, if any), set up a named object reference (i.e., this[name]) to the new widget if name is provided, and draw the peer if this widget has been drawn already.
The widget to be added as a peer will be removed from its old master and/or parent, if any, and it will be added as a child to the parent of this canvas (if any)
 Canvas addPeer(Canvas newPeer, java.lang.String name, boolean autoDraw, boolean preDraw)
          Adds newPeer as a peer of this widget (also making it a child of this widget's parent, if any), set up a named object reference (i.e., this[name]) to the new widget if name is provided, and draw the peer if this widget has been drawn already.
The widget to be added as a peer will be removed from its old master and/or parent, if any, and it will be added as a child to the parent of this canvas (if any)
 HandlerRegistration addResizedHandler(ResizedHandler handler)
          Add a resized handler.
 HandlerRegistration addRightMouseDownHandler(RightMouseDownHandler handler)
          Add a rightMouseDown handler.
 HandlerRegistration addScrolledHandler(ScrolledHandler handler)
          Add a scrolled handler.
 HandlerRegistration addShowContextMenuHandler(ShowContextMenuHandler handler)
          Add a showContextMenu handler.
 void addStyleName(java.lang.String style)
          Multiple styles are currently not supported.
 void adjustForContent(boolean immediate)
          This method tells a component to adjust for size changes made to content by external code.
 void animateFade(int opacity)
          Animate a change in opacity from the widget's current opacity to the specified opacity.
 void animateFade(int opacity, AnimationCallback callback)
          Animate a change in opacity from the widget's current opacity to the specified opacity.
 void animateFade(int opacity, AnimationCallback callback, int duration)
          Animate a change in opacity from the widget's current opacity to the specified opacity.
 void animateHide(AnimationEffect effect)
          Hide a canvas by shrinking it vertically to zero height over a period of time.
 void animateHide(AnimationEffect effect, AnimationCallback callback)
          Hide a canvas by shrinking it vertically to zero height over a period of time.
 void animateHide(AnimationEffect effect, AnimationCallback callback, int duration)
          Hide a canvas by shrinking it vertically to zero height over a period of time.
 void animateMove(int left, int top)
          Animate a reposition of this canvas from its current position to the specified position
 void animateMove(int left, int top, AnimationCallback callback)
          Animate a reposition of this canvas from its current position to the specified position
 void animateMove(int left, int top, AnimationCallback callback, int duration)
          Animate a reposition of this canvas from its current position to the specified position
 void animateMove(int left, int top, AnimationCallback callback, int duration, AnimationAcceleration acceleration)
          Animate a reposition of this canvas from its current position to the specified position
 void animateRect(int left, int top, int width, int height)
          Animate a reposition / resize of this canvas from its current size and postion.
 void animateRect(int left, int top, int width, int height, AnimationCallback callback)
          Animate a reposition / resize of this canvas from its current size and postion.
 void animateRect(int left, int top, int width, int height, AnimationCallback callback, int duration)
          Animate a reposition / resize of this canvas from its current size and postion.
 void animateResize(int width, int height)
          Animate a resize of this canvas from its current size to the specified size
 void animateResize(int width, int height, AnimationCallback callback)
          Animate a resize of this canvas from its current size to the specified size
 void animateResize(int width, int height, AnimationCallback callback, int duration)
          Animate a resize of this canvas from its current size to the specified size
 void animateScroll(int scrollLeft, int scrollTop)
          Animate a scroll from the current scroll position to the specified position.
 void animateScroll(int scrollLeft, int scrollTop, AnimationCallback callback)
          Animate a scroll from the current scroll position to the specified position.
 void animateScroll(int scrollLeft, int scrollTop, AnimationCallback callback, int duration)
          Animate a scroll from the current scroll position to the specified position.
 void animateShow(AnimationEffect effect)
          Show a canvas by growing it vertically to its fully drawn height over a period of time.
 void animateShow(AnimationEffect effect, AnimationCallback callback)
          Show a canvas by growing it vertically to its fully drawn height over a period of time.
 void animateShow(AnimationEffect effect, AnimationCallback callback, int duration)
          Show a canvas by growing it vertically to its fully drawn height over a period of time.
 void blur()
          If this canvas has keyboard focus, blur it.
 void bringToFront()
          Puts this widget at the top of the stacking order, so it appears in front of all other widgets in the same parent.
 void clear()
          Remove all visual representation of a Canvas.
 void clickMaskUp()
          Determines whether a clickmask is showing
 void clickMaskUp(java.lang.String ID)
          Determines whether a clickmask is showing
 java.lang.Boolean contains(Canvas canvas)
          Returns true if element is a descendant of this widget (i.e., exists below this widget in the containment hierarchy); and false otherwise.
 java.lang.Boolean contains(Canvas canvas, boolean testSelf)
          Returns true if element is a descendant of this widget (i.e., exists below this widget in the containment hierarchy); and false otherwise.
 java.lang.Boolean containsEvent()
          Return true if the last event's mouse coordinates are within the bounds of this component. NOTE: Z-ordering is not considered for the purposes of this test.
 java.lang.Boolean containsFocus()
          Returns true if the keyboard focus is in this Canvas or any child of this Canvas.
 java.lang.Boolean containsPoint(int x, int y)
          Return whether or not this object contains the specified global (x,y) coordinates.
 java.lang.Boolean containsPoint(int x, int y, boolean withinViewport)
          Return whether or not this object contains the specified global (x,y) coordinates.
protected static Canvas[] convertToCanvasArray(com.google.gwt.core.client.JavaScriptObject nativeArray)
           
protected  com.google.gwt.core.client.JavaScriptObject create()
           
 void disable()
          Disables this widget and any children and peers of this widget.
 void enable()
          Enables this widget and any children / peers of this widget.
 void focus()
          If this canvas can accept focus, give it keyboard focus.
 int getAbsoluteLeft()
           
 int getAbsoluteTop()
           
 java.lang.String getAccessKey()
          If specified this governs the accessKey for the widget. This should be set to a character - when a user hits Alt+[accessKey], or in Mozilla Firefox 2.0 and above, Shift+Alt+[accessKey], focus will be given to the widget in question.
 AnimationEffect getAnimateAcceleration()
          Default acceleration effect to apply to all animations on this Canvas. Can be overridden by setting animationAcceleration for specific animations or by passing an acceleration function directly into the appropriate method.
 java.lang.Integer getAnimateFadeTime()
          Default time for performing an animated fade.
 AnimationAcceleration getAnimateHideAcceleration()
          Default acceleration function for performing an animated hide.
 java.lang.Integer getAnimateHideTime()
          Default time for performing an animated hide.
 AnimationAcceleration getAnimateMoveAcceleration()
          Default acceleration effect for performing an animated move.
 java.lang.Integer getAnimateMoveTime()
          Default time for performing an animated move.
 AnimationAcceleration getAnimateRectAcceleration()
          Default acceleration function for performing an animated move and resize.
 java.lang.Integer getAnimateRectTime()
          Default time for performing an animated setRect.
 AnimationAcceleration getAnimateResizeAcceleration()
          Default acceleration function for performing an animated resize.
 java.lang.Integer getAnimateResizeTime()
          Default time for performing an animated resize.
 AnimationAcceleration getAnimateScrollAcceleration()
          Default acceleration function for performing an animated scroll.
 java.lang.Integer getAnimateScrollTime()
          Default time for performing an animated scroll.
 AnimationAcceleration getAnimateShowAcceleration()
          Default acceleration function for performing an animated show.
 java.lang.Integer getAnimateShowTime()
          Default time for performing an animated show.
 int getAnimateTime()
          Default total duration of animations.
 java.lang.String getAppImgDir()
          Default directory for app-specific images, relative to the Page-wide Page.getAppImgDir().
 java.lang.Boolean getAutoShowParent()
          If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.
 java.lang.String getBackgroundImage()
          URL for a background image for this widget (corresponding to the CSS "background-image" attribute).
 java.lang.String getBackgroundPosition()
          Specifies how the background image should be positioned on the widget. It corresponds to the CSS background-position attribute.
 BkgndRepeat getBackgroundRepeat()
          Specifies how the background image should be tiled if this widget is larger than the image.
 java.lang.String getBorder()
          Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid blue").
 int getBottom()
          Return the bottom coordinate of this object as rendered, relative to its enclosing context, in pixels.
static Canvas getById(java.lang.String ID)
          Retrieve a Canvas by it's global ID.
 java.lang.Boolean getCanAcceptDrop()
          Indicates that this object can receive dropped widgets (i.e.
 java.lang.Boolean getCanDrag()
          Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize).
 java.lang.Boolean getCanDragReposition()
          Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.
 java.lang.Boolean getCanDragResize()
          Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.
 java.lang.Boolean getCanDragScroll()
          If this Canvas is canAcceptDrop:true, when the user drags a droppable widget over an edge of the widget, should we scroll to show the rest of the widget's content? Returned from canvas.shouldDragScroll().
 java.lang.Boolean getCanDrop()
          Indicates that this object can be dropped on top of other widgets.
 java.lang.Boolean getCanDropBefore()
          When explicitly set to false, disallows drop before this member in the Layout.
 java.lang.Boolean getCanFocus()
          Can this widget be allowed to become the target of keyboard events?
 java.lang.Boolean getCanHover()
          Will this Canvas fire hover events when the user hovers over it, or one of its children?
 java.lang.Boolean getCanSelectText()
          Whether native drag selection of contained text is allowed within this Canvas.
 Canvas[] getChildren()
          Array of all Canvii that are immediate children of this Canvas.
 java.lang.Boolean getChildrenSnapResizeToGrid()
          If true, causes this canvas's children to snap to its grid when resizing. This behavior can be overridden on a per-child basis by setting the snapToGrid or snapResizeToGrid value on the child.
 java.lang.Boolean getChildrenSnapToGrid()
          If true, causes this canvas's children to snap to its grid when dragging. This behavior can be overridden on a per-child basis by setting the snapToGrid value on the child.
 java.lang.String getContents()
          The contents of a canvas or label widget.
 Menu getContextMenu()
          Context menu to show for this object, an instance of the Menu widget.
 Cursor getCursor()
          Specifies the cursor image to display when the mouse pointer is over this widget.
 int getDefaultHeight()
          For custom components, establishes a default height for the component.
 int getDefaultWidth()
          For custom components, establishes a default width for the component.
 java.lang.Boolean getDestroyed()
          If this property is set to true, the BaseWidget.destroy() method has been called on this canvas.
 java.lang.Boolean getDestroying()
          This property is set to true when the BaseWidget.destroy() method is called on a widget. If this property is true, but destroyed is not, this indicates the canvas is in the process of being destroyed.
 java.lang.Boolean getDisabled()
          If set to true, the widget will be disabled.
 Cursor getDisabledCursor()
          Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled.
 int getDoubleClickDelay()
          Amount of time (in msec) between which two clicks are considered a single click
 DragAppearance getDragAppearance()
          Visual appearance to show when the object is being dragged.
 DragIntersectStyle getDragIntersectStyle()
          This indicates how the system will test for droppable targets: either by intersection with the mouse or intersection with the rectangle of the dragMoveTarget.
 java.lang.Integer getDragOpacity()
          If this widget has dragAppearance "target", this value specifies the opacity to render the target while it is being dragged.
 Cursor getDragRepositionCursor()
          Cursor to switch to if the mouse is over a widget that is drag repositionable.
 int getDragScrollDelay()
          If this widget supports drag-scrolling, This property specifies how many ms the user must hover over the drag-scroll threshold before scrolling begins.
 int getDragStartDistance()
          Number of pixels the cursor needs to move before the EventHandler starts a drag operation.
 Canvas getDragTarget()
          A different widget that should be actually dragged when dragging initiates on this widget.
 java.lang.String getDragType()
          The "type" of thing given as a string that can be dragged from this widget.
 java.lang.Boolean getDynamicContents()
          Dynamic contents allows the contents string to be treated as a simple, but powerful template.
 java.lang.String getEdgeBackgroundColor()
          Background color for the EdgedCanvas created to decorate this component.
 java.lang.String getEdgeCenterBackgroundColor()
          Background color for the center section only.
 java.lang.String getEdgeImage()
          Base name of images for edges.
 java.lang.Integer getEdgeOffset()
          Amount the contained Canvas should be offset.
 java.lang.Integer getEdgeOpacity()
          Opacity of the edges.
 java.lang.Boolean getEdgeShowCenter()
          Whether to show media in the center section, that is, behind the decorated Canvas.
 int getEdgeSize()
          Size in pixels for corners and edges
 int getExtraSpace()
          When this Canvas is included as a member in a Layout, extra blank space that should be left after this member in a Layout.
 java.lang.String getGroupTitle()
          Return the groupTitle.
 java.lang.Integer getHeight()
           
 java.lang.String getHeightAsString()
           
 Alignment getHoverAlign()
          If this.showHover is true, this property can be used to customize the alignment of content in the hover canvas.
 int getHoverDelay()
          If this.canHover is true, how long should the mouse be kept over this widget before the hover event is fired
 java.lang.Integer getHoverHeight()
          If this.showHover is true, this property can be used to customize the height of the hover canvas shown.
 void getHoverHTML()
          If this.showHover is true, when the user holds the mouse over this Canvas for long enough to trigger a hover event, a hover canvas is shown by default.
 java.lang.Boolean getHoverMoveWithMouse()
          If this.showHover is true, should this widget's hover canvas be moved with the mouse while visible?
 java.lang.Integer getHoverOpacity()
          If this.showHover is true, should the hover canvas be shown with opacity other than 100?
 java.lang.String getHoverStyle()
          If this.showHover is true, this property can be used to specify the css style to apply to the hover canvas.
 VerticalAlignment getHoverVAlign()
          If this.showHover is true, this property can be used to customize the vertical alignment of content in the hover canvas.
 java.lang.Integer getHoverWidth()
          If showHover is true, this property can be used to customize the width of the hover canvas shown.
 java.lang.Boolean getHoverWrap()
          If this.showHover is true, this property can be used to customize the whether content in the hover canvas is displayed in a single line, or wraps.
 int getHSnapOrigin()
          Get an offset to be used when calculating snap positioning.
 int getHSnapOrigin(Canvas snapChild)
          Get an offset to be used when calculating snap positioning.
 int getHSnapPosition(int coordinate)
           Override this method to provide a custom snap-to grid.
 int getHSnapPosition(int coordinate, java.lang.String direction)
           Override this method to provide a custom snap-to grid.
 DrawPosition getHtmlPosition()
          If htmlElement is specified, this attribute specifies the position where the canvas should be inserted relative to the htmlElement in the DOM.
static java.lang.String getImgURL(java.lang.String URL)
          Return the full URL for an image to be drawn in this canvas.
static java.lang.String getImgURL(java.lang.String URL, java.lang.String imgDir)
          Return the full URL for an image to be drawn in this canvas.
 int getInnerContentHeight()
          Returns the amount of space available for interior content (or relatively positioned child widget(s)) without introducing clipping, scrolling or overflow.
This is the space within the viewport of the widget (not including padding, and excluding margins, borders or scrollbars) rendered at its specified size.
 int getInnerContentWidth()
          Returns the amount of space available for interior content (or relatively positioned child widget(s)) without introducing clipping, scrolling or overflow.
This is the space within the viewport of the widget (not including padding, and excluding margins, borders or scrollbars) rendered at its specified size.
 int getInnerHeight()
          Returns the amount of space available for (an) absolutely positioned child widget(s) or HTML content, without introducing clipping, scrolling or overflow.
This is the space within the viewport of the widget (including padding, but excluding margins, borders or scrollbars) rendered at its specified size.
 int getInnerWidth()
          Returns the amount of space available for (an) absolutely positioned child widget(s) or HTML content, without introducing clipping, scrolling or overflow.
This is the space within the viewport of the widget (including padding, but excluding margins, borders or scrollbars) rendered at its specified size.
 java.lang.Boolean getIsGroup()
          Return the isGroup.
 int getLeft()
          Number of pixels the left side of the widget is offset to the right from its default drawing context (either its parent's topleft corner, or the document flow, depending on the value of the position property).
 java.lang.Integer getMargin()
          Set the CSS Margin, in pixels, for this component.
 java.lang.Boolean getMatchElement()
          If htmlElement is specified, should this canvas initially be drawn at the same dimensions as the htmlElement?
Note: setting this property will not force the canvas to resize if the element subsequently resizes (for example due to page reflow).
 int getMaxHeight()
          Maximum height that this Canvas can be resized to.
 int getMaxWidth()
          Maximum width that this Canvas can be resized to.
 int getMinHeight()
          Minimum height that this Canvas can be resized to.
 int getMinWidth()
          Minimum width that this Canvas can be resized to.
 int getMouseStillDownDelay()
          Amount of time (in msec) between 'mouseStillDown' events for this object
 int getMouseStillDownInitialDelay()
          Amount of time (in msec) before mouseStillDown events start to be fired for this object.
 int getNextZIndex()
          get the next zIndex for the next item to be drawn.
 java.lang.Boolean getNoDoubleClicks()
          If true, this canvas will recieve all mouse-clicks as single click events rather than doubleClicks.
 int getOffsetHeight()
           
 int getOffsetWidth()
           
 int getOffsetX()
          Return the X-coordinate of the last event relative to the left edge of the content of this Canvas.

NOTE: To get a coordinate relative to the viewport of this Canvas, subtract this.getScrollLeft()
 int getOffsetY()
          Return the Y-coordinate of the last event, relative to the top edge of the content of this Canvas.

NOTE: To get a coordinate relative to the viewport of this Canvas, subtract this.getScrollTop()
 java.lang.Integer getOpacity()
          Renders the widget to be partly transparent.
static Canvas getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
           
 Overflow getOverflow()
          Controls what happens when the drawn size of the content of a Canvas is either greater or smaller than the specified size of the Canvas.
 java.lang.Integer getPadding()
          Set the CSS padding of this component, in pixels.
 int getPageBottom()
          Return the page-relative bottom coordinate of this object, in pixels.
 int getPageLeft()
          Returns the page-relative left coordinate of the widget on the page, in pixels.
 Rectangle getPageRect()
           
 int getPageRight()
          Return the page-relative right coordinate of this object, in pixels.
 int getPageTop()
          Returns the page-relative top coordinate of the widget on the page, in pixels
 Canvas getParentElement()
          This Canvas's immediate parent, if any.
 PercentBoxModel getPercentBox()
          Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a specified snapTo.
 Positioning getPosition()
          Absolute or relative, corresponding to the "absolute" (with respect to parent) or "relative" (with respect to document flow) values for the CSS position attribute.
 java.lang.String getPrefix()
           
 java.lang.String getPrompt()
          Prompt displayed in hover canvas if showHover is true.
 Rectangle getRect()
          Get all four coordinates, relative to the enclosing context, at one.
 java.lang.Boolean getRedrawOnResize()
          Should this element be redrawn in response to a resize?
 java.lang.String getResizeBarTarget()
          When this Canvas is included as a member in a Layout, and showResizeBar is set to true so that a resizeBar is created, resizeBarTarget:"next" can be set to indicate that the resizeBar should resize the next member of the layout rather than this one.
 int getRight()
          Return the right coordinate of this object as rendered, relative to its enclosing context, in pixels.
 int getScrollbarSize()
          How thick should we make the scrollbars for this canvas.
NOTE: has no effect if showCustomScrollbars is false.
 int getScrollBottom()
          Returns the scrollTop required to scroll vertically to the end of this widget's content.
 int getScrollHeight()
          Returns the scrollable height of the widget's contents, including children, ignoring clipping.
 int getScrollLeft()
          Get the number of pixels this Canvas is scrolled from its left edge.
 int getScrollRight()
          Returns the scrollLeft required to scroll horizontally to the end of this widget's content.
 int getScrollTop()
          Get the number of pixels this Canvas is scrolled from its top edge.
 int getScrollWidth()
          Returns the scrollable width of the widget's contents, including children, ignoring clipping.
 int getShadowDepth()
          Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.
 java.lang.String getShadowImage()
          Base name of the series of images for the sides, corners, and center of the shadow.
 java.lang.Integer getShadowOffset()
          Offset of the shadow.
 java.lang.Integer getShadowSoftness()
          Softness, or degree of blurring, of the shadow.
 java.lang.Boolean getShowCustomScrollbars()
          Whether to use the browser's native scrollbars or SmartGWT-based scrollbars.
 java.lang.Boolean getShowDragShadow()
          When this widget is dragged, if its dragAppearance is "target", should we show a shadow behind the canvas during the drag.
 java.lang.Boolean getShowEdges()
          Whether an EdgedCanvas should be used to show image-based edges around this component.
 java.lang.Boolean getShowHover()
          If this.canHover is true, should we show the global hover canvas by default when the user hovers over this canvas?
 java.lang.Boolean getShowResizeBar()
          When this Canvas is included as a member in a Layout, whether a resizeBar should be shown after this member in the layout, to allow it to be resized.
 java.lang.Boolean getShowShadow()
          Whether to show a drop shadow for this Canvas
 java.lang.String getSkinImgDir()
          Default directory for skin images (those defined by the class), relative to the Page-wide Page.getSkinDir().
 java.lang.String getSnapAxis()
          Describes which axes to apply snap-to-grid to. Valid values are Canvas.HORIZONTAL, Canvas.VERTICAL and Canvas.BOTH
 java.lang.String getSnapEdge()
          If snapTo is defined to this widget, this property can be used to define which edge of this widget should be snapped to an edge of the master or parent element.
 java.lang.String getSnapHDirection()
          The horizontal snap direction. Set this value to Canvas.BEFORE to snap to the nearest gridpoint to the left; set it to Canvas.AFTER to snap to the nearest gridpoint to the right; and set it to Canvas.NEAREST to snap to the nearest gridpoint in either direction.
 int getSnapHGap()
          The horizontal grid size to use, in pixels, when snap-to-grid is enabled.
 java.lang.Integer getSnapOffsetLeft()
          If snapTo is defined for this widget, this property can be used to specify an offset in px or percentage for the left coordinate of this widget.
 java.lang.Integer getSnapOffsetTop()
          If snapTo is defined for this widget, this property can be used to specify an offset in px or percentage for the top coordinate of this widget.
 java.lang.Boolean getSnapOnDrop()
          When this canvas is dropped onto an object supporting snap-to-grid, should it snap to the grid (true, the default) or just drop wherever the mouse is (false).
 java.lang.Boolean getSnapResizeToGrid()
          Causes this canvas to snap to its parent's grid when resizing. Note that this value defaults to the Canvas's snapToGrid value if undefined.
 java.lang.String getSnapTo()
          Position this widget such that it is aligned with ("snapped to") an edge of its masterElement (if specified), or its parentElement.
 java.lang.Boolean getSnapToGrid()
          Causes this canvas to snap to its parent's grid when dragging.
 java.lang.String getSnapVDirection()
          The vertical snap direction. Set this value to Canvas.BEFORE to snap to the nearest gridpoint above; set it to Canvas.AFTER to snap to the nearest gridpoint below; and set it to Canvas.NEAREST to snap to the nearest gridpoint in either direction.
 int getSnapVGap()
          The vertical grid size to use, in pixels, when snap-to-grid is enabled.
 java.lang.String getStyleName()
          The CSS class applied to this widget as a whole.
 java.lang.Integer getTabIndex()
          If specified this governs the tabIndex of the widget in the page's tab order. Note that by default SmartGWT auto-assigns tab-indices, ensuring focusable widgets are reachable by tabbing in the order in which they are drawn on the page. canvas.tabIndex cannot be set to greater than com.smartgwt.client.widgets.Canvas#TAB_INDEX_FLOOR - as we reserve the values above this range for auto-assigned tab-indices.
 java.lang.String getTitle()
          Synonmy for getPrompt()
 java.lang.String getTooltip()
          Synonmy for getPrompt()
 int getTop()
          Number of pixels the top of the widget is offset down from its default drawing context (either its parent's top-left corner, or the document flow, depending on the value of the position property).
 int getViewportHeight()
          Returns the height of the viewport onto the scrollable content.
 int getViewportWidth()
          Returns the width of the viewport onto the scrollable content.
 Visibility getVisibility()
          Controls widget visibility when the widget is initialized.
 int getVisibleHeight()
          Return the visible height of the Canvas.
 int getVisibleWidth()
          Return the visible width of the Canvas.
 int getVSnapOrigin()
          Get an offset to be used when calculating snap positioning.
 int getVSnapOrigin(Canvas snapChild)
          Get an offset to be used when calculating snap positioning.
 int getVSnapPosition(int coordinate)
          Override this method to provide a custom snap-to grid.
 int getVSnapPosition(int coordinate, java.lang.String direction)
          Override this method to provide a custom snap-to grid.
 java.lang.Integer getWidth()
           
 java.lang.String getWidthAsString()
           
 int getZIndex()
          Get the z-Index of this canvas.
 void handleHover()
          Handler fired on a delay when the user hovers the mouse over this hover-target. Default implementation will fire this.hover() (if defined), and handle showing the hover canvas if this.showHover is true.
 void hide()
          Sets the widget's CSS visibility attribute to "hidden".
 void hideClickMask()
          Hides the click mask associated with this canvas.
 void hideClickMask(java.lang.String ID)
          Hides the click mask associated with this canvas.
 void hideContextMenu()
           The default implementation of this method hides the contextMenu currently being shown for this component (which occurs when the mouse button that toggles the context menu is released). Override if you want some other behavior.
static java.lang.String imgHTML(java.lang.String src)
          Generates the HTML for an image unique to this Canvas.
static java.lang.String imgHTML(java.lang.String src, int width, int height)
           
static java.lang.String imgHTML(java.lang.String src, int width, int height, java.lang.String name, java.lang.String extraStuff, java.lang.String imgDir)
          Generates the HTML for an image unique to this Canvas.
 java.lang.Boolean intersects(Canvas other)
          Returns true if the rectangles of this widget and the specified widget overlap.
 java.lang.Boolean isDirty()
          Returns whether a canvas is waiting to be redrawn.
 java.lang.Boolean isDisabled()
          Is this canvas disabled? Note that the disabled state is inherited - this method will return true if this widget, or any of its ancestors are marked disabled.
 java.lang.Boolean isDrawn()
          Returns the boolean true, if the widget has been completely drawn, and false otherwise.
 boolean isVisible()
          Returns true if the widget is visible, taking all parents into account, so that a widget which is not hidden might still report itself as not visible if it is within a hidden parent.
 java.lang.Boolean keyUp()
           Executed when a key is released on a focusable widget (canFocus: true).
 void layoutChildren(java.lang.String reason)
           layoutChildren() is where a Canvas should implement a sizing policy for it's Canvas children.
 java.lang.String linkHTML(java.lang.String href)
          Generates the HTML for a standard link element
 java.lang.String linkHTML(java.lang.String href, java.lang.String text, java.lang.String target, java.lang.String ID, int tabIndex, java.lang.String accessKey)
          Generates the HTML for a standard link element
 void markForDestroy()
          BaseWidget.destroy() this canvas on a timeout.
 void markForRedraw()
          Marks the widget as "dirty" so that it will be added to a queue for redraw.
 void markForRedraw(java.lang.String reason)
          Marks the widget as "dirty" so that it will be added to a queue for redraw.
 void moveAbove(Canvas canvas)
          Puts this widget just above the specified widget in the stacking order, so it appears in front of the specified widget if both widgets have the same parent.
 void moveBelow(Canvas canvas)
          Puts this widget just below the specified widget in the stacking order, so it appears behind the specified widget if both widgets have the same parent.
 java.lang.Boolean moveBy(int deltaX, int deltaY)
          Moves the widget deltaX pixels to the right and deltaY pixels down.
 boolean moveTo(int left, int top)
          Moves the widget so that its top-left corner is at the specified coordinates.
 void parentResized()
          Fires when the interior size of the parent changes, including parent resize and scrollbar introduction or removal.
 void redraw()
          Redraws the widget immediately with its current property values.
 void redraw(java.lang.String reason)
          Redraws the widget immediately with its current property values.
 void removeChild(Canvas child)
          Remove a child from its parent if it has one.
 void removeChild(Canvas child, java.lang.String name)
          Remove a child from its parent if it has one.
 java.lang.Boolean resizeBy()
          Resizes the widget, adding deltaX to its width and deltaY to its height (moves the right and/or bottom sides of the widget).
 java.lang.Boolean resizeBy(int deltaX, int deltaY)
          Resizes the widget, adding deltaX to its width and deltaY to its height (moves the right and/or bottom sides of the widget).
 java.lang.Boolean resizeTo()
          Resizes the widget to the specified width and height (moves the right and/ or bottom sides of the widget).
 java.lang.Boolean resizeTo(int width, int height)
          Resizes the widget to the specified width and height (moves the right and/ or bottom sides of the widget).
 void scrollBy(int dX, int dY)
          Scroll this widget by some pixel increment in either (or both) direction(s).
 void scrollByPercent(int dX, int dY)
          Scroll this widget by some percentage of scroll size in either (or both) direction(s).
 void scrollTo()
          Scrolls the content of the widget so that the origin (top-left corner) of the content is left pixels to the left and top pixels above the widget's top-left corner (but still clipped by the widget's dimensions).
 void scrollTo(int left, int top)
          Scrolls the content of the widget so that the origin (top-left corner) of the content is left pixels to the left and top pixels above the widget's top-left corner (but still clipped by the widget's dimensions).
 void scrollToBottom()
          Vertically scrolls the content of the widget to the end of its content
 void scrollToLeft()
          Horizontally scrolls the content of the widget to 0
 void scrollToPercent(int left, int top)
          Scroll this widget to some position specified as a percentage of scroll size in either (or both) direction(s).
 void scrollToRight()
          Horizontally scrolls the content of the widget to the end of its content
 void scrollToTop()
          Vertically scrolls the content of the widget to 0
 void sendToBack()
          Puts this widget at the bottom of the stacking order, so it appears behind all other widgets in the same parent.
 void setAccessKey(java.lang.String accessKey)
          If specified this governs the accessKey for the widget. This should be set to a character - when a user hits Alt+[accessKey], or in Mozilla Firefox 2.0 and above, Shift+Alt+[accessKey], focus will be given to the widget in question.
 void setAlign(Alignment align)
           
 void setAnimateAcceleration(AnimationEffect animateAcceleration)
          Default acceleration effect to apply to all animations on this Canvas. Can be overridden by setting animationAcceleration for specific animations or by passing an acceleration function directly into the appropriate method.
 void setAnimateFadeTime(java.lang.Integer animateFadeTime)
          Default time for performing an animated fade.
 void setAnimateHideAcceleration(AnimationAcceleration animateHideAcceleration)
          Default acceleration function for performing an animated hide.
 void setAnimateHideTime(java.lang.Integer animateHideTime)
          Default time for performing an animated hide.
 void setAnimateMoveAcceleration(AnimationAcceleration animateMoveAcceleration)
          Default acceleration effect for performing an animated move.
 void setAnimateMoveTime(java.lang.Integer animateMoveTime)
          Default time for performing an animated move.
 void setAnimateRectAcceleration(AnimationAcceleration animateRectAcceleration)
          Default acceleration function for performing an animated move and resize.
 void setAnimateRectTime(java.lang.Integer animateRectTime)
          Default time for performing an animated setRect.
 void setAnimateResizeAcceleration(AnimationAcceleration animateResizeAcceleration)
          Default acceleration function for performing an animated resize.
 void setAnimateResizeTime(java.lang.Integer animateResizeTime)
          Default time for performing an animated resize.
 void setAnimateScrollAcceleration(AnimationAcceleration animateScrollAcceleration)
          Default acceleration function for performing an animated scroll.
 void setAnimateScrollTime(java.lang.Integer animateScrollTime)
          Default time for performing an animated scroll.
 void setAnimateShowAcceleration(AnimationAcceleration animateShowAcceleration)
          Default acceleration function for performing an animated show.
 void setAnimateShowTime(java.lang.Integer animateShowTime)
          Default time for performing an animated show.
 void setAnimateTime(int animateTime)
          Default total duration of animations.
 void setAppImgDir(java.lang.String appImgDir)
          Default directory for app-specific images, relative to the Page-wide Page.getAppImgDir().
 void setAutoHeight()
           
 void setAutoShowParent(java.lang.Boolean autoShowParent)
          If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.
 void setAutoWidth()
           
 void setBackgroundColor(java.lang.String backgroundColor)
          The background color for this widget.
 void setBackgroundImage(java.lang.String backgroundImage)
          URL for a background image for this widget (corresponding to the CSS "background-image" attribute).
 void setBackgroundPosition(java.lang.String backgroundPosition)
          Specifies how the background image should be positioned on the widget. It corresponds to the CSS background-position attribute.
 void setBackgroundRepeat(BkgndRepeat backgroundRepeat)
          Specifies how the background image should be tiled if this widget is larger than the image.
 void setBorder(java.lang.String border)
          Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid blue").
 void setBottom(int bottom)
          Resizes the widget vertically to position its bottom edge at the specified coordinate.
 void setCanAcceptDrop(java.lang.Boolean canAcceptDrop)
          Indicates that this object can receive dropped widgets (i.e.
 void setCanDrag(java.lang.Boolean canDrag)
          Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize).
 void setCanDragReposition(java.lang.Boolean canDragReposition)
          Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.
 void setCanDragResize(java.lang.Boolean canDragResize)
          Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.
 void setCanDragScroll(java.lang.Boolean canDragScroll)
          If this Canvas is canAcceptDrop:true, when the user drags a droppable widget over an edge of the widget, should we scroll to show the rest of the widget's content? Returned from canvas.shouldDragScroll().
 void setCanDrop(java.lang.Boolean canDrop)
          Indicates that this object can be dropped on top of other widgets.
 void setCanDropBefore(java.lang.Boolean canDropBefore)
          When explicitly set to false, disallows drop before this member in the Layout.
 void setCanFocus(java.lang.Boolean canFocus)
          Can this widget be allowed to become the target of keyboard events?
 void setCanHover(java.lang.Boolean canHover)
          Will this Canvas fire hover events when the user hovers over it, or one of its children?
 void setCanSelectText(java.lang.Boolean canSelectText)
          Whether native drag selection of contained text is allowed within this Canvas.
 void setChildren(Canvas... children)
          Array of all Canvii that are immediate children of this Canvas.
 void setChildrenSnapResizeToGrid(java.lang.Boolean childrenSnapResizeToGrid)
          If true, causes this canvas's children to snap to its grid when resizing. This behavior can be overridden on a per-child basis by setting the snapToGrid or snapResizeToGrid value on the child.
 void setChildrenSnapToGrid(java.lang.Boolean childrenSnapToGrid)
          If true, causes this canvas's children to snap to its grid when dragging. This behavior can be overridden on a per-child basis by setting the snapToGrid value on the child.
 void setContents(java.lang.String contents)
          The contents of a canvas or label widget.
 void setContextMenu(Menu contextMenu)
          Context menu to show for this object, an instance of the Menu widget.
 void setCursor(Cursor cursor)
          Specifies the cursor image to display when the mouse pointer is over this widget.
 void setDefaultHeight(int defaultHeight)
          For custom components, establishes a default height for the component.
 void setDefaultWidth(int defaultWidth)
          For custom components, establishes a default width for the component.
 void setDisabled(java.lang.Boolean disabled)
          If set to true, the widget will be disabled.
 void setDisabledCursor(Cursor disabledCursor)
          Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled.
 void setDoubleClickDelay(int doubleClickDelay)
          Amount of time (in msec) between which two clicks are considered a single click
 void setDragAppearance(DragAppearance dragAppearance)
          Visual appearance to show when the object is being dragged.
 void setDragIntersectStyle(DragIntersectStyle dragIntersectStyle)
          This indicates how the system will test for droppable targets: either by intersection with the mouse or intersection with the rectangle of the dragMoveTarget.
 void setDragOpacity(java.lang.Integer dragOpacity)
          If this widget has dragAppearance "target", this value specifies the opacity to render the target while it is being dragged.
 void setDragRepositionCursor(Cursor dragRepositionCursor)
          Cursor to switch to if the mouse is over a widget that is drag repositionable.
 void setDragScrollDelay(int dragScrollDelay)
          If this widget supports drag-scrolling, This property specifies how many ms the user must hover over the drag-scroll threshold before scrolling begins.
 void setDragStartDistance(int dragStartDistance)
          Number of pixels the cursor needs to move before the EventHandler starts a drag operation.
 void setDragTarget(Canvas dragTarget)
          A different widget that should be actually dragged when dragging initiates on this widget.
 void setDragType(java.lang.String dragType)
          The "type" of thing given as a string that can be dragged from this widget.
 void setDropTypes(java.lang.String... dropTypes)
          The "type" of thing(s) that can be dropped on this widget specified as a string or an array of strings (indicating multiple types).
 void setDynamicContents(java.lang.Boolean dynamicContents)
          Dynamic contents allows the contents string to be treated as a simple, but powerful template.
 void setEdgeBackgroundColor(java.lang.String edgeBackgroundColor)
          Background color for the EdgedCanvas created to decorate this component.
 void setEdgeCenterBackgroundColor(java.lang.String edgeCenterBackgroundColor)
          Background color for the center section only.
 void setEdgeImage(java.lang.String edgeImage)
          Base name of images for edges.
 void setEdgeMarginSize(int edgeMarginSize)
           
 void setEdgeOffset(java.lang.Integer edgeOffset)
          Amount the contained Canvas should be offset.
 void setEdgeOpacity(java.lang.Integer edgeOpacity)
          Opacity of the edges.
 void setEdgeShowCenter(java.lang.Boolean edgeShowCenter)
          Whether to show media in the center section, that is, behind the decorated Canvas.
 void setEdgeSize(int edgeSize)
          Size in pixels for corners and edges
 void setExtraSpace(int extraSpace)
          When this Canvas is included as a member in a Layout, extra blank space that should be left after this member in a Layout.
 void setGroupTitle(java.lang.String groupTitle)
          Set the groupTitle.
 void setHeight(int height)
          Size for this component's vertical dimension.
 void setHeight(java.lang.String height)
           
 void setHeight100()
          Convenience method that sets the height to 100%.
 void setHoverAlign(Alignment hoverAlign)
          If this.showHover is true, this property can be used to customize the alignment of content in the hover canvas.
 void setHoverDelay(int hoverDelay)
          If this.canHover is true, how long should the mouse be kept over this widget before the hover event is fired
 void setHoverHeight(java.lang.Integer hoverHeight)
          If this.showHover is true, this property can be used to customize the height of the hover canvas shown.
 void setHoverMoveWithMouse(java.lang.Boolean hoverMoveWithMouse)
          If this.showHover is true, should this widget's hover canvas be moved with the mouse while visible?
 void setHoverOpacity(java.lang.Integer hoverOpacity)
          If this.showHover is true, should the hover canvas be shown with opacity other than 100?
 void setHoverStyle(java.lang.String hoverStyle)
          If this.showHover is true, this property can be used to specify the css style to apply to the hover canvas.
 void setHoverVAlign(VerticalAlignment hoverVAlign)
          If this.showHover is true, this property can be used to customize the vertical alignment of content in the hover canvas.
 void setHoverWidth(java.lang.Integer hoverWidth)
          If showHover is true, this property can be used to customize the width of the hover canvas shown.
 void setHoverWrap(java.lang.Boolean hoverWrap)
          If this.showHover is true, this property can be used to customize the whether content in the hover canvas is displayed in a single line, or wraps.
 void setHtmlPosition(DrawPosition htmlPosition)
          If htmlElement is specified, this attribute specifies the position where the canvas should be inserted relative to the htmlElement in the DOM.
 void setImage(java.lang.String identifier, java.lang.String URL)
          Set the URL of an image element by name.
 void setImage(java.lang.String identifier, java.lang.String URL, java.lang.String imgDir)
          Set the URL of an image element by name.
 void setIsGroup(java.lang.Boolean isGroup)
          Set the isGroup.
 void setKeepInParentRect(java.lang.Boolean keepInParentRect)
           
 void setKeepInParentRect(Rectangle rectangle)
           
 void setLayoutAlign(Alignment layoutAlign)
          When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout.
 void setLayoutAlign(VerticalAlignment layoutAlign)
          When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout.
 void setLeft(int left)
          Number of pixels the left side of the widget is offset to the right from its default drawing context (either its parent's topleft corner, or the document flow, depending on the value of the position property).
 void setMargin(java.lang.Integer margin)
          Set the CSS Margin, in pixels, for this component.
 void setMatchElement(java.lang.Boolean matchElement)
          If htmlElement is specified, should this canvas initially be drawn at the same dimensions as the htmlElement?
Note: setting this property will not force the canvas to resize if the element subsequently resizes (for example due to page reflow).
 void setMaxHeight(int maxHeight)
          Maximum height that this Canvas can be resized to.
 void setMaxWidth(int maxWidth)
          Maximum width that this Canvas can be resized to.
 void setMinHeight(int minHeight)
          Minimum height that this Canvas can be resized to.
 void setMinWidth(int minWidth)
          Minimum width that this Canvas can be resized to.
 void setMouseStillDownDelay(int mouseStillDownDelay)
          Amount of time (in msec) between 'mouseStillDown' events for this object
 void setMouseStillDownInitialDelay(int mouseStillDownInitialDelay)
          Amount of time (in msec) before mouseStillDown events start to be fired for this object.
 void setNoDoubleClicks(java.lang.Boolean noDoubleClicks)
          If true, this canvas will recieve all mouse-clicks as single click events rather than doubleClicks.
 void setOpacity(java.lang.Integer opacity)
          Renders the widget to be partly transparent.
 void setOverflow(Overflow overflow)
          Controls what happens when the drawn size of the content of a Canvas is either greater or smaller than the specified size of the Canvas.
 void setPadding(java.lang.Integer padding)
          Set the CSS padding of this component, in pixels.
 void setPageLeft(int left)
          Set the page-relative left coordinate of this widget.
 void setPageTop(int top)
          Set the page-relative top coordinate of this widget.
 void setParentElement(Canvas parentElement)
          This Canvas's immediate parent, if any.
 void setPercentBox(PercentBoxModel percentBox)
          Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a specified snapTo.
 void setPosition(Positioning position)
          Absolute or relative, corresponding to the "absolute" (with respect to parent) or "relative" (with respect to document flow) values for the CSS position attribute.
 void setPrefix(java.lang.String prefix)
           
 void setPrompt(java.lang.String prompt)
          Prompt displayed in hover canvas if showHover is true.
 void setRect(int left, int top, int width, int height)
          Set all four coordinates, relative to the enclosing context, at once.
 void setRect(Rectangle rectangle)
          Set all four coordinates, relative to the enclosing context, at once.
 void setRedrawOnResize(java.lang.Boolean redrawOnResize)
          Should this element be redrawn in response to a resize?
 void setResizeBarTarget(java.lang.String resizeBarTarget)
          When this Canvas is included as a member in a Layout, and showResizeBar is set to true so that a resizeBar is created, resizeBarTarget:"next" can be set to indicate that the resizeBar should resize the next member of the layout rather than this one.
 void setResizeFrom(java.lang.String... resizeFrom)
           
 void setRight(int right)
          Resizes the widget horizontally to position its right side at the specified coordinate.
 void setScrollbarSize(int scrollbarSize)
          How thick should we make the scrollbars for this canvas.
NOTE: has no effect if showCustomScrollbars is false.
 void setShadowDepth(int shadowDepth)
          Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.
 void setShadowImage(java.lang.String shadowImage)
          Base name of the series of images for the sides, corners, and center of the shadow.
 void setShadowOffset(java.lang.Integer shadowOffset)
          Offset of the shadow.
 void setShadowSoftness(java.lang.Integer shadowSoftness)
          Softness, or degree of blurring, of the shadow.
 void setShowCustomScrollbars(java.lang.Boolean showCustomScrollbars)
          Whether to use the browser's native scrollbars or SmartGWT-based scrollbars.
 void setShowDragShadow(java.lang.Boolean showDragShadow)
          When this widget is dragged, if its dragAppearance is "target", should we show a shadow behind the canvas during the drag.
 void setShowEdges(java.lang.Boolean showEdges)
          Whether an EdgedCanvas should be used to show image-based edges around this component.
 void setShowHover(java.lang.Boolean showHover)
          If this.canHover is true, should we show the global hover canvas by default when the user hovers over this canvas?
 void setShowResizeBar(java.lang.Boolean showResizeBar)
          When this Canvas is included as a member in a Layout, whether a resizeBar should be shown after this member in the layout, to allow it to be resized.
 void setShowShadow(java.lang.Boolean showShadow)
          Whether to show a drop shadow for this Canvas Method to update showShadow.
 void setSkinImgDir(java.lang.String skinImgDir)
          Default directory for skin images (those defined by the class), relative to the Page-wide Page.getSkinDir().
 void setSmoothFade(java.lang.Boolean smoothFade)
           
 void setSnapAxis(java.lang.String snapAxis)
          Describes which axes to apply snap-to-grid to. Valid values are Canvas.HORIZONTAL, Canvas.VERTICAL and Canvas.BOTH
 void setSnapEdge(java.lang.String snapEdge)
          If snapTo is defined to this widget, this property can be used to define which edge of this widget should be snapped to an edge of the master or parent element.
 void setSnapHDirection(java.lang.String snapHDirection)
          The horizontal snap direction. Set this value to Canvas.BEFORE to snap to the nearest gridpoint to the left; set it to Canvas.AFTER to snap to the nearest gridpoint to the right; and set it to Canvas.NEAREST to snap to the nearest gridpoint in either direction.
 void setSnapHGap(int snapHGap)
          The horizontal grid size to use, in pixels, when snap-to-grid is enabled.
 void setSnapOffsetLeft(java.lang.Integer snapOffsetLeft)
          If snapTo is defined for this widget, this property can be used to specify an offset in px or percentage for the left coordinate of this widget.
 void setSnapOffsetTop(java.lang.Integer snapOffsetTop)
          If snapTo is defined for this widget, this property can be used to specify an offset in px or percentage for the top coordinate of this widget.
 void setSnapOnDrop(java.lang.Boolean snapOnDrop)
          When this canvas is dropped onto an object supporting snap-to-grid, should it snap to the grid (true, the default) or just drop wherever the mouse is (false).
 void setSnapResizeToGrid(java.lang.Boolean snapResizeToGrid)
          Causes this canvas to snap to its parent's grid when resizing. Note that this value defaults to the Canvas's snapToGrid value if undefined.
 void setSnapTo(java.lang.String snapTo)
          Position this widget such that it is aligned with ("snapped to") an edge of its masterElement (if specified), or its parentElement.
 void setSnapToGrid(java.lang.Boolean snapToGrid)
          Causes this canvas to snap to its parent's grid when dragging.
 void setSnapVDirection(java.lang.String snapVDirection)
          The vertical snap direction. Set this value to Canvas.BEFORE to snap to the nearest gridpoint above; set it to Canvas.AFTER to snap to the nearest gridpoint below; and set it to Canvas.NEAREST to snap to the nearest gridpoint in either direction.
 void setSnapVGap(int snapVGap)
          The vertical grid size to use, in pixels, when snap-to-grid is enabled.
 void setStyleName(java.lang.String styleName)
          The CSS class applied to this widget as a whole.
 void setTabIndex(java.lang.Integer tabIndex)
          If specified this governs the tabIndex of the widget in the page's tab order. Note that by default SmartGWT auto-assigns tab-indices, ensuring focusable widgets are reachable by tabbing in the order in which they are drawn on the page. canvas.tabIndex cannot be set to greater than com.smartgwt.client.widgets.Canvas#TAB_INDEX_FLOOR - as we reserve the values above this range for auto-assigned tab-indices.
 void setTitle(java.lang.String title)
          Synonmy for setPrompt(String)
 void setTooltip(java.lang.String tooltip)
          Synonmy for setPrompt(String)
 void setTop(int top)
          Number of pixels the top of the widget is offset down from its default drawing context (either its parent's top-left corner, or the document flow, depending on the value of the position property).
 void setVisibility(Visibility visibility)
          Controls widget visibility when the widget is initialized.
 void setVisible(boolean visible)
           
 void setWidth(int width)
          Size for this component's horizontal dimension.
 void setWidth(java.lang.String width)
          Size for this component's horizontal dimension.
 void setWidth100()
          Convenience method that sets the width to 100%.
 void setZIndex(int newIndex)
          Set the z-Index of the canvas.
 void shouldDragScroll()
          If this widget is showing scrollbars, and a user drags close to the edge of the viewport, should we scroll the viewport in the appropriate direction? Returns this.canDragScroll by default.
 void show()
          Sets this widget's visibility to "inherit", so that it becomes visible if all it's parents are visible or it has no parents.
 void showNextTo(Canvas otherWidget)
          Show this widget next to another widget.
 void showNextTo(Canvas otherWidget, java.lang.String side)
          Show this widget next to another widget.
static void showPrintPreview(Canvas component)
          Show a PrintWindow containing a printable view of the components passed in components to get the print HTML for.
 void updateHover()
          If this canvas is currently showing a hover (see handleHover()), this method can be called to update the contents of the hover.
 void updateHover(java.lang.String hoverHTML)
          If this canvas is currently showing a hover (see handleHover()), this method can be called to update the contents of the hover.
 void updateShadow()
          Update teh canvas shadow.
 java.lang.Boolean visibleAtPoint(int x, int y)
          Does this widget contain the specified global (x,y) coordinates, and have no other widgets also at the specified position, obscuring this one? This is commonly used for (for example) drag and drop interactions.
 java.lang.Boolean visibleAtPoint(int x, int y, boolean withinViewport, Canvas ignoreWidgets)
          Does this widget contain the specified global (x,y) coordinates, and have no other widgets also at the specified position, obscuring this one? This is commonly used for (for example) drag and drop interactions.
 java.lang.Boolean willAcceptDrop()
           Returns true if the widget object being dragged can be dropped on this widget, and false otherwise.
 
Methods inherited from class com.smartgwt.client.widgets.BaseWidget
addDrawHandler, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getElement, getElement, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, hashCode, isConfigOnly, isCreated, onDestroy, onDraw, onInit, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDragTracker, setElement, setHtmlElement, setID, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

Canvas

public Canvas()

Canvas

public Canvas(com.google.gwt.core.client.JavaScriptObject jsObj)

Canvas

public Canvas(java.lang.String id)
Method Detail

getOrCreateRef

public static Canvas getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

create

protected com.google.gwt.core.client.JavaScriptObject create()
Overrides:
create in class BaseWidget

setAnimateTime

public void setAnimateTime(int animateTime)
Default total duration of animations. Can be overridden by setting animation times for specific animations, or by passing a duration parameter into the appropriate animate...() method.

Note : This is an advanced setting

Parameters:
animateTime - animateTime Default value is 300

getAnimateTime

public int getAnimateTime()
Default total duration of animations. Can be overridden by setting animation times for specific animations, or by passing a duration parameter into the appropriate animate...() method.

Returns:
int

setAnimateAcceleration

public void setAnimateAcceleration(AnimationEffect animateAcceleration)
Default acceleration effect to apply to all animations on this Canvas. Can be overridden by setting animationAcceleration for specific animations or by passing an acceleration function directly into the appropriate method.

Note : This is an advanced setting

Parameters:
animateAcceleration - animateAcceleration Default value is "smoothEnd"

getAnimateAcceleration

public AnimationEffect getAnimateAcceleration()
Default acceleration effect to apply to all animations on this Canvas. Can be overridden by setting animationAcceleration for specific animations or by passing an acceleration function directly into the appropriate method.

Returns:
AnimationEffect

setAnimateMoveTime

public void setAnimateMoveTime(java.lang.Integer animateMoveTime)
Default time for performing an animated move. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateMoveTime - animateMoveTime Default value is null

getAnimateMoveTime

public java.lang.Integer getAnimateMoveTime()
Default time for performing an animated move. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateResizeTime

public void setAnimateResizeTime(java.lang.Integer animateResizeTime)
Default time for performing an animated resize. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateResizeTime - animateResizeTime Default value is null

getAnimateResizeTime

public java.lang.Integer getAnimateResizeTime()
Default time for performing an animated resize. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateRectTime

public void setAnimateRectTime(java.lang.Integer animateRectTime)
Default time for performing an animated setRect. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateRectTime - animateRectTime Default value is null

getAnimateRectTime

public java.lang.Integer getAnimateRectTime()
Default time for performing an animated setRect. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateFadeTime

public void setAnimateFadeTime(java.lang.Integer animateFadeTime)
Default time for performing an animated fade. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateFadeTime - animateFadeTime Default value is null

getAnimateFadeTime

public java.lang.Integer getAnimateFadeTime()
Default time for performing an animated fade. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateScrollTime

public void setAnimateScrollTime(java.lang.Integer animateScrollTime)
Default time for performing an animated scroll. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateScrollTime - animateScrollTime Default value is null

getAnimateScrollTime

public java.lang.Integer getAnimateScrollTime()
Default time for performing an animated scroll. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateShowTime

public void setAnimateShowTime(java.lang.Integer animateShowTime)
Default time for performing an animated show. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateShowTime - animateShowTime Default value is null

getAnimateShowTime

public java.lang.Integer getAnimateShowTime()
Default time for performing an animated show. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateHideTime

public void setAnimateHideTime(java.lang.Integer animateHideTime)
Default time for performing an animated hide. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateHideTime - animateHideTime Default value is null

getAnimateHideTime

public java.lang.Integer getAnimateHideTime()
Default time for performing an animated hide. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateMoveAcceleration

public void setAnimateMoveAcceleration(AnimationAcceleration animateMoveAcceleration)
Default acceleration effect for performing an animated move. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateMoveAcceleration - animateMoveAcceleration Default value is null

getAnimateMoveAcceleration

public AnimationAcceleration getAnimateMoveAcceleration()
Default acceleration effect for performing an animated move. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateResizeAcceleration

public void setAnimateResizeAcceleration(AnimationAcceleration animateResizeAcceleration)
Default acceleration function for performing an animated resize. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateResizeAcceleration - animateResizeAcceleration Default value is null

getAnimateResizeAcceleration

public AnimationAcceleration getAnimateResizeAcceleration()
Default acceleration function for performing an animated resize. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateRectAcceleration

public void setAnimateRectAcceleration(AnimationAcceleration animateRectAcceleration)
Default acceleration function for performing an animated move and resize. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateRectAcceleration - animateRectAcceleration Default value is null

getAnimateRectAcceleration

public AnimationAcceleration getAnimateRectAcceleration()
Default acceleration function for performing an animated move and resize. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateScrollAcceleration

public void setAnimateScrollAcceleration(AnimationAcceleration animateScrollAcceleration)
Default acceleration function for performing an animated scroll. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateScrollAcceleration - animateScrollAcceleration Default value is null

getAnimateScrollAcceleration

public AnimationAcceleration getAnimateScrollAcceleration()
Default acceleration function for performing an animated scroll. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateShowAcceleration

public void setAnimateShowAcceleration(AnimationAcceleration animateShowAcceleration)
Default acceleration function for performing an animated show. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateShowAcceleration - animateShowAcceleration Default value is null

getAnimateShowAcceleration

public AnimationAcceleration getAnimateShowAcceleration()
Default acceleration function for performing an animated show. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateHideAcceleration

public void setAnimateHideAcceleration(AnimationAcceleration animateHideAcceleration)
Default acceleration function for performing an animated hide. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateHideAcceleration - animateHideAcceleration Default value is null

getAnimateHideAcceleration

public AnimationAcceleration getAnimateHideAcceleration()
Default acceleration function for performing an animated hide. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setShowResizeBar

public void setShowResizeBar(java.lang.Boolean showResizeBar)
                      throws java.lang.IllegalStateException
When this Canvas is included as a member in a Layout, whether a resizeBar should be shown after this member in the layout, to allow it to be resized.

By default the resize bar acts on the Canvas that it is declared on. If you want the resize bar to instead act on the next member of the Layout (e.g. to collapse down or to the right), set resizeBarTarget as well. When this Canvas is included as a member in a Layout, dynamically updates whether a resizeBar should be shown after this member in the layout, to allow it to be resized.

Parameters:
showResizeBar - setting for this.showResizeBar. Default value is false
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getShowResizeBar

public java.lang.Boolean getShowResizeBar()
When this Canvas is included as a member in a Layout, whether a resizeBar should be shown after this member in the layout, to allow it to be resized.

By default the resize bar acts on the Canvas that it is declared on. If you want the resize bar to instead act on the next member of the Layout (e.g. to collapse down or to the right), set resizeBarTarget as well.

Returns:
Boolean

setResizeBarTarget

public void setResizeBarTarget(java.lang.String resizeBarTarget)
                        throws java.lang.IllegalStateException
When this Canvas is included as a member in a Layout, and showResizeBar is set to true so that a resizeBar is created, resizeBarTarget:"next" can be set to indicate that the resizeBar should resize the next member of the layout rather than this one. For resizeBars that support hiding their target member when clicked on, resizeBarTarget:"next" also means that the next member will be the one hidden.

This is typically used to create a 3-way split pane, where left and right-hand sections can be resized or hidden to allow a center section to expand.

NOTE: as with any Layout, to ensure all available space is used, one or more members must maintain a flexible size (eg 75%, or *). In a two pane Layout with a normal resize bar, to fill all space after a user resizes, the member on the right should have flexible size. With resizeBarTarget:"next", the member on the left should have flexible size.

Parameters:
resizeBarTarget - resizeBarTarget Default value is null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getResizeBarTarget

public java.lang.String getResizeBarTarget()
When this Canvas is included as a member in a Layout, and showResizeBar is set to true so that a resizeBar is created, resizeBarTarget:"next" can be set to indicate that the resizeBar should resize the next member of the layout rather than this one. For resizeBars that support hiding their target member when clicked on, resizeBarTarget:"next" also means that the next member will be the one hidden.

This is typically used to create a 3-way split pane, where left and right-hand sections can be resized or hidden to allow a center section to expand.

NOTE: as with any Layout, to ensure all available space is used, one or more members must maintain a flexible size (eg 75%, or *). In a two pane Layout with a normal resize bar, to fill all space after a user resizes, the member on the right should have flexible size. With resizeBarTarget:"next", the member on the left should have flexible size.

Returns:
String

setExtraSpace

public void setExtraSpace(int extraSpace)
                   throws java.lang.IllegalStateException
When this Canvas is included as a member in a Layout, extra blank space that should be left after this member in a Layout.

Parameters:
extraSpace - extraSpace Default value is 0
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getExtraSpace

public int getExtraSpace()
When this Canvas is included as a member in a Layout, extra blank space that should be left after this member in a Layout.

Returns:
int

setHtmlPosition

public void setHtmlPosition(DrawPosition htmlPosition)
If htmlElement is specified, this attribute specifies the position where the canvas should be inserted relative to the htmlElement in the DOM. Setter for the htmlPosition.

Note : This is an advanced setting

Parameters:
htmlPosition - New htmlPosition for this canvas. Default value is "afterBegin"

getHtmlPosition

public DrawPosition getHtmlPosition()
If htmlElement is specified, this attribute specifies the position where the canvas should be inserted relative to the htmlElement in the DOM.

Returns:
DrawPosition

setMatchElement

public void setMatchElement(java.lang.Boolean matchElement)
If htmlElement is specified, should this canvas initially be drawn at the same dimensions as the htmlElement?
Note: setting this property will not force the canvas to resize if the element subsequently resizes (for example due to page reflow).

Note : This is an advanced setting

Parameters:
matchElement - matchElement Default value is null

getMatchElement

public java.lang.Boolean getMatchElement()
If htmlElement is specified, should this canvas initially be drawn at the same dimensions as the htmlElement?
Note: setting this property will not force the canvas to resize if the element subsequently resizes (for example due to page reflow).

Returns:
Boolean

setPosition

public void setPosition(Positioning position)
Absolute or relative, corresponding to the "absolute" (with respect to parent) or "relative" (with respect to document flow) values for the CSS position attribute.

Setting position:"relative" enables SmartGWT components to be embedded directly into the native HTML flow of a page, causing the component to be rendered within an existing DOM structure. This attribute should only be set to "relative" on a top level component (a component with no parentElement).

There are 2 ways to embed relatively positioned canvases in the DOM - by default the component will be written out inline when it gets BaseWidget.draw(). For example to embed a canvas in an HTML table you could use this code:

 <table>
   <tr>
     <td>
       <script>
         isc.Canvas.create({autoDraw:true, backgroundColor:"red", position:"relative"});
       </script>
     <td>
   </tr>
 </table>
 
Alternatively you can make use of the htmlElement attribute.

Relative positioning is intended as a short-term integration scenario while incrementally upgrading existing applications. Note that relative positioning is not used to manage layout within SmartGWT components - instead the Layout class would typically be used. For best consistency and flexibility across browsers, all SmartGWT layout managers use absolute positioning.

For canvases with a specified htmlElement, this attribute defaults to "relative". In all other cases the default value will be "aboslute".

Note : This is an advanced setting

Parameters:
position - position Default value is null

getPosition

public Positioning getPosition()
Absolute or relative, corresponding to the "absolute" (with respect to parent) or "relative" (with respect to document flow) values for the CSS position attribute.

Setting position:"relative" enables SmartGWT components to be embedded directly into the native HTML flow of a page, causing the component to be rendered within an existing DOM structure. This attribute should only be set to "relative" on a top level component (a component with no parentElement).

There are 2 ways to embed relatively positioned canvases in the DOM - by default the component will be written out inline when it gets BaseWidget.draw(). For example to embed a canvas in an HTML table you could use this code:

 <table>
   <tr>
     <td>
       <script>
         isc.Canvas.create({autoDraw:true, backgroundColor:"red", position:"relative"});
       </script>
     <td>
   </tr>
 </table>
 
Alternatively you can make use of the htmlElement attribute.

Relative positioning is intended as a short-term integration scenario while incrementally upgrading existing applications. Note that relative positioning is not used to manage layout within SmartGWT components - instead the Layout class would typically be used. For best consistency and flexibility across browsers, all SmartGWT layout managers use absolute positioning.

For canvases with a specified htmlElement, this attribute defaults to "relative". In all other cases the default value will be "aboslute".

Returns:
Positioning

setLeft

public void setLeft(int left)
Number of pixels the left side of the widget is offset to the right from its default drawing context (either its parent's topleft corner, or the document flow, depending on the value of the position property). Set the left coordinate of this object, relative to its enclosing context, in pixels. NOTE: if you're setting multiple coordinates, use setRect(), moveTo() or resizeTo() instead

Parameters:
left - new left coordinate. Default value is 0

getLeft

public int getLeft()
Number of pixels the left side of the widget is offset to the right from its default drawing context (either its parent's topleft corner, or the document flow, depending on the value of the position property).

Returns:
Return the left coordinate of this object, relative to its enclosing context, in pixels.

setTop

public void setTop(int top)
Number of pixels the top of the widget is offset down from its default drawing context (either its parent's top-left corner, or the document flow, depending on the value of the position property). Set the top coordinate of this object, relative to its enclosing context, in pixels.

NOTE: if you're setting multiple coordinates, use setRect() or moveTo() instead

Parameters:
top - new top coordinate. Default value is 0

getTop

public int getTop()
Number of pixels the top of the widget is offset down from its default drawing context (either its parent's top-left corner, or the document flow, depending on the value of the position property).

Returns:
Return the top coordinate of this object, relative to its enclosing context, in pixels.

setDefaultWidth

public void setDefaultWidth(int defaultWidth)
For custom components, establishes a default width for the component.

For a component that should potentially be sized automatically by a Layout, set this property rather than width directly, because Layouts regard a width setting as an explicit size that shouldn't be changed.

Note : This is an advanced setting

Parameters:
defaultWidth - defaultWidth Default value is 100

getDefaultWidth

public int getDefaultWidth()
For custom components, establishes a default width for the component.

For a component that should potentially be sized automatically by a Layout, set this property rather than width directly, because Layouts regard a width setting as an explicit size that shouldn't be changed.

Returns:
int

setDefaultHeight

public void setDefaultHeight(int defaultHeight)
For custom components, establishes a default height for the component.

For a component that should potentially be sized automatically by a Layout, set this property rather than height directly, because Layouts regard a height setting as an explicit size that shouldn't be changed.

Note : This is an advanced setting

Parameters:
defaultHeight - defaultHeight Default value is 100

getDefaultHeight

public int getDefaultHeight()
For custom components, establishes a default height for the component.

For a component that should potentially be sized automatically by a Layout, set this property rather than height directly, because Layouts regard a height setting as an explicit size that shouldn't be changed.

Returns:
int

setMinWidth

public void setMinWidth(int minWidth)
Minimum width that this Canvas can be resized to.

Note that a Canvas with overflow:"visible" has an implicit minimize size based on it's contents.

Note : This is an advanced setting

Parameters:
minWidth - minWidth Default value is 10

getMinWidth

public int getMinWidth()
Minimum width that this Canvas can be resized to.

Note that a Canvas with overflow:"visible" has an implicit minimize size based on it's contents.

Returns:
int

setMaxWidth

public void setMaxWidth(int maxWidth)
Maximum width that this Canvas can be resized to.

Note : This is an advanced setting

Parameters:
maxWidth - maxWidth Default value is 10000

getMaxWidth

public int getMaxWidth()
Maximum width that this Canvas can be resized to.

Returns:
int

setMinHeight

public void setMinHeight(int minHeight)
Minimum height that this Canvas can be resized to.

Note that a Canvas with overflow:"visible" has an implicit minimize size based on it's contents.

Note : This is an advanced setting

Parameters:
minHeight - minHeight Default value is 10

getMinHeight

public int getMinHeight()
Minimum height that this Canvas can be resized to.

Note that a Canvas with overflow:"visible" has an implicit minimize size based on it's contents.

Returns:
int

setMaxHeight

public void setMaxHeight(int maxHeight)
Maximum height that this Canvas can be resized to.

Note : This is an advanced setting

Parameters:
maxHeight - maxHeight Default value is 10000

getMaxHeight

public int getMaxHeight()
Maximum height that this Canvas can be resized to.

Returns:
int

setAutoShowParent

public void setAutoShowParent(java.lang.Boolean autoShowParent)
If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.

Note : This is an advanced setting

Parameters:
autoShowParent - autoShowParent Default value is false

getAutoShowParent

public java.lang.Boolean getAutoShowParent()
If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.

Returns:
Boolean

setVisibility

public void setVisibility(Visibility visibility)
Controls widget visibility when the widget is initialized. See Visibility type for details. Sets this widget's visibility to "inherit", so that it becomes visible if all it's parents are visible or it has no parents.

If the widget has not yet been drawn (and doesn't have a parent or master), this method calls the draw method as well.

Parameters:
visibility - visibility Default value is Canvas.INHERIT

getVisibility

public Visibility getVisibility()
Controls widget visibility when the widget is initialized. See Visibility type for details.

Returns:
Returns true if the widget is visible, taking all parents into account, so that a widget which is not hidden might still report itself as not visible if it is within a hidden parent.

NOTE: Undrawn widgets will report themselves as visible if they would be visible if drawn.


setCanSelectText

public void setCanSelectText(java.lang.Boolean canSelectText)
Whether native drag selection of contained text is allowed within this Canvas.

Note that setting this property to false will not avoid text selection which is initiated outside this Canvas from continuing into this Canvas, even if text selection began in another Canvas.

Note : This is an advanced setting

Parameters:
canSelectText - canSelectText Default value is false

getCanSelectText

public java.lang.Boolean getCanSelectText()
Whether native drag selection of contained text is allowed within this Canvas.

Note that setting this property to false will not avoid text selection which is initiated outside this Canvas from continuing into this Canvas, even if text selection began in another Canvas.

Returns:
Boolean

setStyleName

public void setStyleName(java.lang.String styleName)
The CSS class applied to this widget as a whole. Sets the CSS class for this widget

Overrides:
setStyleName in class com.google.gwt.user.client.ui.UIObject
Parameters:
styleName - new CSS class name (must be defined previously). Default value is "normal"

getStyleName

public java.lang.String getStyleName()
The CSS class applied to this widget as a whole.

Overrides:
getStyleName in class com.google.gwt.user.client.ui.UIObject
Returns:
String

setContents

public void setContents(java.lang.String contents)
The contents of a canvas or label widget. Any HTML string is acceptable. Changes the contents of a widget to newContents, an HTML string.

When dynamicContents is set, setContents() can also be called with no arguments to cause contents to be re-evaluated.

Note : This is an advanced setting

Parameters:
contents - an HTML string to be set as the contents of this widget. Default value is " "

getContents

public java.lang.String getContents()
The contents of a canvas or label widget. Any HTML string is acceptable.

Returns:
Returns the contents of a Canvas. The contents are an HTML string.

setDynamicContents

public void setDynamicContents(java.lang.Boolean dynamicContents)
Dynamic contents allows the contents string to be treated as a simple, but powerful template. When this attribute is set to true, expressions of the form \${arbitrary JS here} are replaced by the result of the evaluation of the JS code inside the curly brackets. This evaluation happens at draw time. If you want to trigger a re-evaluation of the expressions in the contents string you can call markForRedraw() on the canvas.

You can use this feature to build some simple custom components. For example, let's say you want to show the value of a Slider in a Canvas somewhere on the screen. You can do this by observing the valueChanged() method on the slider and calling setContents() on your canvas with the new string or you can set the contents of the canvas to something like:

"The slider value is \${sliderInstance.getValue()}."

Next you set dynamicContents: true on the canvas, observe valueChanged() on the slider and call canvas.markForRedraw() in that observation. This approach is cleaner than setContents() when the Canvas is aggregating several values or dynamic expressions. Like so:

 Slider.create({
     ID: "mySlider"
 });

 Canvas.create({
     ID: "myCanvas",
     dynamicContents: true,
     contents: "The slider value is \${mySlider.getValue()}."
 });
     
 myCanvas.observe(mySlider, "valueChanged", 
                  "observer.markForRedraw()");
 
You can embed an arbitrary number of dynamic expressions in the contents string. The search and replace is optimized for speed.

If an error occurs during the evaluation of one of the expressions, a warning is logged to the ISC Developer Console and the error string is embedded in place of the expected value in the Canvas.

The value of a function is its return value. The value of any variable is the same as that returned by its toString() representation.

Inside the evalution contentext, this points to the canvas instance that has the dynamicContents string as its contents - in other words the canvas instance on which the template is declared.

Note : This is an advanced setting

Parameters:
dynamicContents - dynamicContents Default value is false

getDynamicContents

public java.lang.Boolean getDynamicContents()
Dynamic contents allows the contents string to be treated as a simple, but powerful template. When this attribute is set to true, expressions of the form \${arbitrary JS here} are replaced by the result of the evaluation of the JS code inside the curly brackets. This evaluation happens at draw time. If you want to trigger a re-evaluation of the expressions in the contents string you can call markForRedraw() on the canvas.

You can use this feature to build some simple custom components. For example, let's say you want to show the value of a Slider in a Canvas somewhere on the screen. You can do this by observing the valueChanged() method on the slider and calling setContents() on your canvas with the new string or you can set the contents of the canvas to something like:

"The slider value is \${sliderInstance.getValue()}."

Next you set dynamicContents: true on the canvas, observe valueChanged() on the slider and call canvas.markForRedraw() in that observation. This approach is cleaner than setContents() when the Canvas is aggregating several values or dynamic expressions. Like so:

 Slider.create({
     ID: "mySlider"
 });

 Canvas.create({
     ID: "myCanvas",
     dynamicContents: true,
     contents: "The slider value is \${mySlider.getValue()}."
 });
     
 myCanvas.observe(mySlider, "valueChanged", 
                  "observer.markForRedraw()");
 
You can embed an arbitrary number of dynamic expressions in the contents string. The search and replace is optimized for speed.

If an error occurs during the evaluation of one of the expressions, a warning is logged to the ISC Developer Console and the error string is embedded in place of the expected value in the Canvas.

The value of a function is its return value. The value of any variable is the same as that returned by its toString() representation.

Inside the evalution contentext, this points to the canvas instance that has the dynamicContents string as its contents - in other words the canvas instance on which the template is declared.

Returns:
Boolean

setMargin

public void setMargin(java.lang.Integer margin)
Set the CSS Margin, in pixels, for this component. Margin provides blank space outside of the border.

This property sets the same thickness of margin on every side. Differing per-side margins can be set in a CSS style and applied via styleName.

Note that the specified size of the widget will be the size including the margin thickness on each side. Set the CSS Margin, in pixels, for this component. Margin provides blank space outside of the border.

This property sets the same thickness of margin on every side. Differing per-side margins can be set in a CSS style and applied via styleName.

Note that the specified size of the widget will be the size including the margin thickness on each side.

Parameters:
margin - new margin in pixels. Default value is null

getMargin

public java.lang.Integer getMargin()
Set the CSS Margin, in pixels, for this component. Margin provides blank space outside of the border.

This property sets the same thickness of margin on every side. Differing per-side margins can be set in a CSS style and applied via styleName.

Note that the specified size of the widget will be the size including the margin thickness on each side.

Returns:
Integer

setPadding

public void setPadding(java.lang.Integer padding)
Set the CSS padding of this component, in pixels. Padding provides space between the border and the component's contents.

This property sets the same thickness of padding on every side. Differing per-side padding can be set in a CSS style and applied via styleName.

Note that CSS padding does not affect the placement of children. To provide a blank area around children, either use margin or use a Layout as the parent instead, and use properties such as layoutMargin to create blank space. Set the CSS padding of this component, in pixels. Padding provides space between the border and the component's contents.

This property sets the same thickness of padding on every side. Differing per-side padding can be set in a CSS style and applied via styleName.

Parameters:
padding - new padding in pixels. Default value is null

getPadding

public java.lang.Integer getPadding()
Set the CSS padding of this component, in pixels. Padding provides space between the border and the component's contents.

This property sets the same thickness of padding on every side. Differing per-side padding can be set in a CSS style and applied via styleName.

Note that CSS padding does not affect the placement of children. To provide a blank area around children, either use margin or use a Layout as the parent instead, and use properties such as layoutMargin to create blank space.

Returns:
Integer

setBorder

public void setBorder(java.lang.String border)
Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid blue").

This property applies the same border to all four sides of this component. Different per-side borders can be set in a CSS style and applied via styleName. Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid blue").

This property applies the same border to all four sides of this component. Different per-side borders can be set in a CSS style and applied via styleName.

Parameters:
border - new border to set to (eg: "2px solid black"). Default value is null

getBorder

public java.lang.String getBorder()
Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid blue").

This property applies the same border to all four sides of this component. Different per-side borders can be set in a CSS style and applied via styleName.

Returns:
String

setBackgroundImage

public void setBackgroundImage(java.lang.String backgroundImage)
                        throws java.lang.IllegalStateException
URL for a background image for this widget (corresponding to the CSS "background-image" attribute). Sets the background to an image file given by newImage. This URL should be given as a string relative to the image directory for the page (./images by default).

Parameters:
backgroundImage - new URL (local to Page image directory) for background image. Default value is null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getBackgroundImage

public java.lang.String getBackgroundImage()
URL for a background image for this widget (corresponding to the CSS "background-image" attribute).

Returns:
String

setBackgroundRepeat

public void setBackgroundRepeat(BkgndRepeat backgroundRepeat)
Specifies how the background image should be tiled if this widget is larger than the image. It corresponds to the CSS background-repeat attribute. See BkgndRepeat type for details.

Parameters:
backgroundRepeat - backgroundRepeat Default value is Canvas.REPEAT

getBackgroundRepeat

public BkgndRepeat getBackgroundRepeat()
Specifies how the background image should be tiled if this widget is larger than the image. It corresponds to the CSS background-repeat attribute. See BkgndRepeat type for details.

Returns:
BkgndRepeat

setBackgroundPosition

public void setBackgroundPosition(java.lang.String backgroundPosition)
Specifies how the background image should be positioned on the widget. It corresponds to the CSS background-position attribute. If unset, no background-position attribute is specified if a background image is specified.

Parameters:
backgroundPosition - backgroundPosition Default value is null

getBackgroundPosition

public java.lang.String getBackgroundPosition()
Specifies how the background image should be positioned on the widget. It corresponds to the CSS background-position attribute. If unset, no background-position attribute is specified if a background image is specified.

Returns:
String

setAppImgDir

public void setAppImgDir(java.lang.String appImgDir)
Default directory for app-specific images, relative to the Page-wide Page.getAppImgDir().

Note : This is an advanced setting

Parameters:
appImgDir - appImgDir Default value is ""

getAppImgDir

public java.lang.String getAppImgDir()
Default directory for app-specific images, relative to the Page-wide Page.getAppImgDir().

Returns:
String

setSkinImgDir

public void setSkinImgDir(java.lang.String skinImgDir)
Default directory for skin images (those defined by the class), relative to the Page-wide Page.getSkinDir().

Note : This is an advanced setting

Parameters:
skinImgDir - skinImgDir Default value is "images/"

getSkinImgDir

public java.lang.String getSkinImgDir()
Default directory for skin images (those defined by the class), relative to the Page-wide Page.getSkinDir().

Returns:
String

setCursor

public void setCursor(Cursor cursor)
Specifies the cursor image to display when the mouse pointer is over this widget. It corresponds to the CSS cursor attribute. See Cursor type for different cursors. Sets the cursor for this widget to cursor. See the cursor property for possible values.

Note : This is an advanced setting

Parameters:
cursor - new cursor. Default value is Canvas.DEFAULT

getCursor

public Cursor getCursor()
Specifies the cursor image to display when the mouse pointer is over this widget. It corresponds to the CSS cursor attribute. See Cursor type for different cursors.

Returns:
Cursor

setDisabledCursor

public void setDisabledCursor(Cursor disabledCursor)
Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled. It corresponds to the CSS cursor attribute. See Cursor type for different cursors.

Note : This is an advanced setting

Parameters:
disabledCursor - disabledCursor Default value is Canvas.DEFAULT

getDisabledCursor

public Cursor getDisabledCursor()
Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled. It corresponds to the CSS cursor attribute. See Cursor type for different cursors.

Returns:
Cursor

setOpacity

public void setOpacity(java.lang.Integer opacity)
Renders the widget to be partly transparent. A widget's opacity property may be set to any number between 0 (transparent) to 100 (opaque). Null means don't specify opacity directly, 100 is fully opaque. Note that heavy use of opacity may slow down your browser. See canvas.setOpacity() for details. Sets the opacity for the widget to the newOpacity value. This newOpacity value must be within the range of 0 (transparent) to 100 (opaque).
In Internet Explorer, any other filter effects will be wiped out.

Note : This is an advanced setting

Parameters:
opacity - new opacity level. Default value is null

getOpacity

public java.lang.Integer getOpacity()
Renders the widget to be partly transparent. A widget's opacity property may be set to any number between 0 (transparent) to 100 (opaque). Null means don't specify opacity directly, 100 is fully opaque. Note that heavy use of opacity may slow down your browser. See canvas.setOpacity() for details.

Returns:
Integer

setOverflow

public void setOverflow(Overflow overflow)
Controls what happens when the drawn size of the content of a Canvas is either greater or smaller than the specified size of the Canvas. Similar to the CSS property overflow, but consistent across browsers. See Overflow type for details. Update the overflow of a Canvas after it has been created.

Parameters:
overflow - New overflow value.. Default value is Canvas.VISIBLE

getOverflow

public Overflow getOverflow()
Controls what happens when the drawn size of the content of a Canvas is either greater or smaller than the specified size of the Canvas. Similar to the CSS property overflow, but consistent across browsers. See Overflow type for details.

Returns:
Overflow

setShowCustomScrollbars

public void setShowCustomScrollbars(java.lang.Boolean showCustomScrollbars)
Whether to use the browser's native scrollbars or SmartGWT-based scrollbars.

SmartGWT-based scrollbars are skinnable, giving you complete control over look and feel. SmartGWT-based scrollbars also enable some interactions not possible with native scrollbars, such as fixedRecordHeights in grids in combination with dataPageSize.

Native browser scrollbars are slightly faster simply because there are less SmartGWT components that need to be created, drawn and updated. Each visible SmartGWT-based scrollbar on the screen has roughly the impact of two StretchImgButtons.

SmartGWT is always aware of the size of the scrollbar, regardless of whether native or custom scrollbars are used, and regardless of what operating system and/or operating system "theme" or "skin" is in use. This means SmartGWT will correctly report the getViewportHeight(), that is, the interior area of the widget excluding space taken by scrollbars, which is key for exactly filling a component with content without creating unnecessary scrolling.

The showCustomScrollbars setting is typically overridden in load_skin.js in order to change the default for all SmartGWT components at once, like so:

     isc.Canvas.addProperties({ showCustomScrollbars:false });
 

Note : This is an advanced setting

Parameters:
showCustomScrollbars - showCustomScrollbars Default value is true

getShowCustomScrollbars

public java.lang.Boolean getShowCustomScrollbars()
Whether to use the browser's native scrollbars or SmartGWT-based scrollbars.

SmartGWT-based scrollbars are skinnable, giving you complete control over look and feel. SmartGWT-based scrollbars also enable some interactions not possible with native scrollbars, such as fixedRecordHeights in grids in combination with dataPageSize.

Native browser scrollbars are slightly faster simply because there are less SmartGWT components that need to be created, drawn and updated. Each visible SmartGWT-based scrollbar on the screen has roughly the impact of two StretchImgButtons.

SmartGWT is always aware of the size of the scrollbar, regardless of whether native or custom scrollbars are used, and regardless of what operating system and/or operating system "theme" or "skin" is in use. This means SmartGWT will correctly report the getViewportHeight(), that is, the interior area of the widget excluding space taken by scrollbars, which is key for exactly filling a component with content without creating unnecessary scrolling.

The showCustomScrollbars setting is typically overridden in load_skin.js in order to change the default for all SmartGWT components at once, like so:

     isc.Canvas.addProperties({ showCustomScrollbars:false });
 

Returns:
Boolean

setScrollbarSize

public void setScrollbarSize(int scrollbarSize)
How thick should we make the scrollbars for this canvas.
NOTE: has no effect if showCustomScrollbars is false.

Note : This is an advanced setting

Parameters:
scrollbarSize - scrollbarSize Default value is 16

getScrollbarSize

public int getScrollbarSize()
How thick should we make the scrollbars for this canvas.
NOTE: has no effect if showCustomScrollbars is false.

Returns:
Returns the thickness of this widget's scrollbars.
For canvases showing custom scrollbars this is determined from this.scrollbarSize

setDisabled

public void setDisabled(java.lang.Boolean disabled)
If set to true, the widget will be disabled. A widget is only considered enabled if it is individually enabled and all parents above it in the containment hierarchy are enabled. This allows you to enable or disable all components of a complex nested widget by enabling or disabling the top-level parent only. set the disabled state of this object

Note : This is an advanced setting

Parameters:
disabled - new disabled state of this object - pass true to disable the widget. Default value is false

getDisabled

public java.lang.Boolean getDisabled()
If set to true, the widget will be disabled. A widget is only considered enabled if it is individually enabled and all parents above it in the containment hierarchy are enabled. This allows you to enable or disable all components of a complex nested widget by enabling or disabling the top-level parent only.

Returns:
Is this canvas disabled? Note that the disabled state is inherited - this method will return true if this widget, or any of its ancestors are marked disabled.

setRedrawOnResize

public void setRedrawOnResize(java.lang.Boolean redrawOnResize)
Should this element be redrawn in response to a resize?

Should be set to true for components whose BaseWidget.getInnerHTML() will not automatically reflow to fit the component's new size.

Note : This is an advanced setting

Parameters:
redrawOnResize - redrawOnResize Default value is true

getRedrawOnResize

public java.lang.Boolean getRedrawOnResize()
Should this element be redrawn in response to a resize?

Should be set to true for components whose BaseWidget.getInnerHTML() will not automatically reflow to fit the component's new size.

Returns:
Boolean

setCanFocus

public void setCanFocus(java.lang.Boolean canFocus)
Can this widget be allowed to become the target of keyboard events?

If canFocus is unset (the default), only scrollable widgets with visible scrollbars are focusable, to allow for keyboard scrolling.

A widget normally receives focus by being clicked on or tabbed to. Change whether a widget can accept keyboard focus.

Note : This is an advanced setting

Parameters:
canFocus - whether the widget should now accept focus. Default value is null

getCanFocus

public java.lang.Boolean getCanFocus()
Can this widget be allowed to become the target of keyboard events?

If canFocus is unset (the default), only scrollable widgets with visible scrollbars are focusable, to allow for keyboard scrolling.

A widget normally receives focus by being clicked on or tabbed to.

Returns:
Boolean

setTabIndex

public void setTabIndex(java.lang.Integer tabIndex)
If specified this governs the tabIndex of the widget in the page's tab order. Note that by default SmartGWT auto-assigns tab-indices, ensuring focusable widgets are reachable by tabbing in the order in which they are drawn on the page. canvas.tabIndex cannot be set to greater than com.smartgwt.client.widgets.Canvas#TAB_INDEX_FLOOR - as we reserve the values above this range for auto-assigned tab-indices. Assign an explicit tabIndex to this widget.

Note : This is an advanced setting

Parameters:
tabIndex - New tabIndex for this widget. Must be less than com.smartgwt.client.widgets.Canvas#TAB_INDEX_FLOOR to avoid interfering with auto-assigned tab indices on the page.. Default value is null

getTabIndex

public java.lang.Integer getTabIndex()
If specified this governs the tabIndex of the widget in the page's tab order. Note that by default SmartGWT auto-assigns tab-indices, ensuring focusable widgets are reachable by tabbing in the order in which they are drawn on the page. canvas.tabIndex cannot be set to greater than com.smartgwt.client.widgets.Canvas#TAB_INDEX_FLOOR - as we reserve the values above this range for auto-assigned tab-indices.

Returns:
Integer

setAccessKey

public void setAccessKey(java.lang.String accessKey)
If specified this governs the accessKey for the widget. This should be set to a character - when a user hits Alt+[accessKey], or in Mozilla Firefox 2.0 and above, Shift+Alt+[accessKey], focus will be given to the widget in question. Set the accessKey for this canvas.

The accessKey can be set to any alphanumeric character (symbols not supported) Having set an accessKey, the canvas will be given focus when the user hits Alt+[accessKey], or in Mozilla Firefox 2.0 and above, Shift+Alt+[accessKey].

Note : This is an advanced setting

Parameters:
accessKey - Character to use as an accessKey for this widget. Case Insensitive.. Default value is null

getAccessKey

public java.lang.String getAccessKey()
If specified this governs the accessKey for the widget. This should be set to a character - when a user hits Alt+[accessKey], or in Mozilla Firefox 2.0 and above, Shift+Alt+[accessKey], focus will be given to the widget in question.

Returns:
String

setContextMenu

public void setContextMenu(Menu contextMenu)
Context menu to show for this object, an instance of the Menu widget.

Note : This is an advanced setting

Parameters:
contextMenu - contextMenu Default value is null

getContextMenu

public Menu getContextMenu()
Context menu to show for this object, an instance of the Menu widget.

Returns:
Menu

setPrompt

public void setPrompt(java.lang.String prompt)
Prompt displayed in hover canvas if showHover is true.

Parameters:
prompt - prompt Default value is null

getPrompt

public java.lang.String getPrompt()
Prompt displayed in hover canvas if showHover is true.

Returns:
String

setCanDrag

public void setCanDrag(java.lang.Boolean canDrag)
Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize). Normally canDragReposition or canDragResize would be used instead of this property. Note: this property may be manipulated by higher-level dragging semantics.

Note : This is an advanced setting

Parameters:
canDrag - canDrag Default value is false

getCanDrag

public java.lang.Boolean getCanDrag()
Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize). Normally canDragReposition or canDragResize would be used instead of this property. Note: this property may be manipulated by higher-level dragging semantics.

Returns:
Boolean

setDragStartDistance

public void setDragStartDistance(int dragStartDistance)
Number of pixels the cursor needs to move before the EventHandler starts a drag operation.

Note : This is an advanced setting

Parameters:
dragStartDistance - dragStartDistance Default value is 5

getDragStartDistance

public int getDragStartDistance()
Number of pixels the cursor needs to move before the EventHandler starts a drag operation.

Returns:
int

setCanDragScroll

public void setCanDragScroll(java.lang.Boolean canDragScroll)
If this Canvas is canAcceptDrop:true, when the user drags a droppable widget over an edge of the widget, should we scroll to show the rest of the widget's content? Returned from canvas.shouldDragScroll().

Note : This is an advanced setting

Parameters:
canDragScroll - canDragScroll Default value is true

getCanDragScroll

public java.lang.Boolean getCanDragScroll()
If this Canvas is canAcceptDrop:true, when the user drags a droppable widget over an edge of the widget, should we scroll to show the rest of the widget's content? Returned from canvas.shouldDragScroll().

Returns:
Boolean

setDragScrollDelay

public void setDragScrollDelay(int dragScrollDelay)
If this widget supports drag-scrolling, This property specifies how many ms the user must hover over the drag-scroll threshold before scrolling begins.

Note : This is an advanced setting

Parameters:
dragScrollDelay - dragScrollDelay Default value is 100

getDragScrollDelay

public int getDragScrollDelay()
If this widget supports drag-scrolling, This property specifies how many ms the user must hover over the drag-scroll threshold before scrolling begins.

Returns:
int

setDragIntersectStyle

public void setDragIntersectStyle(DragIntersectStyle dragIntersectStyle)
This indicates how the system will test for droppable targets: either by intersection with the mouse or intersection with the rectangle of the dragMoveTarget.

Note : This is an advanced setting

Parameters:
dragIntersectStyle - dragIntersectStyle Default value is "mouse"

getDragIntersectStyle

public DragIntersectStyle getDragIntersectStyle()
This indicates how the system will test for droppable targets: either by intersection with the mouse or intersection with the rectangle of the dragMoveTarget.

Returns:
DragIntersectStyle

setCanDragReposition

public void setCanDragReposition(java.lang.Boolean canDragReposition)
Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.

Note : This is an advanced setting

Parameters:
canDragReposition - canDragReposition Default value is false

getCanDragReposition

public java.lang.Boolean getCanDragReposition()
Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.

Returns:
Boolean

setDragRepositionCursor

public void setDragRepositionCursor(Cursor dragRepositionCursor)
Cursor to switch to if the mouse is over a widget that is drag repositionable.

Note : This is an advanced setting

Parameters:
dragRepositionCursor - dragRepositionCursor Default value is Canvas.MOVE

getDragRepositionCursor

public Cursor getDragRepositionCursor()
Cursor to switch to if the mouse is over a widget that is drag repositionable.

Returns:
Cursor

setCanDragResize

public void setCanDragResize(java.lang.Boolean canDragResize)
Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.

Note : This is an advanced setting

Parameters:
canDragResize - canDragResize Default value is false

getCanDragResize

public java.lang.Boolean getCanDragResize()
Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.

Returns:
Boolean

setCanHover

public void setCanHover(java.lang.Boolean canHover)
Will this Canvas fire hover events when the user hovers over it, or one of its children?

Parameters:
canHover - canHover Default value is null

getCanHover

public java.lang.Boolean getCanHover()
Will this Canvas fire hover events when the user hovers over it, or one of its children?

Returns:
Boolean

setHoverDelay

public void setHoverDelay(int hoverDelay)
If this.canHover is true, how long should the mouse be kept over this widget before the hover event is fired

Parameters:
hoverDelay - hoverDelay Default value is 300

getHoverDelay

public int getHoverDelay()
If this.canHover is true, how long should the mouse be kept over this widget before the hover event is fired

Returns:
int

setShowHover

public void setShowHover(java.lang.Boolean showHover)
If this.canHover is true, should we show the global hover canvas by default when the user hovers over this canvas?

Parameters:
showHover - showHover Default value is true

getShowHover

public java.lang.Boolean getShowHover()
If this.canHover is true, should we show the global hover canvas by default when the user hovers over this canvas?

Returns:
Boolean

setHoverWidth

public void setHoverWidth(java.lang.Integer hoverWidth)
If showHover is true, this property can be used to customize the width of the hover canvas shown.

Parameters:
hoverWidth - hoverWidth Default value is null

getHoverWidth

public java.lang.Integer getHoverWidth()
If showHover is true, this property can be used to customize the width of the hover canvas shown.

Returns:
Integer

setHoverHeight

public void setHoverHeight(java.lang.Integer hoverHeight)
If this.showHover is true, this property can be used to customize the height of the hover canvas shown.

Parameters:
hoverHeight - hoverHeight Default value is null

getHoverHeight

public java.lang.Integer getHoverHeight()
If this.showHover is true, this property can be used to customize the height of the hover canvas shown.

Returns:
Integer

setHoverAlign

public void setHoverAlign(Alignment hoverAlign)
If this.showHover is true, this property can be used to customize the alignment of content in the hover canvas.

Parameters:
hoverAlign - hoverAlign Default value is null

getHoverAlign

public Alignment getHoverAlign()
If this.showHover is true, this property can be used to customize the alignment of content in the hover canvas.

Returns:
Alignment

setHoverVAlign

public void setHoverVAlign(VerticalAlignment hoverVAlign)
If this.showHover is true, this property can be used to customize the vertical alignment of content in the hover canvas.

Parameters:
hoverVAlign - hoverVAlign Default value is null

getHoverVAlign

public VerticalAlignment getHoverVAlign()
If this.showHover is true, this property can be used to customize the vertical alignment of content in the hover canvas.

Returns:
VerticalAlignment

setHoverWrap

public void setHoverWrap(java.lang.Boolean hoverWrap)
If this.showHover is true, this property can be used to customize the whether content in the hover canvas is displayed in a single line, or wraps.

Parameters:
hoverWrap - hoverWrap Default value is null

getHoverWrap

public java.lang.Boolean getHoverWrap()
If this.showHover is true, this property can be used to customize the whether content in the hover canvas is displayed in a single line, or wraps.

Returns:
Boolean

setHoverStyle

public void setHoverStyle(java.lang.String hoverStyle)
If this.showHover is true, this property can be used to specify the css style to apply to the hover canvas.

Parameters:
hoverStyle - hoverStyle Default value is null

getHoverStyle

public java.lang.String getHoverStyle()
If this.showHover is true, this property can be used to specify the css style to apply to the hover canvas.

Returns:
String

setHoverOpacity

public void setHoverOpacity(java.lang.Integer hoverOpacity)
If this.showHover is true, should the hover canvas be shown with opacity other than 100?

Parameters:
hoverOpacity - hoverOpacity Default value is null

getHoverOpacity

public java.lang.Integer getHoverOpacity()
If this.showHover is true, should the hover canvas be shown with opacity other than 100?

Returns:
Integer

setHoverMoveWithMouse

public void setHoverMoveWithMouse(java.lang.Boolean hoverMoveWithMouse)
If this.showHover is true, should this widget's hover canvas be moved with the mouse while visible?

Parameters:
hoverMoveWithMouse - hoverMoveWithMouse Default value is null

getHoverMoveWithMouse

public java.lang.Boolean getHoverMoveWithMouse()
If this.showHover is true, should this widget's hover canvas be moved with the mouse while visible?

Returns:
Boolean

setDragAppearance

public void setDragAppearance(DragAppearance dragAppearance)
Visual appearance to show when the object is being dragged.

Note : This is an advanced setting

Parameters:
dragAppearance - dragAppearance Default value is EventHandler.OUTLINE

getDragAppearance

public DragAppearance getDragAppearance()
Visual appearance to show when the object is being dragged.

Returns:
DragAppearance

setDragType

public void setDragType(java.lang.String dragType)
The "type" of thing given as a string that can be dragged from this widget. If specified, this will be matched up with the dropTypes of droppable widgets as detailed in the dropTypes property.

Note : This is an advanced setting

Parameters:
dragType - dragType Default value is null

getDragType

public java.lang.String getDragType()
The "type" of thing given as a string that can be dragged from this widget. If specified, this will be matched up with the dropTypes of droppable widgets as detailed in the dropTypes property.

Returns:
String

setShowDragShadow

public void setShowDragShadow(java.lang.Boolean showDragShadow)
When this widget is dragged, if its dragAppearance is "target", should we show a shadow behind the canvas during the drag.

Note : This is an advanced setting

Parameters:
showDragShadow - showDragShadow Default value is null

getShowDragShadow

public java.lang.Boolean getShowDragShadow()
When this widget is dragged, if its dragAppearance is "target", should we show a shadow behind the canvas during the drag.

Returns:
Boolean

setDragOpacity

public void setDragOpacity(java.lang.Integer dragOpacity)
If this widget has dragAppearance "target", this value specifies the opacity to render the target while it is being dragged. A null value implies we do not modify the opacity.

Note : This is an advanced setting

Parameters:
dragOpacity - dragOpacity Default value is null

getDragOpacity

public java.lang.Integer getDragOpacity()
If this widget has dragAppearance "target", this value specifies the opacity to render the target while it is being dragged. A null value implies we do not modify the opacity.

Returns:
Integer

setCanDrop

public void setCanDrop(java.lang.Boolean canDrop)
Indicates that this object can be dropped on top of other widgets. Only valid if canDrag or canDragReposition is true.

Note : This is an advanced setting

Parameters:
canDrop - canDrop Default value is false

getCanDrop

public java.lang.Boolean getCanDrop()
Indicates that this object can be dropped on top of other widgets. Only valid if canDrag or canDragReposition is true.

Returns:
Boolean

setCanAcceptDrop

public void setCanAcceptDrop(java.lang.Boolean canAcceptDrop)
Indicates that this object can receive dropped widgets (i.e. other widgets can be dropped on top of it).

Note : This is an advanced setting

Parameters:
canAcceptDrop - canAcceptDrop Default value is false

getCanAcceptDrop

public java.lang.Boolean getCanAcceptDrop()
Indicates that this object can receive dropped widgets (i.e. other widgets can be dropped on top of it).

Returns:
Boolean

setCanDropBefore

public void setCanDropBefore(java.lang.Boolean canDropBefore)
When explicitly set to false, disallows drop before this member in the Layout.

Note : This is an advanced setting

Parameters:
canDropBefore - canDropBefore Default value is null

getCanDropBefore

public java.lang.Boolean getCanDropBefore()
When explicitly set to false, disallows drop before this member in the Layout.

Returns:
Boolean

setMouseStillDownInitialDelay

public void setMouseStillDownInitialDelay(int mouseStillDownInitialDelay)
Amount of time (in msec) before mouseStillDown events start to be fired for this object.

Note : This is an advanced setting

Parameters:
mouseStillDownInitialDelay - mouseStillDownInitialDelay Default value is 400

getMouseStillDownInitialDelay

public int getMouseStillDownInitialDelay()
Amount of time (in msec) before mouseStillDown events start to be fired for this object.

Returns:
int

setMouseStillDownDelay

public void setMouseStillDownDelay(int mouseStillDownDelay)
Amount of time (in msec) between 'mouseStillDown' events for this object

Note : This is an advanced setting

Parameters:
mouseStillDownDelay - mouseStillDownDelay Default value is 100

getMouseStillDownDelay

public int getMouseStillDownDelay()
Amount of time (in msec) between 'mouseStillDown' events for this object

Returns:
int

setDoubleClickDelay

public void setDoubleClickDelay(int doubleClickDelay)
Amount of time (in msec) between which two clicks are considered a single click

Note : This is an advanced setting

Parameters:
doubleClickDelay - doubleClickDelay Default value is 250

getDoubleClickDelay

public int getDoubleClickDelay()
Amount of time (in msec) between which two clicks are considered a single click

Returns:
int

setNoDoubleClicks

public void setNoDoubleClicks(java.lang.Boolean noDoubleClicks)
If true, this canvas will recieve all mouse-clicks as single click events rather than doubleClicks.

Note : This is an advanced setting

Parameters:
noDoubleClicks - noDoubleClicks Default value is null

getNoDoubleClicks

public java.lang.Boolean getNoDoubleClicks()
If true, this canvas will recieve all mouse-clicks as single click events rather than doubleClicks.

Returns:
Boolean

setPercentBox

public void setPercentBox(PercentBoxModel percentBox)
                   throws java.lang.IllegalStateException
Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a specified snapTo.

Only affects widgets with a a specified percentSource, or widgets that have snapTo set and are peers of some masterElement.

Determines whether the coordinates used for sizing (for percentage sized widgets) and positioning (if snapTo is set) should be relative to the visible size or the viewport size of the percentSource or masterElement widget.

Note : This is an advanced setting

Parameters:
percentBox - percentBox Default value is "visible"
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getPercentBox

public PercentBoxModel getPercentBox()
Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a specified snapTo.

Only affects widgets with a a specified percentSource, or widgets that have snapTo set and are peers of some masterElement.

Determines whether the coordinates used for sizing (for percentage sized widgets) and positioning (if snapTo is set) should be relative to the visible size or the viewport size of the percentSource or masterElement widget.

Returns:
PercentBoxModel

setSnapTo

public void setSnapTo(java.lang.String snapTo)
Position this widget such that it is aligned with ("snapped to") an edge of its masterElement (if specified), or its parentElement.

Note that this property also impacts the sizing of this widget. If this widgets size is specifed as a percent value, and has no explicit percentSource, sizing will be calculated based on the size of the masterElement when snapTo is set.

Possible values: BR, BL, TR, TL, R, L, B, T, C where B=Bottom, T=Top, L=Left, R=right and C=center Set the snapTo property of this canvas, and handle repositioning.

Parameters:
snapTo - new snapTo value. Default value is null

getSnapTo

public java.lang.String getSnapTo()
Position this widget such that it is aligned with ("snapped to") an edge of its masterElement (if specified), or its parentElement.

Note that this property also impacts the sizing of this widget. If this widgets size is specifed as a percent value, and has no explicit percentSource, sizing will be calculated based on the size of the masterElement when snapTo is set.

Possible values: BR, BL, TR, TL, R, L, B, T, C where B=Bottom, T=Top, L=Left, R=right and C=center

Returns:
Return the snapTo value of this object

setSnapEdge

public void setSnapEdge(java.lang.String snapEdge)
If snapTo is defined to this widget, this property can be used to define which edge of this widget should be snapped to an edge of the master or parent element.

If unspecified the, default snapTo behavior is set up to align the "snapTo" edge of this widget with the snapTo edge of the master or parent. Set the snapEdge property of this canvas, and handle repositioning.

Parameters:
snapEdge - new snapEdge value. Default value is null

getSnapEdge

public java.lang.String getSnapEdge()
If snapTo is defined to this widget, this property can be used to define which edge of this widget should be snapped to an edge of the master or parent element.

If unspecified the, default snapTo behavior is set up to align the "snapTo" edge of this widget with the snapTo edge of the master or parent.

Returns:
Return the snapEdge value of this object

setSnapOffsetLeft

public void setSnapOffsetLeft(java.lang.Integer snapOffsetLeft)
If snapTo is defined for this widget, this property can be used to specify an offset in px or percentage for the left coordinate of this widget.

For example if snapTo is specifed as "L" and snapOffsetLeft is set to 6, this widget will be rendered 6px inside the left edge of its parent or master element.

Parameters:
snapOffsetLeft - snapOffsetLeft Default value is null

getSnapOffsetLeft

public java.lang.Integer getSnapOffsetLeft()
If snapTo is defined for this widget, this property can be used to specify an offset in px or percentage for the left coordinate of this widget.

For example if snapTo is specifed as "L" and snapOffsetLeft is set to 6, this widget will be rendered 6px inside the left edge of its parent or master element.

Returns:
Integer

setSnapOffsetTop

public void setSnapOffsetTop(java.lang.Integer snapOffsetTop)
If snapTo is defined for this widget, this property can be used to specify an offset in px or percentage for the top coordinate of this widget.

For example if snapTo is specifed as "T" and snapOffsetTop is set to 6, this widget will be rendered 6px below the top edge of its parent or master element.

Parameters:
snapOffsetTop - snapOffsetTop Default value is null

getSnapOffsetTop

public java.lang.Integer getSnapOffsetTop()
If snapTo is defined for this widget, this property can be used to specify an offset in px or percentage for the top coordinate of this widget.

For example if snapTo is specifed as "T" and snapOffsetTop is set to 6, this widget will be rendered 6px below the top edge of its parent or master element.

Returns:
Integer

setSnapToGrid

public void setSnapToGrid(java.lang.Boolean snapToGrid)
Causes this canvas to snap to its parent's grid when dragging.

Parameters:
snapToGrid - snapToGrid Default value is null

getSnapToGrid

public java.lang.Boolean getSnapToGrid()
Causes this canvas to snap to its parent's grid when dragging.

Returns:
Boolean

setSnapResizeToGrid

public void setSnapResizeToGrid(java.lang.Boolean snapResizeToGrid)
Causes this canvas to snap to its parent's grid when resizing. Note that this value defaults to the Canvas's snapToGrid value if undefined.

Parameters:
snapResizeToGrid - snapResizeToGrid Default value is null

getSnapResizeToGrid

public java.lang.Boolean getSnapResizeToGrid()
Causes this canvas to snap to its parent's grid when resizing. Note that this value defaults to the Canvas's snapToGrid value if undefined.

Returns:
Boolean

setChildrenSnapToGrid

public void setChildrenSnapToGrid(java.lang.Boolean childrenSnapToGrid)
If true, causes this canvas's children to snap to its grid when dragging. This behavior can be overridden on a per-child basis by setting the snapToGrid value on the child.

Parameters:
childrenSnapToGrid - childrenSnapToGrid Default value is null

getChildrenSnapToGrid

public java.lang.Boolean getChildrenSnapToGrid()
If true, causes this canvas's children to snap to its grid when dragging. This behavior can be overridden on a per-child basis by setting the snapToGrid value on the child.

Returns:
Boolean

setChildrenSnapResizeToGrid

public void setChildrenSnapResizeToGrid(java.lang.Boolean childrenSnapResizeToGrid)
If true, causes this canvas's children to snap to its grid when resizing. This behavior can be overridden on a per-child basis by setting the snapToGrid or snapResizeToGrid value on the child.

Parameters:
childrenSnapResizeToGrid - childrenSnapResizeToGrid Default value is null

getChildrenSnapResizeToGrid

public java.lang.Boolean getChildrenSnapResizeToGrid()
If true, causes this canvas's children to snap to its grid when resizing. This behavior can be overridden on a per-child basis by setting the snapToGrid or snapResizeToGrid value on the child.

Returns:
Boolean

setSnapHGap

public void setSnapHGap(int snapHGap)
The horizontal grid size to use, in pixels, when snap-to-grid is enabled.

Parameters:
snapHGap - snapHGap Default value is 20

getSnapHGap

public int getSnapHGap()
The horizontal grid size to use, in pixels, when snap-to-grid is enabled.

Returns:
int

setSnapVGap

public void setSnapVGap(int snapVGap)
The vertical grid size to use, in pixels, when snap-to-grid is enabled.

Parameters:
snapVGap - snapVGap Default value is 20

getSnapVGap

public int getSnapVGap()
The vertical grid size to use, in pixels, when snap-to-grid is enabled.

Returns:
int

setSnapHDirection

public void setSnapHDirection(java.lang.String snapHDirection)
The horizontal snap direction. Set this value to Canvas.BEFORE to snap to the nearest gridpoint to the left; set it to Canvas.AFTER to snap to the nearest gridpoint to the right; and set it to Canvas.NEAREST to snap to the nearest gridpoint in either direction.

Parameters:
snapHDirection - snapHDirection Default value is Canvas.AFTER

getSnapHDirection

public java.lang.String getSnapHDirection()
The horizontal snap direction. Set this value to Canvas.BEFORE to snap to the nearest gridpoint to the left; set it to Canvas.AFTER to snap to the nearest gridpoint to the right; and set it to Canvas.NEAREST to snap to the nearest gridpoint in either direction.

Returns:
String

setSnapVDirection

public void setSnapVDirection(java.lang.String snapVDirection)
The vertical snap direction. Set this value to Canvas.BEFORE to snap to the nearest gridpoint above; set it to Canvas.AFTER to snap to the nearest gridpoint below; and set it to Canvas.NEAREST to snap to the nearest gridpoint in either direction.

Parameters:
snapVDirection - snapVDirection Default value is Canvas.AFTER

getSnapVDirection

public java.lang.String getSnapVDirection()
The vertical snap direction. Set this value to Canvas.BEFORE to snap to the nearest gridpoint above; set it to Canvas.AFTER to snap to the nearest gridpoint below; and set it to Canvas.NEAREST to snap to the nearest gridpoint in either direction.

Returns:
String

setSnapAxis

public void setSnapAxis(java.lang.String snapAxis)
Describes which axes to apply snap-to-grid to. Valid values are Canvas.HORIZONTAL, Canvas.VERTICAL and Canvas.BOTH

Parameters:
snapAxis - snapAxis Default value is Canvas.BOTH

getSnapAxis

public java.lang.String getSnapAxis()
Describes which axes to apply snap-to-grid to. Valid values are Canvas.HORIZONTAL, Canvas.VERTICAL and Canvas.BOTH

Returns:
String

setSnapOnDrop

public void setSnapOnDrop(java.lang.Boolean snapOnDrop)
When this canvas is dropped onto an object supporting snap-to-grid, should it snap to the grid (true, the default) or just drop wherever the mouse is (false).

Note : This is an advanced setting

Parameters:
snapOnDrop - snapOnDrop Default value is true

getSnapOnDrop

public java.lang.Boolean getSnapOnDrop()
When this canvas is dropped onto an object supporting snap-to-grid, should it snap to the grid (true, the default) or just drop wherever the mouse is (false).

Returns:
Boolean

getDestroyed

public java.lang.Boolean getDestroyed()
                               throws java.lang.IllegalStateException
If this property is set to true, the BaseWidget.destroy() method has been called on this canvas. This implies the canvas is no longer valid. Its ID has been removed from global scope, and calling standard canvas APIs on it is likely to result in errors. Note : This method should be called only after the widget has been rendered.

Returns:
Boolean
Throws:
java.lang.IllegalStateException - if widget has not yet been rendered.

getDestroying

public java.lang.Boolean getDestroying()
                                throws java.lang.IllegalStateException
This property is set to true when the BaseWidget.destroy() method is called on a widget. If this property is true, but destroyed is not, this indicates the canvas is in the process of being destroyed. Note : This method should be called only after the widget has been rendered.

Returns:
Boolean
Throws:
java.lang.IllegalStateException - if widget has not yet been rendered.

setShowEdges

public void setShowEdges(java.lang.Boolean showEdges)
                  throws java.lang.IllegalStateException
Whether an EdgedCanvas should be used to show image-based edges around this component.

Parameters:
showEdges - showEdges Default value is false
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getShowEdges

public java.lang.Boolean getShowEdges()
Whether an EdgedCanvas should be used to show image-based edges around this component.

Returns:
Boolean

setEdgeSize

public void setEdgeSize(int edgeSize)
                 throws java.lang.IllegalStateException
Size in pixels for corners and edges

Parameters:
edgeSize - edgeSize Default value is 10
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getEdgeSize

public int getEdgeSize()
Size in pixels for corners and edges

Returns:
int

setEdgeOffset

public void setEdgeOffset(java.lang.Integer edgeOffset)
                   throws java.lang.IllegalStateException
Amount the contained Canvas should be offset. Defaults to edgeSize; set to less than edgeSize to allow the contained Canvas to overlap the edge and corner media.

Parameters:
edgeOffset - edgeOffset Default value is null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getEdgeOffset

public java.lang.Integer getEdgeOffset()
Amount the contained Canvas should be offset. Defaults to edgeSize; set to less than edgeSize to allow the contained Canvas to overlap the edge and corner media.

Returns:
Integer

setEdgeImage

public void setEdgeImage(java.lang.String edgeImage)
                  throws java.lang.IllegalStateException
Base name of images for edges. Extensions for each corner or edge piece will be added to this image URL, before the extension. For example, with the default base name of "edge.gif", the top-left corner image will be "edge_TL.gif".

The full list of extensions is: "_TL", "_TR", "_BL", "_BR", "_T", "_L", "_B", "_R", "_center".

Parameters:
edgeImage - edgeImage Default value is "[SKIN]edge.gif"
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getEdgeImage

public java.lang.String getEdgeImage()
Base name of images for edges. Extensions for each corner or edge piece will be added to this image URL, before the extension. For example, with the default base name of "edge.gif", the top-left corner image will be "edge_TL.gif".

The full list of extensions is: "_TL", "_TR", "_BL", "_BR", "_T", "_L", "_B", "_R", "_center".

Returns:
String

setEdgeBackgroundColor

public void setEdgeBackgroundColor(java.lang.String edgeBackgroundColor)
                            throws java.lang.IllegalStateException
Background color for the EdgedCanvas created to decorate this component. This can be used to provide an underlying "tint" color for translucent edge media

Parameters:
edgeBackgroundColor - edgeBackgroundColor Default value is null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getEdgeBackgroundColor

public java.lang.String getEdgeBackgroundColor()
Background color for the EdgedCanvas created to decorate this component. This can be used to provide an underlying "tint" color for translucent edge media

Returns:
String

setEdgeOpacity

public void setEdgeOpacity(java.lang.Integer edgeOpacity)
                    throws java.lang.IllegalStateException
Opacity of the edges. Defaults to matching this.opacity. if setOpacity(java.lang.Integer) is called on a Canvas where edgeOpacity is set, edgeOpacity will be considered a percentage of the parent's opacity (so 50% opaque parent plus edgeOpacity 50 means 25% opaque edges) Set the edgeOpacity and mark the canvas for redraw

Parameters:
edgeOpacity - new edge-opacity level. Default value is null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getEdgeOpacity

public java.lang.Integer getEdgeOpacity()
Opacity of the edges. Defaults to matching this.opacity. if setOpacity(java.lang.Integer) is called on a Canvas where edgeOpacity is set, edgeOpacity will be considered a percentage of the parent's opacity (so 50% opaque parent plus edgeOpacity 50 means 25% opaque edges)

Returns:
Integer

setEdgeShowCenter

public void setEdgeShowCenter(java.lang.Boolean edgeShowCenter)
                       throws java.lang.IllegalStateException
Whether to show media in the center section, that is, behind the decorated Canvas.

Parameters:
edgeShowCenter - edgeShowCenter Default value is false
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getEdgeShowCenter

public java.lang.Boolean getEdgeShowCenter()
Whether to show media in the center section, that is, behind the decorated Canvas.

Returns:
Boolean

setEdgeCenterBackgroundColor

public void setEdgeCenterBackgroundColor(java.lang.String edgeCenterBackgroundColor)
                                  throws java.lang.IllegalStateException
Background color for the center section only. Can be used as a surrogate background color for the decorated Canvas, if the Canvas is set to partially overlap the edges and hence can't show a background color itself without occluding media.

Parameters:
edgeCenterBackgroundColor - edgeCenterBackgroundColor Default value is null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getEdgeCenterBackgroundColor

public java.lang.String getEdgeCenterBackgroundColor()
Background color for the center section only. Can be used as a surrogate background color for the decorated Canvas, if the Canvas is set to partially overlap the edges and hence can't show a background color itself without occluding media.

Returns:
String

setShowShadow

public void setShowShadow(java.lang.Boolean showShadow)
                   throws java.lang.IllegalStateException
Whether to show a drop shadow for this Canvas Method to update showShadow.

Parameters:
showShadow - true if the shadow should be visible false if not. Default value is false
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getShowShadow

public java.lang.Boolean getShowShadow()
Whether to show a drop shadow for this Canvas

Returns:
Boolean

setShadowDepth

public void setShadowDepth(int shadowDepth)
                    throws java.lang.IllegalStateException
Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.

This is a single parameter that can be used to control both shadowSoftness and shadowOffset.

Parameters:
shadowDepth - shadowDepth Default value is 4
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getShadowDepth

public int getShadowDepth()
Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.

This is a single parameter that can be used to control both shadowSoftness and shadowOffset.

Returns:
int

setShadowImage

public void setShadowImage(java.lang.String shadowImage)
                    throws java.lang.IllegalStateException
Base name of the series of images for the sides, corners, and center of the shadow.

The actual image names fetched for the dropShadow combine the segment name and the shadowDepth setting. For example, given "ds.png" as the base name, a depth of 4, and the top-left segment of the shadow, we'd use "ds4_TL.png".

The names for segments are the same as those given for controlling resizable edges; see resizeFrom. The center segment has the name "center". The center segment is the only segment that doesn't include the depth in the URL, so the final image name for the center given a baseName of "ds.png" would be just "ds_center.png".

Note : This is an advanced setting

Parameters:
shadowImage - shadowImage Default value is "[SKIN]ds.png"
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getShadowImage

public java.lang.String getShadowImage()
Base name of the series of images for the sides, corners, and center of the shadow.

The actual image names fetched for the dropShadow combine the segment name and the shadowDepth setting. For example, given "ds.png" as the base name, a depth of 4, and the top-left segment of the shadow, we'd use "ds4_TL.png".

The names for segments are the same as those given for controlling resizable edges; see resizeFrom. The center segment has the name "center". The center segment is the only segment that doesn't include the depth in the URL, so the final image name for the center given a baseName of "ds.png" would be just "ds_center.png".

Returns:
String

isDrawn

public java.lang.Boolean isDrawn()
Returns the boolean true, if the widget has been completely drawn, and false otherwise.

Overrides:
isDrawn in class BaseWidget
Returns:
true if drawn, false if not drawn

isDirty

public java.lang.Boolean isDirty()
Returns whether a canvas is waiting to be redrawn. Will return true if markForRedraw() has been called, but this canvas has not yet been redrawn.

Returns:
true is this canvas needs to be redrawn; false otherwise

markForRedraw

public void markForRedraw()
Marks the widget as "dirty" so that it will be added to a queue for redraw. Redraw of dirty components is handled by a looping timer and will after a very short delay (typically less than 100ms). In most cases it is recommended that developers use markForRedraw() instead of calling redraw() directly. Since this method queues the redraw, multiple calls to markForRedraw() within a single thread of excecution will only lead to a single DOM manipulation which greatly improves application performance.


markForRedraw

public void markForRedraw(java.lang.String reason)
Marks the widget as "dirty" so that it will be added to a queue for redraw. Redraw of dirty components is handled by a looping timer and will after a very short delay (typically less than 100ms). In most cases it is recommended that developers use markForRedraw() instead of calling redraw() directly. Since this method queues the redraw, multiple calls to markForRedraw() within a single thread of excecution will only lead to a single DOM manipulation which greatly improves application performance.

Parameters:
reason - reason for performing the redraw

redraw

public void redraw()
Redraws the widget immediately with its current property values. Generally, if you want a Canvas to redraw, call markForRedraw() - this will cause the Canvas to be redrawn when current processing ends, so that a series of modifications made to a Canvas will cause it to redraw only once. Only call redraw() directly if you need immediate responsiveness, for example you are redrawing in response to continuous mouse motion.


redraw

public void redraw(java.lang.String reason)
Redraws the widget immediately with its current property values. Generally, if you want a Canvas to redraw, call markForRedraw() - this will cause the Canvas to be redrawn when current processing ends, so that a series of modifications made to a Canvas will cause it to redraw only once. Only call redraw() directly if you need immediate responsiveness, for example you are redrawing in response to continuous mouse motion.

Parameters:
reason - reason for performing the redraw

clear

public void clear()
Remove all visual representation of a Canvas.

This is far more expensive than hide(), because in order to become visible again, the Canvas must be draw()n again. Generally, application code has no reason to call clear(); if you want to temporarily hide a Canvas, use hide() and show(), and if you want to permanently destroy a Canvas, use destroy().

Note: a clear() will happen as part of moving a Canvas to a different parent. See addChild().


markForDestroy

public void markForDestroy()
BaseWidget.destroy() this canvas on a timeout. This method should be used instead of calling canvas.destroy() directly unless there's a reason a the canvas needs to be destroyed synchronously. By using a timeout, this method ensures the destroy() will occur after the current thread of execution completes. This allows you to easily mark canvases for destruction while they're handling events, which must complete before the canvas can be destroyed.


addChild

public Canvas addChild(Canvas newChild)
Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if name argument is provided, and draw the child if this widget has been drawn already.

If newChild has a parent it will be removed from it. If it has a master, it will be detached from it if the master is a child of a different parent. If newChild has peers, they'll be added to this widget as children as well.

Parameters:
newChild - new child canvas to add
Returns:
the new child, or null if it couldn't be added

addChild

public Canvas addChild(Canvas newChild,
                       java.lang.String name,
                       boolean autoDraw)
Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if name argument is provided, and draw the child if this widget has been drawn already.

If newChild has a parent it will be removed from it. If it has a master, it will be detached from it if the master is a child of a different parent. If newChild has peers, they'll be added to this widget as children as well.

Parameters:
newChild - new child canvas to add
name - name to assign to child (eg: this[name] == child)
autoDraw - if false, child will not automatically be drawn (only for advanced use)
Returns:
the new child, or null if it couldn't be added

addPeer

public Canvas addPeer(Canvas newPeer)
Adds newPeer as a peer of this widget (also making it a child of this widget's parent, if any), set up a named object reference (i.e., this[name]) to the new widget if name is provided, and draw the peer if this widget has been drawn already.
The widget to be added as a peer will be removed from its old master and/or parent, if any, and it will be added as a child to the parent of this canvas (if any)

Parameters:
newPeer - new peer widget to add
Returns:
the new peer, or null if it couldn't be added

addPeer

public Canvas addPeer(Canvas newPeer,
                      java.lang.String name,
                      boolean autoDraw,
                      boolean preDraw)
Adds newPeer as a peer of this widget (also making it a child of this widget's parent, if any), set up a named object reference (i.e., this[name]) to the new widget if name is provided, and draw the peer if this widget has been drawn already.
The widget to be added as a peer will be removed from its old master and/or parent, if any, and it will be added as a child to the parent of this canvas (if any)

Parameters:
newPeer - new peer widget to add
name - name to assign to peer (eg: this[peer] == child)
autoDraw - if true, peer will not automatically be drawn (only for advanced use)
preDraw - if true, when draw is called on the master widget, the peer will be drawn before the master
Returns:
the new peer, or null if it couldn't be added

contains

public java.lang.Boolean contains(Canvas canvas)
Returns true if element is a descendant of this widget (i.e., exists below this widget in the containment hierarchy); and false otherwise.

Parameters:
canvas - the canvas to be tested
Returns:
true if specified element is a descendant of this canvas; false otherwise

contains

public java.lang.Boolean contains(Canvas canvas,
                                  boolean testSelf)
Returns true if element is a descendant of this widget (i.e., exists below this widget in the containment hierarchy); and false otherwise.

Parameters:
canvas - the canvas to be tested
testSelf - If passed this method will return true if the the canvas parameter is a pointer to this widget.
Returns:
true if specified element is a descendant of this canvas; false otherwise

hideClickMask

public void hideClickMask()
Hides the click mask associated with this canvas.


hideClickMask

public void hideClickMask(java.lang.String ID)
Hides the click mask associated with this canvas.

Parameters:
ID - optional ID of specific clickMask to hide. If not passed, defaults to hiding the click mask associated with this widget only.

clickMaskUp

public void clickMaskUp()
Determines whether a clickmask is showing


clickMaskUp

public void clickMaskUp(java.lang.String ID)
Determines whether a clickmask is showing

Parameters:
ID - optional ID of specific clickMask to check. If not passed, checks for the click mask associated with this widget only.

getRight

public int getRight()
Return the right coordinate of this object as rendered, relative to its enclosing context, in pixels.

Returns:
right coordinate

setRight

public void setRight(int right)
Resizes the widget horizontally to position its right side at the specified coordinate.

NOTE: if you're setting multiple coordinates, use setRect(), moveTo() or resizeTo() instead

Parameters:
right - new right coordinate

getBottom

public int getBottom()
Return the bottom coordinate of this object as rendered, relative to its enclosing context, in pixels.

Returns:
bottom coordinate

setBottom

public void setBottom(int bottom)
Resizes the widget vertically to position its bottom edge at the specified coordinate.

NOTE: if you're setting multiple coordinates, use setRect(), moveTo() or resizeTo() instead

Parameters:
bottom - new bottom coordinate

getScrollWidth

public int getScrollWidth()
Returns the scrollable width of the widget's contents, including children, ignoring clipping.

Returns:
the scrollable width of the widget's contents

getScrollHeight

public int getScrollHeight()
Returns the scrollable height of the widget's contents, including children, ignoring clipping.

Returns:
height of the element that can scroll

getScrollLeft

public int getScrollLeft()
Get the number of pixels this Canvas is scrolled from its left edge.

Returns:
scrollLeft

getScrollTop

public int getScrollTop()
Get the number of pixels this Canvas is scrolled from its top edge.

Returns:
scrollTop

setPageLeft

public void setPageLeft(int left)
Set the page-relative left coordinate of this widget.

Parameters:
left - new left coordinate in pixels

setPageTop

public void setPageTop(int top)
Set the page-relative top coordinate of this widget.

Parameters:
top - new top coordinate in pixels

getPageLeft

public int getPageLeft()
Returns the page-relative left coordinate of the widget on the page, in pixels.

Returns:
global left coordinate

getPageTop

public int getPageTop()
Returns the page-relative top coordinate of the widget on the page, in pixels

Returns:
GLOBAL top coordinate

getPageRight

public int getPageRight()
Return the page-relative right coordinate of this object, in pixels.

Returns:
GLOBAL right coordinate

getPageBottom

public int getPageBottom()
Return the page-relative bottom coordinate of this object, in pixels.

Returns:
GLOBAL bottom coordinate

containsPoint

public java.lang.Boolean containsPoint(int x,
                                       int y)
Return whether or not this object contains the specified global (x,y) coordinates.

Will return false if any parentElement does not contain the specified point, (EG: you're hovering over an element's absolute location, but it is scrolled out of view in a parent element)

Parameters:
x - GLOBAL x-coordinate
y - GLOBAL y-coordinate
Returns:
true if this object contains the specified point; false otherwise

containsPoint

public java.lang.Boolean containsPoint(int x,
                                       int y,
                                       boolean withinViewport)
Return whether or not this object contains the specified global (x,y) coordinates.

Will return false if any parentElement does not contain the specified point, (EG: you're hovering over an element's absolute location, but it is scrolled out of view in a parent element)

Parameters:
x - GLOBAL x-coordinate
y - GLOBAL y-coordinate
withinViewport - point lies specificly within our viewport (drawn area excluding margins and scrollbars if present)
Returns:
true if this object contains the specified point; false otherwise

visibleAtPoint

public java.lang.Boolean visibleAtPoint(int x,
                                        int y)
Does this widget contain the specified global (x,y) coordinates, and have no other widgets also at the specified position, obscuring this one? This is commonly used for (for example) drag and drop interactions.

Parameters:
x - GLOBAL x-coordinate
y - GLOBAL y-coordinate
Returns:
true if this object contains the specified point; false otherwise

visibleAtPoint

public java.lang.Boolean visibleAtPoint(int x,
                                        int y,
                                        boolean withinViewport,
                                        Canvas ignoreWidgets)
Does this widget contain the specified global (x,y) coordinates, and have no other widgets also at the specified position, obscuring this one? This is commonly used for (for example) drag and drop interactions.

Parameters:
x - GLOBAL x-coordinate
y - GLOBAL y-coordinate
withinViewport - point lies within our viewport rather than just our drawn area
ignoreWidgets - If passed ignore widget(s), do not check whether those widgets occludes this one.
Returns:
true if this object contains the specified point; false otherwise

intersects

public java.lang.Boolean intersects(Canvas other)
Returns true if the rectangles of this widget and the specified widget overlap.

Parameters:
other - other canvas to test for intersection
Returns:
true if this canvas intersects other; false otherwise

containsEvent

public java.lang.Boolean containsEvent()
Return true if the last event's mouse coordinates are within the bounds of this component. NOTE: Z-ordering is not considered for the purposes of this test. If the coordinate you're testing is occluded by other component, but the X,Y coordiates are still within the bounds of that component, this method will return true.

Returns:
true if the event occurred within the bounds of this component

getOffsetX

public int getOffsetX()
Return the X-coordinate of the last event relative to the left edge of the content of this Canvas.

NOTE: To get a coordinate relative to the viewport of this Canvas, subtract this.getScrollLeft()

Returns:

getOffsetY

public int getOffsetY()
Return the Y-coordinate of the last event, relative to the top edge of the content of this Canvas.

NOTE: To get a coordinate relative to the viewport of this Canvas, subtract this.getScrollTop()

Returns:

getViewportWidth

public int getViewportWidth()
Returns the width of the viewport onto the scrollable content.

Returns:
width of the viewport, in pixels

getViewportHeight

public int getViewportHeight()
Returns the height of the viewport onto the scrollable content.

Returns:
height of the viewport, in pixels

getInnerHeight

public int getInnerHeight()
Returns the amount of space available for (an) absolutely positioned child widget(s) or HTML content, without introducing clipping, scrolling or overflow.
This is the space within the viewport of the widget (including padding, but excluding margins, borders or scrollbars) rendered at its specified size.

Returns:
inner height of the widget in pixels

getInnerWidth

public int getInnerWidth()
Returns the amount of space available for (an) absolutely positioned child widget(s) or HTML content, without introducing clipping, scrolling or overflow.
This is the space within the viewport of the widget (including padding, but excluding margins, borders or scrollbars) rendered at its specified size.

Returns:
inner width of the widget in pixels

getInnerContentHeight

public int getInnerContentHeight()
Returns the amount of space available for interior content (or relatively positioned child widget(s)) without introducing clipping, scrolling or overflow.
This is the space within the viewport of the widget (not including padding, and excluding margins, borders or scrollbars) rendered at its specified size.

Returns:
inner height of the widget in pixels

getInnerContentWidth

public int getInnerContentWidth()
Returns the amount of space available for interior content (or relatively positioned child widget(s)) without introducing clipping, scrolling or overflow.
This is the space within the viewport of the widget (not including padding, and excluding margins, borders or scrollbars) rendered at its specified size.

Returns:
inner height of the widget in pixels

getVisibleWidth

public int getVisibleWidth()
Return the visible width of the Canvas.

Returns:
visible width in pixels

getVisibleHeight

public int getVisibleHeight()
Return the visible height of the Canvas.

Returns:
visible height in pixels

moveBy

public java.lang.Boolean moveBy(int deltaX,
                                int deltaY)
Moves the widget deltaX pixels to the right and deltaY pixels down. Pass negative numbers to move up and/or to the left.

Parameters:
deltaX - amount to move horizontally (may be negative)
deltaY - amount to move vertically (may be negative)
Returns:
whether the component actually moved

getVSnapOrigin

public int getVSnapOrigin()
Get an offset to be used when calculating snap positioning. Returns 0 by default.

Returns:
The offset to use when snapping

getVSnapOrigin

public int getVSnapOrigin(Canvas snapChild)
Get an offset to be used when calculating snap positioning. Returns 0 by default.

Parameters:
snapChild - the child that is being snapped
Returns:
The offset to use when snapping

getHSnapOrigin

public int getHSnapOrigin()
Get an offset to be used when calculating snap positioning. Returns 0 by default.

Returns:
The offset to use when snapping

getHSnapOrigin

public int getHSnapOrigin(Canvas snapChild)
Get an offset to be used when calculating snap positioning. Returns 0 by default.

Parameters:
snapChild - the child that is being snapped
Returns:
The offset to use when snapping

showNextTo

public void showNextTo(Canvas otherWidget)
Show this widget next to another widget.

Parameters:
otherWidget - Canvas to show next to

showNextTo

public void showNextTo(Canvas otherWidget,
                       java.lang.String side)
Show this widget next to another widget.

Parameters:
otherWidget - Canvas to show next to
side - which side to show on, defaults to "right"

resizeBy

public java.lang.Boolean resizeBy()
Resizes the widget, adding deltaX to its width and deltaY to its height (moves the right and/or bottom sides of the widget).

Returns:
whether the component actually changed size

resizeBy

public java.lang.Boolean resizeBy(int deltaX,
                                  int deltaY)
Resizes the widget, adding deltaX to its width and deltaY to its height (moves the right and/or bottom sides of the widget).

Parameters:
deltaX - amount to resize horizontally (may be negative)
deltaY - amount to resize vertically (may be negative)
Returns:
whether the component actually changed size

addResizedHandler

public HandlerRegistration addResizedHandler(ResizedHandler handler)
Add a resized handler.

Observable method called whenever a Canvas changes size. Note that if this canvas is overflow, and is waiting for a queued redraw (see isDirty()), the value for getVisibleWidth() and getVisibleHeight() will be unreliable until redraw() fires.

Specified by:
addResizedHandler in interface HasResizedHandlers
Parameters:
handler - the resized handler
Returns:
HandlerRegistration used to remove this handler

layoutChildren

public void layoutChildren(java.lang.String reason)
layoutChildren() is where a Canvas should implement a sizing policy for it's Canvas children. Since layoutChildren calls parentResized() on its children, parentResized() is a good place for a child to implement a layout policy that can be used within any parent.

Recommended practice for a Canvas that manages Canvas children is to create those children without any initial coordinate or size settings and do all sizing when layoutChildren() is called.

layoutChildren() is always called at least once before children are drawn, and is called automatically whenever the viewport size changes (which includes both resizing and introduction/removal of scrolling). layoutChildren() can also be manually invoked in any other component-specific situation which changes the layout.

NOTE: layoutChildren() may be called before draw() if a widget is resized before draw(), so be sure to avoid errors such as assuming that any children you automatically create have already been created.

NOTE: auto-sizing: layoutChildren() is also called once during the initial draw(), before children are drawn, with a "reason" of "initial draw". During this invocation of layoutChildren() it is legal to directly draw children (call child.draw()), which is otherwise never allowed. This allows a Canvas to implement an auto-sizing layout policy by drawing some children before deciding on the sizes of remaining children, which is far more efficient than drawing all children and resizing some of them after they are drawn.

Parameters:
reason - reason why layoutChildren() is being called, passed when framework code invokes layoutChildren()

resizeTo

public java.lang.Boolean resizeTo()
Resizes the widget to the specified width and height (moves the right and/ or bottom sides of the widget). The width and height parameters can be expressed as a percentage of viewport size or as the number of pixels.

Returns:
whether the size actually changed

resizeTo

public java.lang.Boolean resizeTo(int width,
                                  int height)
Resizes the widget to the specified width and height (moves the right and/ or bottom sides of the widget). The width and height parameters can be expressed as a percentage of viewport size or as the number of pixels.

Parameters:
width - new width for canvas
height - new height for canvas
Returns:
whether the size actually changed

parentResized

public void parentResized()
Fires when the interior size of the parent changes, including parent resize and scrollbar introduction or removal.

This method allows a child to implement a layout policy that can be used within any parent, such as a Resizer component that always snaps to the parent's bottom-right corner. The default implementation of this method applies a child's percent sizes, if any, or implements layout based on the snapTo property


shouldDragScroll

public void shouldDragScroll()
If this widget is showing scrollbars, and a user drags close to the edge of the viewport, should we scroll the viewport in the appropriate direction? Returns this.canDragScroll by default.


adjustForContent

public void adjustForContent(boolean immediate)
This method tells a component to adjust for size changes made to content by external code.

This is for very advanced use in which the contents of a Canvas are being directly updated by Ajax techniques, which is required for integration with some third-party libraries. Calling this method is required because browsers do not provide consistent events by which SmartGWT can be notified of external content changes.

Only contents supplied to a widget via contents or via an override of BaseWidget.getInnerHTML() should be manipulated directly. Contents automatically generated by SmartGWT components (such as the basic structure of a Button) should never be manipulated: these structures are considered internal, differ by platform, and will change without notice.

Parameters:
immediate - By default the adjustment will occur on a small delay for performance reasons. Pass in this parameter to force immediate adjustment.

scrollToTop

public void scrollToTop()
Vertically scrolls the content of the widget to 0


scrollToBottom

public void scrollToBottom()
Vertically scrolls the content of the widget to the end of its content


scrollToLeft

public void scrollToLeft()
Horizontally scrolls the content of the widget to 0


scrollToRight

public void scrollToRight()
Horizontally scrolls the content of the widget to the end of its content


scrollBy

public void scrollBy(int dX,
                     int dY)
Scroll this widget by some pixel increment in either (or both) direction(s).

Parameters:
dX - Number of pixels to scroll horizontally
dY - Number of pixels to scroll vertically

scrollTo

public void scrollTo()
Scrolls the content of the widget so that the origin (top-left corner) of the content is left pixels to the left and top pixels above the widget's top-left corner (but still clipped by the widget's dimensions).

This is guaranteed to be called whenever this Canvas is scrolled, whether scrolling is initiated programmatically, by custom scrollbars, or a by a native scrollbar.


scrollTo

public void scrollTo(int left,
                     int top)
Scrolls the content of the widget so that the origin (top-left corner) of the content is left pixels to the left and top pixels above the widget's top-left corner (but still clipped by the widget's dimensions).

This is guaranteed to be called whenever this Canvas is scrolled, whether scrolling is initiated programmatically, by custom scrollbars, or a by a native scrollbar.

Parameters:
left - the left coordinate
top - the top coordiante

addScrolledHandler

public HandlerRegistration addScrolledHandler(ScrolledHandler handler)
Add a scrolled handler.

Notification that this component has just scrolled. Use with com.smartgwt.client..Class#observe.

Fires for both CSS and Scrollbar.

Specified by:
addScrolledHandler in interface HasScrolledHandlers
Parameters:
handler - the scrolled handler
Returns:
HandlerRegistration used to remove this handler

show

public void show()
Sets this widget's visibility to "inherit", so that it becomes visible if all it's parents are visible or it has no parents.

If the widget has not yet been drawn (and doesn't have a parent or master), this method calls the draw method as well.


hide

public void hide()
Sets the widget's CSS visibility attribute to "hidden".


enable

public void enable()
Enables this widget and any children / peers of this widget.


disable

public void disable()
Disables this widget and any children and peers of this widget.


isDisabled

public java.lang.Boolean isDisabled()
Is this canvas disabled? Note that the disabled state is inherited - this method will return true if this widget, or any of its ancestors are marked disabled.

Returns:
true if the widget or any widget above it in the containment hierarchy are disabled.

focus

public void focus()
If this canvas can accept focus, give it keyboard focus. After this method, the canvas will appear focussed and will recieve keyboard events.


blur

public void blur()
If this canvas has keyboard focus, blur it. After this method, the canvas will no longer appear focussed and will stop recieving keyboard events.


containsFocus

public java.lang.Boolean containsFocus()
Returns true if the keyboard focus is in this Canvas or any child of this Canvas.

Returns:
whether this Canvas contains the keyboard focus

bringToFront

public void bringToFront()
Puts this widget at the top of the stacking order, so it appears in front of all other widgets in the same parent.


sendToBack

public void sendToBack()
Puts this widget at the bottom of the stacking order, so it appears behind all other widgets in the same parent.


moveAbove

public void moveAbove(Canvas canvas)
Puts this widget just above the specified widget in the stacking order, so it appears in front of the specified widget if both widgets have the same parent.

Parameters:
canvas - canvas to move above

moveBelow

public void moveBelow(Canvas canvas)
Puts this widget just below the specified widget in the stacking order, so it appears behind the specified widget if both widgets have the same parent.

Parameters:
canvas - canvas to move below

handleHover

public void handleHover()
Handler fired on a delay when the user hovers the mouse over this hover-target. Default implementation will fire this.hover() (if defined), and handle showing the hover canvas if this.showHover is true.


updateHover

public void updateHover()
If this canvas is currently showing a hover (see handleHover()), this method can be called to update the contents of the hover. Has no effect if the hover canvas is not showing for this widget.


updateHover

public void updateHover(java.lang.String hoverHTML)
If this canvas is currently showing a hover (see handleHover()), this method can be called to update the contents of the hover. Has no effect if the hover canvas is not showing for this widget.

Parameters:
hoverHTML - Option to specify new HTML for the hover. If not passed, the result of getHoverHTML() will be used instead. Note that if the hover HTML is empty the hover will be hidden.

addHoverHiddenHandler

public HandlerRegistration addHoverHiddenHandler(HoverHiddenHandler handler)
Add a hoverHidden handler.

If showHover is true for this canvas, this notification method will be fired whenever the hover shown in response to handleHover() is hidden. This method may be observed or overridden.

Specified by:
addHoverHiddenHandler in interface HasHoverHiddenHandlers
Parameters:
handler - the hoverHidden handler
Returns:
HandlerRegistration used to remove this handler

addHoverHandler

public HandlerRegistration addHoverHandler(HoverHandler handler)
Add a hover handler.

If canHover is true for this widget, the hover string method will be fired when the user hovers over this canvas. If this method returns false, it will suppress the default behavior of showing a hover canvas if this.showHover is true.

Specified by:
addHoverHandler in interface HasHoverHandlers
Parameters:
handler - the hover handler
Returns:
HandlerRegistration used to remove this handler

getHoverHTML

public void getHoverHTML()
If this.showHover is true, when the user holds the mouse over this Canvas for long enough to trigger a hover event, a hover canvas is shown by default. This method returns the contents of that hover canvas. Default implementation returns this.prompt - override for custom hover HTML. Note that returning null or an empty string will suppress the hover canvas altogether.


addShowContextMenuHandler

public HandlerRegistration addShowContextMenuHandler(ShowContextMenuHandler handler)
Add a showContextMenu handler.

Executed when the right mouse button is clicked. The default implementation of this method auto-creates a Menu from the contextMenu property on this component and then calls Menu.showContextMenu() on it to show it.

If you want to show a standard context menu, you can simply define your Menu and set it as the contextMenu property on your component - you do not need to override this method.

If you want to do some other processing before showing a menu or do something else entirely, then you should override this method. Note that the return value from this method controls whether or not the native browser context menu is shown.

Specified by:
addShowContextMenuHandler in interface HasShowContextMenuHandlers
Parameters:
handler - the showContextMenu handler
Returns:
HandlerRegistration used to remove this handler

hideContextMenu

public void hideContextMenu()
The default implementation of this method hides the contextMenu currently being shown for this component (which occurs when the mouse button that toggles the context menu is released). Override if you want some other behavior.


addMouseOverHandler

public HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
Add a mouseOver handler.

Executed when mouse enters this widget. No default implementation.

Specified by:
addMouseOverHandler in interface HasMouseOverHandlers
Parameters:
handler - the mouseOver handler
Returns:
HandlerRegistration used to remove this handler

addMouseDownHandler

public HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
Add a mouseDown handler.

Executed when the left mouse down is pressed on this widget. No default implementation.

Specified by:
addMouseDownHandler in interface HasMouseDownHandlers
Parameters:
handler - the mouseDown handler
Returns:
HandlerRegistration used to remove this handler

addRightMouseDownHandler

public HandlerRegistration addRightMouseDownHandler(RightMouseDownHandler handler)
Add a rightMouseDown handler.

Executed when the right mouse down is pressed on this widget. No default implementation.

Specified by:
addRightMouseDownHandler in interface HasRightMouseDownHandlers
Parameters:
handler - the rightMouseDown handler
Returns:
HandlerRegistration used to remove this handler

addMouseStillDownHandler

public HandlerRegistration addMouseStillDownHandler(MouseStillDownHandler handler)
Add a mouseStillDown handler.

Executed repeatedly (every mouseStillDownDelay by default) when the system is idle - i.e. not busy running other scripts - and the left mouse button is held down after having been pressed in the object. This event is not native to JavaScript, but is provided by the ISC system.

Note: The event handling system waits mouseStillDownInitialDelay before calling mouseStillDown for the first time on the widget. Subsequently the method is called every mouseStillDownDelay. Both attributes are configurable per widget instance.

This method is called only when the left mouse is held down.

Specified by:
addMouseStillDownHandler in interface HasMouseStillDownHandlers
Parameters:
handler - the mouseStillDown handler
Returns:
HandlerRegistration used to remove this handler

addMouseMoveHandler

public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
Add a mouseMove handler.

Executed when the mouse moves within this widget. No default implementation.

Specified by:
addMouseMoveHandler in interface HasMouseMoveHandlers
Parameters:
handler - the mouseMove handler
Returns:
HandlerRegistration used to remove this handler

addMouseOutHandler

public HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
Add a mouseOut handler.

Executed when the mouse leaves this widget. No default implementation.

Specified by:
addMouseOutHandler in interface HasMouseOutHandlers
Parameters:
handler - the mouseOut handler
Returns:
HandlerRegistration used to remove this handler

addMouseUpHandler

public HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
Add a mouseUp handler.

Executed when the left mouse is released on this widget. No default implementation.

Specified by:
addMouseUpHandler in interface HasMouseUpHandlers
Parameters:
handler - the mouseUp handler
Returns:
HandlerRegistration used to remove this handler

addClickHandler

public HandlerRegistration addClickHandler(ClickHandler handler)
Add a click handler.

Executed when the left mouse is clicked (pressed and then released) on this widget. No default implementation.

Specified by:
addClickHandler in interface HasClickHandlers
Parameters:
handler - the click handler
Returns:
HandlerRegistration used to remove this handler

addDoubleClickHandler

public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
Add a doubleClick handler.

Executed when the left mouse button is clicked twice in rapid succession (within doubleClickDelay by default) in this object.

Specified by:
addDoubleClickHandler in interface HasDoubleClickHandlers
Parameters:
handler - the doubleClick handler
Returns:
HandlerRegistration used to remove this handler

addMouseWheelHandler

public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
Add a mouseWheel handler.

Executed when the mouse wheel is actuated.

Specified by:
addMouseWheelHandler in interface HasMouseWheelHandlers
Parameters:
handler - the mouseWheel handler
Returns:
HandlerRegistration used to remove this handler

addDragRepositionStartHandler

public HandlerRegistration addDragRepositionStartHandler(DragRepositionStartHandler handler)
Add a dragRepositionStart handler.

Executed when dragging first starts. No default implementation. Create this handler to set things up for the drag reposition.

Specified by:
addDragRepositionStartHandler in interface HasDragRepositionStartHandlers
Parameters:
handler - the dragRepositionStart handler
Returns:
HandlerRegistration used to remove this handler

addDragRepositionMoveHandler

public HandlerRegistration addDragRepositionMoveHandler(DragRepositionMoveHandler handler)
Add a dragRepositionMove handler.

Executed every time the mouse moves while drag-repositioning. If this method does not return false, the dragTarget (or outline if dragAppearance is set to "outline" will automatically be moved as appropriate whenever the mouse moves.

Specified by:
addDragRepositionMoveHandler in interface HasDragRepositionMoveHandlers
Parameters:
handler - the dragRepositionMove handler
Returns:
HandlerRegistration used to remove this handler

addDragRepositionStopHandler

public HandlerRegistration addDragRepositionStopHandler(DragRepositionStopHandler handler)
Add a dragRepositionStop handler.

Executed when the mouse button is released at the end of the drag. Your widget can use this opportunity to fire custom code based upon where the mouse button was released, etc.

Returning true from this handler will cause the dragTarget (or outline if dragAppearance is set to "outline") to be left in its current location. Returning false from this handler will cause it to snap back to its original location.

Specified by:
addDragRepositionStopHandler in interface HasDragRepositionStopHandlers
Parameters:
handler - the dragRepositionStop handler
Returns:
HandlerRegistration used to remove this handler

addDragResizeStartHandler

public HandlerRegistration addDragResizeStartHandler(DragResizeStartHandler handler)
Add a dragResizeStart handler.

Executed when resize dragging first starts. No default implementation. Create this handler to set things up for the drag resize.

Specified by:
addDragResizeStartHandler in interface HasDragResizeStartHandlers
Parameters:
handler - the dragResizeStart handler
Returns:
HandlerRegistration used to remove this handler

addDragResizeMoveHandler

public HandlerRegistration addDragResizeMoveHandler(DragResizeMoveHandler handler)
Add a dragResizeMove handler.

Executed every time the mouse moves while drag-resizing. If this method does not return false, the dragTarget (or outline if dragAppearance is set to "outline" will automatically be moved as appropriate whenever the mouse moves.

Specified by:
addDragResizeMoveHandler in interface HasDragResizeMoveHandlers
Parameters:
handler - the dragResizeMove handler
Returns:
HandlerRegistration used to remove this handler

addDragResizeStopHandler

public HandlerRegistration addDragResizeStopHandler(DragResizeStopHandler handler)
Add a dragResizeStop handler.

Executed when the mouse button is released at the end of the drag resize. Your widget can use this opportunity to fire custom code based upon where the mouse button was released, etc.

Returning true from this handler will cause the dragTarget (or outline if dragAppearance is set to "outline") to be left at its current size. Returning false from this handler will cause it to snap back to its original location size

Specified by:
addDragResizeStopHandler in interface HasDragResizeStopHandlers
Parameters:
handler - the dragResizeStop handler
Returns:
HandlerRegistration used to remove this handler

addDragStartHandler

public HandlerRegistration addDragStartHandler(DragStartHandler handler)
Add a dragStart handler.

Executed when dragging first starts. Your widget can use this opportunity to set things up for the drag, such as setting the drag tracker. Returning false from this event handler will cancel the drag action entirely.

A drag action is considered to be begin when the mouse has moved dragStartDistance with the left mouse down.

Specified by:
addDragStartHandler in interface HasDragStartHandlers
Parameters:
handler - the dragStart handler
Returns:
HandlerRegistration used to remove this handler

addDragMoveHandler

public HandlerRegistration addDragMoveHandler(DragMoveHandler handler)
Add a dragMove handler.

Executed every time the mouse moves while dragging this canvas.

Specified by:
addDragMoveHandler in interface HasDragMoveHandlers
Parameters:
handler - the dragMove handler
Returns:
HandlerRegistration used to remove this handler

addDragStopHandler

public HandlerRegistration addDragStopHandler(DragStopHandler handler)
Add a dragStop handler.

Executed when the mouse button is released at the end of the drag. Your widget can use this opportunity to fire code based on the last location of the drag or reset any visual state that was sent.

Specified by:
addDragStopHandler in interface HasDragStopHandlers
Parameters:
handler - the dragStop handler
Returns:
HandlerRegistration used to remove this handler

addDropOverHandler

public HandlerRegistration addDropOverHandler(DropOverHandler handler)
Add a dropOver handler.

Executed when the compatible dragged object is first moved over this drop target. Your implementation can use this to show a custom visual indication that the object can be dropped here.

Specified by:
addDropOverHandler in interface HasDropOverHandlers
Parameters:
handler - the dropOver handler
Returns:
HandlerRegistration used to remove this handler

addDropMoveHandler

public HandlerRegistration addDropMoveHandler(DropMoveHandler handler)
Add a dropMove handler.

Executed whenever the compatible dragged object is moved over this drop target. You can use this to show a custom visual indication of where the drop would occur within the widget.

Specified by:
addDropMoveHandler in interface HasDropMoveHandlers
Parameters:
handler - the dropMove handler
Returns:
HandlerRegistration used to remove this handler

addDropOutHandler

public HandlerRegistration addDropOutHandler(DropOutHandler handler)
Add a dropOut handler.

Executed when the dragged object is moved out of the rectangle of this drop target. If you have set a visual indication in dropOver or dropMove, you should reset it to its normal state in dropOut.

Specified by:
addDropOutHandler in interface HasDropOutHandlers
Parameters:
handler - the dropOut handler
Returns:
HandlerRegistration used to remove this handler

addKeyDownHandler

public HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
Add a keyDown handler.

Executed when a key is pressed on a focusable widget (canFocus: true).

Use EventHandler.getKey() to find out the com.smartgwt.client..KeyName of the key that was pressed, and use EventHandler.shiftKeyDown() and related functions to determine whether modifier keys were down.

Specified by:
addKeyDownHandler in interface HasKeyDownHandlers
Parameters:
handler - the keyDown handler
Returns:
HandlerRegistration used to remove this handler

keyUp

public java.lang.Boolean keyUp()
Executed when a key is released on a focusable widget (canFocus: true).

Use EventHandler.getKey() to find out the com.smartgwt.client..KeyName of the key that was pressed, and use EventHandler.shiftKeyDown() and related functions to determine whether modifier keys were down.

Returns:
false to prevent this event from bubbling to this widget's parent, true or undefined to bubble.

addKeyPressHandler

public HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
Add a keyPress handler.

Executed when a key is pressed and released on a focusable widget (canFocus: true).

Use EventHandler.getKey() to find out the com.smartgwt.client..KeyName of the key that was pressed, and use EventHandler.shiftKeyDown() and related functions to determine whether modifier keys were down.

Specified by:
addKeyPressHandler in interface HasKeyPressHandlers
Parameters:
handler - the keyPress handler
Returns:
HandlerRegistration used to remove this handler

willAcceptDrop

public java.lang.Boolean willAcceptDrop()
Returns true if the widget object being dragged can be dropped on this widget, and false otherwise. The default implementation of this method simply compares the dragType of the dragTarget (the component being dragged from) with the list of dropTypes on this Canvas. If the dropTypes list contains the dragType value, then this method returns true. Otherwise it returns false.

Returns:
true if the widget object being dragged can be dropped on this widget, false otherwise

getHSnapPosition

public int getHSnapPosition(int coordinate)
Override this method to provide a custom snap-to grid. Note that you do not need to do this if your grid is regular (ie, grid points are every x pixels); regular grids should be defined using snapHGap and snapVGap. You should only override this method if you want to provide support for a grid of irregularly-placed points

Parameters:
coordinate - x-coordinate of the drag event relative to the inside of this widget
Returns:
The horizontal coordinate to snap to

getHSnapPosition

public int getHSnapPosition(int coordinate,
                            java.lang.String direction)
Override this method to provide a custom snap-to grid. Note that you do not need to do this if your grid is regular (ie, grid points are every x pixels); regular grids should be defined using snapHGap and snapVGap. You should only override this method if you want to provide support for a grid of irregularly-placed points

Parameters:
coordinate - x-coordinate of the drag event relative to the inside of this widget
direction - "before" or "after" denoting whether the returned coordinate should match the left or right edge of the current square. If unset snapHDirection will be used by default
Returns:
The horizontal coordinate to snap to

getVSnapPosition

public int getVSnapPosition(int coordinate)
Override this method to provide a custom snap-to grid. Note that you do not need to do this if your grid is regular (ie, grid points are every x pixels) - regular grids should be defined using snapHGap and snapVGap. You should only override this method if you want to provide support for a grid of irregularly-placed points

Parameters:
coordinate - y-coordinate of the drag event relative to the inside of this widget
Returns:
The vertical coordinate to snap to

getVSnapPosition

public int getVSnapPosition(int coordinate,
                            java.lang.String direction)
Override this method to provide a custom snap-to grid. Note that you do not need to do this if your grid is regular (ie, grid points are every x pixels) - regular grids should be defined using snapHGap and snapVGap. You should only override this method if you want to provide support for a grid of irregularly-placed points

Parameters:
coordinate - y-coordinate of the drag event relative to the inside of this widget
direction - "before" or "after" denoting whether the returned coordinate should match the top or bottom edge of the current square. If unset snapHDirection will be used by default
Returns:
The vertical coordinate to snap to

setImage

public void setImage(java.lang.String identifier,
                     java.lang.String URL)
Set the URL of an image element by name.

The image element must have been created from HTML generated by calling canvas.imgHTML() on this particular Canvas.

Parameters:
identifier - name of the image to change, as originally passed to imgHTML
URL - URL for the image

setImage

public void setImage(java.lang.String identifier,
                     java.lang.String URL,
                     java.lang.String imgDir)
Set the URL of an image element by name.

The image element must have been created from HTML generated by calling canvas.imgHTML() on this particular Canvas.

Parameters:
identifier - name of the image to change, as originally passed to imgHTML
URL - URL for the image
imgDir - optional image directory, overrides the default for this Canvas

linkHTML

public java.lang.String linkHTML(java.lang.String href)
Generates the HTML for a standard link element

Parameters:
href - URL for the link to point to
Returns:
HTML for the link

linkHTML

public java.lang.String linkHTML(java.lang.String href,
                                 java.lang.String text,
                                 java.lang.String target,
                                 java.lang.String ID,
                                 int tabIndex,
                                 java.lang.String accessKey)
Generates the HTML for a standard link element

Parameters:
href - URL for the link to point to
text - Text to for the link (defaults to the href)
target - Target window for the link (defaults to opening in a new, unnamed window)
ID - optional ID for the link element to be written out
tabIndex - optional tabIndex for the link
accessKey - optional accessKey for the link
Returns:
HTML for the link

addFocusChangedHandler

public HandlerRegistration addFocusChangedHandler(FocusChangedHandler handler)
Add a focusChanged handler.

Notification function fired when this widget recieves or loses keyboard focus.

Specified by:
addFocusChangedHandler in interface HasFocusChangedHandlers
Parameters:
handler - the focusChanged handler
Returns:
HandlerRegistration used to remove this handler

getById

public static Canvas getById(java.lang.String ID)
Retrieve a Canvas by it's global ID.

Parameters:
ID - global ID of the Canvas
Returns:
the Canvas, or null if not found

addStyleName

public void addStyleName(java.lang.String style)
Multiple styles are currently not supported. This method essentially calls setStyleName(String)

Overrides:
addStyleName in class com.google.gwt.user.client.ui.UIObject
Parameters:
style - the style name
See Also:
setStyleName(String)

setVisible

public void setVisible(boolean visible)
Overrides:
setVisible in class com.google.gwt.user.client.ui.UIObject

setHeight

public void setHeight(int height)
Size for this component's vertical dimension.

Can be a number of pixels, or a percentage like "50%". See documentation for width for details on who percentage values are resolved actual size.

Note that if overflow is set to "visible", this size is a minimum, and the component may overflow to show all content and/or children.

If trying to establish a default height for a custom component, set defaultHeight instead. Resizes the widget vertically to the specified height (moves the bottom side of the widget). The height parameter can be expressed as a percentage of viewport size or as the number of pixels.

NOTE: if you're setting multiple coordinates, use resizeTo() or setRect() instead

Parameters:
height - new height. Default value is null

setHeight100

public void setHeight100()
Convenience method that sets the height to 100%.


setWidth100

public void setWidth100()
Convenience method that sets the width to 100%.


setHeight

public void setHeight(java.lang.String height)
Overrides:
setHeight in class com.google.gwt.user.client.ui.UIObject

getHeight

public java.lang.Integer getHeight()

getHeightAsString

public java.lang.String getHeightAsString()

setTitle

public void setTitle(java.lang.String title)
Synonmy for setPrompt(String)

Overrides:
setTitle in class BaseWidget
Parameters:
title - the title

getTitle

public java.lang.String getTitle()
Synonmy for getPrompt()

Overrides:
getTitle in class BaseWidget
Returns:
the title

setTooltip

public void setTooltip(java.lang.String tooltip)
Synonmy for setPrompt(String)

Parameters:
tooltip - the tooltip

getTooltip

public java.lang.String getTooltip()
Synonmy for getPrompt()

Returns:
the tooltip

setWidth

public void setWidth(int width)
Size for this component's horizontal dimension.

Can be a number of pixels, or a percentage like "50%". Percentage sizes are resolved to pixel values as follows:

Layout may specially interpret percentage sizes on their children, and also allow "*" as a size.

Note that if overflow is set to "visible", this size is a minimum, and the component may overflow to show all content and/or children.

If trying to establish a default width for a custom component, set defaultWidth instead. Resizes the widget horizontally to the specified width (moves the right side of the widget). The width parameter can be expressed as a percentage of viewport size or as the number of pixels.

NOTE: if you're setting multiple coordinates, use resizeTo() or setRect() instead

Parameters:
width - new width. Default value is null

setWidth

public void setWidth(java.lang.String width)
Size for this component's horizontal dimension.

Can be a number of pixels, or a percentage like "50%". Percentage sizes are resolved to pixel values as follows:

Layout may specially interpret percentage sizes on their children, and also allow "*" as a size.

Note that if overflow is set to "visible", this size is a minimum, and the component may overflow to show all content and/or children.

If trying to establish a default width for a custom component, set defaultWidth instead. Resizes the widget horizontally to the specified width (moves the right side of the widget). The width parameter can be expressed as a percentage of viewport size or as the number of pixels.

NOTE: if you're setting multiple coordinates, use resizeTo() or setRect() instead

Overrides:
setWidth in class com.google.gwt.user.client.ui.UIObject
Parameters:
width - new width. Default value is null

getWidth

public java.lang.Integer getWidth()

getWidthAsString

public java.lang.String getWidthAsString()

setAlign

public void setAlign(Alignment align)

getAbsoluteLeft

public int getAbsoluteLeft()
Overrides:
getAbsoluteLeft in class com.google.gwt.user.client.ui.UIObject

getAbsoluteTop

public int getAbsoluteTop()
Overrides:
getAbsoluteTop in class com.google.gwt.user.client.ui.UIObject

setDragTarget

public void setDragTarget(Canvas dragTarget)
A different widget that should be actually dragged when dragging initiates on this widget. One example of this is to have a child widget that drags its parent, as with a drag box. Because the parent automatically repositions its children, setting the drag target of the child to the parent and then dragging the child will result in both widgets being moved.
Valid dragTarget values are:
- null (default) [this widget is its own drag target]
- Pointer to another widget, or widget ID
- "parent" drag target is this widget's parentElement
- "top" drag target is this widget's topElement

Note : This is an advanced setting

Parameters:
dragTarget - dragTarget Default value is null

getDragTarget

public Canvas getDragTarget()
A different widget that should be actually dragged when dragging initiates on this widget. One example of this is to have a child widget that drags its parent, as with a drag box. Because the parent automatically repositions its children, setting the drag target of the child to the parent and then dragging the child will result in both widgets being moved.
Valid dragTarget values are:
- null (default) [this widget is its own drag target]
- Pointer to another widget, or widget ID
- "parent" drag target is this widget's parentElement
- "top" drag target is this widget's topElement

Returns:
Canvas

setShadowOffset

public void setShadowOffset(java.lang.Integer shadowOffset)
Offset of the shadow. Defaults to half of shadowDepth if unset.

Because of the blurred edges, a shadow is larger than the originating component by 2xsoftness. An shadowOffset of 0 means that the shadow will extend around the originating component equally in all directions.

Note : This is an advanced setting

Parameters:
shadowOffset - shadowOffset Default value is null

getShadowOffset

public java.lang.Integer getShadowOffset()
Offset of the shadow. Defaults to half of shadowDepth if unset.

Because of the blurred edges, a shadow is larger than the originating component by 2xsoftness. An shadowOffset of 0 means that the shadow will extend around the originating component equally in all directions.

Returns:
Integer

setShadowSoftness

public void setShadowSoftness(java.lang.Integer shadowSoftness)
Softness, or degree of blurring, of the shadow.

A shadow with softness:x is 2x pixels larger in each direction than the element throwing the shadow, and the media for each edge should be x pixels wide/tall.

Defaults to shadowDepth if unset.

Note : This is an advanced setting

Parameters:
shadowSoftness - shadowSoftness Default value is null

getShadowSoftness

public java.lang.Integer getShadowSoftness()
Softness, or degree of blurring, of the shadow.

A shadow with softness:x is 2x pixels larger in each direction than the element throwing the shadow, and the media for each edge should be x pixels wide/tall.

Defaults to shadowDepth if unset.

Returns:
Integer

setGroupTitle

public void setGroupTitle(java.lang.String groupTitle)
Set the groupTitle.

Parameters:
groupTitle - the groupTitle

getGroupTitle

public java.lang.String getGroupTitle()
Return the groupTitle.

Returns:
the groupTitle

setIsGroup

public void setIsGroup(java.lang.Boolean isGroup)
Set the isGroup.

Parameters:
isGroup - the isGroup

getIsGroup

public java.lang.Boolean getIsGroup()
Return the isGroup.

Returns:
the isGroup

setSmoothFade

public void setSmoothFade(java.lang.Boolean smoothFade)
                   throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

setKeepInParentRect

public void setKeepInParentRect(java.lang.Boolean keepInParentRect)

setKeepInParentRect

public void setKeepInParentRect(Rectangle rectangle)

setPrefix

public void setPrefix(java.lang.String prefix)

getPrefix

public java.lang.String getPrefix()

setResizeFrom

public void setResizeFrom(java.lang.String... resizeFrom)

setEdgeMarginSize

public void setEdgeMarginSize(int edgeMarginSize)

setLayoutAlign

public void setLayoutAlign(Alignment layoutAlign)
                    throws java.lang.IllegalStateException
When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout. Default is "left" for a VLayout, "top" for an HLayout.

Parameters:
layoutAlign - layoutAlign Default valaue is null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been rendered

setLayoutAlign

public void setLayoutAlign(VerticalAlignment layoutAlign)
                    throws java.lang.IllegalStateException
When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout. Default is "left" for a VLayout, "top" for an HLayout.

Parameters:
layoutAlign - layoutAlign Default valaue is null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been rendered

setDropTypes

public void setDropTypes(java.lang.String... dropTypes)
The "type" of thing(s) that can be dropped on this widget specified as a string or an array of strings (indicating multiple types). Leave this with the value null to indicate that this widget can accept anything dropped on it from the page.

Note : This is an advanced setting

Parameters:
dropTypes - dropTypes Default value is Canvas.ANYTHING

moveTo

public boolean moveTo(int left,
                      int top)
Moves the widget so that its top-left corner is at the specified coordinates. This method will also accept a single parameter as an object array with left and top given as properties.

Parameters:
left - x-coordinate to move to in LOCAL coordinates
top - y-coordinate to move to in LOCAL coordinates
Returns:
whether the component actually moved

scrollByPercent

public void scrollByPercent(int dX,
                            int dY)
Scroll this widget by some percentage of scroll size in either (or both) direction(s).

Parameters:
dX - Percentage to scroll horizontally.
dY - Percentage to scroll vertically.

scrollToPercent

public void scrollToPercent(int left,
                            int top)
Scroll this widget to some position specified as a percentage of scroll size in either (or both) direction(s).

Parameters:
left - left Percentage position to scroll to
top - top Percentage position to scroll to

isVisible

public boolean isVisible()
Returns true if the widget is visible, taking all parents into account, so that a widget which is not hidden might still report itself as not visible if it is within a hidden parent.

NOTE: Undrawn widgets will report themselves as visible if they would be visible if drawn.

Overrides:
isVisible in class com.google.gwt.user.client.ui.UIObject
Returns:
true if the widget is visible, false otherwise

animateMove

public void animateMove(int left,
                        int top)
Animate a reposition of this canvas from its current position to the specified position

Parameters:
left - new left position (or null for unchanged)
top - new top position (or null for unchanged)

animateMove

public void animateMove(int left,
                        int top,
                        AnimationCallback callback)
Animate a reposition of this canvas from its current position to the specified position

Parameters:
left - new left position (or null for unchanged)
top - new top position (or null for unchanged)
callback - When the move completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation

animateMove

public void animateMove(int left,
                        int top,
                        AnimationCallback callback,
                        int duration)
Animate a reposition of this canvas from its current position to the specified position

Parameters:
left - new left position (or null for unchanged)
top - new top position (or null for unchanged)
callback - When the move completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation
duration - Duration in ms of the animated move

animateMove

public void animateMove(int left,
                        int top,
                        AnimationCallback callback,
                        int duration,
                        AnimationAcceleration acceleration)
Animate a reposition of this canvas from its current position to the specified position

Parameters:
left - new left position (or null for unchanged)
top - new top position (or null for unchanged)
callback - When the move completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation
duration - Duration in ms of the animated move
acceleration - Optional acceleration effect to bias the ratios

animateScroll

public void animateScroll(int scrollLeft,
                          int scrollTop)
Animate a scroll from the current scroll position to the specified position.

Parameters:
scrollLeft - desired final left scroll postion
scrollTop - desired final top scroll postion

animateScroll

public void animateScroll(int scrollLeft,
                          int scrollTop,
                          AnimationCallback callback)
Animate a scroll from the current scroll position to the specified position.

Parameters:
scrollLeft - desired final left scroll postion
scrollTop - desired final top scroll postion
callback - When the scroll completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation

animateScroll

public void animateScroll(int scrollLeft,
                          int scrollTop,
                          AnimationCallback callback,
                          int duration)
Animate a scroll from the current scroll position to the specified position.

Parameters:
scrollLeft - desired final left scroll postion
scrollTop - desired final top scroll postion
callback - When the scroll completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation
duration - Duration in ms of the animated scroll

animateRect

public void animateRect(int left,
                        int top,
                        int width,
                        int height)
Animate a reposition / resize of this canvas from its current size and postion.

Parameters:
left - new left position (or null for unchanged)
top - new top position (or null for unchanged)
width - new width (or null for unchanged)
height - new height (or null for unchanged)

animateRect

public void animateRect(int left,
                        int top,
                        int width,
                        int height,
                        AnimationCallback callback)
Animate a reposition / resize of this canvas from its current size and postion.

Parameters:
left - new left position (or null for unchanged)
top - new top position (or null for unchanged)
width - new width (or null for unchanged)
height - new height (or null for unchanged)
callback - When the setRect completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation

animateRect

public void animateRect(int left,
                        int top,
                        int width,
                        int height,
                        AnimationCallback callback,
                        int duration)
Animate a reposition / resize of this canvas from its current size and postion.

Parameters:
left - new left position (or null for unchanged)
top - new top position (or null for unchanged)
width - new width (or null for unchanged)
height - new height (or null for unchanged)
callback - When the setRect completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation
duration - Duration in ms of the animated setRect

animateResize

public void animateResize(int width,
                          int height)
Animate a resize of this canvas from its current size to the specified size

Parameters:
width - new width (or null for unchanged)
height - new height (or null for unchanged)

animateResize

public void animateResize(int width,
                          int height,
                          AnimationCallback callback)
Animate a resize of this canvas from its current size to the specified size

Parameters:
width - new width (or null for unchanged)
height - new height (or null for unchanged)
callback - When the resize completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation

animateResize

public void animateResize(int width,
                          int height,
                          AnimationCallback callback,
                          int duration)
Animate a resize of this canvas from its current size to the specified size

Parameters:
width - new width (or null for unchanged)
height - new height (or null for unchanged)
callback - When the resize completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation
duration - Duration in ms of the animated resize

animateFade

public void animateFade(int opacity)
Animate a change in opacity from the widget's current opacity to the specified opacity.

Parameters:
opacity - desired final opacity

animateFade

public void animateFade(int opacity,
                        AnimationCallback callback)
Animate a change in opacity from the widget's current opacity to the specified opacity.

Parameters:
opacity - desired final opacity
callback - When the fade completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation

animateFade

public void animateFade(int opacity,
                        AnimationCallback callback,
                        int duration)
Animate a change in opacity from the widget's current opacity to the specified opacity.

Parameters:
opacity - desired final opacity
callback - When the fade completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation
duration - Duration in ms of the animated fade

animateHide

public void animateHide(AnimationEffect effect)
Hide a canvas by shrinking it vertically to zero height over a period of time. This method will not fire if the widget is already drawn and visible, or has overflow other than "visible" or "hidden".

Parameters:
effect - How should the content of the window be hidden during the hide? If ommitted, default behavior can be configured via animateHideEffect

animateHide

public void animateHide(AnimationEffect effect,
                        AnimationCallback callback)
Hide a canvas by shrinking it vertically to zero height over a period of time. This method will not fire if the widget is already drawn and visible, or has overflow other than "visible" or "hidden".

Parameters:
effect - How should the content of the window be hidden during the hide? If ommitted, default behavior can be configured via animateHideEffect
callback - When the hide completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation.

animateHide

public void animateHide(AnimationEffect effect,
                        AnimationCallback callback,
                        int duration)
Hide a canvas by shrinking it vertically to zero height over a period of time. This method will not fire if the widget is already drawn and visible, or has overflow other than "visible" or "hidden".

Parameters:
effect - How should the content of the window be hidden during the hide? If ommitted, default behavior can be configured via animateHideEffect
callback - When the hide completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation.
duration - Duration in ms of the animated hide. If unset, duration will be picked up from animateHideTime

animateShow

public void animateShow(AnimationEffect effect)
Show a canvas by growing it vertically to its fully drawn height over a period of time. This method will not fire if the widget is already drawn and visible, or has overflow other than "visible" or "hidden".

Parameters:
effect - Animation effect to use when revealing the widget. If ommitted, default behavior can be configured via animateShowEffect

animateShow

public void animateShow(AnimationEffect effect,
                        AnimationCallback callback)
Show a canvas by growing it vertically to its fully drawn height over a period of time. This method will not fire if the widget is already drawn and visible, or has overflow other than "visible" or "hidden".

Parameters:
effect - Animation effect to use when revealing the widget. If ommitted, default behavior can be configured via animateShowEffect
callback - When the show completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation.

animateShow

public void animateShow(AnimationEffect effect,
                        AnimationCallback callback,
                        int duration)
Show a canvas by growing it vertically to its fully drawn height over a period of time. This method will not fire if the widget is already drawn and visible, or has overflow other than "visible" or "hidden".

Parameters:
effect - Animation effect to use when revealing the widget. If ommitted, default behavior can be configured via animateShowEffect
callback - When the show completes this callback will be fired. Single 'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation.
duration - Duration in ms of the animated show. If unset, duration will be picked up from animateShowTime

updateShadow

public void updateShadow()
Update teh canvas shadow.


getZIndex

public int getZIndex()
Get the z-Index of this canvas.

Returns:
the zIndex

getNextZIndex

public int getNextZIndex()
get the next zIndex for the next item to be drawn. see setZIndex() for notes

Returns:
the next zIndex

setZIndex

public void setZIndex(int newIndex)
Set the z-Index of the canvas.

Parameters:
newIndex - the new zIndex to set to

setBackgroundColor

public void setBackgroundColor(java.lang.String backgroundColor)
The background color for this widget. It corresponds to the CSS background-color attribute. You can set this property to an RGB value (e.g. #22AAFF) or a named color (e.g. red) from a list of browser supported color names. Sets the background color of this widget to newColor.

Parameters:
backgroundColor - new color to set the widget's background to. Default value is null

getPageRect

public Rectangle getPageRect()

setRect

public void setRect(Rectangle rectangle)
Set all four coordinates, relative to the enclosing context, at once.

Moves the widget so that its top-left corner is at the specified top-left coordinates, then resizes it to the specified width and height.

Parameters:
rectangle - new coordinates

setRect

public void setRect(int left,
                    int top,
                    int width,
                    int height)
Set all four coordinates, relative to the enclosing context, at once.

Moves the widget so that its top-left corner is at the specified top-left coordinates, then resizes it to the specified width and height.

Parameters:
left - new left coordinate, Array of coordinates in parameter order, or Object with left, top, width, height properties. If an Array or Object is passed, the remaining parameters are ignored
top - new top coordinate
width - new width
height - new height

getRect

public Rectangle getRect()
Get all four coordinates, relative to the enclosing context, at one.

Returns:
the Rectangle

getImgURL

public static java.lang.String getImgURL(java.lang.String URL)
Return the full URL for an image to be drawn in this canvas.

If the passed URL begins with the special prefix "[SKIN]", it will have the widget.skinImgDir and Page.skinImgDir prepended. Otherwise the image is assumed to be application-specific, and will have the widget.appImgDir and Page.appImgDir automatically prepended.

Note that if passed an absolute path (starting with "/" or "http://" for example), no extra image directory information will be prepended to the generated URL.//

Parameters:
URL - URL local to skin or application image directory
Returns:
URL to use

getImgURL

public static java.lang.String getImgURL(java.lang.String URL,
                                         java.lang.String imgDir)
Return the full URL for an image to be drawn in this canvas.

If the passed URL begins with the special prefix "[SKIN]", it will have the widget.skinImgDir and Page.skinImgDir prepended. Otherwise the image is assumed to be application-specific, and will have the widget.appImgDir and Page.appImgDir automatically prepended.

Note that if passed an absolute path (starting with "/" or "http://" for example), no extra image directory information will be prepended to the generated URL.//

Parameters:
URL - URL local to skin or application image directory
imgDir - optional image directory to override the default for this Canvas
Returns:
URL to use

imgHTML

public static java.lang.String imgHTML(java.lang.String src)
Generates the HTML for an image unique to this Canvas.

The full URL for the image will be formed according to the rules documented for getImgURL(java.lang.String).

The created image will have an identifier unique to this Canvas, and subsequent calls to com.smartgwt.client.widgets.Canvas#getImage and setImage(java.lang.String, java.lang.String) with the name passed to this function will act on the image object produced by the HTML returned from this call.

Parameters:
src - URL local to the skin or application directory.
NOTE: instead of passing several parameters, you can pass an object as the 'src' parameter with properties for all the various function parameters with, eg:
canvas.imgHTML( {src:"foo", width:10, height:10} );
Returns:
HTML to draw the image.

imgHTML

public static java.lang.String imgHTML(java.lang.String src,
                                       int width,
                                       int height,
                                       java.lang.String name,
                                       java.lang.String extraStuff,
                                       java.lang.String imgDir)
Generates the HTML for an image unique to this Canvas.

The full URL for the image will be formed according to the rules documented for getImgURL(java.lang.String).

The created image will have an identifier unique to this Canvas, and subsequent calls to com.smartgwt.client.widgets.Canvas#getImage and setImage(java.lang.String, java.lang.String) with the name passed to this function will act on the image object produced by the HTML returned from this call.

Parameters:
src - URL local to the skin or application directory.
NOTE: instead of passing several parameters, you can pass an object as the 'src' parameter with properties for all the various function parameters with, eg:
canvas.imgHTML( {src:"foo", width:10, height:10} );
width - width of the image
height - height of the image
name - name for the image
extraStuff - additional attributes to write in the tag
imgDir - image-specific image directory to override the default for this Canvas
Returns:
HTML to draw the image.

imgHTML

public static java.lang.String imgHTML(java.lang.String src,
                                       int width,
                                       int height)

getScrollBottom

public int getScrollBottom()
Returns the scrollTop required to scroll vertically to the end of this widget's content.


getScrollRight

public int getScrollRight()
Returns the scrollLeft required to scroll horizontally to the end of this widget's content.


showPrintPreview

public static void showPrintPreview(Canvas component)
Show a PrintWindow containing a printable view of the components passed in components to get the print HTML for.

Parameters:
component -

setParentElement

public void setParentElement(Canvas parentElement)
                      throws java.lang.IllegalStateException
This Canvas's immediate parent, if any.
Can be initialized, but any subsequent manipulation should be via addChild(com.smartgwt.client.widgets.Canvas) and removeChild(com.smartgwt.client.widgets.Canvas) calls on the parent.

Note : This is an advanced setting

Parameters:
parentElement - parentElement Default value is null
Throws:
java.lang.IllegalStateException - this property cannot be changed after the component has been created

getParentElement

public Canvas getParentElement()
This Canvas's immediate parent, if any.
Can be initialized, but any subsequent manipulation should be via addChild(com.smartgwt.client.widgets.Canvas) and removeChild(com.smartgwt.client.widgets.Canvas) calls on the parent.

Returns:
Canvas

addChild

public void addChild(com.google.gwt.user.client.ui.Widget widget)
Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if name argument is provided, and draw the child if this widget has been drawn already.

If newChild has a parent it will be removed from it. If it has a master, it will be detached from it if the master is a child of a different parent. If newChild has peers, they'll be added to this widget as children as well.

Parameters:
newChild - new child canvas to add

setChildren

public void setChildren(Canvas... children)
Array of all Canvii that are immediate children of this Canvas.

Note : This is an advanced setting

Parameters:
children - children Default value is null

getChildren

public Canvas[] getChildren()
Array of all Canvii that are immediate children of this Canvas.

Note : This is an advanced setting


convertToCanvasArray

protected static Canvas[] convertToCanvasArray(com.google.gwt.core.client.JavaScriptObject nativeArray)

removeChild

public void removeChild(Canvas child)
Remove a child from its parent if it has one.

Parameters:
child - Child canvas to remove from this parent.

removeChild

public void removeChild(Canvas child,
                        java.lang.String name)
Remove a child from its parent if it has one.

Parameters:
child - Child canvas to remove from this parent.
name - If the child canvas was assigned a name, it should be passed in here to ensure this[name] is cleared

getOffsetHeight

public int getOffsetHeight()
Overrides:
getOffsetHeight in class com.google.gwt.user.client.ui.UIObject

getOffsetWidth

public int getOffsetWidth()
Overrides:
getOffsetWidth in class com.google.gwt.user.client.ui.UIObject

setAutoHeight

public void setAutoHeight()

setAutoWidth

public void setAutoWidth()

addDropHandler

public HandlerRegistration addDropHandler(DropHandler handler)
Add a onDrop handler.

Notification method fired when the user drops another canvas onto this one. Returning false from this method will prevent any default drop behavior from occurring

Specified by:
addDropHandler in interface HasDropHandlers
Parameters:
handler - the onDrop handler
Returns:
HandlerRegistration used to remove this handler