You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2010/01/21 01:18:37 UTC
svn commit: r901456 - in /pivot/trunk:
tutorials/src/org/apache/pivot/tutorials/layout/ tutorials/www/
wtk-terra/src/org/apache/pivot/wtk/skin/terra/
Author: gbrown
Date: Thu Jan 21 00:18:36 2010
New Revision: 901456
URL: http://svn.apache.org/viewvc?rev=901456&view=rev
Log:
Additional minor tweaks to TerraFormSkin.
Modified:
pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/forms.wtkx
pivot/trunk/tutorials/www/forms.xml
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java
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_test.json
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/package.html
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/forms.wtkx
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/forms.wtkx?rev=901456&r1=901455&r2=901456&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/forms.wtkx (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/forms.wtkx Thu Jan 21 00:18:36 2010
@@ -77,7 +77,7 @@
<rows>
<TablePane.Row>
<BoxPane styles="{verticalAlignment:'center'}">
- <Label wtkx:id="errorLabel" styles="{color:'#ff0000'}"/>
+ <Label wtkx:id="errorLabel" styles="{color:22}"/>
</BoxPane>
<BoxPane styles="{horizontalAlignment:'right', verticalAlignment:'center'}">
<PushButton wtkx:id="submitButton" buttonData="Submit"
Modified: pivot/trunk/tutorials/www/forms.xml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/www/forms.xml?rev=901456&r1=901455&r2=901456&view=diff
==============================================================================
--- pivot/trunk/tutorials/www/forms.xml (original)
+++ pivot/trunk/tutorials/www/forms.xml Thu Jan 21 00:18:36 2010
@@ -118,7 +118,7 @@
<rows>
<TablePane.Row>
<BoxPane styles="{verticalAlignment:'center'}">
- <Label wtkx:id="errorLabel" styles="{color:'#ff0000'}"/>
+ <Label wtkx:id="errorLabel" styles="{color:22}"/>
</BoxPane>
<BoxPane styles="{horizontalAlignment:'right', verticalAlignment:'center'}">
<PushButton wtkx:id="submitButton" buttonData="Submit"
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java?rev=901456&r1=901455&r2=901456&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java Thu Jan 21 00:18:36 2010
@@ -31,6 +31,7 @@
import org.apache.pivot.wtk.Component;
import org.apache.pivot.wtk.ComponentMouseListener;
import org.apache.pivot.wtk.Dimensions;
+import org.apache.pivot.wtk.Display;
import org.apache.pivot.wtk.Form;
import org.apache.pivot.wtk.FormAttributeListener;
import org.apache.pivot.wtk.FormListener;
@@ -44,7 +45,9 @@
import org.apache.pivot.wtk.Theme;
import org.apache.pivot.wtk.VerticalAlignment;
import org.apache.pivot.wtk.Window;
+import org.apache.pivot.wtk.WindowStateListener;
import org.apache.pivot.wtk.effects.Decorator;
+import org.apache.pivot.wtk.effects.DropShadowDecorator;
import org.apache.pivot.wtk.media.Image;
import org.apache.pivot.wtk.skin.ContainerSkin;
@@ -99,25 +102,9 @@
}
}
+ private class FieldMouseListener extends ComponentMouseListener.Adapter {
+ private Window flagMessageWindow = null;
- private ArrayList<Separator> separators = new ArrayList<Separator>();
- private ArrayList<ArrayList<BoxPane>> rowHeaders = new ArrayList<ArrayList<BoxPane>>();
- // TODO private ArrayList<ArrayList<Label>> flagMessages = new ArrayList<ArrayList<Label>>();
-
- private int horizontalSpacing = 6;
- private int verticalSpacing = 6;
- private int flagImageOffset = 4;
- private boolean fill = false;
- private boolean showFirstSectionHeading = false;
- private boolean showFlagIcons = true;
- private boolean showFlagHighlight = true;
- private boolean showFlagMessagesInline = false;
- private boolean leftAlignLabels = false;
- private String delimiter = DEFAULT_DELIMITER;
-
- private Window flagMessageWindow = null;
-
- private ComponentMouseListener fieldMouseListener = new ComponentMouseListener.Adapter() {
@Override
public void mouseOver(Component component) {
Form.Flag flag = Form.getFlag(component);
@@ -164,8 +151,34 @@
label.getStyles().put("backgroundColor", backgroundColor);
flagMessageWindow = new Window(label);
+ flagMessageWindow.getDecorators().add(new DropShadowDecorator(3, 3, 3));
flagMessageWindow.getDecorators().add(new FieldIdentifierDecorator(backgroundColor));
+ flagMessageWindow.getWindowStateListeners().add(new WindowStateListener.Adapter() {
+ private ApplicationContext.ScheduledCallback scheduledHideFlagMessageCallback = null;
+
+ @Override
+ public void windowOpened(Window window) {
+ // Set a timer to hide the message
+ Runnable hideFlagMessageCallback = new Runnable() {
+ public void run() {
+ flagMessageWindow.close();
+ }
+ };
+
+ scheduledHideFlagMessageCallback =
+ ApplicationContext.scheduleCallback(hideFlagMessageCallback,
+ HIDE_FLAG_MESSAGE_DELAY);
+ }
+
+ @Override
+ public void windowClosed(Window window, Display display, Window owner) {
+ scheduledHideFlagMessageCallback.cancel();
+ flagMessageWindow = null;
+ }
+ });
+
+ // Open the window
Point location = component.mapPointToAncestor(component.getDisplay(), 0,
component.getHeight());
@@ -176,10 +189,6 @@
flagMessageWindow.setLocation(location.x, y);
flagMessageWindow.open(component.getWindow());
-
- // Set a timer to hide the message
- scheduledHideFlagMessageCallback =
- ApplicationContext.scheduleCallback(hideFlagMessageCallback, HIDE_FLAG_MESSAGE_DELAY);
}
}
}
@@ -189,37 +198,30 @@
if (flagMessageWindow != null) {
flagMessageWindow.close();
}
-
- if (scheduledHideFlagMessageCallback != null) {
- scheduledHideFlagMessageCallback.cancel();
- }
-
- flagMessageWindow = null;
- scheduledHideFlagMessageCallback = null;
}
};
- private Runnable hideFlagMessageCallback = new Runnable() {
- public void run() {
- if (flagMessageWindow != null) {
- flagMessageWindow.close();
- }
-
- // TODO Fade the message
-
- flagMessageWindow = null;
- scheduledHideFlagMessageCallback = null;
- }
- };
+ private ArrayList<Separator> separators = new ArrayList<Separator>();
+ private ArrayList<ArrayList<BoxPane>> rowHeaders = new ArrayList<ArrayList<BoxPane>>();
+ // TODO private ArrayList<ArrayList<Label>> flagMessages = new ArrayList<ArrayList<Label>>();
- private ApplicationContext.ScheduledCallback scheduledHideFlagMessageCallback = null;
+ private int horizontalSpacing = 6;
+ private int verticalSpacing = 6;
+ private int flagImageOffset = 4;
+ private boolean fill = false;
+ private boolean showFirstSectionHeading = false;
+ private boolean showFlagIcons = true;
+ private boolean showFlagHighlight = true;
+ private boolean showFlagMessagesInline = false;
+ private boolean leftAlignLabels = false;
+ private String delimiter = DEFAULT_DELIMITER;
private static final int FLAG_IMAGE_SIZE = 16;
private static final int FLAG_HIGHLIGHT_PADDING = 2;
private static final int FIELD_INDICATOR_WIDTH = 13;
private static final int FIELD_INDICATOR_HEIGHT = 6;
private static final int FIELD_INDICATOR_OFFSET = 10;
- private static final int HIDE_FLAG_MESSAGE_DELAY = 5000;
+ private static final int HIDE_FLAG_MESSAGE_DELAY = 3500;
private static final String DEFAULT_DELIMITER = ":";
@@ -647,17 +649,22 @@
switch (messageType) {
case ERROR: {
- highlightColor = theme.getColor(22);
+ highlightColor = theme.getColor(21);
break;
}
case WARNING: {
- highlightColor = theme.getColor(25);
+ highlightColor = theme.getColor(24);
break;
}
case QUESTION: {
- highlightColor = theme.getColor(16);
+ highlightColor = theme.getColor(15);
+ break;
+ }
+
+ case INFO: {
+ highlightColor = theme.getColor(9);
break;
}
}
@@ -986,7 +993,7 @@
// Add mouse listener
if (!showFlagMessagesInline) {
- field.getComponentMouseListeners().add(fieldMouseListener);
+ field.getComponentMouseListeners().add(new FieldMouseListener());
}
// Update the field label and flag
@@ -1009,7 +1016,7 @@
// Remove mouse listener
if (!showFlagMessagesInline) {
Component field = removed.get(i);
- field.getComponentMouseListeners().remove(fieldMouseListener);
+ field.getComponentMouseListeners().remove(new FieldMouseListener());
}
}
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=901456&r1=901455&r2=901456&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 Jan 21 00:18:36 2010
@@ -234,7 +234,6 @@
* Gets the image that this theme uses to represent messages of the
* specified type.
*/
- @Override
public Image getMessageIcon(MessageType messageType) {
String messageIconName;
@@ -293,7 +292,6 @@
* Gets the "small" image that this theme uses to represent messages of the
* specified type.
*/
- @Override
public Image getSmallMessageIcon(MessageType messageType) {
String smallMessageIconName;
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_test.json
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_test.json?rev=901456&r1=901455&r2=901456&view=diff
==============================================================================
Binary files - no diff available.
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/package.html
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/package.html?rev=901456&r1=901455&r2=901456&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/package.html (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/package.html Thu Jan 21 00:18:36 2010
@@ -23,8 +23,8 @@
</p>
<p>
Terra skins get their colors from the theme's color palette, which contains
-24 indexed colors. Each Terra skin exposes setter methods for each of its
-color styles that take an integer value; such methods allow callers to style
+27 indexed colors. Most Terra skins expose a setter methods for each color
+style that accepts an integer value; such methods allow callers to style
the component by referencing the theme's color palette. The default palette
is shown below:
</p>
@@ -58,13 +58,13 @@
<td><tt>colors</tt></td>
<td><tt>List<String></tt></td>
<td>
-This list should contain 8 colors in a form understandable by
+This list should contain 9 colors in a form understandable by
<tt>java.awt.Color.decode()</tt>. This list represents the theme's
"base color palette", from which the full color palette is
-derived. Each of these 8 colors will be expanded to comprise 3
+derived. Each of these 9 colors will be expanded to three
colors in the final palette: a darker version, the color itself,
and a lighter version. Thus, the final color palette will contain
-24 colors. For instance, in the <a href="#palette">default color
+27 colors. For instance, in the <a href="#palette">default color
palette</a> the "base palette" colors are the colors in the middle
column.
</td>