Class HeadlessPointerTool

java.lang.Object
edu.cnu.mdi.view.HeadlessPointerTool
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener

public class HeadlessPointerTool extends Object implements MouseListener, MouseMotionListener
A minimal, "headless" pointer tool that enables item dragging (and other item modifications supported by AItem) on views that do not have a visible AToolBar.

In the toolbar-driven workflow, a pointer tool (e.g. PointerButton) is typically responsible for installing mouse listeners and driving AItem modification state (start/modify/stop). This class provides the same essential behavior without requiring a toolbar UI.

Behavior

This tool intentionally does not attempt to manage selection state or multi-item operations; it is meant for "mini-map"/virtual views such as VirtualView, where the primary goal is simple item dragging.

  • Field Details

    • DEFAULT_DRAG_THRESHOLD_PX

      public static final int DEFAULT_DRAG_THRESHOLD_PX
      Default drag threshold (pixels) before promoting a press into a drag.
      See Also:
  • Constructor Details

    • HeadlessPointerTool

      public HeadlessPointerTool(BaseView view)
      Create and immediately install a headless pointer tool on the view's canvas.
      Parameters:
      view - the view whose container/canvas should receive pointer behavior.
      Throws:
      NullPointerException - if view, its container, or its component is null.
  • Method Details