18a19,20 > import java.awt.event.MouseEvent; > import java.awt.event.InputEvent; 33a36,56 > * Add the touched figure to the selection of an invoke action. > * Overrides ActionTool's mouseDown to allow for peeling the border > * if there is one already. > * This is done by CTRLing the click > * @see #action > */ > public void mouseDown(MouseEvent e, int x, int y) { > // if not CTRLed then proceed normally > if ((e.getModifiers() & InputEvent.CTRL_MASK) == 0) { > super.mouseDown(e, x, y); > } > else { > Figure target = drawing().findFigure(x, y); > if (target != null && target instanceof DecoratorFigure) { > view().addToSelection(target); > reverseAction(target); > } > } > } > > /** 47a71,83 > * Peels off the border from the clicked figure. > */ > public void reverseAction(Figure figure) { > setUndoActivity(createUndoActivity()); > Vector v = new Vector(); > v.addElement(figure); > > v.addElement(((DecoratorFigure)figure).peelDecoration()); > getUndoActivity().setAffectedFigures(new FigureEnumerator(v)); > ((BorderTool.UndoActivity)getUndoActivity()).replaceAffectedFigures(); > } > > /**