Class EdgedCanvas

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClearHandlers, 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, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers

public class EdgedCanvas extends Canvas
EdgedCanvas acts as a decorative, image-based frame around another single Canvas.
See Also:
  • Constructor Details

    • EdgedCanvas

      public EdgedCanvas()
    • EdgedCanvas

      public EdgedCanvas(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static EdgedCanvas getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class Canvas
    • setAddEdgeStyleSuffix

      public EdgedCanvas setAddEdgeStyleSuffix(Boolean addEdgeStyleSuffix)
      If specified, the edgeStyleName will be treated as a base style name and appended with following suffixes to support separate styling per cell:

      _TL (top left cell)
      _T (top center cell)
      _TR (top right cell)
      _L (middle left cell)
      _C (center cell)
      _R (middle right cell)
      _BL (bottom left cell)
      _B (bottom center cell)
      _BR (bottom right cell)

      Parameters:
      addEdgeStyleSuffix - New addEdgeStyleSuffix value. Default value is false
      Returns:
      EdgedCanvas instance, for chaining setter calls
    • getAddEdgeStyleSuffix

      public Boolean getAddEdgeStyleSuffix()
      If specified, the edgeStyleName will be treated as a base style name and appended with following suffixes to support separate styling per cell:

      _TL (top left cell)
      _T (top center cell)
      _TR (top right cell)
      _L (middle left cell)
      _C (center cell)
      _R (middle right cell)
      _BL (bottom left cell)
      _B (bottom center cell)
      _BR (bottom right cell)

      Returns:
      Current addEdgeStyleSuffix value. Default value is false
    • setCenterBackgroundColor

      public EdgedCanvas setCenterBackgroundColor(String centerBackgroundColor) throws 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:
      centerBackgroundColor - New centerBackgroundColor value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getCenterBackgroundColor

      public String getCenterBackgroundColor()
      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:
      Current centerBackgroundColor value. Default value is null
      See Also:
    • setEdgeBottom

      public EdgedCanvas setEdgeBottom(Integer edgeBottom) throws IllegalStateException
      Height in pixels for bottom corners and edges. Defaults to edgeSize when unset.
      Parameters:
      edgeBottom - New edgeBottom value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEdgeBottom

      public Integer getEdgeBottom()
      Height in pixels for bottom corners and edges. Defaults to edgeSize when unset.
      Returns:
      Current edgeBottom value. Default value is null
    • setEdgeColor

      public EdgedCanvas setEdgeColor(String edgeColor) throws IllegalStateException
      CSS color (WITHOUT "#") for the edges. If specified, will be used as part of image names. Example: "edge_88FF88_TL.gif".
      Parameters:
      edgeColor - New edgeColor value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getEdgeColor

      public String getEdgeColor()
      CSS color (WITHOUT "#") for the edges. If specified, will be used as part of image names. Example: "edge_88FF88_TL.gif".
      Returns:
      Current edgeColor value. Default value is null
      See Also:
    • setEdgeImage

      public EdgedCanvas setEdgeImage(String edgeImage) throws 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".

      Overrides:
      setEdgeImage in class Canvas
      Parameters:
      edgeImage - New edgeImage value. Default value is "[SKIN]/rounded/frame/FFFFFF/6.png"
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getEdgeImage

      public 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".

      Overrides:
      getEdgeImage in class Canvas
      Returns:
      Current edgeImage value. Default value is "[SKIN]/rounded/frame/FFFFFF/6.png"
      See Also:
    • setEdgeLeft

      public EdgedCanvas setEdgeLeft(Integer edgeLeft) throws IllegalStateException
      Height in pixels for left corners and edges. Defaults to edgeSize when unset.
      Parameters:
      edgeLeft - New edgeLeft value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEdgeLeft

      public Integer getEdgeLeft()
      Height in pixels for left corners and edges. Defaults to edgeSize when unset.
      Returns:
      Current edgeLeft value. Default value is null
    • setEdgeOffsetBottom

      public EdgedCanvas setEdgeOffsetBottom(Integer edgeOffsetBottom) throws IllegalStateException
      Amount the contained Canvas should be offset from the bottom. Defaults to the size for the bottom edge. Set smaller to allow the contained Canvas to overlap the edge and corner media.

      Note : This is an advanced setting

      Parameters:
      edgeOffsetBottom - New edgeOffsetBottom value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEdgeOffsetBottom

      public Integer getEdgeOffsetBottom()
      Amount the contained Canvas should be offset from the bottom. Defaults to the size for the bottom edge. Set smaller to allow the contained Canvas to overlap the edge and corner media.
      Returns:
      Current edgeOffsetBottom value. Default value is null
    • setEdgeOffsetLeft

      public EdgedCanvas setEdgeOffsetLeft(Integer edgeOffsetLeft) throws IllegalStateException
      Amount the contained Canvas should be offset from the left. Defaults to the size for the left edge. Set smaller to allow the contained Canvas to overlap the edge and corner media.

      Note : This is an advanced setting

      Parameters:
      edgeOffsetLeft - New edgeOffsetLeft value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEdgeOffsetLeft

      public Integer getEdgeOffsetLeft()
      Amount the contained Canvas should be offset from the left. Defaults to the size for the left edge. Set smaller to allow the contained Canvas to overlap the edge and corner media.
      Returns:
      Current edgeOffsetLeft value. Default value is null
    • setEdgeOffsetRight

      public EdgedCanvas setEdgeOffsetRight(Integer edgeOffsetRight) throws IllegalStateException
      Amount the contained Canvas should be offset from the right. Defaults to the size for the right edge. Set smaller to allow the contained Canvas to overlap the edge and corner media.

      Note : This is an advanced setting

      Parameters:
      edgeOffsetRight - New edgeOffsetRight value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEdgeOffsetRight

      public Integer getEdgeOffsetRight()
      Amount the contained Canvas should be offset from the right. Defaults to the size for the right edge. Set smaller to allow the contained Canvas to overlap the edge and corner media.
      Returns:
      Current edgeOffsetRight value. Default value is null
    • setEdgeOffsetTop

      public EdgedCanvas setEdgeOffsetTop(Integer edgeOffsetTop) throws IllegalStateException
      Amount the contained Canvas should be offset from the top. Defaults to the size for the top edge. Set smaller to allow the contained Canvas to overlap the edge and corner media.

      Note : This is an advanced setting

      Parameters:
      edgeOffsetTop - New edgeOffsetTop value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEdgeOffsetTop

      public Integer getEdgeOffsetTop()
      Amount the contained Canvas should be offset from the top. Defaults to the size for the top edge. Set smaller to allow the contained Canvas to overlap the edge and corner media.
      Returns:
      Current edgeOffsetTop value. Default value is null
    • setEdgeRight

      public EdgedCanvas setEdgeRight(Integer edgeRight) throws IllegalStateException
      Height in pixels for right corners and edges. Defaults to edgeSize when unset.
      Parameters:
      edgeRight - New edgeRight value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEdgeRight

      public Integer getEdgeRight()
      Height in pixels for right corners and edges. Defaults to edgeSize when unset.
      Returns:
      Current edgeRight value. Default value is null
    • setEdgeStyleName

      public EdgedCanvas setEdgeStyleName(String edgeStyleName)
      Optional property specifying the CSS ClassName to apply to the various parts of this edged canvas (top, bottom, corners, sides and center). To apply separate styles for each part, use addEdgeStyleSuffix.
      Parameters:
      edgeStyleName - New edgeStyleName value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      See Also:
    • getEdgeStyleName

      public String getEdgeStyleName()
      Optional property specifying the CSS ClassName to apply to the various parts of this edged canvas (top, bottom, corners, sides and center). To apply separate styles for each part, use addEdgeStyleSuffix.
      Returns:
      Current edgeStyleName value. Default value is null
      See Also:
    • setEdgeTop

      public EdgedCanvas setEdgeTop(Integer edgeTop) throws IllegalStateException
      Height in pixels for top corners and edges. Defaults to edgeSize when unset.
      Parameters:
      edgeTop - New edgeTop value. Default value is null
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEdgeTop

      public Integer getEdgeTop()
      Height in pixels for top corners and edges. Defaults to edgeSize when unset.
      Returns:
      Current edgeTop value. Default value is null
    • setShowCenter

      public EdgedCanvas setShowCenter(Boolean showCenter) throws IllegalStateException
      Whether to show media in the center section, that is, behind the decorated Canvas.
      Parameters:
      showCenter - New showCenter value. Default value is false
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowCenter

      public Boolean getShowCenter()
      Whether to show media in the center section, that is, behind the decorated Canvas.
      Returns:
      Current showCenter value. Default value is false
    • setSkinImgDir

      public EdgedCanvas setSkinImgDir(String skinImgDir) throws IllegalStateException
      Standard skin directory for edge images (sides and corners).
      Overrides:
      setSkinImgDir in class Canvas
      Parameters:
      skinImgDir - New skinImgDir value. Default value is "images/edges/"
      Returns:
      EdgedCanvas instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getSkinImgDir

      public String getSkinImgDir()
      Standard skin directory for edge images (sides and corners).
      Overrides:
      getSkinImgDir in class Canvas
      Returns:
      Current skinImgDir value. Default value is "images/edges/"
      See Also:
    • setDefaultProperties

      public static void setDefaultProperties(EdgedCanvas edgedCanvasProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      edgedCanvasProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • preloadImages

      public static void preloadImages()
      Preload primary EdgedCanvas images.
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(EdgedCanvasLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class Canvas