From: <ha...@us...> - 2006-11-19 19:31:58
|
Revision: 6273 http://svn.sourceforge.net/jmol/?rev=6273&view=rev Author: hansonr Date: 2006-11-19 11:31:53 -0800 (Sun, 19 Nov 2006) Log Message: ----------- cursor changes for dragging Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/BbcageRenderer.java trunk/Jmol/src/org/jmol/viewer/Frame.java trunk/Jmol/src/org/jmol/viewer/MouseManager.java trunk/Jmol/src/org/jmol/viewer/StateManager.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/viewer/BbcageRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/BbcageRenderer.java 2006-11-19 19:00:48 UTC (rev 6272) +++ trunk/Jmol/src/org/jmol/viewer/BbcageRenderer.java 2006-11-19 19:31:53 UTC (rev 6273) @@ -37,6 +37,9 @@ } void render() { + + if (false && viewer.pointToCenter) //not ready to implement this + showCenterPointer(); Bbcage bbcage = (Bbcage)shape; short mad = bbcage.mad; if (mad == 0) @@ -72,4 +75,11 @@ screens[Bbcage.edges[i+1]]); } } + + void showCenterPointer() { + short colix = viewer.getColixBackgroundContrast(); + screens[0].set(viewer.getCursorX(), viewer.getCursorY(), 1); + viewer.transformPoint(viewer.getRotationCenter(), screens[1]); + g3d.drawDottedLine(colix, screens[0], screens[1]); + } } Modified: trunk/Jmol/src/org/jmol/viewer/Frame.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Frame.java 2006-11-19 19:00:48 UTC (rev 6272) +++ trunk/Jmol/src/org/jmol/viewer/Frame.java 2006-11-19 19:31:53 UTC (rev 6273) @@ -360,6 +360,7 @@ loadShape(JmolConstants.SHAPE_STICKS); loadShape(JmolConstants.SHAPE_HSTICKS); loadShape(JmolConstants.SHAPE_MEASURES); + loadShape(JmolConstants.SHAPE_BBCAGE); loadShape(JmolConstants.SHAPE_UCCAGE); if (adapter != null) { Modified: trunk/Jmol/src/org/jmol/viewer/MouseManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/MouseManager.java 2006-11-19 19:00:48 UTC (rev 6272) +++ trunk/Jmol/src/org/jmol/viewer/MouseManager.java 2006-11-19 19:31:53 UTC (rev 6273) @@ -197,6 +197,7 @@ if (logMouseEvents) Logger.debug("mouseReleased("+x+","+y+","+modifiers+")"); viewer.setInMotion(false); + viewer.getAwtComponent().setCursor(Cursor.getDefaultCursor()); } int previousClickX, previousClickY; @@ -334,7 +335,8 @@ void mouseSinglePressDrag(int deltaX, int deltaY, int modifiers) { //viewer.setStatusUserAction("mouseSinglePressDrag: " + modifiers); - + viewer.getAwtComponent().setCursor( + Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); switch (modifiers & BUTTON_MODIFIER_MASK) { case LEFT: viewer.rotateXYBy(deltaX, deltaY); @@ -343,7 +345,8 @@ case ALT_LEFT: case ALT_SHIFT_LEFT: if (drawMode) { - viewer.checkObjectDragged(previousDragX, previousDragY, deltaX, deltaY, modifiers); + viewer.checkObjectDragged(previousDragX, previousDragY, deltaX, deltaY, + modifiers); break; } case MIDDLE: Modified: trunk/Jmol/src/org/jmol/viewer/StateManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/StateManager.java 2006-11-19 19:00:48 UTC (rev 6272) +++ trunk/Jmol/src/org/jmol/viewer/StateManager.java 2006-11-19 19:31:53 UTC (rev 6273) @@ -404,6 +404,7 @@ boolean showHiddenSelectionHalos = false; boolean showMeasurements = true; boolean frankOn = false; + boolean centerPointer = true; //atoms and bonds Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2006-11-19 19:00:48 UTC (rev 6272) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2006-11-19 19:31:53 UTC (rev 6273) @@ -403,9 +403,16 @@ return transformManager.getMoveToText(timespan); } + boolean pointToCenter = false; + + boolean getPointToCenter() { + return pointToCenter; + } + void rotateXYBy(int xDelta, int yDelta) { //mouseSinglePressDrag transformManager.rotateXYBy(xDelta, yDelta); + //just an idea. Nah... pointToCenter = global.centerPointer; refresh(1, "Viewer:rotateXYBy()"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |