modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ColorPickerSkin.java

Print this page
rev 8726 : [mq]: rt40280
   1 /*
   2  * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  38 import java.util.Collections;
  39 import java.util.List;
  40 import java.util.Locale;
  41 
  42 import javafx.css.StyleableDoubleProperty;
  43 import javafx.css.StyleableStringProperty;
  44 import javafx.geometry.Pos;
  45 import javafx.scene.Node;
  46 import javafx.scene.image.ImageView;
  47 import javafx.scene.layout.StackPane;
  48 import javafx.scene.shape.Rectangle;
  49 
  50 import com.sun.javafx.css.converters.SizeConverter;
  51 import com.sun.javafx.css.converters.StringConverter;
  52 import com.sun.javafx.scene.control.behavior.ColorPickerBehavior;
  53 
  54 import java.util.HashMap;
  55 import java.util.Map;
  56 
  57 import javafx.scene.control.ColorPicker;

  58 import javafx.beans.property.BooleanProperty;
  59 import javafx.beans.value.WritableValue;
  60 import javafx.css.Styleable;
  61 import javafx.css.StyleableProperty;
  62 import javafx.event.ActionEvent;
  63 import javafx.scene.control.Label;
  64 import javafx.scene.paint.Color;
  65 
  66 import com.sun.javafx.scene.control.skin.resources.ControlResources;
  67 
  68 import static javafx.scene.paint.Color.*;
  69 
  70 /**
  71  *
  72  */
  73 public class ColorPickerSkin extends ComboBoxPopupControl<Color> {
  74 
  75     private Label displayNode; 
  76     private StackPane pickerColorBox;
  77     private Rectangle colorRect; 


 641             STYLEABLES = Collections.unmodifiableList(styleables);
 642         }
 643     }
 644      
 645     /**
 646      * @return The CssMetaData associated with this class, which may include the
 647      * CssMetaData of its super classes.
 648      */
 649     public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData() {
 650         return StyleableProperties.STYLEABLES;
 651     }
 652 
 653     /**
 654      * {@inheritDoc}
 655      */
 656     @Override
 657     public List<CssMetaData<? extends Styleable, ?>> getCssMetaData() {
 658         return getClassCssMetaData();
 659     }
 660 










 661 }
   1 /*
   2  * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  38 import java.util.Collections;
  39 import java.util.List;
  40 import java.util.Locale;
  41 
  42 import javafx.css.StyleableDoubleProperty;
  43 import javafx.css.StyleableStringProperty;
  44 import javafx.geometry.Pos;
  45 import javafx.scene.Node;
  46 import javafx.scene.image.ImageView;
  47 import javafx.scene.layout.StackPane;
  48 import javafx.scene.shape.Rectangle;
  49 
  50 import com.sun.javafx.css.converters.SizeConverter;
  51 import com.sun.javafx.css.converters.StringConverter;
  52 import com.sun.javafx.scene.control.behavior.ColorPickerBehavior;
  53 
  54 import java.util.HashMap;
  55 import java.util.Map;
  56 
  57 import javafx.scene.control.ColorPicker;
  58 import javafx.scene.control.TextField;
  59 import javafx.beans.property.BooleanProperty;
  60 import javafx.beans.value.WritableValue;
  61 import javafx.css.Styleable;
  62 import javafx.css.StyleableProperty;
  63 import javafx.event.ActionEvent;
  64 import javafx.scene.control.Label;
  65 import javafx.scene.paint.Color;
  66 
  67 import com.sun.javafx.scene.control.skin.resources.ControlResources;
  68 
  69 import static javafx.scene.paint.Color.*;
  70 
  71 /**
  72  *
  73  */
  74 public class ColorPickerSkin extends ComboBoxPopupControl<Color> {
  75 
  76     private Label displayNode; 
  77     private StackPane pickerColorBox;
  78     private Rectangle colorRect; 


 642             STYLEABLES = Collections.unmodifiableList(styleables);
 643         }
 644     }
 645      
 646     /**
 647      * @return The CssMetaData associated with this class, which may include the
 648      * CssMetaData of its super classes.
 649      */
 650     public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData() {
 651         return StyleableProperties.STYLEABLES;
 652     }
 653 
 654     /**
 655      * {@inheritDoc}
 656      */
 657     @Override
 658     public List<CssMetaData<? extends Styleable, ?>> getCssMetaData() {
 659         return getClassCssMetaData();
 660     }
 661 
 662     @Override protected javafx.util.StringConverter<Color> getConverter() {
 663         return null;
 664     }
 665 
 666     /**
 667      * ColorPicker does not use a main text field.
 668      */
 669     @Override protected TextField getEditor() {
 670         return null;
 671     }
 672 }