Class ColorPickerSkin

All Implemented Interfaces:

public class ColorPickerSkin
extends ComboBoxPopupControl<Color>
Default skin implementation for the ColorPicker control.
See Also:
  • 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.
      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>>
      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.
      computePrefWidth in class ComboBoxBaseSkin<Color>
      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
      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>
      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.
      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>
      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.
      layoutChildren in class ComboBoxBaseSkin<Color>
      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.
      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.
      getCssMetaData in class SkinBase<ComboBoxBase<Color>>
      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>
      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>
      the editor