// Figure out where the initial mouse button press happened and
// store the initial position. We also store the center of the
// affordance.
if (event instanceof MouseButtonEvent3D) {
MouseButtonEvent3D be = (MouseButtonEvent3D)event;
if (be.isPressed() && be.getButton() == ButtonId.BUTTON1) {
// Figure out where the button press is in screen and world
// coordinates. Also fetch the current rotation for cell.
MouseEvent awtButtonEvent = (MouseEvent)be.getAwtEvent();
dragStartScreen = new Point(awtButtonEvent.getX(), awtButtonEvent.getY());
dragStartWorld = be.getIntersectionPointWorld();
// Figure out the world coordinates of the center of the
// affordance.
Entity entity = event.getEntity();
RenderComponent rc = (RenderComponent)entity.getComponent(RenderComponent.class);
Vector3f centerWorld = rc.getSceneRoot().getWorldTranslation();
// Compute the vector from the starting point of the drag
// to the center of the affordance in world coordinates.
dragStartVectorWorld = dragStartWorld.subtract(centerWorld);
dragStartRadius = dragStartVectorWorld.length();
// Show the resize label, make sure we do this in an
// AWT Event Thread
showResizeLabel(awtMouseEvent);
// Tell the listeners that a resizing has started
fireResizingStarted();
} else if (be.isReleased() == true) {
// Hide the resize label, make sure we do this in an
// AWT Event Thread
hideResizeLabel();
}
return;