You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/07/08 14:13:11 UTC
svn commit: r792108 - in
/incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test:
WatermarkDecoratorTest.java watermark_decorator_test.wtkx
Author: tvolkert
Date: Wed Jul 8 12:13:11 2009
New Revision: 792108
URL: http://svn.apache.org/viewvc?rev=792108&view=rev
Log:
PIVOT-166 :: Added WatermarkDecoratorTest
Added:
incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/WatermarkDecoratorTest.java
incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/watermark_decorator_test.wtkx
Added: incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/WatermarkDecoratorTest.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/WatermarkDecoratorTest.java?rev=792108&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/WatermarkDecoratorTest.java (added)
+++ incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/WatermarkDecoratorTest.java Wed Jul 8 12:13:11 2009
@@ -0,0 +1,48 @@
+/*
+ * 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 org.apache.pivot.wtk.test;
+
+import org.apache.pivot.collections.Map;
+import org.apache.pivot.wtk.Application;
+import org.apache.pivot.wtk.Display;
+import org.apache.pivot.wtk.Window;
+import org.apache.pivot.wtkx.WTKXSerializer;
+
+public class WatermarkDecoratorTest implements Application {
+ private Window window = null;
+
+ public void startup(Display display, Map<String, String> properties) throws Exception {
+ WTKXSerializer wtkxSerializer = new WTKXSerializer();
+ window = (Window)wtkxSerializer.readObject(this, "watermark_decorator_test.wtkx");
+
+ window.open(display);
+ }
+
+ public boolean shutdown(boolean optional) {
+ if (window!= null) {
+ window.close();
+ }
+
+ return false;
+ }
+
+ public void suspend() {
+ }
+
+ public void resume() {
+ }
+}
Added: incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/watermark_decorator_test.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/watermark_decorator_test.wtkx?rev=792108&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/watermark_decorator_test.wtkx (added)
+++ incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/watermark_decorator_test.wtkx Wed Jul 8 12:13:11 2009
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<Window wtkx:id="window"
+ title="Watermark Decorator Test"
+ maximized="true"
+ xmlns:wtkx="http://pivot.apache.org/wtkx"
+ xmlns="org.apache.pivot.wtk">
+ <content>
+ <TablePane styles="{verticalSpacing:1, showHorizontalGridLines:true}">
+ <columns>
+ <TablePane.Column width="1*" />
+ </columns>
+ <rows>
+ <TablePane.Row height="-1">
+ <FlowPane styles="{padding:10}">
+ <PushButton buttonData="Toggle Watermark" toggleButton="true">
+ <buttonStateListeners>
+ <wtkx:script language="javascript">
+ <![CDATA[
+ importPackage(org.apache.pivot.wtk.effects);
+
+ function stateChanged(button, previousState) {
+ if (button.isSelected()) {
+ cardPane.getDecorators().add(new WatermarkDecorator("Only below the line"));
+ } else {
+ cardPane.getDecorators().removeAll();
+ }
+ }
+ ]]>
+ </wtkx:script>
+ </buttonStateListeners>
+ </PushButton>
+ </FlowPane>
+ </TablePane.Row>
+ <TablePane.Row height="1*">
+ <CardPane wtkx:id="cardPane" selectedIndex="0">
+ <FlowPane />
+ </CardPane>
+ </TablePane.Row>
+ </rows>
+ </TablePane>
+ </content>
+</Window>