From: <ha...@us...> - 2009-12-10 16:47:15
|
Revision: 11887 http://jmol.svn.sourceforge.net/jmol/?rev=11887&view=rev Author: hansonr Date: 2009-12-10 16:47:04 +0000 (Thu, 10 Dec 2009) Log Message: ----------- multitouch Modified Paths: -------------- trunk/Jmol/src/com/sparshui/common/Location.java trunk/Jmol/src/com/sparshui/common/messages/events/TouchEvent.java trunk/Jmol/src/com/sparshui/server/GestureServer.java trunk/Jmol/src/com/sparshui/server/TouchPoint.java trunk/Jmol/src/org/jmol/multitouch/sparshui/JmolSparshClientAdapter.java trunk/Jmol/src/org/jmol/multitouch/sparshui/SingleTouchGesture.java trunk/Jmol/src/org/jmol/multitouch/sparshui/TwoPointGesture.java trunk/Jmol/src/org/jmol/viewer/ActionManager.java trunk/Jmol/src/org/jmol/viewer/ActionManagerMT.java trunk/Jmol/src/org/jmol/viewer/TransformManager.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/com/sparshui/common/Location.java =================================================================== --- trunk/Jmol/src/com/sparshui/common/Location.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/com/sparshui/common/Location.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -60,7 +60,10 @@ } public String toString() { - return "x = " + _x + ", y = " + _y + "(" + pixelLocation(this).getX() + " " + pixelLocation(this).getY() + ")"; + return "x = " + _x + ", y = " + _y + + (_x < 1 && _x > 0 ? "(" + + pixelLocation(this).getX() + " " + pixelLocation(this).getY() + ")" + : ""); } Modified: trunk/Jmol/src/com/sparshui/common/messages/events/TouchEvent.java =================================================================== --- trunk/Jmol/src/com/sparshui/common/messages/events/TouchEvent.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/com/sparshui/common/messages/events/TouchEvent.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -96,12 +96,10 @@ if (data.length < 24) { System.err.println("An error occurred while deserializing a TouchEvent."); } else { - System.out.println("TouchEvent decode1 " + data.length); _id = Converter.byteArrayToInt(data, 0); _x = Converter.byteArrayToFloat(data, 4); _y = Converter.byteArrayToFloat(data, 8); _state = Converter.byteArrayToInt(data, 12); - System.out.println("TouchEvent decode2 " + data.length); _time = Converter.byteArrayToLong(data, 16); } } Modified: trunk/Jmol/src/com/sparshui/server/GestureServer.java =================================================================== --- trunk/Jmol/src/com/sparshui/server/GestureServer.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/com/sparshui/server/GestureServer.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -127,11 +127,10 @@ if (port == NetworkConfiguration.DEVICE_PORT) { Logger.info("[GestureServer] Accepting device connections"); acceptConnection(_mySocket.accept()); - } else { - Logger.info("[GestureServer] Accepting client connections"); - acceptConnection(_mySocket.accept()); return; // only one of these } + Logger.info("[GestureServer] Accepting client connections"); + acceptConnection(_mySocket.accept()); } catch (IOException e) { Logger.error("[GestureServer] Failed to establish connection on port " + port); e.printStackTrace(); @@ -209,8 +208,8 @@ boolean processTouchPoint(HashMap inputDeviceTouchPoints, int id, Location location, long time, int state) { if (Logger.debugging) { - Logger.info("[GestureServer] processTouchPoint " + id + " " + location - + " " + time + " " + state); + Logger.info("[GestureServer] processTouchPoint id=" + id + " state=" + state + " " + location + + " " + time); } Integer iid = new Integer(id); if (inputDeviceTouchPoints.containsKey(iid)) { @@ -223,7 +222,7 @@ } return true; } - TouchPoint touchPoint = new TouchPoint(location, time); + TouchPoint touchPoint = new TouchPoint(id, location, time); inputDeviceTouchPoints.put(iid, touchPoint); return processBirth(touchPoint); } Modified: trunk/Jmol/src/com/sparshui/server/TouchPoint.java =================================================================== --- trunk/Jmol/src/com/sparshui/server/TouchPoint.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/com/sparshui/server/TouchPoint.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -13,12 +13,12 @@ /** * Used to assign a globally unique id to a new touch point. */ - private static int nextID = 0; + //private static int nextID = 0; /** * */ - private static Object idLock = new Object(); + //private static Object idLock = new Object(); /** * @@ -61,13 +61,15 @@ } /** * + * @param id * @param location * @param time */ - public TouchPoint(Location location, long time) { - synchronized(idLock) { - _id = nextID++; - } + public TouchPoint(int id, Location location, long time) { + //synchronized(idLock) { + // _id = nextID++; + //} + _id = id; // for debugging, I need the exact match with device points _location = location; _time = time; _state = TouchState.BIRTH; Modified: trunk/Jmol/src/org/jmol/multitouch/sparshui/JmolSparshClientAdapter.java =================================================================== --- trunk/Jmol/src/org/jmol/multitouch/sparshui/JmolSparshClientAdapter.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/org/jmol/multitouch/sparshui/JmolSparshClientAdapter.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -114,7 +114,9 @@ gestureServer = (JmolGestureServerInterface) Interface .getInterface("com.sparshui.server.GestureServer"); gestureServer.startGestureServer(); - if (!isSimulation) + if (true || isSimulation) { + Logger.info("JmolSparshClientAdapter skipping driver startup"); + } else { try { String driver = (new File("JmolMultiTouchDriver.exe")).getAbsolutePath(); Logger.info("JmolSparshClientAdapter starting " + driver); @@ -130,6 +132,7 @@ } catch (Exception e) { System.out.println(e.getMessage()); } + } int port = NetworkConfiguration.CLIENT_PORT; try { actionManager = client; // ActionManagerMT @@ -233,7 +236,6 @@ fixXY(((TouchEvent) event).getX(), ((TouchEvent) event).getY()); iData = ((TouchEvent) event).getState(); time = ((TouchEvent) event).getTime(); - System.out.println("JmolSparshClientAdapter received time: " + time); break; case ActionManagerMT.ZOOM_EVENT: fixXY(((ZoomEvent) event).getCenter().getX(), ((ZoomEvent) event).getCenter().getY()); Modified: trunk/Jmol/src/org/jmol/multitouch/sparshui/SingleTouchGesture.java =================================================================== --- trunk/Jmol/src/org/jmol/multitouch/sparshui/SingleTouchGesture.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/org/jmol/multitouch/sparshui/SingleTouchGesture.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -2,6 +2,8 @@ import java.util.Vector; +import org.jmol.util.Logger; + import com.sparshui.common.TouchState; import com.sparshui.common.messages.events.TouchEvent; import com.sparshui.gestures.Gesture; @@ -43,8 +45,8 @@ */ // @override public Vector processChange(Vector touchPoints, TouchPoint changedTouchPoint) { - System.out.println("SingleTouchGesture processChange1 " + _nCurrent - + " state=" + changedTouchPoint.getState()); + if (Logger.debugging) + Logger.info("\nSingle id=" + changedTouchPoint.getID() + " state=" + changedTouchPoint.getState() + " ncurrent=" + _nCurrent + " nMoves=" + nMoves); Vector retEvents = new Vector(); switch (changedTouchPoint.getState()) { case TouchState.BIRTH: @@ -71,6 +73,8 @@ return retEvents; break; } + if (Logger.debugging) + Logger.info("Single creating new touch event"); retEvents.add(new TouchEvent(changedTouchPoint)); return retEvents; } Modified: trunk/Jmol/src/org/jmol/multitouch/sparshui/TwoPointGesture.java =================================================================== --- trunk/Jmol/src/org/jmol/multitouch/sparshui/TwoPointGesture.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/org/jmol/multitouch/sparshui/TwoPointGesture.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -62,8 +62,9 @@ protected Location _offsetCentroid = null; private Vector _traces1 = new Vector(); private Vector _traces2 = new Vector(); + private int _id1 = -1; + private int _id2 = -1; private int _nTraces = 0; - private int _nCurrent = 0; private float _scale; private float _rotation; private float _distance0; @@ -83,8 +84,11 @@ //@override public Vector processChange(Vector touchPoints, TouchPoint changedPoint) { + return processChangeSync(touchPoints, changedPoint); + } + private synchronized Vector processChangeSync(Vector touchPoints, + TouchPoint changedPoint) { Vector events = null; - switch(changedPoint.getState()) { case TouchState.BIRTH: events = processBirth(changedPoint); @@ -93,50 +97,53 @@ events = processMove(changedPoint); break; case TouchState.DEATH: - events = processDeath(); + events = processDeath(changedPoint); break; } - return (events != null) ? events : new Vector(); } // @override protected Vector processBirth(TouchPoint touchPoint) { - _nCurrent++; Location location = touchPoint.getLocation(); - System.out.println("TwoPointGesture birth ntraces:" + _nTraces + " ncurrent:" + _nCurrent); + int id = touchPoint.getID(); + System.out.println("TwoPointGesture birth ntraces:" + _nTraces + " ids:" + _id1+","+_id2+ " id:" + id); switch (_nTraces) { case 0: - _traces1 = new Vector(); + _traces1.clear(); _traces1.add(Location.pixelLocation(location)); + _id1 = id; + _nTraces = 1; break; case 1: - _traces2 = new Vector(); + _traces2.clear(); _traces2.add(Location.pixelLocation(location)); + _id2 = id; + Object o = _traces1.lastElement(); + _traces1.clear(); + _traces1.add(o); + _nTraces = 2; break; - default: - _myType = ActionManagerMT.INVALID_GESTURE; } - _nTraces++; return null; } // @override protected Vector processMove(TouchPoint touchPoint) { - System.out.println("TwoPointGesture move ntraces:" + _nTraces + " ncurrent:" + _nCurrent); + int id = touchPoint.getID(); + if (id != _id1 && id != _id2) { + + } + System.out.println("TwoPointGesture move ntraces:" + _nTraces + " ids:" + _id1+","+_id2+ " id:" + touchPoint.getID()); Vector events = new Vector(); - if (_nTraces != 2) + if (!updateLocations(touchPoint)) return events; - Location location = Location.pixelLocation(touchPoint.getLocation()); - updateLocations(location); - if (_nCurrent < 2) - return events; if (_myType == ActionManagerMT.INVALID_GESTURE) checkType(); if (_myType == ActionManagerMT.INVALID_GESTURE || !updateCentroid()) return events; - location = Location.screenLocation(_offsetCentroid); + Location location = Location.screenLocation(_offsetCentroid); Event event = null; switch (_myType) { case ActionManagerMT.ZOOM_GESTURE: @@ -155,45 +162,70 @@ } // @override - protected Vector processDeath() { - _nCurrent--; - System.out.println("TwoPointGesture death ntraces:" + _nTraces + " ncurrent:" + _nCurrent); - if (_nCurrent <= 0) { - _nTraces = _nCurrent = 0; - _traces1 = null; - _traces2 = null; - _v00 = null; - _myType = ActionManagerMT.INVALID_GESTURE; + protected Vector processDeath(TouchPoint touchPoint) { + System.out.println("TwoPointGesture death ntraces:" + _nTraces + " ids:" + + _id1 + "," + _id2 + " id:" + touchPoint.getID()); + if (--_nTraces == 1) { + int id = touchPoint.getID(); + if (id == _id1) { + _id1 = _id2; + Vector v = _traces1; + _traces1 = _traces2; + _traces2 = v; + _traces2.clear(); + _id2 = -1; + } else if (id == _id2) { + _traces2.clear(); + _id2 = -1; + } else { + _nTraces = 0; + } + } + if (_nTraces == 0) { + _traces1.clear(); + _traces2.clear(); + _id1 = _id2 = -1; } + _v00 = null; + _myType = ActionManagerMT.INVALID_GESTURE; return null; } - private void updateLocations(Location location) { - boolean id1 = (_nCurrent < 2 - || location.distance2((Location) _traces1.lastElement()) <= location - .distance2((Location) _traces2.lastElement())); - if (id1) { + private boolean updateLocations(TouchPoint touchPoint) { + Location location = Location.pixelLocation(touchPoint.getLocation()); + int id = touchPoint.getID(); + if (id == _id1) { + //System.out.println("TwoPointGesture updateLocation 1: " + id + " " + //+ location); _traces1.add(location); + } else if (id == _id2) { + //System.out.println("TwoPointGesture updateLocation 2: " + id + " " + // + location); + _traces2.add(location); } else { - _traces2.add(location); + //System.out.println("TwoPointGesture updateLocation NOT: " + id); + return false; } - if (_nCurrent == 2) { - // weight centroid to the branch that is not moving - // this works for zoom or rotation - if (_v00 == null) { - Location l1 = (Location) _traces1.firstElement(); - Location l2 = (Location) _traces2.firstElement(); - _v00 = new Vector3f(l2.getX() - l1.getX(), l2.getY() - l1.getY(), 0); - _distance0 = _v00.length(); - _v00.normalize(); - } - } + if (_nTraces < 2) + return false; + // weight centroid to the branch that is not moving + // this works for zoom or rotation + if (_v00 != null) + return true; + Location l1 = (Location) _traces1.firstElement(); + Location l2 = (Location) _traces2.firstElement(); + _v00 = new Vector3f(l2.getX() - l1.getX(), l2.getY() - l1.getY(), 0); + _distance0 = _v00.length(); + _v00.normalize(); + //System.out.println("TwoPointGesture updateLocation _v00 and _distance0: " + // + _v00 + " " + _distance0); + return true; } private void checkType() { - System.out.println("TwoPointGesture type=" + _myType + " _v00=" + _v00 - + "\n traces sizes: " + _traces1.size() + " " + _traces2.size()); - if (_traces1.size() < 10 || _traces2.size() < 10) + //System.out.println("TwoPointGesture type=" + _myType + " _v00=" + _v00 + // + "\n traces sizes: " + _traces1.size() + " " + _traces2.size()); + if (_traces1.size() < 5 || _traces2.size() < 5) return; Location loc10 = (Location) _traces1.firstElement(); Location loc20 = (Location) _traces2.firstElement(); @@ -205,24 +237,20 @@ - loc20.getY(), 0); float d1 = v1.length(); float d2 = v2.length(); + if (d1 <= 2 || d2 <= 2) + return; v1.normalize(); v2.normalize(); float cos01 = Math.abs(_v00.dot(v1)); float cos02 = Math.abs(_v00.dot(v2)); float cos12 = v1.dot(v2); - if (d1 < 2 || d2 < 2 || Math.abs(cos12) > 0.90) { - if (d1 >= 2 && d2 >= 2 && cos12 > 0.9) { - // two co-aligned motions - _myType = ActionManagerMT.MULTI_POINT_DRAG_GESTURE; - } else if (d1 < 2 && cos02 < 0.80 || d2 < 2 && cos01 < 0.80 || cos01 < 0.80 - && cos02 < 0.80) { - // two oppositely directed but offset motions - _myType = ActionManagerMT.ROTATE_GESTURE; - } else if (d1 < 2 && cos02 > 0.9 || d2 < 2 && cos01 > 0.9 || cos01 > 0.9 - && cos02 > 0.9) { - // to classic zoom motions - _myType = ActionManagerMT.ZOOM_GESTURE; - } + System.out.println("2pg cos12=" + cos12); + if (cos12 > 0.9) { + // two co-aligned motions + _myType = ActionManagerMT.MULTI_POINT_DRAG_GESTURE; + } else if (cos12 < -0.8) { + // to classic zoom motions + _myType = ActionManagerMT.ZOOM_GESTURE; } //if (Logger.debugging) Logger.info("TwoPointGesture type=" + _myType + " _v00=" + _v00 @@ -264,6 +292,7 @@ if (Math.abs(d1 - _distance0) < 2) return false; _scale = (d1 < _distance0 ? -1 : 1); + _distance0 = d1; float w1 = d2 / (d1 + d2); float w2 = 1 - w1; _offsetCentroid = new Location(loc10.getX() * w1 + loc20.getX() * w2, Modified: trunk/Jmol/src/org/jmol/viewer/ActionManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/ActionManager.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/org/jmol/viewer/ActionManager.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -727,7 +727,9 @@ } if (isBound(action, ACTION_rotate)) { - viewer.rotateXYBy(deltaX, deltaY); + float degX = ((float) deltaX) / viewer.getScreenWidth() * 180; + float degY = ((float) deltaY) / viewer.getScreenHeight() * 180; + viewer.rotateXYBy(degX, degY); return; } @@ -738,8 +740,10 @@ } if (viewer.allowRotateSelected() && isBound(action, ACTION_rotateSelected)) { + float degX = ((float) deltaX) / viewer.getScreenWidth() * 180; + float degY = ((float) deltaY) / viewer.getScreenHeight() * 180; checkMotion(Viewer.CURSOR_MOVE); - viewer.rotateMolecule(deltaX, deltaY); + viewer.rotateMolecule(degX, degY); return; } if (drawMode && ( @@ -1388,8 +1392,8 @@ return 0; MotionPoint mp1 = getNode(ptNext - 1 - nPointsPrevious); MotionPoint mp0 = getNode(ptNext - nPoints - nPointsPrevious); - float dx = mp1.x - mp0.x; - float dy = mp1.y - mp0.y; + float dx = ((float) (mp1.x - mp0.x)) / viewer.getScreenWidth() * 180; + float dy = ((float) (mp1.y - mp0.y)) / viewer.getScreenHeight() * 180; float speed = (float) Math.sqrt(dx * dx + dy * dy) / (mp1.time - mp0.time); return speed; } Modified: trunk/Jmol/src/org/jmol/viewer/ActionManagerMT.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/ActionManagerMT.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/org/jmol/viewer/ActionManagerMT.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -92,6 +92,7 @@ super.setBinding(newBinding); binding.unbindMouseAction(Binding.RIGHT); if (simulator != null && binding != null) { + binding.unbindJmolAction(ACTION_center); binding.unbind(Binding.CTRL + Binding.LEFT + Binding.SINGLE_CLICK, null); binding.bind(Binding.CTRL + Binding.LEFT + Binding.SINGLE_CLICK, ACTION_multiTouchSimulation); } @@ -232,19 +233,19 @@ break; case CLICK: // always follows DEATH when found - mouseClicked(time, (int) pt.x, (int) pt.y, Binding.LEFT, 1); + super.mouseClicked(time, (int) pt.x, (int) pt.y, Binding.LEFT, 1); } break; case ZOOM_EVENT: float scale = pt.z; if (scale == -1 || scale == 1) { pt.z = Float.NaN; - zoomByFactor((int)scale, (int) pt.x, (int) pt.y); + zoomByFactor((int)scale, Integer.MAX_VALUE, Integer.MAX_VALUE);//(int) pt.x, (int) pt.y); } break; case ROTATE_EVENT: checkMotion(Viewer.CURSOR_MOVE); - viewer.rotateZBy((int) pt.z, (int) pt.x, (int) pt.y); + viewer.rotateZBy((int) pt.z, Integer.MAX_VALUE, Integer.MAX_VALUE);//(int) pt.x, (int) pt.y); break; case DRAG_EVENT: if (iData == 2) { @@ -277,6 +278,8 @@ } void mouseClicked(long time, int x, int y, int mods, int count) { + if (haveMultiTouchInput) + return; super.mouseClicked(time, x, y, mods, count); } Modified: trunk/Jmol/src/org/jmol/viewer/TransformManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/TransformManager.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/org/jmol/viewer/TransformManager.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -334,7 +334,7 @@ rotateAboutPointsInternal(pt2, pt1, 10 * speed, Float.NaN, false, true, null, true); } - void rotateXYBy(int xDelta, int yDelta, BitSet bsAtoms) { + void rotateXYBy(float xDelta, float yDelta, BitSet bsAtoms) { // from mouse action rotateXRadians(yDelta * JmolConstants.radiansPerDegree, bsAtoms); rotateYRadians(xDelta * JmolConstants.radiansPerDegree, bsAtoms); Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2009-12-09 19:24:34 UTC (rev 11886) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2009-12-10 16:47:04 UTC (rev 11887) @@ -68,9 +68,12 @@ import java.awt.Image; import java.awt.Dimension; import java.awt.MediaTracker; +import java.awt.Point; import java.awt.Rectangle; import java.awt.Component; import java.awt.Event; +import java.awt.Toolkit; +import java.awt.image.MemoryImageSource; import java.util.Hashtable; import java.util.BitSet; import java.util.Properties; @@ -236,7 +239,8 @@ private boolean jvm11orGreater = false; private boolean jvm12orGreater = false; private boolean jvm14orGreater = false; - + private boolean multiTouch = false; + private Viewer(Component display, JmolAdapter modelAdapter, String commandOptions) { // use allocateViewer if (Logger.debugging) { @@ -253,7 +257,7 @@ && strJavaVersion.compareTo("1.1.5") <= 0 && "Mac OS".equals(strOSName))); jvm12orGreater = (strJavaVersion.compareTo("1.2") >= 0); jvm14orGreater = (strJavaVersion.compareTo("1.4") >= 0); - boolean multiTouch = (commandOptions != null && commandOptions.contains("-multitouch")); + multiTouch = (commandOptions != null && commandOptions.contains("-multitouch")); stateManager = new StateManager(this); g3d = new Graphics3D(display); colorManager = new ColorManager(this, g3d); @@ -262,10 +266,18 @@ transformManager = new TransformManager11(this); selectionManager = new SelectionManager(this); if (display != null) { - if (multiTouch) + if (multiTouch) { + int[] pixels = new int[1]; + Image image = Toolkit.getDefaultToolkit().createImage( + new MemoryImageSource(1, 1, pixels, 0, 1)); + Cursor transparentCursor = + Toolkit.getDefaultToolkit().createCustomCursor + (image, new Point(0, 0), "invisibleCursor"); + display.setCursor(transparentCursor); actionManager = new ActionManagerMT(this, commandOptions); - else + } else { actionManager = new ActionManager(this); + } if (jvm14orGreater) mouseManager = new MouseManager14(display, this, actionManager); else if (jvm11orGreater) @@ -881,7 +893,7 @@ + (x == Integer.MAX_VALUE ? "" : " " + x + " " + y)); } - void rotateXYBy(int xDelta, int yDelta) { + void rotateXYBy(float xDelta, float yDelta) { // mouseSinglePressDrag if (mouseEnabled) transformManager.rotateXYBy(xDelta, yDelta, null); @@ -906,7 +918,7 @@ + (x == Integer.MAX_VALUE ? "" : " " + x + " " + y): ""); } - void rotateMolecule(int deltaX, int deltaY) { + void rotateMolecule(float deltaX, float deltaY) { if (isJmolDataFrame()) return; if (mouseEnabled) { @@ -4167,7 +4179,7 @@ private int currentCursor = CURSOR_DEFAULT; public void setCursor(int cursor) { - if (currentCursor == cursor || display == null) + if (multiTouch || currentCursor == cursor || display == null) return; int c; switch (currentCursor = cursor) { @@ -7607,11 +7619,11 @@ break; case 4: if (key.equals("rotateXYBy")) - rotateXYBy(Parser.parseInt(tokens[2]), Parser.parseInt(tokens[3])); + rotateXYBy(Parser.parseFloat(tokens[2]), Parser.parseFloat(tokens[3])); else if (key.equals("translateXYBy")) translateXYBy(Parser.parseInt(tokens[2]), Parser.parseInt(tokens[3])); else if (key.equals("rotateMolecule")) - rotateMolecule(Parser.parseInt(tokens[2]), Parser.parseInt(tokens[3])); + rotateMolecule(Parser.parseFloat(tokens[2]), Parser.parseFloat(tokens[3])); break; case 5: if (key.equals("spinXYBy")) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |