19 package org.sleuthkit.autopsy.contentviewers.imagetagging;
21 import com.sun.javafx.event.EventDispatchChainImpl;
22 import java.beans.PropertyChangeEvent;
23 import java.beans.PropertyChangeListener;
24 import java.beans.PropertyChangeSupport;
25 import javafx.event.Event;
26 import javafx.geometry.Point2D;
27 import javafx.scene.Group;
28 import javafx.scene.Node;
29 import javafx.scene.input.MouseEvent;
44 private final EventDispatchChainImpl
NO_OP_CHAIN =
new EventDispatchChainImpl();
45 private final PropertyChangeSupport
pcs =
new PropertyChangeSupport(
this);
52 backDrop.setOnMousePressed((mouseEvent) -> {
53 if (currentFocus != null) {
54 currentFocus.getEventDispatcher().dispatchEvent(
58 this.pcs.firePropertyChange(
new PropertyChangeEvent(
this,
64 this.addEventFilter(MouseEvent.MOUSE_PRESSED, (MouseEvent e) -> {
65 if (!e.isPrimaryButtonDown()) {
80 this.pcs.addPropertyChangeListener(fcl);
96 if(currentFocus != null) {
97 resetFocus(currentFocus);
112 double minTagSize = Double.MAX_VALUE;
115 for (Node node : this.getChildren()) {
118 if (tag.contains(coordinate) && tagSize < minTagSize) {
120 minTagSize = tagSize;
143 if (n == null || n.equals(currentFocus)) {
145 }
else if (currentFocus != null && !currentFocus.equals(n)) {
146 resetFocus(currentFocus);
150 this.pcs.firePropertyChange(
new PropertyChangeEvent(
this,
ImageTagControls.
FOCUSED.getName(), currentFocus, n));
void requestFocus(ImageTag n)
volatile ImageTag currentFocus
ImageTag getTagToSelect(Point2D coordinate)
static final EventType< Event > FOCUSED
final PropertyChangeSupport pcs
final EventDispatchChainImpl NO_OP_CHAIN
ImageTagsGroup(Node backDrop)
void addFocusChangeListener(PropertyChangeListener fcl)
static final EventType< Event > NOT_FOCUSED
void resetFocus(ImageTag n)