Permalink
Browse files

o Set Squidy to next SNAPSHOT 1.5.1

o Set Doubleclick node @deprecated (not very useful)
o Added ClickCountFilter and RelativeMouse (just for test purposes and
will be removed in future releases)
  • Loading branch information...
raedle committed Aug 5, 2012
1 parent 22c58e6 commit 15e8d25b381b72fd40abfbe5119f62145c2339fe
View
@@ -6,7 +6,7 @@
<groupId>org.squidy</groupId>
<artifactId>squidy</artifactId>
<packaging>pom</packaging>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.1-SNAPSHOT</version>
<modules>
<module>squidy-common</module>
<module>squidy-manager</module>
View
@@ -3,7 +3,7 @@
<parent>
<artifactId>squidy</artifactId>
<groupId>org.squidy</groupId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>squidy-common</artifactId>
@@ -48,7 +48,7 @@
* Time: 7:19:03 PM
* </pre>
*
- * @author Roman R&amp;aumldle <a href="mailto:Roman.Raedle@uni-konstanz.de">Roman .Raedle@uni-konstanz.de</a>
+ * @author Roman Rädle <a href="mailto:Roman.Raedle@uni-konstanz.de">Roman.Raedle@uni-konstanz.de</a>
* Human-Computer Interaction Group University of Konstanz
* @version $Id: DynamicCodeClassLoader.java 772 2011-09-16 15:39:44Z raedle $
* @since 1.0.0
View
@@ -3,7 +3,7 @@
<parent>
<artifactId>squidy</artifactId>
<groupId>org.squidy</groupId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>squidy-designer</artifactId>
@@ -73,7 +73,9 @@
private static InputWindow instance = null;
private List<AbstractNode> registeredMouse = new ArrayList<AbstractNode>();
- private List<AbstractNode> registeredKeyboard = new ArrayList<AbstractNode>();
+ private List<AbstractNode> registeredKeyboard = new ArrayList<AbstractNode>();
+
+ public static final DataConstant CLICK_COUNT = DataConstant.get(Integer.class, "CLICK_COUNT");
private InputWindow() {
super("Squidy Input Window");
@@ -169,27 +171,27 @@ public void windowClosing(WindowEvent e) {
text.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)) {
- pushSampleButton(1, true);
+ pushSampleButton(1, true, e.getClickCount());
} else {
if (SwingUtilities.isMiddleMouseButton(e)) {
- pushSampleButton(2, true);
+ pushSampleButton(2, true, e.getClickCount());
} else {
if (SwingUtilities.isRightMouseButton(e)) {
- pushSampleButton(3, true);
+ pushSampleButton(3, true, e.getClickCount());
}
}
}
}
public void mouseReleased(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)) {
- pushSampleButton(1, false);
+ pushSampleButton(1, false, e.getClickCount());
} else {
if (SwingUtilities.isMiddleMouseButton(e)) {
- pushSampleButton(2, false);
+ pushSampleButton(2, false, e.getClickCount());
} else {
if (SwingUtilities.isRightMouseButton(e)) {
- pushSampleButton(3, false);
+ pushSampleButton(3, false, e.getClickCount());
}
}
}
@@ -249,12 +251,13 @@ private void pushSamplePos2D(double x, double y) {
}
}
- private void pushSampleButton(int type, boolean flag) {
+ private void pushSampleButton(int type, boolean flag, int clickCount) {
DataButton button = null;
AbstractNode node = null;
for(ListIterator<AbstractNode> it = registeredMouse.listIterator(); it.hasNext();){
node = it.next();
- button = new DataButton(node.getClass(), type, flag);
+ button = new DataButton(node.getClass(), type, flag);
+ button.setAttribute(CLICK_COUNT, clickCount);
node.publish(button);
}
}
View
@@ -4,7 +4,7 @@
<parent>
<artifactId>squidy</artifactId>
<groupId>org.squidy</groupId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>squidy-manager</artifactId>
View
@@ -4,7 +4,7 @@
<parent>
<artifactId>squidy</artifactId>
<groupId>org.squidy</groupId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.1-SNAPSHOT</version>
</parent>
<artifactId>squidy-nodes</artifactId>
<build>
@@ -0,0 +1,89 @@
+/**
+ * Squidy Interaction Library is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the License,
+ * or (at your option) any later version.
+ *
+ * Squidy Interaction Library is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Squidy Interaction Library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * 2009 Human-Computer Interaction Group, University of Konstanz.
+ * <http://hci.uni-konstanz.de>
+ *
+ * Please contact info@squidy-lib.de or visit our website
+ * <http://www.squidy-lib.de> for further information.
+ */
+
+package org.squidy.nodes;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+import org.squidy.manager.controls.TextField;
+import org.squidy.manager.data.IData;
+import org.squidy.manager.data.Processor;
+import org.squidy.manager.data.Property;
+import org.squidy.manager.data.impl.DataButton;
+import org.squidy.manager.model.AbstractNode;
+
+/**
+ * <code>ClickCountFilter</code>.
+ *
+ * <pre>
+ * Date: Aug 03, 2012
+ * Time: 1:30:05 AM
+ * </pre>
+ *
+ * @author Roman Rädle, <a
+ * href="mailto:Roman.Raedle@uni-konstanz.de">Roman.Raedle
+ * @uni-konstanz.de</a>, University of Konstanz
+ * @version $Id$
+ */
+@XmlType(name = "ClickCountFilter")
+@Processor(name = "Click Count Filter", types = { Processor.Type.FILTER }, tags = {
+ "count", "click" })
+public class ClickCountFilter extends AbstractNode {
+
+ // ################################################################################
+ // BEGIN OF PROPERTIES
+ // ################################################################################
+
+ @XmlAttribute(name = "Click-Count")
+ @Property(name = "Click-Count", description = "Number of clicks.")
+ @TextField
+ private int clickCount = 1;
+
+ public int getClickCount() {
+ return clickCount;
+ }
+
+ public void setClickCount(int clickCount) {
+ this.clickCount = clickCount;
+ }
+
+ // ################################################################################
+ // END OF PROPERTIES
+ // ################################################################################
+
+ /**
+ *
+ */
+ public IData process(DataButton dataButton) {
+
+ if (dataButton.hasAttribute(MouseIO.CLICK_COUNT)) {
+ int value = (int) dataButton.getAttribute(MouseIO.CLICK_COUNT);
+
+ if (value == clickCount)
+ return dataButton;
+
+ return null;
+ }
+ return dataButton;
+ }
+}
@@ -70,6 +70,7 @@
tags = { },
status = Status.UNSTABLE
)
+@Deprecated
public class Doubleclick extends AbstractNode {
// ################################################################################
@@ -45,6 +45,7 @@
import org.squidy.designer.util.InputWindow;
import org.squidy.manager.controls.CheckBox;
import org.squidy.manager.controls.TextField;
+import org.squidy.manager.data.DataConstant;
import org.squidy.manager.data.IData;
import org.squidy.manager.data.Processor;
import org.squidy.manager.data.Property;
@@ -83,6 +84,8 @@
private static final boolean isWindows = System.getProperty("os.name").startsWith("Windows");
private InputWindow inputWindow;
private CDirectInputMouse cdim;
+
+ public static final DataConstant CLICK_COUNT = DataConstant.get(Integer.class, "CLICK_COUNT");
// ################################################################################
// BEGIN OF ADJUSTABLES
@@ -0,0 +1,124 @@
+/**
+ * Squidy Interaction Library is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the License,
+ * or (at your option) any later version.
+ *
+ * Squidy Interaction Library is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Squidy Interaction Library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * 2009 Human-Computer Interaction Group, University of Konstanz.
+ * <http://hci.uni-konstanz.de>
+ *
+ * Please contact info@squidy-lib.de or visit our website
+ * <http://www.squidy-lib.de> for further information.
+ */
+
+package org.squidy.nodes;
+
+import java.awt.Robot;
+import java.awt.event.KeyEvent;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+import org.squidy.manager.controls.TextField;
+import org.squidy.manager.data.IData;
+import org.squidy.manager.data.Processor;
+import org.squidy.manager.data.Property;
+import org.squidy.manager.data.impl.DataButton;
+import org.squidy.manager.data.impl.DataDigital;
+import org.squidy.manager.data.impl.DataKey;
+import org.squidy.manager.data.impl.DataPosition2D;
+import org.squidy.manager.model.AbstractNode;
+
+/**
+ * <code>RelativeMouseIO</code>.
+ *
+ * <pre>
+ * Date: Aug 03, 2012
+ * Time: 1:35:05 AM
+ * </pre>
+ *
+ * @author Roman Rädle, <a
+ * href="mailto:Roman.Raedle@uni-konstanz.de">Roman.Raedle
+ * @uni-konstanz.de</a>, University of Konstanz
+ * @version $Id$
+ */
+@XmlType(name = "RelativeMouse")
+@Processor(name = "Relative Mouse", types = { Processor.Type.FILTER }, tags = {
+ "mouse", "relative" })
+public class RelativeMouse extends AbstractNode {
+
+ // ################################################################################
+ // BEGIN OF PROPERTIES
+ // ################################################################################
+
+ @XmlAttribute(name = "X-Resolution")
+ @Property(name = "X-Resolution", description = "X-Resolution (in pixel) of the screen")
+ @TextField
+ private int resolutionX = 1920;
+
+ public int getResolutionX() {
+ return resolutionX;
+ }
+
+ public void setResolutionX(int resolutionX) {
+ this.resolutionX = resolutionX;
+ }
+
+ @XmlAttribute(name = "Y-Resolution")
+ @Property(name = "Y-Resolution", description = "Y-Resolution (in pixel) of the screen")
+ @TextField
+ private int resolutionY = 1200;
+
+ public int getResolutionY() {
+ return resolutionY;
+ }
+
+ public void setResolutionY(int resolutionY) {
+ this.resolutionY = resolutionY;
+ }
+
+ // ################################################################################
+ // END OF PROPERTIES
+ // ################################################################################
+
+ private int x = 0;
+ private int y = 0;
+
+ /**
+ *
+ */
+ public IData process(DataDigital dataDigital) {
+
+ if (dataDigital.hasAttribute(Keyboard.KEY_EVENT)) {
+ int key = (int) dataDigital.getAttribute(Keyboard.KEY_EVENT);
+
+ switch (key) {
+ case KeyEvent.VK_LEFT:
+ if (x >= 0) x--;
+ break;
+ case KeyEvent.VK_RIGHT:
+ if (x <= resolutionX) x++;
+ break;
+ case KeyEvent.VK_UP:
+ if (y >= 0) y--;
+ break;
+ case KeyEvent.VK_DOWN:
+ if (y <= resolutionY) y++;
+ break;
+ }
+
+ return new DataPosition2D(RelativeMouse.class, ((double)x / (double)resolutionX), ((double)y / (double)resolutionY));
+ }
+
+ return null;
+ }
+}

0 comments on commit 15e8d25

Please sign in to comment.