Skip to content

Commit 6816bf0

Browse files
Historical snapshot
0 parents  commit 6816bf0

13 files changed

+3893
-0
lines changed

.classpath

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>

.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>laf-plugin</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

build.properties

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
jdk.home=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
2+
javac.source=1.6
3+
javac.target=1.6
4+
javac.encoding=ISO-8859-1
5+
javac.debug=on
6+
javac.generate.no.warnings=off
7+
javac.args=
8+
javac.max.memory=128m

build.xml

+150
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<project name="laf-plugin" default="all">
3+
<property file="local.build.properties" />
4+
<property file="build.properties" />
5+
6+
<!-- Compiler options -->
7+
<patternset id="javac.excluded" />
8+
<patternset id="javac.resources">
9+
<include name="**/?*.properties" />
10+
<include name="**/?*.xml" />
11+
<include name="**/?*.gif" />
12+
<include name="**/?*.png" />
13+
<include name="**/?*.jpeg" />
14+
<include name="**/?*.jpg" />
15+
<include name="**/?*.ttf" />
16+
<include name="**/?*.license" />
17+
</patternset>
18+
<!-- JDK definitions -->
19+
20+
<path id="jdk.classpath">
21+
<fileset dir="${jdk.home}">
22+
<include name="jre/lib/charsets.jar" />
23+
<include name="jre/lib/deploy.jar" />
24+
<include name="jre/lib/javaws.jar" />
25+
<include name="jre/lib/jce.jar" />
26+
<include name="jre/lib/jsse.jar" />
27+
<include name="jre/lib/plugin.jar" />
28+
<include name="jre/lib/rt.jar" />
29+
<include name="jre/lib/ext/dnsns.jar" />
30+
<include name="jre/lib/ext/localedata.jar" />
31+
<include name="jre/lib/ext/sunjce_provider.jar" />
32+
<include name="jre/lib/ext/sunpkcs11.jar" />
33+
</fileset>
34+
</path>
35+
36+
<property name="project.jdk.home" value="${jdk.home}" />
37+
<property name="project.jdk.classpath" value="jdk.classpath" />
38+
<!-- Project Libraries -->
39+
<!-- Global Libraries -->
40+
41+
<dirname property="module.laf-plugin.basedir" file="${ant.file}" />
42+
43+
<property name="javac.args.laf-plugin" value="${javac.args}" />
44+
45+
<property name="laf-plugin.build.dir" value="${module.laf-plugin.basedir}/build/" />
46+
<property name="laf-plugin.output.dir" value="${laf-plugin.build.dir}/classes" />
47+
<property name="laf-plugin.drop.dir" value="${module.laf-plugin.basedir}/drop" />
48+
<property name="laf-plugin.lib.dir" value="${module.laf-plugin.basedir}/lib" />
49+
<property name="laf-plugin.src.dir" value="${module.laf-plugin.basedir}/src/" />
50+
<property name="laf-plugin.version" value="1.1final Landshark" />
51+
52+
<path id="laf-plugin.module.bootclasspath">
53+
<!-- Paths to be included in compilation bootclasspath -->
54+
</path>
55+
56+
<property name="module.jdk.home.laf-plugin" value="${project.jdk.home}" />
57+
<property name="module.jdk.classpath.laf-plugin" value="${project.jdk.classpath}" />
58+
59+
<path id="laf-plugin.module.classpath">
60+
<path refid="${module.jdk.classpath.laf-plugin}" />
61+
</path>
62+
63+
<patternset id="excluded.from.module.laf-plugin" />
64+
65+
<patternset id="excluded.from.compilation.laf-plugin">
66+
<patternset refid="excluded.from.module.laf-plugin" />
67+
<patternset refid="javac.excluded" />
68+
</patternset>
69+
70+
<path id="laf-plugin.module.sourcepath">
71+
<dirset dir="${laf-plugin.src.dir}">
72+
<include name="org/pushingpixels/lafplugin" />
73+
</dirset>
74+
</path>
75+
76+
<target name="compile.module.laf-plugin" depends="compile.module.laf-plugin.production" description="compile module laf-plugin" />
77+
78+
<target name="compile.module.laf-plugin.production" description="compile module laf-plugin production classes">
79+
<mkdir dir="${laf-plugin.output.dir}" />
80+
<javac source="${javac.source}" target="${javac.target}" encoding="${javac.encoding}" destdir="${laf-plugin.output.dir}" debug="${javac.debug}" nowarn="${javac.generate.no.warnings}" memoryMaximumSize="${javac.max.memory}" fork="true" executable="${module.jdk.home.laf-plugin}/bin/javac">
81+
<compilerarg line="${javac.args.laf-plugin}" />
82+
<bootclasspath refid="laf-plugin.module.bootclasspath" />
83+
<classpath refid="laf-plugin.module.classpath" />
84+
<src refid="laf-plugin.module.sourcepath" />
85+
<patternset refid="excluded.from.compilation.laf-plugin" />
86+
</javac>
87+
<copy todir="${laf-plugin.output.dir}">
88+
<fileset dir="${laf-plugin.src.dir}">
89+
<patternset refid="javac.resources" />
90+
<type type="file" />
91+
<patternset refid="excluded.from.compilation.laf-plugin" />
92+
</fileset>
93+
</copy>
94+
</target>
95+
96+
<target name="clean.module.laf-plugin" description="cleanup module">
97+
<delete dir="${laf-plugin.output.dir}" />
98+
</target>
99+
100+
<target name="init" description="Build initialization">
101+
<!-- Perform any build initialization in this target -->
102+
</target>
103+
104+
<target name="jar-bin" description="create runtime jar">
105+
<mkdir dir="${laf-plugin.drop.dir}" />
106+
<delete file="${laf-plugin.drop.dir}/laf-plugin.jar" />
107+
<jar compress="true" destfile="${laf-plugin.drop.dir}/laf-plugin.jar">
108+
<fileset dir="${laf-plugin.output.dir}/"/>
109+
<manifest>
110+
<attribute name="Laf-Plugin-Version" value="${laf-plugin.version}" />
111+
<attribute name="Laf-Plugin-BuildStamp" value="${build.time}" />
112+
</manifest>
113+
</jar>
114+
<copy file="${laf-plugin.drop.dir}/laf-plugin.jar" todir="${module.laf-plugin.basedir}/../substance/lib/build" />
115+
</target>
116+
117+
<target name="distro" description="create distribution">
118+
<delete file="${module.laf-plugin.basedir}/laf-plugin-all.zip" />
119+
<zip destfile="${module.laf-plugin.basedir}/laf-plugin-all.zip" compress="true">
120+
<fileset dir="${module.laf-plugin.basedir}">
121+
<include name="src/**" />
122+
<include name="build*.xml" />
123+
<include name="build*.properties" />
124+
<!--
125+
<include name="www/index.html" />
126+
<include name="www/docs/**" />
127+
<include name="www/images/**" />
128+
<include name="docs/**" />
129+
-->
130+
</fileset>
131+
</zip>
132+
</target>
133+
134+
<target name="timestamp">
135+
<tstamp>
136+
<format property="build.time" pattern="MMMM d, yyyy hh:mm:ss z" />
137+
</tstamp>
138+
<echo message="Beginning build: ${build.time}" />
139+
<echo message="Java home: ${java.home}" />
140+
<echo message="Java version: ${ant.java.version}" />
141+
<echo message="Ant version: ${ant.version}" />
142+
<echo message="JavaC home: ${jdk.home}" />
143+
</target>
144+
145+
<target name="jar" depends="jar-bin" description="create all jars" />
146+
147+
<target name="clean" depends="clean.module.laf-plugin" description="cleanup all" />
148+
149+
<target name="all" depends="timestamp, init, clean, compile.module.laf-plugin, jar" description="build all" />
150+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/*
2+
* Copyright (c) 2005-2010 Laf-Plugin Kirill Grouchnikov and contributors. All Rights Reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions are met:
6+
*
7+
* o Redistributions of source code must retain the above copyright notice,
8+
* this list of conditions and the following disclaimer.
9+
*
10+
* o Redistributions in binary form must reproduce the above copyright notice,
11+
* this list of conditions and the following disclaimer in the documentation
12+
* and/or other materials provided with the distribution.
13+
*
14+
* o Neither the name of Flamingo Kirill Grouchnikov nor the names of
15+
* its contributors may be used to endorse or promote products derived
16+
* from this software without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25+
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
27+
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
package org.pushingpixels.lafplugin;
31+
32+
import java.util.Iterator;
33+
import java.util.Set;
34+
35+
import javax.swing.UIDefaults;
36+
37+
/**
38+
* Plugin manager for look-and-feels.
39+
*
40+
* @author Kirill Grouchnikov
41+
* @author Erik Vickroy
42+
* @author Robert Beeger
43+
* @author Frederic Lavigne
44+
* @author Pattrick Gotthardt
45+
*/
46+
public class ComponentPluginManager extends PluginManager {
47+
/**
48+
* Simple constructor.
49+
*
50+
* @param xmlName
51+
* The name of XML file that contains plugin configuration.
52+
* @param mainTag
53+
* The main tag in the XML configuration file.
54+
* @param pluginTag
55+
* The tag that corresponds to a single plugin kind. Specifies
56+
* the plugin kind that will be located in
57+
* {@link #getAvailablePlugins(boolean)}.
58+
*/
59+
public ComponentPluginManager(String xmlName) {
60+
super(xmlName, LafComponentPlugin.TAG_MAIN,
61+
LafComponentPlugin.COMPONENT_TAG_PLUGIN_CLASS);
62+
}
63+
64+
/**
65+
* Helper function to initialize all available component plugins of
66+
* <code>this</code> plugin manager. Calls the
67+
* {@link LafComponentPlugin#initialize()} of all available component
68+
* plugins.
69+
*/
70+
public void initializeAll() {
71+
Set availablePlugins = this.getAvailablePlugins();
72+
for (Iterator iterator = availablePlugins.iterator(); iterator
73+
.hasNext();) {
74+
Object pluginObject = iterator.next();
75+
if (pluginObject instanceof LafComponentPlugin)
76+
((LafComponentPlugin) pluginObject).initialize();
77+
}
78+
}
79+
80+
/**
81+
* Helper function to uninitialize all available component plugins of
82+
* <code>this</code> plugin manager. Calls the
83+
* {@link LafComponentPlugin#uninitialize()} of all available component
84+
* plugins.
85+
*/
86+
public void uninitializeAll() {
87+
Set availablePlugins = this.getAvailablePlugins();
88+
for (Iterator iterator = availablePlugins.iterator(); iterator
89+
.hasNext();) {
90+
Object pluginObject = iterator.next();
91+
if (pluginObject instanceof LafComponentPlugin)
92+
((LafComponentPlugin) pluginObject).uninitialize();
93+
}
94+
}
95+
96+
/**
97+
* Helper function to process the (possibly) theme-dependent default
98+
* settings of all available component plugins of <code>this</code> plugin
99+
* manager. Calls the {@link LafComponentPlugin#getDefaults(Object)} of all
100+
* available plugins and puts the respective results in the specified table.
101+
*
102+
* @param table
103+
* The table that will be updated with the (possibly)
104+
* theme-dependent default settings of all available component
105+
* plugins.
106+
* @param themeInfo
107+
* LAF-specific information on the current theme.
108+
*/
109+
public void processAllDefaultsEntries(UIDefaults table, Object themeInfo) {
110+
Set availablePlugins = this.getAvailablePlugins();
111+
for (Iterator iterator = availablePlugins.iterator(); iterator
112+
.hasNext();) {
113+
Object pluginObject = iterator.next();
114+
if (pluginObject instanceof LafComponentPlugin) {
115+
Object[] defaults = ((LafComponentPlugin) pluginObject)
116+
.getDefaults(themeInfo);
117+
if (defaults != null) {
118+
table.putDefaults(defaults);
119+
}
120+
}
121+
}
122+
}
123+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright (c) 2005-2010 Laf-Plugin Kirill Grouchnikov and contributors. All Rights Reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions are met:
6+
*
7+
* o Redistributions of source code must retain the above copyright notice,
8+
* this list of conditions and the following disclaimer.
9+
*
10+
* o Redistributions in binary form must reproduce the above copyright notice,
11+
* this list of conditions and the following disclaimer in the documentation
12+
* and/or other materials provided with the distribution.
13+
*
14+
* o Neither the name of Laf-Plugin Kirill Grouchnikov nor the names of
15+
* its contributors may be used to endorse or promote products derived
16+
* from this software without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25+
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
27+
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
package org.pushingpixels.lafplugin;
31+
32+
import javax.swing.plaf.metal.MetalTheme;
33+
34+
/**
35+
* Basic interface for look-and-feel plugins.
36+
*
37+
* @author Kirill Grouchnikov
38+
* @author Erik Vickroy
39+
* @author Robert Beeger
40+
* @author Frederic Lavigne
41+
* @author Pattrick Gotthardt
42+
*/
43+
public interface LafComponentPlugin extends LafPlugin {
44+
/**
45+
* XML tag for look-and-feel plugins that specify component UI delegates.
46+
*/
47+
public static final String COMPONENT_TAG_PLUGIN_CLASS = "component-plugin-class";
48+
49+
/**
50+
* Initializes <code>this</code> plugin.
51+
*/
52+
public void initialize();
53+
54+
/**
55+
* Unitializes <code>this</code> plugin.
56+
*/
57+
public void uninitialize();
58+
59+
/**
60+
* Retrieves a collection of custom settings based on the specified theme.
61+
* The entries in the array should be pairwise, odd being symbolic name of a
62+
* setting, and even being the setting value.
63+
*
64+
* @param themeInfo
65+
* Theme information object. Can be {@link MetalTheme}, for
66+
* instance or any other LAF-specific object.
67+
* @return Collection of custom settings based on the specified theme. The
68+
* entries in the array should be pairwise, odd being symbolic name
69+
* of a setting, and even being the setting value.
70+
*/
71+
public Object[] getDefaults(Object themeInfo);
72+
}

0 commit comments

Comments
 (0)