make/jdk/src/classes/build/tools/generatenimbus/UIStyle.java
author vlivanov
Thu, 18 Jan 2018 02:25:18 +0300
changeset 48596 860326263d1f
parent 47389 18c850407be9
permissions -rw-r--r--
8194963: SystemDictionary::link_method_handle_constant() can't link MethodHandle.invoke()/invokeExact() Reviewed-by: kvn, psandoz
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 21805
diff changeset
     2
 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
     4
 *
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3742
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3742
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    10
 *
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    15
 * accompanied this code).
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    16
 *
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3742
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3742
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3742
diff changeset
    23
 * questions.
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    24
 */
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    25
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    26
package build.tools.generatenimbus;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    27
47389
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    28
import javax.xml.stream.XMLStreamException;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    29
import javax.xml.stream.XMLStreamReader;
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    30
import java.util.ArrayList;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    31
import java.util.List;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    32
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    33
class UIStyle {
47389
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    34
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    35
    public enum CacheMode {
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    36
        NO_CACHING, FIXED_SIZES, NINE_SQUARE_SCALE
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    37
    }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    38
47389
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    39
    private UIColor textForeground = null;
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    40
    private boolean textForegroundInherited = true;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    41
47389
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    42
    private UIColor textBackground = null;
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    43
    private boolean textBackgroundInherited = true;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    44
47389
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    45
    private UIColor background = null;
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    46
    private boolean backgroundInherited = true;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    47
47389
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    48
    private boolean cacheSettingsInherited = true;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    49
    CacheMode cacheMode = CacheMode.FIXED_SIZES;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    50
    String maxHozCachedImgScaling = "1.0";
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    51
    String maxVertCachedImgScaling = "1.0";
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    52
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    53
    private List<UIProperty> uiProperties = new ArrayList<>();
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    54
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    55
    UIStyle() {
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    56
    }
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
    57
47389
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    58
    UIStyle(XMLStreamReader reader) throws XMLStreamException {
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    59
        while (reader.hasNext()) {
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    60
            int eventType = reader.next();
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    61
            switch (eventType) {
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    62
                case XMLStreamReader.START_ELEMENT:
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    63
                    switch (reader.getLocalName()) {
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    64
                        case "textForeground":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    65
                            textForeground = new UIColor(reader);
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    66
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    67
                        case "textBackground":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    68
                            textBackground = new UIColor(reader);
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    69
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    70
                        case "background":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    71
                            background = new UIColor(reader);
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    72
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    73
                        case "uiProperty":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    74
                            uiProperties.add(new UIProperty(reader));
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    75
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    76
                        case "inherit-textForeground":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    77
                            textForegroundInherited = Boolean.parseBoolean(reader.getElementText());
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    78
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    79
                        case "inherit-textBackground":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    80
                            textBackgroundInherited = Boolean.parseBoolean(reader.getElementText());
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    81
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    82
                        case "cacheSettingsInherited":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    83
                            cacheSettingsInherited = Boolean.parseBoolean(reader.getElementText());
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    84
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    85
                        case "inherit-background":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    86
                            backgroundInherited = Boolean.parseBoolean(reader.getElementText());
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    87
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    88
                        case "cacheMode":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    89
                            cacheMode = CacheMode.valueOf(reader.getElementText());
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    90
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    91
                        case "maxHozCachedImgScaling":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    92
                            maxHozCachedImgScaling = reader.getElementText();
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    93
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    94
                        case "maxVertCachedImgScaling":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    95
                            maxVertCachedImgScaling = reader.getElementText();
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    96
                            break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    97
                    }
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    98
                    break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
    99
                case XMLStreamReader.END_ELEMENT:
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
   100
                    switch (reader.getLocalName()) {
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
   101
                        case "style":
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
   102
                            return;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
   103
                    }
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
   104
                    break;
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
   105
            }
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
   106
        }
18c850407be9 8187599: Remove dependency of Building Nimbus L&F on JAXB
ssadetsky
parents: 47216
diff changeset
   107
    }
3742
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   108
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   109
    private UIStyle parentStyle = null;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   110
    public void setParentStyle(UIStyle parentStyle) {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   111
        this.parentStyle = parentStyle;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   112
    }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   113
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   114
    public CacheMode getCacheMode() {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   115
        if (cacheSettingsInherited) {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   116
            return (parentStyle == null ?
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   117
                CacheMode.FIXED_SIZES : parentStyle.getCacheMode());
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   118
        } else {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   119
            return cacheMode;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   120
        }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   121
    }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   122
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   123
    public String getMaxHozCachedImgScaling() {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   124
        if (cacheSettingsInherited) {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   125
            return (parentStyle == null ?
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   126
                "1.0" : parentStyle.getMaxHozCachedImgScaling());
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   127
        } else {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   128
            return maxHozCachedImgScaling;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   129
        }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   130
    }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   131
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   132
    public String getMaxVertCachedImgScaling() {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   133
        if (cacheSettingsInherited) {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   134
            return (parentStyle == null ?
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   135
                "1.0" : parentStyle.getMaxVertCachedImgScaling());
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   136
        } else {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   137
            return maxVertCachedImgScaling;
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   138
        }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   139
    }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   140
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   141
    public String write(String prefix) {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   142
        StringBuilder sb = new StringBuilder();
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   143
        if (! textForegroundInherited) {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   144
            sb.append(String.format("        addColor(d, \"%s%s\", %s);\n",
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   145
                    prefix, "textForeground", textForeground.getValue().write()));
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   146
        }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   147
        if (! textBackgroundInherited) {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   148
            sb.append(String.format("        addColor(d, \"%s%s\", %s);\n",
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   149
                    prefix, "textBackground", textBackground.getValue().write()));
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   150
        }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   151
        if (! backgroundInherited) {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   152
            sb.append(String.format("        addColor(d, \"%s%s\", %s);\n",
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   153
                    prefix, "background", background.getValue().write()));
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   154
        }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   155
        for (UIProperty property : uiProperties) {
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   156
            sb.append(property.write(prefix));
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   157
        }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   158
        return sb.toString();
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   159
    }
5e1b8bc3cb1a 6844267: Nimbus generator depends on JIBX
peterz
parents:
diff changeset
   160
}