org.jhotdraw8.draw.tool.SimpleHandleTracker Maven / Gradle / Ivy
Show all versions of org.jhotdraw8.draw Show documentation
/*
* @(#)SimpleHandleTracker.java
* Copyright © 2023 The authors and contributors of JHotDraw. MIT License.
*/
package org.jhotdraw8.draw.tool;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import org.jhotdraw8.draw.DrawingView;
import org.jhotdraw8.draw.figure.Figure;
import org.jhotdraw8.draw.handle.Handle;
import java.util.Collection;
/**
* {@code SimpleHandleTracker} implements interactions with the handles of a
* Figure.
*
* The {@code SimpleHandleTracker} handles one of the three states of the
* {@code SelectionTool}. Iz comes into action, when the user presses the mouse
* button over a {@code Figure}.
*
* Design pattern:
* Name: Chain of Responsibility.
* Role: Handler.
* Partners: {@link SelectionTool} as Handler, {@link SelectAreaTracker} as
* Handler, {@link DragTracker} as Handler, {@link HandleTracker} as Handler.
*
* Design pattern:
* Name: State.
* Role: State.
* Partners: {@link SelectAreaTracker} as State, {@link DragTracker} as State,
* {@link SelectionTool} as Context.
*
* @author Werner Randelshofer
* @see SelectionTool
*/
public class SimpleHandleTracker extends AbstractTracker implements HandleTracker {
private Handle handle;
private Collection