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 2012/06/18 11:55:10 UTC
svn commit: r1351255 - in
/pivot/branches/2.0.x/tests/src/org/apache/pivot/tests: IMG_0725_2.jpg
clipboard.js issues/pivot_843.bxml palette.png
Author: smartini
Date: Mon Jun 18 09:55:09 2012
New Revision: 1351255
URL: http://svn.apache.org/viewvc?rev=1351255&view=rev
Log:
PIVOT-843, test case (without test image for now)
Added:
pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/IMG_0725_2.jpg (with props)
pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/clipboard.js
pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/issues/pivot_843.bxml
pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/palette.png (with props)
Added: pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/IMG_0725_2.jpg
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/IMG_0725_2.jpg?rev=1351255&view=auto
==============================================================================
Binary file - no diff available.
Propchange: pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/IMG_0725_2.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/clipboard.js
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/clipboard.js?rev=1351255&view=auto
==============================================================================
--- pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/clipboard.js (added)
+++ pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/clipboard.js Mon Jun 18 09:55:09 2012
@@ -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.
+ */
+importPackage(org.apache.pivot.wtk);
+
+function copy() {
+ // Copy the selected image to the clipboard
+ var selectedSourceIndex = sourceImageCardPane.getSelectedIndex();
+ var sourceImageView = sourceImageCardPane.get(selectedSourceIndex);
+ var sourceImage = sourceImageView.getImage();
+
+ var content = new LocalManifest();
+ content.putImage(sourceImage);
+
+ Clipboard.setContent(content);
+
+ // Diagnostic info
+ // Alert("Copy Image").open(window);
+}
+
+function paste() {
+ // Diagnostic info
+ // Prompt("Paste Image").open(window);
+
+ // Paste any available image from the clipboard
+ var content = Clipboard.getContent();
+
+ if (content != null) {
+ var image = content.getImage();
+
+ if (image != null) {
+ destinationImageView.setImage(image);
+ }
+ }
+}
\ No newline at end of file
Added: pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/issues/pivot_843.bxml
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/issues/pivot_843.bxml?rev=1351255&view=auto
==============================================================================
--- pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/issues/pivot_843.bxml (added)
+++ pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/issues/pivot_843.bxml Mon Jun 18 09:55:09 2012
@@ -0,0 +1,109 @@
+<?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 title="Pivot-843 Test" maximized="true"
+ bxml:id="window"
+ xmlns:bxml="http://pivot.apache.org/bxml"
+ xmlns="org.apache.pivot.wtk">
+ <bxml:script src="../clipboard.js"/>
+
+ <windowStateListeners>
+ <![CDATA[
+ function windowOpened(window) {
+ sourceImageButtonGroup.setSelection(sourceImageButton1);
+ sourceImageButton1.requestFocus();
+ }
+ ]]>
+ </windowStateListeners>
+
+ <TablePane styles="{horizontalSpacing:4, verticalSpacing:4}">
+ <columns>
+ <TablePane.Column width="1*"/>
+ <TablePane.Column width="1*"/>
+ </columns>
+
+ <TablePane.Row height="1*">
+ <Border styles="{padding:2}">
+ <CardPane bxml:id="sourceImageCardPane" styles="{padding:4}">
+ <ImageView image="/org/apache/pivot/tests/IMG_0725_2.jpg"/>
+ <ImageView image="/org/apache/pivot/tests/palette.png"/>
+ <ImageView image="/org/apache/pivot/tests/issues/pivot_843_test.jpg"/>
+ </CardPane>
+ </Border>
+ <Border styles="{padding:2}">
+ <CardPane selectedIndex="0" styles="{padding:4}">
+ <ImageView bxml:id="destinationImageView"/>
+ </CardPane>
+ </Border>
+ </TablePane.Row>
+
+ <TablePane.Row height="-1">
+ <BoxPane orientation="vertical" styles="{fill:true}">
+ <BoxPane bxml:id="sourceImageButtonBoxPane"
+ styles="{horizontalAlignment:'center', verticalAlignment:'center'}">
+ <bxml:define>
+ <ButtonGroup bxml:id="sourceImageButtonGroup">
+ <buttonGroupListeners>
+ <![CDATA[
+ function selectionChanged(buttonGroup, previousSelection) {
+ var selection = buttonGroup.getSelection();
+
+ if (selection != null) {
+ var index = sourceImageButtonBoxPane.indexOf(selection);
+ sourceImageCardPane.setSelectedIndex(index);
+ }
+ }
+ ]]>
+ </buttonGroupListeners>
+ </ButtonGroup>
+ </bxml:define>
+
+ <PushButton bxml:id="sourceImageButton1"
+ buttonData="IMG_0725_2.jpg" toggleButton="true"
+ buttonGroup="$sourceImageButtonGroup"
+ tooltipText="Good Image"
+ />
+ <PushButton bxml:id="sourceImageButton2"
+ buttonData="palette.png" toggleButton="true"
+ buttonGroup="$sourceImageButtonGroup"
+ tooltipText="palette.png"
+ />
+ <PushButton bxml:id="sourceImageButton3"
+ buttonData="pivot_843_test.jpg" toggleButton="true"
+ buttonGroup="$sourceImageButtonGroup"
+ tooltipText="Sample Image with problems after Paste"
+ />
+ </BoxPane>
+
+ <BoxPane styles="{horizontalAlignment:'center'}">
+ <PushButton bxml:id="copyButton" buttonData="Copy"
+ ButtonPressListener.buttonPressed="copy()"
+ tooltipText="Copy the selected image in memory"
+ />
+ </BoxPane>
+ </BoxPane>
+
+ <BoxPane styles="{horizontalAlignment:'center', verticalAlignment:'center'}">
+ <PushButton bxml:id="pasteButton" buttonData="Paste"
+ ButtonPressListener.buttonPressed="paste()"
+ tooltipText="Paste an image from memory (could be from outside this application)"
+ />
+ </BoxPane>
+ </TablePane.Row>
+ </TablePane>
+</Window>
Added: pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/palette.png
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/palette.png?rev=1351255&view=auto
==============================================================================
Binary file - no diff available.
Propchange: pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/palette.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream