dark Nimbus l&f theme
authorS. Aubrecht <saubrecht@netbeans.org>
Thu, 10 Jan 2013 11:24:52 +0100
changeset 17906d2d137638cef
parent 17905 af4aac727a19
child 17907 44d61093247e
dark Nimbus l&f theme
darknimbustheme/build.xml
darknimbustheme/manifest.mf
darknimbustheme/nbproject/build-impl.xml
darknimbustheme/nbproject/genfiles.properties
darknimbustheme/nbproject/platform.properties
darknimbustheme/nbproject/project.properties
darknimbustheme/nbproject/project.xml
darknimbustheme/src/org/netbeans/nimbus/theme/Bundle.properties
darknimbustheme/src/org/netbeans/nimbus/theme/Installer.java
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/darknimbustheme/build.xml	Thu Jan 10 11:24:52 2013 +0100
     1.3 @@ -0,0 +1,8 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
     1.6 +<!-- for some information on what you could do (e.g. targets to override). -->
     1.7 +<!-- If you delete this file and reopen the project it will be recreated. -->
     1.8 +<project name="org.netbeans.nimbus.theme" default="netbeans" basedir=".">
     1.9 +    <description>Builds, tests, and runs the project org.netbeans.nimbus.theme.</description>
    1.10 +    <import file="nbproject/build-impl.xml"/>
    1.11 +</project>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/darknimbustheme/manifest.mf	Thu Jan 10 11:24:52 2013 +0100
     2.3 @@ -0,0 +1,6 @@
     2.4 +Manifest-Version: 1.0
     2.5 +OpenIDE-Module: org.netbeans.nimbus.theme/1
     2.6 +OpenIDE-Module-Implementation-Version: 1
     2.7 +OpenIDE-Module-Install: org/netbeans/nimbus/theme/Installer.class
     2.8 +OpenIDE-Module-Localizing-Bundle: org/netbeans/nimbus/theme/Bundle.properties
     2.9 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/darknimbustheme/nbproject/build-impl.xml	Thu Jan 10 11:24:52 2013 +0100
     3.3 @@ -0,0 +1,42 @@
     3.4 +<?xml version="1.0" encoding="UTF-8"?>
     3.5 +<!--
     3.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
     3.7 +***         EDIT ../build.xml INSTEAD         ***
     3.8 +-->
     3.9 +<project name="org.netbeans.nimbus.theme-impl" basedir="..">
    3.10 +    <fail message="Please build using Ant 1.7.1 or higher.">
    3.11 +        <condition>
    3.12 +            <not>
    3.13 +                <antversion atleast="1.7.1"/>
    3.14 +            </not>
    3.15 +        </condition>
    3.16 +    </fail>
    3.17 +    <property file="nbproject/private/platform-private.properties"/>
    3.18 +    <property file="nbproject/platform.properties"/>
    3.19 +    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
    3.20 +        <attribute name="name"/>
    3.21 +        <attribute name="value"/>
    3.22 +        <sequential>
    3.23 +            <property name="@{name}" value="${@{value}}"/>
    3.24 +        </sequential>
    3.25 +    </macrodef>
    3.26 +    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
    3.27 +        <attribute name="property"/>
    3.28 +        <attribute name="value"/>
    3.29 +        <sequential>
    3.30 +            <property name="@{property}" value="@{value}"/>
    3.31 +        </sequential>
    3.32 +    </macrodef>
    3.33 +    <property file="${user.properties.file}"/>
    3.34 +    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
    3.35 +    <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
    3.36 +    <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
    3.37 +    <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
    3.38 +        <condition>
    3.39 +            <not>
    3.40 +                <contains string="${cluster.path.evaluated}" substring="platform"/>
    3.41 +            </not>
    3.42 +        </condition>
    3.43 +    </fail>
    3.44 +    <import file="${harness.dir}/build.xml"/>
    3.45 +</project>
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/darknimbustheme/nbproject/genfiles.properties	Thu Jan 10 11:24:52 2013 +0100
     4.3 @@ -0,0 +1,8 @@
     4.4 +build.xml.data.CRC32=6537529f
     4.5 +build.xml.script.CRC32=06b97986
     4.6 +build.xml.stylesheet.CRC32=a56c6a5b@2.50.1
     4.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     4.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
     4.9 +nbproject/build-impl.xml.data.CRC32=6537529f
    4.10 +nbproject/build-impl.xml.script.CRC32=bae4e29e
    4.11 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.50.1
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/darknimbustheme/nbproject/platform.properties	Thu Jan 10 11:24:52 2013 +0100
     5.3 @@ -0,0 +1,11 @@
     5.4 +cluster.path=\
     5.5 +    ${nbplatform.active.dir}/dlight:\
     5.6 +    ${nbplatform.active.dir}/harness:\
     5.7 +    ${nbplatform.active.dir}/ide:\
     5.8 +    ${nbplatform.active.dir}/java:\
     5.9 +    ${nbplatform.active.dir}/javafx:\
    5.10 +    ${nbplatform.active.dir}/nb:\
    5.11 +    ${nbplatform.active.dir}/platform:\
    5.12 +    ${nbplatform.active.dir}/profiler:\
    5.13 +    ${nbplatform.active.dir}/websvccommon
    5.14 +nbplatform.active=core-main
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/darknimbustheme/nbproject/project.properties	Thu Jan 10 11:24:52 2013 +0100
     6.3 @@ -0,0 +1,5 @@
     6.4 +javac.source=1.6
     6.5 +javac.compilerargs=-Xlint -Xlint:-serial
     6.6 +nbm.needs.restart=true
     6.7 +spec.version.base=1.0
     6.8 +run.args.extra=--laf Nimbus
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/darknimbustheme/nbproject/project.xml	Thu Jan 10 11:24:52 2013 +0100
     7.3 @@ -0,0 +1,29 @@
     7.4 +<?xml version="1.0" encoding="UTF-8"?>
     7.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
     7.6 +    <type>org.netbeans.modules.apisupport.project</type>
     7.7 +    <configuration>
     7.8 +        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
     7.9 +            <code-name-base>org.netbeans.nimbus.theme</code-name-base>
    7.10 +            <standalone/>
    7.11 +            <module-dependencies>
    7.12 +                <dependency>
    7.13 +                    <code-name-base>org.openide.modules</code-name-base>
    7.14 +                    <build-prerequisite/>
    7.15 +                    <compile-dependency/>
    7.16 +                    <run-dependency>
    7.17 +                        <specification-version>7.35</specification-version>
    7.18 +                    </run-dependency>
    7.19 +                </dependency>
    7.20 +                <dependency>
    7.21 +                    <code-name-base>org.openide.util</code-name-base>
    7.22 +                    <build-prerequisite/>
    7.23 +                    <compile-dependency/>
    7.24 +                    <run-dependency>
    7.25 +                        <specification-version>8.29</specification-version>
    7.26 +                    </run-dependency>
    7.27 +                </dependency>
    7.28 +            </module-dependencies>
    7.29 +            <public-packages/>
    7.30 +        </data>
    7.31 +    </configuration>
    7.32 +</project>
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/darknimbustheme/src/org/netbeans/nimbus/theme/Bundle.properties	Thu Jan 10 11:24:52 2013 +0100
     8.3 @@ -0,0 +1,8 @@
     8.4 +OpenIDE-Module-Display-Category=Base IDE
     8.5 +OpenIDE-Module-Long-Description=\
     8.6 +    Dark theme for Nimbus Look and Feel. \
     8.7 +    It goes well with "Norway Today" editor color scheme.\n\
     8.8 +    It does not affect other look and feel implementations so you must force Nimbus l&f, e.g. by using --laf Nimbus command line switch. \
     8.9 +    To revert back to the default Nimbus theme just uninstall this module.
    8.10 +OpenIDE-Module-Name=Dark Nimbus Theme
    8.11 +OpenIDE-Module-Short-Description=Dark theme for Nimbus Look and Feel
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/darknimbustheme/src/org/netbeans/nimbus/theme/Installer.java	Thu Jan 10 11:24:52 2013 +0100
     9.3 @@ -0,0 +1,85 @@
     9.4 +/*
     9.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     9.6 + *
     9.7 + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
     9.8 + *
     9.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    9.10 + * Other names may be trademarks of their respective owners.
    9.11 + *
    9.12 + * The contents of this file are subject to the terms of either the GNU
    9.13 + * General Public License Version 2 only ("GPL") or the Common
    9.14 + * Development and Distribution License("CDDL") (collectively, the
    9.15 + * "License"). You may not use this file except in compliance with the
    9.16 + * License. You can obtain a copy of the License at
    9.17 + * http://www.netbeans.org/cddl-gplv2.html
    9.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    9.19 + * specific language governing permissions and limitations under the
    9.20 + * License.  When distributing the software, include this License Header
    9.21 + * Notice in each file and include the License file at
    9.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    9.23 + * particular file as subject to the "Classpath" exception as provided
    9.24 + * by Oracle in the GPL Version 2 section of the License file that
    9.25 + * accompanied this code. If applicable, add the following below the
    9.26 + * License Header, with the fields enclosed by brackets [] replaced by
    9.27 + * your own identifying information:
    9.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    9.29 + *
    9.30 + * Contributor(s):
    9.31 + *
    9.32 + * The Original Software is NetBeans. The Initial Developer of the Original
    9.33 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
    9.34 + * Microsystems, Inc. All Rights Reserved.
    9.35 + *
    9.36 + * If you wish your version of this file to be governed by only the CDDL
    9.37 + * or only the GPL Version 2, indicate your decision by adding
    9.38 + * "[Contributor] elects to include this software in this distribution
    9.39 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    9.40 + * single choice of license, a recipient has the option to distribute
    9.41 + * your version of this file under either the CDDL, the GPL Version 2 or
    9.42 + * to extend the choice of license to its licensees as provided above.
    9.43 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    9.44 + * Version 2 license, then the option applies only if the new code is
    9.45 + * made subject to such option by the copyright holder.
    9.46 + */
    9.47 +package org.netbeans.nimbus.theme;
    9.48 +
    9.49 +import java.awt.Color;
    9.50 +import javax.swing.UIManager;
    9.51 +import org.openide.modules.ModuleInstall;
    9.52 +
    9.53 +/**
    9.54 + * 
    9.55 + * @author S. Aubrecht
    9.56 + */
    9.57 +public class Installer extends ModuleInstall {
    9.58 +
    9.59 +    @Override
    9.60 +    public void restored() {
    9.61 +    }
    9.62 +
    9.63 +    @Override
    9.64 +    public void validate() throws IllegalStateException {
    9.65 +        super.validate();
    9.66 +        UIManager.put( "control", new Color( 128, 128, 128) );
    9.67 +        UIManager.put( "info", new Color(128,128,128) );
    9.68 +        UIManager.put( "nimbusBase", new Color( 18, 30, 49) );
    9.69 +        UIManager.put( "nimbusAlertYellow", new Color( 248, 187, 0) );
    9.70 +        UIManager.put( "nimbusDisabledText", new Color( 128, 128, 128) );
    9.71 +        UIManager.put( "nimbusFocus", new Color(115,164,209) );
    9.72 +        UIManager.put( "nimbusGreen", new Color(176,179,50) );
    9.73 +        UIManager.put( "nimbusInfoBlue", new Color( 66, 139, 221) );
    9.74 +        UIManager.put( "nimbusLightBackground", new Color( 18, 30, 49) );
    9.75 +        UIManager.put( "nimbusOrange", new Color(191,98,4) );
    9.76 +        UIManager.put( "nimbusRed", new Color(169,46,34) );
    9.77 +        UIManager.put( "nimbusSelectedText", new Color( 255, 255, 255) );
    9.78 +        UIManager.put( "nimbusSelectionBackground", new Color( 104, 93, 156) );
    9.79 +        UIManager.put( "text", new Color( 230, 230, 230) );
    9.80 +
    9.81 +        //there's a problem with HtmlLabelUI.ensureContrastingColor() which
    9.82 +        //automatically assumes white background on Nimbus thus reverts white foreground
    9.83 +        //of unselected text into black. With Swing based rendering it works fine.
    9.84 +        System.setProperty( "nb.useSwingHtmlRendering", "true");
    9.85 +    }
    9.86 +
    9.87 +
    9.88 +}