Class KlighdLabelWidgetEventHandler

java.lang.Object
edu.umd.cs.piccolo.event.PBasicInputEventHandler
de.cau.cs.kieler.klighd.piccolo.internal.events.KlighdBasicInputEventHandler
de.cau.cs.kieler.klighd.ui.viewers.KlighdLabelWidgetEventHandler
All Implemented Interfaces:
IKlighdInputEventHandlerEx, edu.umd.cs.piccolo.event.PInputEventListener, EventListener

public class KlighdLabelWidgetEventHandler extends KlighdBasicInputEventHandler
A dedicated KlighdBasicInputEventHandler in charge of putting the text label widget in place and updating it.

The text label shall be as smoothly as possible integrated into the diagram meaning that there should be as little as possible additional clicks required in order to select the text (or parts of it) and copy it, for example. This however requires quite some event handling magic like duplicating SWT events.

Update: deactivated the magic code as it doesn't work properly on windows setups
Author:
chsch
  • Constructor Details

    • KlighdLabelWidgetEventHandler

      public KlighdLabelWidgetEventHandler(PiccoloViewerUI viewer, org.eclipse.swt.custom.StyledText labelWidget)
      Constructor that just calls super.
      Parameters:
      viewer - the employed PiccoloViewerUI
      labelWidget - the employed labelWidget
  • Method Details

    • mouseMoved

      public void mouseMoved(edu.umd.cs.piccolo.event.PInputEvent event)


      This method triggers the preparation of the text label widget if it's not blocked due to a text selection and the mouse moved over a text figure node, and hides the widget if the mouse moved over a non-text figure and no text selection was defined.
      Overrides:
      mouseMoved in class edu.umd.cs.piccolo.event.PBasicInputEventHandler
    • mousePressed

      public void mousePressed(edu.umd.cs.piccolo.event.PInputEvent event)


      This method triggers the preparation of the text label widget if the user clicked on it, regardless whether the widget is blocked due to text selection.
      Overrides:
      mousePressed in class edu.umd.cs.piccolo.event.PBasicInputEventHandler
    • mouseReleased

      public void mouseReleased(edu.umd.cs.piccolo.event.PInputEvent event)
      Overrides:
      mouseReleased in class edu.umd.cs.piccolo.event.PBasicInputEventHandler