Java Code Examples for javafx.scene.input.MouseEvent#MOUSE_DRAGGED

The following examples show how to use javafx.scene.input.MouseEvent#MOUSE_DRAGGED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PointerEventHandler.java    From jfxvnc with Apache License 2.0 6 votes vote down vote up
private void sendMouseEvents(MouseEvent event) {

    xPosProperty.set((int) Math.floor(event.getX() / zoomLevel));
    yPosProperty.set((int) Math.floor(event.getY() / zoomLevel));

    byte buttonMask = 0;
    if (event.getEventType() == MouseEvent.MOUSE_PRESSED || event.getEventType() == MouseEvent.MOUSE_DRAGGED) {
      if (event.isMiddleButtonDown()) {
        buttonMask = 2;
      } else if (event.isSecondaryButtonDown()) {
        buttonMask = 4;
      } else {
        buttonMask = 1;
      }
      fire(new PointerEvent(buttonMask, xPosProperty.get(), yPosProperty.get()));
    } else if (event.getEventType() == MouseEvent.MOUSE_RELEASED || event.getEventType() == MouseEvent.MOUSE_MOVED) {
      buttonMask = 0;
    }

    fire(new PointerEvent(buttonMask, xPosProperty.get(), yPosProperty.get()));

  }
 
Example 2
Source File: HeatControlSkin.java    From Enzo with Apache License 2.0 6 votes vote down vote up
private void handleMouseEvent(final MouseEvent MOUSE_EVENT) {
    final Object    SRC  = MOUSE_EVENT.getSource();
    final EventType TYPE = MOUSE_EVENT.getEventType();
    if (SRC.equals(targetIndicator)) {
        if (MouseEvent.MOUSE_PRESSED == TYPE) {    
            userAction = true;
            value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", getSkinnable().getTarget()));
            resizeText();                
        } else if (MouseEvent.MOUSE_DRAGGED == TYPE) {
            touchRotate(MOUSE_EVENT.getSceneX() - getSkinnable().getLayoutX(), MOUSE_EVENT.getSceneY() - getSkinnable().getLayoutY(), targetIndicatorRotate);                
        } else if (MouseEvent.MOUSE_RELEASED == TYPE) {                
            getSkinnable().setTarget(Double.parseDouble(newTarget));
            fadeBack();
        }
    }
}
 
Example 3
Source File: OverviewPanel.java    From constellation with Apache License 2.0 5 votes vote down vote up
@Override
public void handle(final MouseEvent t) {
    if (t.getEventType() == MouseEvent.MOUSE_MOVED) {
        handleResizing(t);
    } else if (t.getEventType() == MouseEvent.MOUSE_PRESSED) {
        origin = t.getX(); // Set the origin on all mouse presses.

        handleResizing(t);
    } else if (t.getEventType() == MouseEvent.MOUSE_RELEASED) {
        handleRelease(t);
    } else if (t.getEventType() == MouseEvent.MOUSE_DRAGGED) {
        handleDragging(t);
    }
}
 
Example 4
Source File: FXEventQueueDevice.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override
public void moveto(Node node, double xoffset, double yoffset) {
    MouseButton buttons = deviceState.getButtons();
    if (node != deviceState.getNode()) {
        if (deviceState.getNode() != null) {
            dispatchEvent(createMouseEvent(MouseEvent.MOUSE_PRESSED, null, null, xoffset, yoffset, 0, 0, buttons, 0,
                    deviceState.shiftPressed, deviceState.ctrlPressed, deviceState.altPressed, deviceState.metaPressed,
                    buttons == MouseButton.PRIMARY, buttons == MouseButton.MIDDLE, buttons == MouseButton.SECONDARY, false,
                    false, false, node));
        }
        dispatchEvent(createMouseEvent(MouseEvent.MOUSE_ENTERED, null, null, xoffset, yoffset, 0, 0, buttons, 0,
                deviceState.shiftPressed, deviceState.ctrlPressed, deviceState.altPressed, deviceState.metaPressed,
                buttons == MouseButton.PRIMARY, buttons == MouseButton.MIDDLE, buttons == MouseButton.SECONDARY, false, false,
                false, node));
    }
    Node source = node;
    EventType<MouseEvent> id = MouseEvent.MOUSE_MOVED;
    if (buttons != MouseButton.NONE) {
        id = MouseEvent.MOUSE_DRAGGED;
        source = deviceState.getDragSource();
    }
    MouseButton modifierEx = deviceState.getButtonMask();
    dispatchEvent(createMouseEvent(id, null, null, xoffset, yoffset, 0, 0, buttons, 0, deviceState.shiftPressed,
            deviceState.ctrlPressed, deviceState.altPressed, deviceState.metaPressed, modifierEx == MouseButton.PRIMARY,
            modifierEx == MouseButton.MIDDLE, modifierEx == MouseButton.SECONDARY, false, false, false, source));
    deviceState.setNode(node);
    deviceState.setMousePosition(xoffset, yoffset);
}
 
Example 5
Source File: UICanvas.java    From arma-dialog-creator with MIT License 5 votes vote down vote up
@Override
public void handle(MouseEvent event) {
	MouseButton btn = event.getButton();
	if (!(event.getTarget() instanceof Canvas)) {
		return;
	}

	Canvas c = (Canvas) event.getTarget();
	Point2D p = c.sceneToLocal(event.getSceneX(), event.getSceneY());
	int mousex = (int) p.getX();
	int mousey = (int) p.getY();

	if (event.getEventType() == MouseEvent.MOUSE_MOVED || event.getEventType() == MouseEvent.MOUSE_DRAGGED) {
		canvas.mouseMoved(mousex, mousey);
		canvas.setLastMousePosition(mousex, mousey);
		if (mouseDown) {
			this.canvas.requestPaint();
		}
	} else {
		if (event.getEventType() == MouseEvent.MOUSE_PRESSED) {
			mouseDown = true;
			canvas.mousePressed(mousex, mousey, btn);
		} else if (event.getEventType() == MouseEvent.MOUSE_RELEASED) {
			canvas.mouseReleased(mousex, mousey, btn);
			mouseDown = false;
			canvas.requestPaint();
		}
	}

}
 
Example 6
Source File: CardAppleMouse.java    From jace with GNU General Public License v2.0 5 votes vote down vote up
private void processMouseEvent(MouseEvent event) {
    if (event.getEventType() == MouseEvent.MOUSE_MOVED || event.getEventType() == MouseEvent.MOUSE_DRAGGED) {
        Node source = (Node) event.getSource();
        updateLocation(event.getSceneX(), event.getSceneY(), source.getBoundsInLocal());
        event.consume();
    }
    if (event.getEventType() == MouseEvent.MOUSE_PRESSED || event.getEventType() == MouseEvent.MOUSE_DRAGGED) {
        mousePressed(event);
        event.consume();
    } else if (event.getEventType() == MouseEvent.MOUSE_RELEASED) {
        mouseReleased(event);
        event.consume();
    }
}
 
Example 7
Source File: DragSupport.java    From scenic-view with GNU General Public License v3.0 4 votes vote down vote up
public DragSupport(Node target, final KeyCode modifier, final MouseButton mouseButton, final Orientation orientation, final Property<Number> property, final double factor) {
    this.target = target;
    mouseEventHandler = new EventHandler<MouseEvent>() {

        @Override
        public void handle(MouseEvent t) {
            if (t.getEventType() != MouseEvent.MOUSE_ENTERED_TARGET
                    && t.getEventType() != MouseEvent.MOUSE_EXITED_TARGET) {
                lastMouseEvent = t;
            }
            if (t.getEventType() == MouseEvent.MOUSE_PRESSED) {
                if (t.getButton() == mouseButton
                        && isModifierCorrect(t, modifier)) {
                    anchor = property.getValue();
                    dragAnchor = getCoord(t, orientation);
                    t.consume();
                }
            } else if (t.getEventType() == MouseEvent.MOUSE_DRAGGED) {
                if (t.getButton() == mouseButton
                        && isModifierCorrect(t, modifier)) {
                    property.setValue(anchor.doubleValue()
                            + (getCoord(t, orientation) - dragAnchor) * factor);
                    t.consume();
                }
            }
        }
    };
    keyboardEventHandler = (KeyEvent t) -> {
        if (t.getEventType() == KeyEvent.KEY_PRESSED) {
            if (t.getCode() == modifier) {
                anchor = property.getValue();
                if (lastMouseEvent != null) {
                    dragAnchor = getCoord(lastMouseEvent, orientation);
                }
                t.consume();
            }
        } else if (t.getEventType() == KeyEvent.KEY_RELEASED) {
            if (t.getCode() != modifier && isModifierCorrect(t, modifier)) {
                anchor = property.getValue();
                if (lastMouseEvent != null) {
                    dragAnchor = getCoord(lastMouseEvent, orientation);
                }
                t.consume();
            }
        }
    };
    target.addEventHandler(MouseEvent.ANY, mouseEventHandler);
    target.addEventHandler(KeyEvent.ANY, keyboardEventHandler);
}
 
Example 8
Source File: ImagePanel.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
@Override
public void handle(MouseEvent e) {
    if (e.getEventType() == MouseEvent.MOUSE_PRESSED) {
        requestFocus();
        if (new_rectangle_is_being_drawn == false) {
            starting_point_x = e.getX();
            starting_point_y = e.getY();
            newRect = new Annotation();
            newRect.setFill(SELECTED_ANNOTATION_COLOR);
            new_rectangle_is_being_drawn = true;
            anchorPane.getChildren().add(newRect);
        }
    }
    if (e.getEventType() == MouseEvent.MOUSE_DRAGGED) {
        if (!edit) {
            return;
        }
        if (new_rectangle_is_being_drawn == true) {
            double current_ending_point_x = e.getX();
            double current_ending_point_y = e.getY();
            if (current_ending_point_x < 0) {
                current_ending_point_x = 0;
            }
            if (current_ending_point_y < 0) {
                current_ending_point_y = 0;
            }
            if (current_ending_point_x > canvas.getWidth()) {
                current_ending_point_x = canvas.getWidth();
            }
            if (current_ending_point_y > canvas.getHeight()) {
                current_ending_point_y = canvas.getHeight();
            }

            adjust_rectangle_properties(starting_point_x, starting_point_y, current_ending_point_x, current_ending_point_y,
                    newRect);
            ensureVisible(scrollPane, newRect);
        }
    }
    if (e.getEventType() == MouseEvent.MOUSE_RELEASED) {
        anchorPane.getChildren().remove(newRect);
        newRect.setFill(ANNOTATION_COLOR);
        newRect.setText("Annotation");
        if (newRect.getWidth() > 10 && newRect.getHeight() > 10) {
            System.out.println("ImagePanel.ImagePanelMouseListener.handle(" + newRect + ")");
            annotations.add(newRect);
        }
        drawGraphics();
        newRect = null;
        new_rectangle_is_being_drawn = false;
    }
}
 
Example 9
Source File: GUIConsoleInput.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Creates a new GUI console input.
 *
 * @param area GUI text area
 */
public GUIConsoleInput(InlineCssTextArea area) {
  this.area = area;
  initialPos = -1;
  inputText = null;
  area.setEditable(false);
  queue = new ArrayBlockingQueue<>(1);
  listener = new EventHandler<KeyEvent>() {
    @Override
    public void handle(KeyEvent e) {
      switch (e.getCode()) {
        case UP:
        case KP_UP:
        case PAGE_UP:
          area.moveTo(initialPos);
          e.consume();
          break;
        case DOWN:
        case KP_DOWN:
        case PAGE_DOWN:
          area.moveTo(area.getLength());
          e.consume();
          break;
        // ensure always that caret position is >= initialPos
        case LEFT:
        case KP_LEFT:
        case BACK_SPACE:
          if (area.getCaretPosition() == initialPos)
            e.consume();
          break;
        // return user response
        case ENTER:
          // after user release enter key return response
          if (e.getEventType() == KeyEvent.KEY_RELEASED)
            returnResponse();
          break;
        // nothing
        default:
          // change area input color
          if (initialPos < area.getLength()) {
            area.setStyle(initialPos, area.getLength(), "-fx-fill: #4a148c;");
          }
          break;
      }
    }
  };
  mouseListener = new EventHandler<MouseEvent>() {
    @Override
    public void handle(MouseEvent e) {
      EventType<? extends MouseEvent> type = e.getEventType();
      // disable mouse selection
      if (type == MouseEvent.DRAG_DETECTED || type == MouseEvent.MOUSE_DRAGGED)
        e.consume();
      // control caret position
      if (type == MouseEvent.MOUSE_CLICKED || type == MouseEvent.MOUSE_RELEASED || type == MouseEvent.MOUSE_PRESSED) {
        if (e.getButton() == MouseButton.PRIMARY) {
          if (area.getCaretPosition() < initialPos) {
            area.setDisable(true);
            area.moveTo(initialPos);
            area.setDisable(false);
          }
        } else {
          e.consume();
        }
      }
    }
  };
  stopListener = new ChangeListener<Boolean>() {
    @Override
    public void changed(ObservableValue obs, Boolean oldValue, Boolean newValue) {
      if (!newValue) {
        returnResponse();
      }
    }
  };
}
 
Example 10
Source File: CreateCurveOnDragHandler.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void startDrag(MouseEvent event) {
	// create new curve
	GeometricCurve curve = new GeometricCurve(new Point[] { new Point(), new Point() },
			MvcLogoExample.GEF_COLOR_GREEN, MvcLogoExample.GEF_STROKE_WIDTH, MvcLogoExample.GEF_DASH_PATTERN, null);
	curve.addSourceAnchorage(getShapePart().getContent());

	// create using CreationPolicy from root part
	CreationPolicy creationPolicy = getHost().getRoot().getAdapter(CreationPolicy.class);
	init(creationPolicy);
	curvePart = (GeometricCurvePart) creationPolicy.create(curve, getHost().getRoot(),
			HashMultimap.<IContentPart<? extends Node>, String> create());
	commit(creationPolicy);

	// disable refresh visuals for the curvePart
	storeAndDisableRefreshVisuals(curvePart);

	// move curve to pointer location
	curvePart.getVisual().setEndPoint(getLocation(event));

	// build operation to deselect all but the new curve part
	List<IContentPart<? extends Node>> toBeDeselected = new ArrayList<>(
			getHost().getRoot().getViewer().getAdapter(SelectionModel.class).getSelectionUnmodifiable());
	toBeDeselected.remove(curvePart);
	DeselectOperation deselectOperation = new DeselectOperation(getHost().getRoot().getViewer(), toBeDeselected);
	// execute on stack
	try {
		getHost().getRoot().getViewer().getDomain().execute(deselectOperation, new NullProgressMonitor());
	} catch (ExecutionException e) {
		throw new RuntimeException(e);
	}

	// find bend target part
	bendTargetPart = findBendTargetPart(curvePart, event.getTarget());
	if (bendTargetPart != null) {
		dragPolicies = bendTargetPart.getAdapters(ClickDragGesture.ON_DRAG_POLICY_KEY);
	}
	if (dragPolicies != null) {
		MouseEvent dragEvent = new MouseEvent(event.getSource(), event.getTarget(), MouseEvent.MOUSE_DRAGGED,
				event.getX(), event.getY(), event.getScreenX(), event.getScreenY(), event.getButton(),
				event.getClickCount(), event.isShiftDown(), event.isControlDown(), event.isAltDown(),
				event.isMetaDown(), event.isPrimaryButtonDown(), event.isMiddleButtonDown(),
				event.isSecondaryButtonDown(), event.isSynthesized(), event.isPopupTrigger(),
				event.isStillSincePress(), event.getPickResult());
		for (IOnDragHandler dragPolicy : dragPolicies.values()) {
			dragPolicy.startDrag(event);
			// XXX: send initial drag event so that the end position is set
			dragPolicy.drag(dragEvent, new Dimension());
		}
	}
}
 
Example 11
Source File: StageFloatable.java    From AnchorFX with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void setupMouseEvents() {
    eventsHandler = event -> {

        if (event.getEventType() == MouseEvent.MOUSE_PRESSED) {
            mousePositionStart = new Point2D(event.getScreenX(), event.getScreenY());
            startWidth = getWidth();
            startX = getX();

            startHeight = getHeight();
            startY = getY();
        }

        if (event.getEventType() == MouseEvent.MOUSE_MOVED) {

            boolean sizeRight = valueInRange(event.getX(), stackPanelContainer.getWidth() - stackPanelContainer.getPadding().getLeft(), stackPanelContainer.getWidth());
            boolean sizeLeft = valueInRange(event.getX(), 0, stackPanelContainer.getPadding().getRight());
            boolean sizeTop = valueInRange(event.getY(), 0, stackPanelContainer.getPadding().getTop());
            boolean sizeBottom = valueInRange(event.getY(), stackPanelContainer.getHeight() - stackPanelContainer.getPadding().getBottom(), stackPanelContainer.getHeight());

            Cursor cursor = changeCursor(sizeLeft, sizeRight, sizeTop, sizeBottom);

            getScene().setCursor(cursor);
        }

        if (event.getEventType() == MouseEvent.MOUSE_DRAGGED && (getScene().getCursor() != null && getScene().getCursor() != Cursor.DEFAULT)) {

            if (getScene().getCursor() == Cursor.E_RESIZE || getScene().getCursor() == Cursor.SE_RESIZE || getScene().getCursor() == Cursor.NE_RESIZE) {
                if (event.getScreenX() - getX() + FLOATING_NODE_DROPSHADOW_RADIUS > FLOATING_NODE_MINIMUM_WIDTH) {
                    setWidth(event.getScreenX() - getX() + FLOATING_NODE_DROPSHADOW_RADIUS);
                }
            }
            else if (getScene().getCursor() == Cursor.S_RESIZE || getScene().getCursor() == Cursor.SE_RESIZE || getScene().getCursor() == Cursor.SW_RESIZE) {
                if (event.getScreenY() - getY() + FLOATING_NODE_DROPSHADOW_RADIUS > FLOATING_NODE_MINIMUM_HEIGHT) {
                    setHeight(event.getScreenY() - getY() + FLOATING_NODE_DROPSHADOW_RADIUS);
                }
            }
            else if (getScene().getCursor() == Cursor.W_RESIZE || getScene().getCursor() == Cursor.NW_RESIZE || getScene().getCursor() == Cursor.SW_RESIZE) {

                double newX = event.getScreenX() - FLOATING_NODE_DROPSHADOW_RADIUS;
                double newWidth = startX - newX + startWidth;

                if (newWidth > FLOATING_NODE_MINIMUM_WIDTH) {
                    setX(newX);
                    setWidth(newWidth);
                }

            }
            else if (getScene().getCursor() == Cursor.N_RESIZE || getScene().getCursor() == Cursor.NW_RESIZE || getScene().getCursor() == Cursor.NE_RESIZE) {

                double newY = event.getScreenY() - FLOATING_NODE_DROPSHADOW_RADIUS;
                double newHeight = startY - newY + startHeight;

                if (newHeight > FLOATING_NODE_MINIMUM_HEIGHT) {
                    setY(newY);
                    setHeight(newHeight);
                }

            }

        }
        /*
        else if (event.getEventType() == MouseEvent.MOUSE_RELEASED) {
            // TODO: handle this event?
        }
        */
    };

    stackPanelContainer.addEventFilter(MouseEvent.MOUSE_PRESSED, eventsHandler);
    stackPanelContainer.addEventFilter(MouseEvent.MOUSE_MOVED, eventsHandler);
    stackPanelContainer.addEventFilter(MouseEvent.MOUSE_DRAGGED, eventsHandler);
    stackPanelContainer.addEventFilter(MouseEvent.MOUSE_RELEASED, eventsHandler);
}
 
Example 12
Source File: CameraController.java    From FXyzLib with GNU General Public License v3.0 4 votes vote down vote up
private void handleMouseEvent(MouseEvent t) {

        if (t.getEventType() == MouseEvent.MOUSE_PRESSED) {
            switch (t.getButton()) {
                case PRIMARY:
                    handlePrimaryMousePress(t);
                    break;
                case MIDDLE:
                    handleMiddleMousePress(t);
                    break;
                case SECONDARY:
                    handleSecondaryMousePress(t);
                    break;
                default:
                    throw new AssertionError();
            }
            handleMousePress(t);
        } else if (t.getEventType() == MouseEvent.MOUSE_DRAGGED) {
            Point2D d = getMouseDelta(t);

            switch (t.getButton()) {
                case PRIMARY:
                    handlePrimaryMouseDrag(t, d, speed);
                    break;
                case MIDDLE:
                    handleMiddleMouseDrag(t, d, speed);
                    break;
                case SECONDARY:
                    handleSecondaryMouseDrag(t, d, speed);
                    break;
                default:
                    throw new AssertionError();
            }
        } else if (t.getEventType() == MouseEvent.MOUSE_MOVED) {
            handleMouseMoved(t, getMouseDelta(t), speed);
        } else if (t.getEventType() == MouseEvent.MOUSE_CLICKED) {
            switch (t.getButton()) {
                case PRIMARY:
                    handlePrimaryMouseClick(t);
                    break;
                case MIDDLE:
                    handleMiddleMouseClick(t);
                    break;
                case SECONDARY:
                    handleSecondaryMouseClick(t);
                    break;
                default:
                    throw new AssertionError();
            }
        }
    }
 
Example 13
Source File: RadialBargraphSkin.java    From Enzo with Apache License 2.0 4 votes vote down vote up
private void handleMouseEvent(final MouseEvent MOUSE_EVENT) {
    final Object    SRC  = MOUSE_EVENT.getSource();
    final EventType TYPE = MOUSE_EVENT.getEventType();
    if (getSkinnable().isInteractive() && SRC.equals(threshold)) {
        if (MouseEvent.MOUSE_PRESSED == TYPE) {
            unit.setText("Threshold");
            value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", getSkinnable().getThreshold()));
            resizeText();
        } else if (MouseEvent.MOUSE_DRAGGED == TYPE) {
            touchRotate(MOUSE_EVENT.getSceneX() - getSkinnable().getLayoutX(), MOUSE_EVENT.getSceneY() - getSkinnable().getLayoutY(), thresholdRotate);
        } else if (MouseEvent.MOUSE_RELEASED == TYPE) {
            getSkinnable().setThreshold(Double.parseDouble(value.getText()));
            fadeBackToInteractive();
        }
    } else if (getSkinnable().isInteractive() && SRC instanceof Marker) {
        if (MouseEvent.MOUSE_PRESSED == TYPE) {
            unit.setText(((Marker) SRC).getText());
            value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", ((Marker) SRC).getValue()));
            resizeText();
        } else if (MouseEvent.MOUSE_DRAGGED == TYPE) {
            touchRotate(MOUSE_EVENT.getSceneX() - getSkinnable().getLayoutX(), MOUSE_EVENT.getSceneY() - getSkinnable().getLayoutY(), getSkinnable().getMarkers().get(SRC));
        } else if (MouseEvent.MOUSE_RELEASED == TYPE) {
            ((Marker) SRC).setValue(Double.parseDouble(value.getText()));
            fadeBackToInteractive();
        }
    } else if (getSkinnable().isInteractive() && SRC.equals(minMeasuredValue)) {
        if (MouseEvent.MOUSE_PRESSED == TYPE) {
            unit.setText("Min");
            value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", getSkinnable().getMinMeasuredValue()));
            resizeText();
        } else if (MouseEvent.MOUSE_RELEASED == TYPE) {
            fadeBackToInteractive();
        }
    } else if (getSkinnable().isInteractive() && SRC.equals(maxMeasuredValue)) {
        if (MouseEvent.MOUSE_PRESSED == TYPE) {
            unit.setText("Max");
            value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", getSkinnable().getMaxMeasuredValue()));
            resizeText();
        } else if (MouseEvent.MOUSE_RELEASED == TYPE) {
            fadeBackToInteractive();
        }
    }
}
 
Example 14
Source File: GaugeSkin.java    From Enzo with Apache License 2.0 4 votes vote down vote up
private void handleMouseEvent(final MouseEvent MOUSE_EVENT) {
    final Object    SRC  = MOUSE_EVENT.getSource();
    final EventType TYPE = MOUSE_EVENT.getEventType();
    if (getSkinnable().isInteractive() && SRC.equals(threshold)) {
        if (MouseEvent.MOUSE_PRESSED == TYPE) {
            unit.setText("Threshold");
            value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", getSkinnable().getThreshold()));
            resizeText();
        } else if (MouseEvent.MOUSE_DRAGGED == TYPE) {
            touchRotate(MOUSE_EVENT.getSceneX() - getSkinnable().getLayoutX(), MOUSE_EVENT.getSceneY() - getSkinnable().getLayoutY(), thresholdRotate);
        } else if (MouseEvent.MOUSE_RELEASED == TYPE) {
            getSkinnable().setThreshold(Double.parseDouble(value.getText()));
            fadeBackToInteractive();
        }
    } else if (getSkinnable().isInteractive() && SRC instanceof Marker) {
        if (MouseEvent.MOUSE_PRESSED == TYPE) {
            unit.setText(((Marker) SRC).getText());
            value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", ((Marker) SRC).getValue()));
            resizeText();
        } else if (MouseEvent.MOUSE_DRAGGED == TYPE) {
            touchRotate(MOUSE_EVENT.getSceneX() - getSkinnable().getLayoutX(), MOUSE_EVENT.getSceneY() - getSkinnable().getLayoutY(), getSkinnable().getMarkers().get(SRC));
        } else if (MouseEvent.MOUSE_RELEASED == TYPE) {
            ((Marker) SRC).setValue(Double.parseDouble(value.getText()));
            fadeBackToInteractive();
        }
    } else if (getSkinnable().isInteractive() && SRC.equals(minMeasuredValue)) {
        if (MouseEvent.MOUSE_PRESSED == TYPE) {
            unit.setText("Min");
            value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", getSkinnable().getMinMeasuredValue()));
            resizeText();
        } else if (MouseEvent.MOUSE_RELEASED == TYPE) {
            fadeBackToInteractive();
        }
    } else if (getSkinnable().isInteractive() && SRC.equals(maxMeasuredValue)) {
        if (MouseEvent.MOUSE_PRESSED == TYPE) {
            unit.setText("Max");
            value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", getSkinnable().getMaxMeasuredValue()));
            resizeText();
        } else if (MouseEvent.MOUSE_RELEASED == TYPE) {
            fadeBackToInteractive();
        }
    }
}