@Override public void undo() throws CannotUndoException { super.undo(); drawing.remove(c); }
@Override public void redo() throws CannotRedoException { super.redo(); for (int i = 0; i < deletedFigureIndices.length; i++) { drawing.remove(deletedFigures.get(i)); } } });
@Override public void undo() throws CannotUndoException { super.undo(); addedDrawing.remove(addedFigure); }
@Override protected void failed(Throwable t) { JOptionPane.showMessageDialog(getView().getComponent(), t.getMessage(), null, JOptionPane.ERROR_MESSAGE); getDrawing().remove(createdFigure); fireToolDone(); } };
@Override public void undo() throws CannotUndoException { super.undo(); addedDrawing.remove(addedFigure); }
@Override public void undo() throws CannotUndoException { super.undo(); addedDrawing.remove(addedFigure); }
@Override protected void failed(Throwable t) { JOptionPane.showMessageDialog(getView().getComponent(), t.getMessage(), null, JOptionPane.ERROR_MESSAGE); getDrawing().remove(createdFigure); fireToolDone(); }
@Override public void deactivate(DrawingEditor editor) { if (createdFigure != null) { getDrawing().remove(createdFigure); createdFigure = null; } targetFigure = null; startConnector = endConnector = null; super.deactivate(editor); }
@Override protected void failed(Throwable value) { Throwable t = (Throwable) value; JOptionPane.showMessageDialog(getView().getComponent(), t.getMessage(), null, JOptionPane.ERROR_MESSAGE); getDrawing().remove(createdFigure); fireToolDone(); } };
@Override public void redo() throws CannotRedoException { super.redo(); for (CompositeFigureEvent evt : new ReversedList<CompositeFigureEvent>(deletionEvents)) { drawing.remove(evt.getChildFigure()); } } });
@Override @SuppressWarnings("unchecked") public Collection<Figure> ungroupFigures(DrawingView view, CompositeFigure group) { LinkedList<Figure> figures = new LinkedList<Figure>(group.getChildren()); view.clearSelection(); group.basicRemoveAllChildren(); LinkedList<Figure> paths = new LinkedList<Figure>(); for (Figure f : figures) { ODGPathFigure path = new ODGPathFigure(); path.removeAllChildren(); for (Map.Entry<AttributeKey, Object> entry : group.getAttributes().entrySet()) { path.set(entry.getKey(), entry.getValue()); } path.add(f); view.getDrawing().basicAdd(path); paths.add(path); } view.getDrawing().remove(group); view.addToSelection(paths); return figures; }
@SuppressWarnings("unchecked") @Override public Collection<Figure> ungroupFigures(DrawingView view, CompositeFigure group) { LinkedList<Figure> figures = new LinkedList<Figure>(group.getChildren()); view.clearSelection(); group.basicRemoveAllChildren(); LinkedList<Figure> paths = new LinkedList<Figure>(); for (Figure f : figures) { ODGPathFigure path = new ODGPathFigure(); path.removeAllChildren(); for (Map.Entry<AttributeKey, Object> entry : group.getAttributes().entrySet()) { path.set(entry.getKey(), entry.getValue()); } path.add(f); view.getDrawing().basicAdd(path); paths.add(path); } view.getDrawing().remove(group); view.addToSelection(paths); return figures; }
public void splitPath(DrawingView view, CompositeFigure group, List<Figure> ungroupedPaths, int[] ungroupedPathsIndices, int[] ungroupedPathsChildCounts) { view.clearSelection(); Iterator<Figure> groupedFigures = new LinkedList<Figure>(group.getChildren()).iterator(); group.basicRemoveAllChildren(); view.getDrawing().remove(group); SVGPathFigure pathFigure = (SVGPathFigure) group; pathFigure.flattenTransform(); for (int i = 0; i < ungroupedPaths.size(); i++) { CompositeFigure path = (CompositeFigure) ungroupedPaths.get(i); view.getDrawing().add(ungroupedPathsIndices[i], path); path.willChange(); for (int j = 0; j < ungroupedPathsChildCounts[i]; j++) { Figure child = groupedFigures.next(); child.willChange(); path.basicAdd(child); } path.changed(); } view.addToSelection(ungroupedPaths); }
public Collection<Figure> ungroupFigures(DrawingView view, CompositeFigure group) { // XXX - This code is redundant with UngroupAction LinkedList<Figure> figures = new LinkedList<Figure>(group.getChildren()); view.clearSelection(); group.basicRemoveAllChildren(); view.getDrawing().basicAddAll(view.getDrawing().indexOf(group), figures); view.getDrawing().remove(group); view.addToSelection(figures); return figures; }
private void show(final boolean doShow) { final JHotDrawImageCanvas canvas = displayViewer.getCanvas(); final Drawing drawing = canvas.getDrawing(); final Figure fig = getFigure(); if (doShow) { if (!drawing.contains(fig)) { drawing.add(fig); } } else { if (drawing.contains(fig)) { drawing.remove(fig); } } }
private void show(final boolean doShow) { final JHotDrawImageCanvas canvas = displayViewer.getCanvas(); final Drawing drawing = canvas.getDrawing(); final Figure fig = getFigure(); if (doShow) { if (!drawing.contains(fig)) { drawing.add(fig); } } else { if (drawing.contains(fig)) { drawing.remove(fig); } } }
@Override protected void finishCreation(BezierFigure createdFigure, DrawingView creationView) { if (DEBUG) System.out.println("PathTool.finishCreation "+createdFigure); creationView.getDrawing().remove(createdFigure); SVGPathFigure createdPath = createPath(); createdPath.removeAllChildren(); createdPath.add(createdFigure); creationView.getDrawing().add(createdPath); creationView.addToSelection(createdPath); fireUndoEvent(createdPath, creationView); } }
@Override protected void finishCreation(BezierFigure createdFigure, DrawingView creationView) { if (DEBUG) { System.out.println("PathTool.finishCreation " + createdFigure); } creationView.getDrawing().remove(createdFigure); SVGPathFigure createdPath = createPath(); createdPath.removeAllChildren(); createdPath.add(createdFigure); creationView.getDrawing().add(createdPath); fireUndoEvent(createdPath, creationView); creationView.addToSelection(createdPath); if (isToolDoneAfterCreation()) { fireToolDone(); } } }
} else { if (createdFigure != null) { getDrawing().remove((Figure) getAddedFigure());
view.getDrawing().remove(getConnection()); fireAreaInvalidated(getDrawingArea());