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 2009/06/05 20:46:41 UTC
svn commit: r782098 - in /incubator/pivot/trunk/wtk:
src/pivot/wtk/skin/FlowPaneSkin.java test/pivot/wtk/test/PushButtonTest.java
Author: gbrown
Date: Fri Jun 5 18:46:41 2009
New Revision: 782098
URL: http://svn.apache.org/viewvc?rev=782098&view=rev
Log:
Fix layout issue in FlowPaneSkin.
Modified:
incubator/pivot/trunk/wtk/src/pivot/wtk/skin/FlowPaneSkin.java
incubator/pivot/trunk/wtk/test/pivot/wtk/test/PushButtonTest.java
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/skin/FlowPaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/skin/FlowPaneSkin.java?rev=782098&r1=782097&r2=782098&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/skin/FlowPaneSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/skin/FlowPaneSkin.java Fri Jun 5 18:46:41 2009
@@ -309,7 +309,7 @@
Orientation orientation = flowPane.getOrientation();
if (orientation == Orientation.HORIZONTAL) {
- int preferredWidth = getPreferredWidth(height);
+ int preferredWidth = getPreferredWidth(-1);
// Determine the fixed width (used in scaling components
// when justified horizontally)
@@ -423,7 +423,7 @@
}
}
} else {
- int preferredHeight = getPreferredHeight(width);
+ int preferredHeight = getPreferredHeight(-1);
// Determine the fixed height (used in scaling components
// when justified vertically)
Modified: incubator/pivot/trunk/wtk/test/pivot/wtk/test/PushButtonTest.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/pivot/wtk/test/PushButtonTest.java?rev=782098&r1=782097&r2=782098&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/test/pivot/wtk/test/PushButtonTest.java (original)
+++ incubator/pivot/trunk/wtk/test/pivot/wtk/test/PushButtonTest.java Fri Jun 5 18:46:41 2009
@@ -18,8 +18,10 @@
import pivot.collections.Dictionary;
import pivot.wtk.Application;
+import pivot.wtk.DesktopApplicationContext;
import pivot.wtk.Display;
import pivot.wtk.FlowPane;
+import pivot.wtk.HorizontalAlignment;
import pivot.wtk.PushButton;
import pivot.wtk.Window;
@@ -30,18 +32,23 @@
throws Exception {
window = new Window();
FlowPane flowPane = new FlowPane();
+ flowPane.getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT);
- PushButton pushButton = new PushButton("OK");
- pushButton.getStyles().put("preferredAspectRatio", 3.0f);
- flowPane.add(pushButton);
+ PushButton uploadButton = new PushButton("Upload");
+ uploadButton.getStyles().put("preferredAspectRatio", 3.0f);
+ flowPane.add(uploadButton);
window.setContent(flowPane);
+ window.setMaximized(true);
window.open(display);
}
public boolean shutdown(boolean optional) {
- window.close();
+ if (window != null) {
+ window.close();
+ }
+
return true;
}
@@ -50,4 +57,8 @@
public void resume() {
}
+
+ public static void main(String[] args) {
+ DesktopApplicationContext.main(PushButtonTest.class, args);
+ }
}