Ejemplo n.º 1
0
  protected void enableDragging() {
    dgr.setComponent(this);

    /**
     * FIX for bug where element is not draggable when initial click begins on label
     *
     * <p>There is a big trick here: the label view is not a subcomponent of view, so dragging on
     * this component will not be seen by palette element view, so we need here to force disable
     * mouse listeners registered for this palette view
     */
    if (getLabelView() != null) {
      if (labelDgr == null) {
        labelDgr = createDragGestureRecognizer();
      }
      getLabelView().disableTextComponentMouseListeners();
      labelDgr.setComponent(getLabelView().getTextComponent());
    }
  }
Ejemplo n.º 2
0
 protected void disableDragging() {
   // dgr.setComponent(null);
   if (getLabelView() != null) {
     getLabelView().enableTextComponentMouseListeners();
   }
   if (labelDgr != null) {
     labelDgr.setComponent(null);
   }
 }