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/05/14 20:07:47 UTC
svn commit: r774858 - in /incubator/pivot/trunk/wtk: src/pivot/wtk/
src/pivot/wtk/skin/ src/pivot/wtk/skin/terra/ src/pivot/wtkx/
test/pivot/wtk/media/ test/pivot/wtk/test/
Author: gbrown
Date: Thu May 14 18:07:47 2009
New Revision: 774858
URL: http://svn.apache.org/viewvc?rev=774858&view=rev
Log:
Add Sheet.ComponentPane class. This class is similar to CardPane, but is tailored to use for hosting content in a sheet.
Added:
incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraSheetComponentPaneSkin.java
incubator/pivot/trunk/wtk/test/pivot/wtk/test/ComponentPaneTest.java
- copied, changed from r774848, incubator/pivot/trunk/wtk/test/pivot/wtk/test/CardPaneTest.java
incubator/pivot/trunk/wtk/test/pivot/wtk/test/activity.wtkd
- copied unchanged from r774848, incubator/pivot/trunk/wtk/test/pivot/wtk/media/drawing/test/activity.wtkd
incubator/pivot/trunk/wtk/test/pivot/wtk/test/component_pane_test.wtkx
- copied, changed from r774850, incubator/pivot/trunk/wtk/test/pivot/wtk/test/card_pane_test.wtkx
incubator/pivot/trunk/wtk/test/pivot/wtk/test/drawing_test.wtkx
- copied unchanged from r774848, incubator/pivot/trunk/wtk/test/pivot/wtk/media/drawing/test/drawing_test.wtkx
incubator/pivot/trunk/wtk/test/pivot/wtk/test/sample.wtkd
- copied unchanged from r774848, incubator/pivot/trunk/wtk/test/pivot/wtk/media/drawing/test/sample.wtkd
Removed:
incubator/pivot/trunk/wtk/test/pivot/wtk/media/
incubator/pivot/trunk/wtk/test/pivot/wtk/test/CardPaneTest.java
incubator/pivot/trunk/wtk/test/pivot/wtk/test/card_pane_test.wtkx
Modified:
incubator/pivot/trunk/wtk/src/pivot/wtk/Sheet.java
incubator/pivot/trunk/wtk/src/pivot/wtk/skin/CardPaneSkin.java
incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraTheme.java
incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/Sheet.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/Sheet.java?rev=774858&r1=774857&r2=774858&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/Sheet.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/Sheet.java Thu May 14 18:07:47 2009
@@ -16,6 +16,7 @@
*/
package pivot.wtk;
+import pivot.collections.Sequence;
import pivot.util.ListenerList;
import pivot.util.Vote;
@@ -26,6 +27,144 @@
* @author gbrown
*/
public class Sheet extends Window {
+ /**
+ * Container for common sheet content.
+ *
+ * @author gbrown
+ */
+ public static class ComponentPane extends Container {
+ private static class ComponentPaneListenerList extends ListenerList<ComponentPaneListener>
+ implements ComponentPaneListener {
+ public Vote previewSelectedIndexChange(ComponentPane componentPane, int selectedIndex) {
+ Vote vote = Vote.APPROVE;
+
+ for (ComponentPaneListener listener : this) {
+ vote = vote.tally(listener.previewSelectedIndexChange(componentPane, selectedIndex));
+ }
+
+ return vote;
+ }
+
+ public void selectedIndexChangeVetoed(ComponentPane componentPane, Vote reason) {
+ for (ComponentPaneListener listener : this) {
+ listener.selectedIndexChangeVetoed(componentPane, reason);
+ }
+ }
+
+ public void selectedIndexChanged(ComponentPane componentPane, int previousSelectedIndex) {
+ for (ComponentPaneListener listener : this) {
+ listener.selectedIndexChanged(componentPane, previousSelectedIndex);
+ }
+ }
+ }
+
+ private int selectedIndex = -1;
+ private ComponentPaneListenerList componentPaneListeners = new ComponentPaneListenerList();
+
+ public ComponentPane() {
+ installSkin(ComponentPane.class);
+ }
+
+ public int getSelectedIndex() {
+ return selectedIndex;
+ }
+
+ public void setSelectedIndex(int selectedIndex) {
+ if (selectedIndex < -1
+ || selectedIndex > getLength() - 1) {
+ throw new IndexOutOfBoundsException();
+ }
+
+ int previousSelectedIndex = this.selectedIndex;
+
+ if (previousSelectedIndex != selectedIndex) {
+ Vote vote = componentPaneListeners.previewSelectedIndexChange(this, selectedIndex);
+
+ if (vote == Vote.APPROVE) {
+ this.selectedIndex = selectedIndex;
+ componentPaneListeners.selectedIndexChanged(this, previousSelectedIndex);
+ } else {
+ componentPaneListeners.selectedIndexChangeVetoed(this, vote);
+ }
+ }
+ }
+
+ public Component getSelectedPanel() {
+ return (selectedIndex == -1) ? null : get(selectedIndex);
+ }
+
+ @Override
+ public void insert(Component component, int index) {
+ // Update the selection
+ if (selectedIndex >= index) {
+ selectedIndex++;
+ }
+
+ super.insert(component, index);
+ }
+
+ @Override
+ public Sequence<Component> remove(int index, int count) {
+ // Update the selection
+ if (selectedIndex >= index) {
+ if (selectedIndex < index + count) {
+ selectedIndex = -1;
+ } else {
+ selectedIndex -= count;
+ }
+ }
+
+ return super.remove(index, count);
+ }
+
+ public ListenerList<ComponentPaneListener> getComponentPaneListeners() {
+ return componentPaneListeners;
+ }
+ }
+
+ /**
+ * Component pane listener interface.
+ *
+ * @author gbrown
+ */
+ public static interface ComponentPaneListener {
+ public static class Adapter implements ComponentPaneListener {
+ public Vote previewSelectedIndexChange(ComponentPane componentPane, int selectedIndex) {
+ return Vote.APPROVE;
+ }
+
+ public void selectedIndexChangeVetoed(ComponentPane componentPane, Vote reason) {
+ }
+
+ public void selectedIndexChanged(ComponentPane componentPane, int previousSelectedIndex) {
+ }
+ }
+
+ /**
+ * Called to preview a selected index change.
+ *
+ * @param componentPane
+ * @param selectedIndex
+ */
+ public Vote previewSelectedIndexChange(ComponentPane componentPane, int selectedIndex);
+
+ /**
+ * Called when a selected index change has been vetoed.
+ *
+ * @param componentPane
+ * @param reason
+ */
+ public void selectedIndexChangeVetoed(ComponentPane componentPane, Vote reason);
+
+ /**
+ * Called when a component pane's selected index has changed.
+ *
+ * @param componentPane
+ * @param previousSelectedIndex
+ */
+ public void selectedIndexChanged(ComponentPane componentPane, int previousSelectedIndex);
+ }
+
private static class SheetStateListenerList extends ListenerList<SheetStateListener>
implements SheetStateListener {
public Vote previewSheetClose(Sheet sheet, boolean result) {
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/skin/CardPaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/skin/CardPaneSkin.java?rev=774858&r1=774857&r2=774858&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/skin/CardPaneSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/skin/CardPaneSkin.java Thu May 14 18:07:47 2009
@@ -31,13 +31,6 @@
/**
* Card pane skin.
- * <p>
- * NOTE We don't support constrained preferred sizes when sizing to the selected
- * card, because we always center the from and to cards during the transition.
- * Supporting a preferred constrained size would imply that we would justify
- * during the transition, and we don't currently provide a way to specify that
- * this is the desired behavior. We could provide horizontal and vertical
- * alignment styles, but the use cases for these are almost non-existent.
*
* @author gbrown
*/
Added: incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraSheetComponentPaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraSheetComponentPaneSkin.java?rev=774858&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraSheetComponentPaneSkin.java (added)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraSheetComponentPaneSkin.java Thu May 14 18:07:47 2009
@@ -0,0 +1,317 @@
+/*
+ * 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.
+ */
+package pivot.wtk.skin.terra;
+
+import pivot.collections.Sequence;
+import pivot.util.Vote;
+import pivot.wtk.Component;
+import pivot.wtk.Container;
+import pivot.wtk.Dimensions;
+import pivot.wtk.Sheet;
+import pivot.wtk.effects.FadeDecorator;
+import pivot.wtk.effects.Transition;
+import pivot.wtk.effects.TransitionListener;
+import pivot.wtk.skin.ContainerSkin;
+
+/**
+ * Terra sheet component pane skin.
+ *
+ * @author gbrown
+ */
+public class TerraSheetComponentPaneSkin extends ContainerSkin
+ implements Sheet.ComponentPaneListener {
+ /**
+ * Class that performs selection change transitions.
+ *
+ * @author gbrown
+ */
+ public class SelectionChangeTransition extends Transition {
+ private FadeDecorator fadeOutDecorator = new FadeDecorator();
+ private FadeDecorator fadeInDecorator = new FadeDecorator();
+
+ private int from;
+ private int to;
+
+ public SelectionChangeTransition(int from, int to) {
+ super(SELECTION_CHANGE_DURATION, SELECTION_CHANGE_RATE, false);
+
+ this.from = from;
+ this.to = to;
+ }
+
+ public int getFrom() {
+ return from;
+ }
+
+ public Component getFromPanel() {
+ Sheet.ComponentPane componentPane = (Sheet.ComponentPane)getComponent();
+ return (from == -1) ? null : componentPane.get(from);
+ }
+
+ public int getTo() {
+ return to;
+ }
+
+ public Component getToPanel() {
+ Sheet.ComponentPane componentPane = (Sheet.ComponentPane)getComponent();
+ return (to == -1) ? null : componentPane.get(to);
+ }
+
+ @Override
+ public void start(TransitionListener transitionListener) {
+ Component fromPanel = getFromPanel();
+ if (fromPanel != null) {
+ fromPanel.getDecorators().add(fadeOutDecorator);
+ }
+
+ Component toPanel = getToPanel();
+ if (toPanel != null) {
+ toPanel.getDecorators().add(fadeInDecorator);
+ toPanel.setSize(toPanel.getPreferredSize());
+ toPanel.setVisible(true);
+ }
+
+ super.start(transitionListener);
+ }
+
+ @Override
+ public void stop() {
+ super.stop();
+
+ Component fromPanel = getFromPanel();
+ if (fromPanel != null) {
+ fromPanel.getDecorators().remove(fadeOutDecorator);
+ fromPanel.setVisible(false);
+ }
+
+ Component toPanel = getToPanel();
+ if (toPanel != null) {
+ toPanel.getDecorators().remove(fadeInDecorator);
+ }
+ }
+
+ @Override
+ protected void update() {
+ float percentComplete = getPercentComplete();
+
+ int width = getWidth();
+ int height = getHeight();
+
+ // Center components
+ Component fromPanel = getFromPanel();
+ if (fromPanel != null) {
+ fromPanel.setLocation((width - fromPanel.getWidth()) / 2,
+ (height - fromPanel.getHeight()) / 2);
+ }
+
+ Component toPanel = getToPanel();
+ if (toPanel != null) {
+ toPanel.setLocation((width - toPanel.getWidth()) / 2,
+ (height - toPanel.getHeight()) / 2);
+ }
+
+ fadeOutDecorator.setOpacity(1.0f - percentComplete);
+ fadeInDecorator.setOpacity(percentComplete);
+
+ invalidateComponent();
+ }
+ }
+
+ private SelectionChangeTransition selectionChangeTransition = null;
+
+ public static final int SELECTION_CHANGE_DURATION = 250;
+ public static final int SELECTION_CHANGE_RATE = 30;
+
+ public void install(Component component) {
+ super.install(component);
+
+ Sheet.ComponentPane componentPane = (Sheet.ComponentPane)component;
+ componentPane.getComponentPaneListeners().add(this);
+ }
+
+ public void uninstall() {
+ Sheet.ComponentPane componentPane = (Sheet.ComponentPane)getComponent();
+ componentPane.getComponentPaneListeners().remove(this);
+
+ super.uninstall();
+ }
+
+ public int getPreferredWidth(int height) {
+ Dimensions preferredSize = getPreferredSize();
+ return preferredSize.width;
+ }
+
+ public int getPreferredHeight(int width) {
+ Dimensions preferredSize = getPreferredSize();
+ return preferredSize.height;
+ }
+
+ public Dimensions getPreferredSize() {
+ Dimensions preferredSize;
+
+ Sheet.ComponentPane componentPane = (Sheet.ComponentPane)getComponent();
+
+ if (selectionChangeTransition == null) {
+ Component selectedPanel = componentPane.getSelectedPanel();
+
+ if (selectedPanel == null) {
+ preferredSize = new Dimensions(0, 0);
+ } else {
+ preferredSize = selectedPanel.getPreferredSize();
+ }
+ } else {
+ float percentComplete = selectionChangeTransition.getPercentComplete();
+
+ int previousWidth;
+ int previousHeight;
+ Component fromPanel = selectionChangeTransition.getFromPanel();
+
+ if (fromPanel == null) {
+ previousWidth = 0;
+ previousHeight = 0;
+ } else {
+ Dimensions fromSize = fromPanel.getPreferredSize();
+ previousWidth = fromSize.width;
+ previousHeight = fromSize.height;
+ }
+
+ int width;
+ int height;
+ Component toPanel = selectionChangeTransition.getToPanel();
+
+ if (toPanel == null) {
+ width = 0;
+ height = 0;
+ } else {
+ Dimensions toSize = toPanel.getPreferredSize();
+ width = toSize.width;
+ height = toSize.height;
+ }
+
+ int preferredWidth = previousWidth + (int)((float)(width - previousWidth) * percentComplete);
+ int preferredHeight = previousHeight + (int)((float)(height - previousHeight) * percentComplete);
+
+ preferredSize = new Dimensions(preferredWidth, preferredHeight);
+ }
+
+ return preferredSize;
+ }
+
+ public void layout() {
+ Sheet.ComponentPane componentPane = (Sheet.ComponentPane)getComponent();
+ int width = getWidth();
+ int height = getHeight();
+
+ for (Component panel : componentPane) {
+ // If the panel is visible, set its size and location
+ if (panel.isVisible()) {
+ panel.setLocation(0, 0);
+ panel.setSize(width, height);
+ }
+ }
+ }
+
+ @Override
+ public void componentInserted(Container container, int index) {
+ if (selectionChangeTransition != null) {
+ selectionChangeTransition.stop();
+ selectionChangeTransition = null;
+ }
+
+ super.componentInserted(container, index);
+
+ Component panel = container.get(index);
+ panel.setVisible(false);
+
+ invalidateComponent();
+ }
+
+ @Override
+ public void componentsRemoved(Container container, int index, Sequence<Component> removed) {
+ if (selectionChangeTransition != null) {
+ selectionChangeTransition.stop();
+ selectionChangeTransition = null;
+ }
+
+ super.componentsRemoved(container, index, removed);
+
+ for (int i = 0, n = removed.getLength(); i < n; i++){
+ Component panel = removed.get(i);
+ panel.setVisible(true);
+ }
+
+ invalidateComponent();
+ }
+
+ public Vote previewSelectedIndexChange(Sheet.ComponentPane componentPane, int selectedIndex) {
+ Vote vote;
+
+ if (componentPane.isShowing()
+ && selectionChangeTransition == null) {
+ int previousSelectedIndex = componentPane.getSelectedIndex();
+
+ selectionChangeTransition =
+ new SelectionChangeTransition(previousSelectedIndex, selectedIndex);
+
+ selectionChangeTransition.start(new TransitionListener() {
+ public void transitionCompleted(Transition transition) {
+ Sheet.ComponentPane componentPane = (Sheet.ComponentPane)getComponent();
+
+ SelectionChangeTransition selectionChangeTransition =
+ (SelectionChangeTransition)transition;
+ componentPane.setSelectedIndex(selectionChangeTransition.getTo());
+ TerraSheetComponentPaneSkin.this.selectionChangeTransition = null;
+
+ invalidateComponent();
+ }
+ });
+ }
+
+ if (selectionChangeTransition == null
+ || !selectionChangeTransition.isRunning()) {
+ vote = Vote.APPROVE;
+ } else {
+ vote = Vote.DEFER;
+ }
+
+ return vote;
+ }
+
+ public void selectedIndexChangeVetoed(Sheet.ComponentPane componentPane, Vote reason) {
+ if (reason == Vote.DENY
+ && selectionChangeTransition != null) {
+ selectionChangeTransition.stop();
+ selectionChangeTransition = null;
+ invalidateComponent();
+ }
+ }
+
+ public void selectedIndexChanged(Sheet.ComponentPane componentPane, int previousSelectedIndex) {
+ int selectedIndex = componentPane.getSelectedIndex();
+ if (selectedIndex != -1) {
+ Component selectedPanel = componentPane.get(selectedIndex);
+ selectedPanel.setVisible(true);
+ }
+
+ if (previousSelectedIndex != -1) {
+ Component previousSelectedPanel = componentPane.get(previousSelectedIndex);
+ previousSelectedPanel.setVisible(false);
+ }
+
+ invalidateComponent();
+ }
+}
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraTheme.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraTheme.java?rev=774858&r1=774857&r2=774858&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraTheme.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraTheme.java Thu May 14 18:07:47 2009
@@ -175,6 +175,7 @@
componentSkinMap.put(ScrollPane.Corner.class, TerraScrollPaneCornerSkin.class);
componentSkinMap.put(Separator.class, TerraSeparatorSkin.class);
componentSkinMap.put(Sheet.class, TerraSheetSkin.class);
+ componentSkinMap.put(Sheet.ComponentPane.class, TerraSheetComponentPaneSkin.class);
componentSkinMap.put(Slider.class, TerraSliderSkin.class);
componentSkinMap.put(Spinner.class, TerraSpinnerSkin.class);
componentSkinMap.put(SplitPane.class, TerraSplitPaneSkin.class);
Modified: incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java?rev=774858&r1=774857&r2=774858&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java Thu May 14 18:07:47 2009
@@ -141,7 +141,7 @@
if (serializer != null) {
String id = namespacePath[i];
-
+
if (namedObjects.containsKey(id)) {
object = namedObjects.get(id);
} else {
Copied: incubator/pivot/trunk/wtk/test/pivot/wtk/test/ComponentPaneTest.java (from r774848, incubator/pivot/trunk/wtk/test/pivot/wtk/test/CardPaneTest.java)
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/pivot/wtk/test/ComponentPaneTest.java?p2=incubator/pivot/trunk/wtk/test/pivot/wtk/test/ComponentPaneTest.java&p1=incubator/pivot/trunk/wtk/test/pivot/wtk/test/CardPaneTest.java&r1=774848&r2=774858&rev=774858&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/test/pivot/wtk/test/CardPaneTest.java (original)
+++ incubator/pivot/trunk/wtk/test/pivot/wtk/test/ComponentPaneTest.java Thu May 14 18:07:47 2009
@@ -20,42 +20,37 @@
import pivot.util.Vote;
import pivot.wtk.Application;
import pivot.wtk.Button;
-import pivot.wtk.CardPane;
-import pivot.wtk.CardPaneListener;
-import pivot.wtk.Component;
import pivot.wtk.DesktopApplicationContext;
import pivot.wtk.Display;
import pivot.wtk.FlowPane;
import pivot.wtk.Frame;
import pivot.wtk.Sheet;
-import pivot.wtkx.WTKXSerializer;
+import pivot.wtkx.Bindable;
-public class CardPaneTest implements Application {
+public class ComponentPaneTest extends Bindable implements Application {
private Frame frame = null;
- private Sheet sheet = null;
- private CardPane cardPane = null;
+
+ @Load(resourceName="component_pane_test.wtkx") private Sheet sheet;
+ @Bind(fieldName="sheet") private Sheet.ComponentPane componentPane;
public void startup(Display display, Dictionary<String, String> properties)
throws Exception {
+ bind();
+
frame = new Frame(new FlowPane());
frame.getStyles().put("padding", 0);
- frame.setTitle("Card Pane Test");
+ frame.setTitle("Component Pane Test");
frame.setPreferredSize(800, 600);
frame.setLocation(20, 20);
- WTKXSerializer wtkxSerializer = new WTKXSerializer();
- sheet = new Sheet((Component)wtkxSerializer.readObject(getClass().getResource("card_pane_test.wtkx")));
-
- cardPane = (CardPane)wtkxSerializer.getObjectByID("cardPane");
-
Button.Group sizeGroup = Button.getGroup("sizeGroup");
sizeGroup.getGroupListeners().add(new Button.GroupListener() {
public void selectionChanged(Button.Group buttonGroup, Button previousSelection) {
final Button selection = buttonGroup.getSelection();
int selectedIndex = selection == null ? -1 : selection.getParent().indexOf(selection);
- cardPane.getCardPaneListeners().add(new CardPaneListener.Adapter() {
- public Vote previewSelectedIndexChange(CardPane cardPane, int selectedIndex) {
+ componentPane.getComponentPaneListeners().add(new Sheet.ComponentPaneListener.Adapter() {
+ public Vote previewSelectedIndexChange(Sheet.ComponentPane componentPane, int selectedIndex) {
if (selection != null) {
selection.getParent().setEnabled(false);
}
@@ -63,21 +58,21 @@
return Vote.APPROVE;
}
- public void selectedIndexChangeVetoed(CardPane cardPane, Vote reason) {
+ public void selectedIndexChangeVetoed(Sheet.ComponentPane componentPane, Vote reason) {
if (selection != null
&& reason == Vote.DENY) {
selection.getParent().setEnabled(true);
}
}
- public void selectedIndexChanged(CardPane cardPane, int previousSelectedIndex) {
+ public void selectedIndexChanged(Sheet.ComponentPane componentPane, int previousSelectedIndex) {
if (selection != null) {
selection.getParent().setEnabled(true);
}
}
});
- cardPane.setSelectedIndex(selectedIndex);
+ componentPane.setSelectedIndex(selectedIndex);
}
});
@@ -100,6 +95,6 @@
}
public static void main(String[] args) {
- DesktopApplicationContext.main(CardPaneTest.class, args);
+ DesktopApplicationContext.main(ComponentPaneTest.class, args);
}
}
Copied: incubator/pivot/trunk/wtk/test/pivot/wtk/test/component_pane_test.wtkx (from r774850, incubator/pivot/trunk/wtk/test/pivot/wtk/test/card_pane_test.wtkx)
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/pivot/wtk/test/component_pane_test.wtkx?p2=incubator/pivot/trunk/wtk/test/pivot/wtk/test/component_pane_test.wtkx&p1=incubator/pivot/trunk/wtk/test/pivot/wtk/test/card_pane_test.wtkx&r1=774850&r2=774858&rev=774858&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/test/pivot/wtk/test/card_pane_test.wtkx (original)
+++ incubator/pivot/trunk/wtk/test/pivot/wtk/test/component_pane_test.wtkx Thu May 14 18:07:47 2009
@@ -16,24 +16,29 @@
limitations under the License.
-->
-<TablePane xmlns:wtkx="http://pivot.dev.java.net/wtkx/2008" xmlns="pivot.wtk">
- <columns>
- <TablePane.Column width="1*"/>
- </columns>
- <rows>
- <TablePane.Row height="-1">
- <FlowPane>
- <PushButton buttonData="320x240" toggleButton="true" group="sizeGroup"/>
- <PushButton buttonData="640x480" toggleButton="true" group="sizeGroup"/>
- <PushButton buttonData="800x600" toggleButton="true" group="sizeGroup"/>
- </FlowPane>
- </TablePane.Row>
- <TablePane.Row height="1*">
- <CardPane wtkx:id="cardPane">
- <Border title="320x240" preferredWidth="320" preferredHeight="240"/>
- <Border title="640x480" preferredWidth="640" preferredHeight="480"/>
- <Border title="800x600" preferredWidth="800" preferredHeight="600"/>
- </CardPane>
- </TablePane.Row>
- </rows>
-</TablePane>
+<Sheet xmlns:wtkx="http://pivot.dev.java.net/wtkx/2008" xmlns="pivot.wtk">
+ <content>
+ <TablePane>
+ <columns>
+ <TablePane.Column width="1*"/>
+ </columns>
+ <rows>
+ <TablePane.Row height="-1">
+ <FlowPane>
+ <PushButton buttonData="320x240" toggleButton="true" group="sizeGroup"/>
+ <PushButton buttonData="640x480" toggleButton="true" group="sizeGroup"/>
+ <PushButton buttonData="800x600" toggleButton="true" group="sizeGroup"/>
+ </FlowPane>
+ </TablePane.Row>
+ <TablePane.Row height="1*">
+ <Sheet.ComponentPane wtkx:id="componentPane">
+ <Border title="320x240" preferredWidth="320" preferredHeight="240"/>
+ <Border title="640x480" preferredWidth="640" preferredHeight="480"/>
+ <Border title="800x600" preferredWidth="800" preferredHeight="600"/>
+ </Sheet.ComponentPane>
+ </TablePane.Row>
+ </rows>
+ </TablePane>
+ </content>
+</Sheet>
+