((tg = (TransformGroup)pr.getNode(PickResult.TRANSFORM_GROUP)) != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))){
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ public void updateScene(int xpos, int ypos){ TransformGroup tg = null; if (mevent.isAltDown() && !mevent.isMetaDown()){ pickCanvas.setShapeLocation(xpos, ypos); PickResult pr = pickCanvas.pickClosest(); if ((pr != null) && ((tg = (TransformGroup)pr.getNode(PickResult.TRANSFORM_GROUP)) != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))){ zoom.setTransformGroup(tg); zoom.wakeup(); currentTG = tg; // Need to clean up Issue 123 --- Chien // freePickResult(pr); } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }
/** * Update the scene to manipulate any nodes. This is not meant to be * called by users. Behavior automatically calls this. You can call * this only if you know what you are doing. * * @param xpos Current mouse X pos. * @param ypos Current mouse Y pos. **/ public void updateScene(int xpos, int ypos){ TransformGroup tg = null; if (!mevent.isMetaDown() && !mevent.isAltDown() && mevent.isShiftDown()){ pickCanvas.setShapeLocation(xpos, ypos); PickResult pr = pickCanvas.pickClosest(); if ((pr != null) && ((tg = (TransformGroup)pr.getNode(PickResult.TRANSFORM_GROUP)) != null) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_READ)) && (tg.getCapability(TransformGroup.ALLOW_TRANSFORM_WRITE))){ drag.setTransformGroup(tg); drag.wakeup(); currentTG = tg; // free the PickResult // Need to clean up Issue 123 --- Chien // freePickResult(pr); } else if (callback!=null) callback.transformChanged( PickingCallback.NO_PICK, null ); } }