Search in sources :

Example 1 with TransitionSelectionChange

use of edu.cmu.cs.hcii.cogtool.ui.DesignEditorSelectionState.TransitionSelectionChange in project cogtool by cogtool.

the class DesignEditorUI method createTransitionSelectionHandler.

// createFrameSelectionHandler
protected AlertHandler createTransitionSelectionHandler() {
    return new AlertHandler() {

        public void handleAlert(EventObject alert) {
            TransitionSelectionChange evt = (TransitionSelectionChange) alert;
            if (evt != null) {
                InteractionDrawingEditor editor = view.getEditor();
                if (evt.changedTransitionFigure != null) {
                    evt.changedTransitionFigure.setSelected(editor, evt.selected);
                } else {
                    Iterator<DesignEditorTransition> transitionFigures = selection.getSelectedTransitionFigures();
                    while (transitionFigures.hasNext()) {
                        DesignEditorTransition transitionFigure = transitionFigures.next();
                        transitionFigure.setSelected(editor, evt.selected);
                    }
                }
                // Repaint the contents
                delayedRepainting.requestRepaint(REPAINT_ALL);
                updateView(evt.changedTransitionFigure == null);
            }
        }
    };
}
Also used : AlertHandler(edu.cmu.cs.hcii.cogtool.util.AlertHandler) DesignEditorTransition(edu.cmu.cs.hcii.cogtool.uimodel.DesignEditorTransition) InteractionDrawingEditor(edu.cmu.cs.hcii.cogtool.view.InteractionDrawingEditor) EventObject(java.util.EventObject) TransitionSelectionChange(edu.cmu.cs.hcii.cogtool.ui.DesignEditorSelectionState.TransitionSelectionChange)

Aggregations

TransitionSelectionChange (edu.cmu.cs.hcii.cogtool.ui.DesignEditorSelectionState.TransitionSelectionChange)1 DesignEditorTransition (edu.cmu.cs.hcii.cogtool.uimodel.DesignEditorTransition)1 AlertHandler (edu.cmu.cs.hcii.cogtool.util.AlertHandler)1 InteractionDrawingEditor (edu.cmu.cs.hcii.cogtool.view.InteractionDrawingEditor)1 EventObject (java.util.EventObject)1