< prev index next >

modules/javafx.graphics/src/main/java/javafx/css/StyleConverter.java

Print this page


   1 /*
   2  * Copyright (c) 2010, 2017, 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


  32 import javafx.css.converter.DurationConverter;
  33 import javafx.css.converter.EffectConverter;
  34 import javafx.css.converter.EnumConverter;
  35 import javafx.css.converter.FontConverter;
  36 import javafx.css.converter.InsetsConverter;
  37 import javafx.css.converter.LadderConverter;
  38 import javafx.css.converter.PaintConverter;
  39 import javafx.css.converter.SizeConverter;
  40 import javafx.css.converter.StopConverter;
  41 import javafx.css.converter.StringConverter;
  42 import javafx.css.converter.URLConverter;
  43 import javafx.geometry.Insets;
  44 import javafx.scene.effect.Effect;
  45 import javafx.scene.paint.Color;
  46 import javafx.scene.paint.Paint;
  47 import javafx.scene.text.Font;
  48 import javafx.util.Duration;
  49 
  50 import com.sun.javafx.scene.layout.region.CornerRadiiConverter;
  51 import com.sun.javafx.util.Logging;
  52 import sun.util.logging.PlatformLogger;
  53 import sun.util.logging.PlatformLogger.Level;
  54 
  55 import java.io.DataInputStream;
  56 import java.io.DataOutputStream;
  57 import java.io.IOException;
  58 import java.util.ArrayList;
  59 import java.util.HashMap;
  60 import java.util.List;
  61 import java.util.Map;
  62 import java.util.WeakHashMap;
  63 
  64 
  65 /**
  66  * StyleConverter converts {@code ParsedValue<F,T>}
  67  * from type {@code F} to type {@code T}. The
  68  * {@link CssMetaData} API requires a {@code StyleConverter} which is used
  69  * when computing a value for the {@code StyleableProperty}. There are
  70  * a number of predefined converters which are accessible by the static
  71  * methods of this class.
  72  *
  73  * {@code F} is the type of the parsed value and {@code T} is the converted type of


   1 /*
   2  * Copyright (c) 2010, 2018, 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


  32 import javafx.css.converter.DurationConverter;
  33 import javafx.css.converter.EffectConverter;
  34 import javafx.css.converter.EnumConverter;
  35 import javafx.css.converter.FontConverter;
  36 import javafx.css.converter.InsetsConverter;
  37 import javafx.css.converter.LadderConverter;
  38 import javafx.css.converter.PaintConverter;
  39 import javafx.css.converter.SizeConverter;
  40 import javafx.css.converter.StopConverter;
  41 import javafx.css.converter.StringConverter;
  42 import javafx.css.converter.URLConverter;
  43 import javafx.geometry.Insets;
  44 import javafx.scene.effect.Effect;
  45 import javafx.scene.paint.Color;
  46 import javafx.scene.paint.Paint;
  47 import javafx.scene.text.Font;
  48 import javafx.util.Duration;
  49 
  50 import com.sun.javafx.scene.layout.region.CornerRadiiConverter;
  51 import com.sun.javafx.util.Logging;
  52 import com.sun.javafx.logging.PlatformLogger;
  53 import com.sun.javafx.logging.PlatformLogger.Level;
  54 
  55 import java.io.DataInputStream;
  56 import java.io.DataOutputStream;
  57 import java.io.IOException;
  58 import java.util.ArrayList;
  59 import java.util.HashMap;
  60 import java.util.List;
  61 import java.util.Map;
  62 import java.util.WeakHashMap;
  63 
  64 
  65 /**
  66  * StyleConverter converts {@code ParsedValue<F,T>}
  67  * from type {@code F} to type {@code T}. The
  68  * {@link CssMetaData} API requires a {@code StyleConverter} which is used
  69  * when computing a value for the {@code StyleableProperty}. There are
  70  * a number of predefined converters which are accessible by the static
  71  * methods of this class.
  72  *
  73  * {@code F} is the type of the parsed value and {@code T} is the converted type of


< prev index next >