Class PointerSettings

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure

public class PointerSettings extends BaseWidget
A set of properties that can be used to configure a canvas pointer.
  • Constructor Details

    • PointerSettings

      public PointerSettings()
    • PointerSettings

      public PointerSettings(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static PointerSettings 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 BaseWidget
    • setColor

      public PointerSettings setColor(String color) throws IllegalStateException
      By default, the pointer will assume the same color as its parent canvas. Set this attribute to enforce a custom color for the pointer.
      Parameters:
      color - New color value. Default value is null
      Returns:
      PointerSettings instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getColor

      public String getColor()
      By default, the pointer will assume the same color as its parent canvas. Set this attribute to enforce a custom color for the pointer.
      Returns:
      Current color value. Default value is null
      See Also:
    • setCornerOffset

      public PointerSettings setCornerOffset(Integer cornerOffset) throws IllegalStateException
      Specifies the amount of offset in pixels from the corner to position the pointer when snapTo is TL, TR, BL or BR. This is useful for a canvas with a rounded corner.
      Parameters:
      cornerOffset - New cornerOffset value. Default value is null
      Returns:
      PointerSettings instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getCornerOffset

      public Integer getCornerOffset()
      Specifies the amount of offset in pixels from the corner to position the pointer when snapTo is TL, TR, BL or BR. This is useful for a canvas with a rounded corner.
      Returns:
      Current cornerOffset value. Default value is null
    • setShowShadow

      public PointerSettings setShowShadow(Boolean showShadow) throws IllegalStateException
      By default, the pointer will show the same shadow as its parent canvas. Set showShadow to false to render the pointer without a shadow.
      Parameters:
      showShadow - New showShadow value. Default value is null
      Returns:
      PointerSettings instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowShadow

      public Boolean getShowShadow()
      By default, the pointer will show the same shadow as its parent canvas. Set showShadow to false to render the pointer without a shadow.
      Returns:
      Current showShadow value. Default value is null
    • setSnapOffsetLeft

      public PointerSettings setSnapOffsetLeft(Integer snapOffsetLeft) throws IllegalStateException
      If snapTo is defined, this property can be used to specify an offset in px or percentage for the left coordinate of the pointer.

      For example if snapTo is specified as "L" and snapOffsetLeft is set to 6, the pointer will be rendered 6px inside the left edge of the window. Alternatively if snapTo was set to "R", a snapOffsetLeft value of -6 would cause the pointer to be rendered 6px inside the right edge of the window.

      Parameters:
      snapOffsetLeft - New snapOffsetLeft value. Default value is null
      Returns:
      PointerSettings instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getSnapOffsetLeft

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

      For example if snapTo is specified as "L" and snapOffsetLeft is set to 6, the pointer will be rendered 6px inside the left edge of the window. Alternatively if snapTo was set to "R", a snapOffsetLeft value of -6 would cause the pointer to be rendered 6px inside the right edge of the window.

      Returns:
      Current snapOffsetLeft value. Default value is null
      See Also:
    • setSnapOffsetTop

      public PointerSettings setSnapOffsetTop(Integer snapOffsetTop) throws IllegalStateException
      If snapTo is defined, this property can be used to specify an offset in px or percentage for the top coordinate of the pointer.

      For example if snapTo is specified as "T" and snapOffsetTop is set to 6, the pointer will be rendered 6px below the top edge of the window. Alternatively if snapTo was set to "B", a snapOffsetTop value of -6 would cause the pointer to be rendered 6px inside the bottom edge of the window.

      Parameters:
      snapOffsetTop - New snapOffsetTop value. Default value is null
      Returns:
      PointerSettings instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getSnapOffsetTop

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

      For example if snapTo is specified as "T" and snapOffsetTop is set to 6, the pointer will be rendered 6px below the top edge of the window. Alternatively if snapTo was set to "B", a snapOffsetTop value of -6 would cause the pointer to be rendered 6px inside the bottom edge of the window.

      Returns:
      Current snapOffsetTop value. Default value is null
      See Also:
    • setSnapTo

      public PointerSettings setSnapTo(String snapTo) throws IllegalStateException
      Specifies the position of the pointer when showing. Accepts similar values as Canvas.snapTo.

      Possible basic values: TL, TR, LT, LB, RT, RB, BL, BR, R, L, B, T where B=Bottom, T=Top, L=Left, R=right. The first letter indicates the edge and the second optional letter indicates the placement along the edge.

      In addition to the basic values above, two different basic values can be combined with a separating slash (/) to position the pointer between the two locations giving more precise control. For example, BL/L positions the pointer along the bottom edge halfway between the bottom-left and the bottom-center.

      If Canvas.showPointer is enabled and a Canvas.pointerTarget is specified but snapTo is null, a reasonable location is calculated based on the location of the pointerTarget.

      Parameters:
      snapTo - New snapTo value. Default value is null
      Returns:
      PointerSettings instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getSnapTo

      public String getSnapTo()
      Specifies the position of the pointer when showing. Accepts similar values as Canvas.snapTo.

      Possible basic values: TL, TR, LT, LB, RT, RB, BL, BR, R, L, B, T where B=Bottom, T=Top, L=Left, R=right. The first letter indicates the edge and the second optional letter indicates the placement along the edge.

      In addition to the basic values above, two different basic values can be combined with a separating slash (/) to position the pointer between the two locations giving more precise control. For example, BL/L positions the pointer along the bottom edge halfway between the bottom-left and the bottom-center.

      If Canvas.showPointer is enabled and a Canvas.pointerTarget is specified but snapTo is null, a reasonable location is calculated based on the location of the pointerTarget.

      Returns:
      Current snapTo value. Default value is null
      See Also:
    • setTargetOffsetInto

      public PointerSettings setTargetOffsetInto(Integer targetOffsetInto) throws IllegalStateException
      If targetSnapTo is defined, this property can be used to specify an offset in px or percentage for the coordinate of the pointer into the Canvas.pointerTarget.

      While targetOffsetLeft and targetOffsetTop can be used to fine tune the pointer's target position the user must be aware of the orientation of the pointer. Instead, this property will be applied to the correct offset so that the pointer points inside (or outside if negative) the target.

      For example if targetSnapTo is specified as "L" and targetOffsetInto is set to 6, the pointer will be rendered 6px inside the left edge of the position target.

      Parameters:
      targetOffsetInto - New targetOffsetInto value. Default value is null
      Returns:
      PointerSettings instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getTargetOffsetInto

      public Integer getTargetOffsetInto()
      If targetSnapTo is defined, this property can be used to specify an offset in px or percentage for the coordinate of the pointer into the Canvas.pointerTarget.

      While targetOffsetLeft and targetOffsetTop can be used to fine tune the pointer's target position the user must be aware of the orientation of the pointer. Instead, this property will be applied to the correct offset so that the pointer points inside (or outside if negative) the target.

      For example if targetSnapTo is specified as "L" and targetOffsetInto is set to 6, the pointer will be rendered 6px inside the left edge of the position target.

      Returns:
      Current targetOffsetInto value. Default value is null
      See Also:
    • setTargetOffsetLeft

      public PointerSettings setTargetOffsetLeft(Integer targetOffsetLeft) throws IllegalStateException
      If targetSnapTo is defined, this property can be used to specify an offset in px or percentage for the left coordinate of the pointer.

      For example if targetSnapTo is specified as "L" and targetOffsetLeft is set to 6, the pointer will be rendered 6px inside the left edge of the pointer target canvas. Alternatively if targetSnapTo was set to "R", a targetOffsetLeft value of -6 would cause the pointer to be rendered 6px inside the right edge of the pointer target canvas.

      Note that targetOffsetInto is likely more suitable for simple customizations.

      Parameters:
      targetOffsetLeft - New targetOffsetLeft value. Default value is null
      Returns:
      PointerSettings instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getTargetOffsetLeft

      public Integer getTargetOffsetLeft()
      If targetSnapTo is defined, this property can be used to specify an offset in px or percentage for the left coordinate of the pointer.

      For example if targetSnapTo is specified as "L" and targetOffsetLeft is set to 6, the pointer will be rendered 6px inside the left edge of the pointer target canvas. Alternatively if targetSnapTo was set to "R", a targetOffsetLeft value of -6 would cause the pointer to be rendered 6px inside the right edge of the pointer target canvas.

      Note that targetOffsetInto is likely more suitable for simple customizations.

      Returns:
      Current targetOffsetLeft value. Default value is null
      See Also:
    • setTargetOffsetTop

      public PointerSettings setTargetOffsetTop(Integer targetOffsetTop) throws IllegalStateException
      If targetSnapTo is defined, this property can be used to specify an offset in px or percentage for the top coordinate of the pointer.

      For example if targetSnapTo is specified as "T" and targetOffsetTop is set to 6, the pointer will be rendered 6px below the top edge of the pointer target canvas. Alternatively if targetSnapTo was set to "B", a targetOffsetTop value of -6 would cause the pointer to be rendered 6px inside the bottom edge of the pointer target canvas.

      Note that targetOffsetInto is likely more suitable for simple customizations.

      Parameters:
      targetOffsetTop - New targetOffsetTop value. Default value is null
      Returns:
      PointerSettings instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getTargetOffsetTop

      public Integer getTargetOffsetTop()
      If targetSnapTo is defined, this property can be used to specify an offset in px or percentage for the top coordinate of the pointer.

      For example if targetSnapTo is specified as "T" and targetOffsetTop is set to 6, the pointer will be rendered 6px below the top edge of the pointer target canvas. Alternatively if targetSnapTo was set to "B", a targetOffsetTop value of -6 would cause the pointer to be rendered 6px inside the bottom edge of the pointer target canvas.

      Note that targetOffsetInto is likely more suitable for simple customizations.

      Returns:
      Current targetOffsetTop value. Default value is null
      See Also:
    • setTargetSnapTo

      public PointerSettings setTargetSnapTo(String targetSnapTo) throws IllegalStateException
      Specifies the position of the pointer into the target when showing. Accepts the same values as snapTo.

      If not specified the center location on the appropriate edge is chosen to match up with the snapTo value.

      Parameters:
      targetSnapTo - New targetSnapTo value. Default value is null
      Returns:
      PointerSettings instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getTargetSnapTo

      public String getTargetSnapTo()
      Specifies the position of the pointer into the target when showing. Accepts the same values as snapTo.

      If not specified the center location on the appropriate edge is chosen to match up with the snapTo value.

      Returns:
      Current targetSnapTo value. Default value is null
      See Also:
    • setDefaultProperties

      public static void setDefaultProperties(PointerSettings pointerSettingsProperties)
      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:
      pointerSettingsProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      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 BaseWidget