com.vaadin.client.ui.colorpicker
Class VColorPickerGradient

java.lang.Object
  extended by FocusPanel
      extended by com.vaadin.client.ui.colorpicker.VColorPickerGradient
All Implemented Interfaces:
SubPartAware

public class VColorPickerGradient
extends FocusPanel
implements SubPartAware

Client side implementation for ColorPickerGradient.

Since:
7.0.0

Field Summary
static java.lang.String CLASSNAME
          Set the CSS class name to allow styling.
static java.lang.String CLASSNAME_BACKGROUND
           
static java.lang.String CLASSNAME_CLICKLAYER
           
static java.lang.String CLASSNAME_CONTAINER
           
static java.lang.String CLASSNAME_FOREGROUND
           
static java.lang.String CLASSNAME_HIGHERBOX
           
static java.lang.String CLASSNAME_LOWERBOX
           
 
Constructor Summary
VColorPickerGradient()
          Instantiates the client side component for a color picker gradient.
 
Method Summary
protected  int getCursorX()
          Returns the latest x-coordinate for pressed-down mouse cursor.
protected  int getCursorY()
          Returns the latest y-coordinate for pressed-down mouse cursor.
 com.google.gwt.user.client.Element getSubPartElement(java.lang.String subPart)
          Locates an element inside a component using the identifier provided in subPart.
 java.lang.String getSubPartName(com.google.gwt.user.client.Element subElement)
          Provides an identifier that identifies the element within the component.
 void onMouseDown(MouseDownEvent event)
           
 void onMouseMove(MouseMoveEvent event)
           
 void onMouseUp(MouseUpEvent event)
           
protected  void setBGColor(java.lang.String bgColor)
          Sets the given css color as the background.
 void setCursor(int x, int y)
          Sets the latest coordinates for pressed-down mouse cursor and updates the cross elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
Set the CSS class name to allow styling.

See Also:
Constant Field Values

CLASSNAME_BACKGROUND

public static final java.lang.String CLASSNAME_BACKGROUND
See Also:
Constant Field Values

CLASSNAME_FOREGROUND

public static final java.lang.String CLASSNAME_FOREGROUND
See Also:
Constant Field Values

CLASSNAME_LOWERBOX

public static final java.lang.String CLASSNAME_LOWERBOX
See Also:
Constant Field Values

CLASSNAME_HIGHERBOX

public static final java.lang.String CLASSNAME_HIGHERBOX
See Also:
Constant Field Values

CLASSNAME_CONTAINER

public static final java.lang.String CLASSNAME_CONTAINER
See Also:
Constant Field Values

CLASSNAME_CLICKLAYER

public static final java.lang.String CLASSNAME_CLICKLAYER
See Also:
Constant Field Values
Constructor Detail

VColorPickerGradient

public VColorPickerGradient()
Instantiates the client side component for a color picker gradient.

Method Detail

getCursorX

protected int getCursorX()
Returns the latest x-coordinate for pressed-down mouse cursor.


getCursorY

protected int getCursorY()
Returns the latest y-coordinate for pressed-down mouse cursor.


setBGColor

protected void setBGColor(java.lang.String bgColor)
Sets the given css color as the background.

Parameters:
bgColor -

onMouseDown

public void onMouseDown(MouseDownEvent event)

onMouseUp

public void onMouseUp(MouseUpEvent event)

onMouseMove

public void onMouseMove(MouseMoveEvent event)

setCursor

public void setCursor(int x,
                      int y)
Sets the latest coordinates for pressed-down mouse cursor and updates the cross elements.

Parameters:
x -
y -

getSubPartElement

public com.google.gwt.user.client.Element getSubPartElement(java.lang.String subPart)
Description copied from interface: SubPartAware
Locates an element inside a component using the identifier provided in subPart. The subPart identifier is component specific and may be any string of characters, numbers, space characters and brackets.

Specified by:
getSubPartElement in interface SubPartAware
Parameters:
subPart - The identifier for the element inside the component
Returns:
The element identified by subPart or null if the element could not be found.

getSubPartName

public java.lang.String getSubPartName(com.google.gwt.user.client.Element subElement)
Description copied from interface: SubPartAware
Provides an identifier that identifies the element within the component. The subElement is a part of the component and must never be null.

Note! getSubPartElement(getSubPartName(element)) == element is not always true. A component can choose to provide a more generic identifier for any given element if the results of all interactions with subElement are the same as interactions with the element identified by the return value. For example a button can return an identifier for the root element even though a DIV inside the button was passed as subElement because interactions with the DIV and the root button element produce the same result.

Specified by:
getSubPartName in interface SubPartAware
Parameters:
subElement - The element the identifier string should uniquely identify
Returns:
An identifier that uniquely identifies subElement or null if no identifier could be provided.


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.