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.scene.Group;
27 import javafx.scene.Node;
28 import javafx.scene.input.MouseEvent;
43 private final EventDispatchChainImpl
NO_OP_CHAIN =
new EventDispatchChainImpl();
44 private final PropertyChangeSupport
pcs =
new PropertyChangeSupport(
this);
51 backDrop.setOnMousePressed((mouseEvent) -> {
52 if (currentFocus != null) {
53 currentFocus.getEventDispatcher().dispatchEvent(
57 this.pcs.firePropertyChange(
new PropertyChangeEvent(
this,
63 this.addEventFilter(MouseEvent.MOUSE_PRESSED, (MouseEvent e) -> {
64 if (!e.isPrimaryButtonDown()) {
69 Node topLevelChild = e.getPickResult().getIntersectedNode();
70 while (!this.getChildren().contains(topLevelChild)) {
71 topLevelChild = topLevelChild.getParent();
84 this.pcs.addPropertyChangeListener(fcl);
100 if(currentFocus != null) {
101 resetFocus(currentFocus);
122 if (n.equals(currentFocus)) {
124 }
else if (currentFocus != null && !currentFocus.equals(n)) {
125 resetFocus(currentFocus);
129 this.pcs.firePropertyChange(
new PropertyChangeEvent(
this,
ImageTagControls.
FOCUSED.getName(), currentFocus, n));
void requestFocus(ImageTag n)
volatile ImageTag currentFocus
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)