Module javafx.controls
Package javafx.scene.control.skin

# Class ColorPickerSkin

java.lang.Object
javafx.scene.control.SkinBase<ComboBoxBase<Color>>
javafx.scene.control.skin.ComboBoxBaseSkin<Color>
javafx.scene.control.skin.ComboBoxPopupControl<Color>
javafx.scene.control.skin.ColorPickerSkin

All Implemented Interfaces:
  `Skin<ComboBoxBase<Color>>`

public class ColorPickerSkin extends ComboBoxPopupControl<Color>
Default skin implementation for the `ColorPicker` control.

Since:
  9
See Also:
  - `ColorPicker`

## Constructor Summary

Constructors
Constructor
Description
`ColorPickerSkin(ColorPicker control)`
Creates a new ColorPickerSkin instance, installing the necessary child nodes into the Control `children` list, as well as the necessary input mappings for handling key, mouse, etc events.

## Method Summary

Modifier and Type
Method
Description
`protected double`
`computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)`
Calculates the preferred width of this `SkinBase`.
`void`
`dispose()`
Called by a Skinnable when the Skin is replaced on the Skinnable.
`static List<CssMetaData<? extends Styleable,?>>`
`getClassCssMetaData()`
Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
`protected StringConverter<Color>`
`getConverter()`
Subclasses are responsible for getting the converter.
`List<CssMetaData<? extends Styleable,?>>`
`getCssMetaData()`
This method should delegate to `Node.getClassCssMetaData()` so that a Node's CssMetaData can be accessed without the need for reflection.
`Node`
`getDisplayNode()`
This method should return a Node that will be positioned within the ComboBox 'button' area.
`protected TextField`
`getEditor()`
ColorPicker does not use a main text field, so this method has been overridden to return null.
`protected Node`
`getPopupContent()`
This method should return the Node that will be displayed when the user clicks on the ComboBox 'button' area.
`protected void`
`layoutChildren(double x, double y, double w, double h)`
Called during the layout pass of the scenegraph.
`void`
`show()`
This method will be called when the ComboBox popup should be displayed.

### Methods inherited from class javafx.scene.control.skin.ComboBoxPopupControl

`hide`

### Methods inherited from class javafx.scene.control.skin.ComboBoxBaseSkin

`computeBaselineOffset, computeMaxHeight, computeMaxWidth, computePrefHeight`

### Methods inherited from class javafx.scene.control.SkinBase

`computeMinHeight, computeMinWidth, consumeMouseEvents, executeAccessibleAction, getChildren, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, queryAccessibleAttribute, registerChangeListener, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ColorPickerSkin

public ColorPickerSkin(ColorPicker control)
Creates a new ColorPickerSkin instance, installing the necessary child nodes into the Control `children` list, as well as the necessary input mappings for handling key, mouse, etc events.

Parameters:
  `control` - The control that this skin should be installed onto.

## Method Details

### dispose

public void dispose()
Called by a Skinnable when the Skin is replaced on the Skinnable. This method allows a Skin to implement any logic necessary to clean up itself after the Skin is no longer needed. It may be used to release native resources. The methods `Skin.getSkinnable()` and `Skin.getNode()` should return null following a call to dispose. Calling dispose twice has no effect.

Specified by:
  `dispose` in interface `Skin<ComboBoxBase<Color>>`
Overrides:
  `dispose` in class `SkinBase<ComboBoxBase<Color>>`

### computePrefWidth

protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
Calculates the preferred width of this `SkinBase`. The default implementation calculates this width as the width of the area occupied by its managed children when they are positioned at their current positions at their preferred widths.

Overrides:
  `computePrefWidth` in class `ComboBoxBaseSkin<Color>`
Parameters:
  `height` - the height that should be used if preferred width depends on it
  `topInset` - the pixel snapped top inset
  `rightInset` - the pixel snapped right inset
  `bottomInset` - the pixel snapped bottom inset
  `leftInset` - the pixel snapped left inset
Returns:
  the calculated preferred width

### getPopupContent

protected Node getPopupContent()
This method should return the Node that will be displayed when the user clicks on the ComboBox 'button' area.

Specified by:
  `getPopupContent` in class `ComboBoxPopupControl<Color>`
Returns:
  the Node that will be displayed when the user clicks on the ComboBox 'button' area

### show

public void show()
This method will be called when the ComboBox popup should be displayed. It is up to specific skin implementations to determine how this is handled.

Overrides:
  `show` in class `ComboBoxPopupControl<Color>`

### getDisplayNode

public Node getDisplayNode()
This method should return a Node that will be positioned within the ComboBox 'button' area.

Specified by:
  `getDisplayNode` in class `ComboBoxBaseSkin<Color>`
Returns:
  the node that will be positioned within the ComboBox 'button' area

### layoutChildren

protected void layoutChildren(double x, double y, double w, double h)
Called during the layout pass of the scenegraph.

Overrides:
  `layoutChildren` in class `ComboBoxBaseSkin<Color>`
Parameters:
  `x` - the x position
  `y` - the y position
  `w` - the width
  `h` - the height

### getClassCssMetaData

public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

Returns:
  the CssMetaData associated with this class, which may include the CssMetaData of its superclasses

### getCssMetaData

public List<CssMetaData<? extends Styleable,?>> getCssMetaData()
This method should delegate to `Node.getClassCssMetaData()` so that a Node's CssMetaData can be accessed without the need for reflection.

Overrides:
  `getCssMetaData` in class `SkinBase<ComboBoxBase<Color>>`
Returns:
  The CssMetaData associated with this node, which may include the CssMetaData of its superclasses.

### getConverter

protected StringConverter<Color> getConverter()
Subclasses are responsible for getting the converter. This will be removed in FX 9 when the converter property is moved up to ComboBoxBase with JDK-8130354.

Specified by:
  `getConverter` in class `ComboBoxPopupControl<Color>`
Returns:
  the string converter

### getEditor

protected TextField getEditor()
ColorPicker does not use a main text field, so this method has been overridden to return null.

Specified by:
  `getEditor` in class `ComboBoxPopupControl<Color>`
Returns:
  the editor