You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2010/10/15 01:03:30 UTC
svn commit: r1022756 - in /pivot/trunk:
tutorials/src/org/apache/pivot/tutorials/
wtk-terra/src/org/apache/pivot/wtk/skin/terra/
Author: smartini
Date: Thu Oct 14 23:03:29 2010
New Revision: 1022756
URL: http://svn.apache.org/viewvc?rev=1022756&view=rev
Log:
PIVOT-245, PIVOT-579
Added:
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_dark.json
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_swing.json
Modified:
pivot/trunk/tutorials/src/org/apache/pivot/tutorials/TerraTheme_dark.json
pivot/trunk/tutorials/src/org/apache/pivot/tutorials/TerraTheme_test.json
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_default.json
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_osx.json
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_ubuntu.json
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_win2k.json
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_windowsXP.json
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_winxp.json
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/TerraTheme_dark.json
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/TerraTheme_dark.json?rev=1022756&r1=1022755&r2=1022756&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/TerraTheme_dark.json (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/TerraTheme_dark.json Thu Oct 14 23:03:29 2010
@@ -16,6 +16,8 @@
*/
{ font: "Verdana 11",
+ colorMultiplier: 0.2,
+
colors: [
"#f2f2f2",
"#2b2b2b",
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/TerraTheme_test.json
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/TerraTheme_test.json?rev=1022756&r1=1022755&r2=1022756&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/TerraTheme_test.json (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/TerraTheme_test.json Thu Oct 14 23:03:29 2010
@@ -16,6 +16,8 @@
*/
{ font: "Verdana 11",
+ colorMultiplier: 0.1,
+
colors: [
"#404039",
"#ffffff",
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java?rev=1022756&r1=1022755&r2=1022756&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java Thu Oct 14 23:03:29 2010
@@ -94,6 +94,8 @@ public final class TerraTheme extends Th
private HashMap<MessageType, Image> messageIcons = null;
private HashMap<MessageType, Image> smallMessageIcons = null;
+ private static float colorMultiplier = 0.1f;
+
public static final String LOCATION_PROPERTY = "location";
public static final String COMMAND_BUTTON_STYLE = "commandButton";
@@ -236,6 +238,8 @@ public final class TerraTheme extends Th
List<String> colorCodes = (List<String>)properties.get("colors");
colors = new ArrayList<Color>(colorCodes.getLength() * 3);
+ colorMultiplier = ((Double)properties.get("colorMultiplier")).floatValue();
+
for (String colorCode : colorCodes) {
Color baseColor = Color.decode(colorCode);
colors.add(darken(baseColor));
@@ -401,20 +405,40 @@ public final class TerraTheme extends Th
/**
* Returns a brighter version of the specified color. Specifically, it
- * increases the brightness (in the HSB color model) by <tt>0.1</tt>.
+ * increases the brightness (in the HSB color model) by the
+ * <tt>colorMultiplier</tt> factor already set.
*/
public static Color brighten(Color color) {
- return adjustBrightness(color, 0.1f);
+ return adjustBrightness(color, colorMultiplier);
}
/**
* Returns a darker version of the specified color. Specifically, it
- * decreases the brightness (in the HSB color model) by <tt>0.1</tt>.
+ * decreases the brightness (in the HSB color model) by the
+ * <tt>colorMultiplier</tt> factor already set.
*/
public static Color darken(Color color) {
- return adjustBrightness(color, -0.1f);
+ return adjustBrightness(color, (colorMultiplier * -1.0f));
}
+ /**
+ * Returns a brighter version of the specified color. Specifically, it
+ * increases the brightness (in the HSB color model) by the given
+ * <tt>adjustment</tt> factor (usually in the range ]0 .. 1[).
+ */
+ public static Color brighten(Color color, float adjustment) {
+ return adjustBrightness(color, adjustment);
+ }
+
+ /**
+ * Returns a darker version of the specified color. Specifically, it
+ * decreases the brightness (in the HSB color model) by the given
+ * <tt>adjustment</tt> factor (usually in the range ]0 .. 1[).
+ */
+ public static Color darken(Color color, float adjustment) {
+ return adjustBrightness(color, (adjustment * -1.0f));
+ }
+
private static Color adjustBrightness(Color color, float adjustment) {
float[] hsb = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null);
hsb[2] = Math.min(Math.max(hsb[2] + adjustment, 0f), 1f);
Added: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_dark.json
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_dark.json?rev=1022756&view=auto
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_dark.json (added)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_dark.json Thu Oct 14 23:03:29 2010
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+{ font: "Verdana 11",
+
+ colorMultiplier: 0.2,
+
+ colors: [
+ "#f2f2f2",
+ "#2b2b2b",
+ "#998e8a",
+ "#0a0a0a",
+ "#f0751c",
+ "#ff7300",
+ "#ffe480",
+ "#c13719"
+ ],
+
+ messageIcons: {
+ error: "message_type-error-32x32.png",
+ warning: "message_type-warning-32x32.png",
+ question: "message_type-question-32x32.png",
+ info: "message_type-info-32x32.png"
+ },
+
+ smallMessageIcons: {
+ error: "message_type-error-16x16.png",
+ warning: "message_type-warning-16x16.png",
+ question: "message_type-question-16x16.png",
+ info: "message_type-info-16x16.png"
+ }
+}
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_default.json
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_default.json?rev=1022756&r1=1022755&r2=1022756&view=diff
==============================================================================
Binary files - no diff available.
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_osx.json
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_osx.json?rev=1022756&r1=1022755&r2=1022756&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_osx.json (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_osx.json Thu Oct 14 23:03:29 2010
@@ -16,6 +16,8 @@
*/
{ font: "Verdana 11",
+ colorMultiplier: 0.1,
+
colors: [
"#000000",
"#ffffff",
Added: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_swing.json
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_swing.json?rev=1022756&view=auto
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_swing.json (added)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_swing.json Thu Oct 14 23:03:29 2010
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+{ font: "Verdana 11",
+
+ colorMultiplier: 0.1,
+
+ colors: [
+ "#000000",
+ "#eeeeee",
+ "#8ea1b2",
+ "#ffffff",
+ "#7a8a99",
+ "#7a8a99",
+ "#ffff00",
+ "#ff0000"
+ ],
+
+ messageIcons: {
+ error: "message_type-error-32x32.png",
+ warning: "message_type-warning-32x32.png",
+ question: "message_type-question-32x32.png",
+ info: "message_type-info-32x32.png"
+ },
+
+ smallMessageIcons: {
+ error: "message_type-error-16x16.png",
+ warning: "message_type-warning-16x16.png",
+ question: "message_type-question-16x16.png",
+ info: "message_type-info-16x16.png"
+ }
+}
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_ubuntu.json
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_ubuntu.json?rev=1022756&r1=1022755&r2=1022756&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_ubuntu.json (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_ubuntu.json Thu Oct 14 23:03:29 2010
@@ -16,14 +16,16 @@
*/
{ font: "Verdana 11",
+ colorMultiplier: 0.1,
+
colors: [
"#3c3b37",
- "#efebe2",
- "#ccbfa9",
"#f0ebe2",
- "#3c3b37",
- "#b9aa95",
- "#ffe480",
+ "#ccbfa9",
+ "#ffffff",
+ "#3b3b3b",
+ "#ab9c85",
+ "#fad26c",
"#f0583d"
],
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_win2k.json
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_win2k.json?rev=1022756&r1=1022755&r2=1022756&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_win2k.json (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_win2k.json Thu Oct 14 23:03:29 2010
@@ -16,6 +16,8 @@
*/
{ font: "Verdana 11",
+ colorMultiplier: 0.1,
+
colors: [
"#000000",
"#D2CFC8",
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_windowsXP.json
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_windowsXP.json?rev=1022756&r1=1022755&r2=1022756&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_windowsXP.json (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_windowsXP.json Thu Oct 14 23:03:29 2010
@@ -16,6 +16,8 @@
*/
{ font: "Verdana 11",
+ colorMultiplier: 0.1,
+
colors: [
"#000000",
"#F4F4F4",
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_winxp.json
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_winxp.json?rev=1022756&r1=1022755&r2=1022756&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_winxp.json (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_winxp.json Thu Oct 14 23:03:29 2010
@@ -16,6 +16,8 @@
*/
{ font: "Verdana 11",
+ colorMultiplier: 0.1,
+
colors: [
"#000000",
"#ffffff",
Re: svn commit: r1022756 - in /pivot/trunk: tutorials/src/org/apache/pivot/tutorials/
wtk-terra/src/org/apache/pivot/wtk/skin/terra/
Posted by Sandro Martini <sa...@gmail.com>.
Ok, committed the delete, thanks.
Uh, just a quick note: I've just attached a patch (here:
https://issues.apache.org/jira/browse/PIVOT-579 ) also for the Terra
package (JavaDoc file), so i can resolve the PIVOT-579.
But here is really too late, so if it's not a problem I'd commit
immediately also this and close the ticket ...
Bye,
Sandro
Re: svn commit: r1022756 - in /pivot/trunk:
tutorials/src/org/apache/pivot/tutorials/
wtk-terra/src/org/apache/pivot/wtk/skin/terra/
Posted by Greg Brown <gk...@mac.com>.
> note that in this commit I have put the following file:
> pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_dark.json
>
> ...
> Note that the same version is present under tutorials, and also
> TerraTheme_test.json but both files are no more used there, so is it
> Ok to delete both those files under tutorials ?
>
Sure.
Fwd: svn commit: r1022756 - in /pivot/trunk: tutorials/src/org/apache/pivot/tutorials/
wtk-terra/src/org/apache/pivot/wtk/skin/terra/
Posted by Sandro Martini <sa...@gmail.com>.
Hi to all,
note that in this commit I have put the following file:
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_dark.json
(without doing this I wasn't unable to launch ColorSchemeBuilder with
that scheme to make some tests).
Note that the same version is present under tutorials, and also
TerraTheme_test.json but both files are no more used there, so is it
Ok to delete both those files under tutorials ?
Bye,
Sandro