@Override public void add(DrawingView view) { target.add(view); }
public void setEditor(DrawingEditor newValue) { DrawingEditor oldValue = editor; if (oldValue != null) { oldValue.remove(view); } editor = newValue; if (newValue != null) { newValue.add(view); } }
public void setEditor(DrawingEditor newValue) { DrawingEditor oldValue = editor; if (oldValue != null) { oldValue.remove(view); } editor = newValue; if (newValue != null) { newValue.add(view); } }
/** * Sets a drawing editor for the view. */ public void setEditor(DrawingEditor newValue) { if (editor != null) { editor.remove(view); } editor = newValue; if (editor != null) { editor.add(view); } }
public void setEditor(DrawingEditor newValue) { DrawingEditor oldValue = editor; if (oldValue != null) { oldValue.remove(view); } editor = newValue; propertiesPanel.setEditor(editor); if (newValue != null) { newValue.add(view); } }
editor.add(view);
@Override public void run() { // Create a simple drawing consisting of three // text areas and an elbow connection. LabeledEllipseFigure ta = new LabeledEllipseFigure(); ta.setBounds(new Point2D.Double(10, 10), new Point2D.Double(100, 100)); LabeledEllipseFigure tb = new LabeledEllipseFigure(); tb.setBounds(new Point2D.Double(220, 120), new Point2D.Double(310, 210)); LabeledEllipseFigure tc = new LabeledEllipseFigure(); tc.setBounds(new Point2D.Double(220, 10), new Point2D.Double(310, 100)); Drawing drawing = new DefaultDrawing(); drawing.add(ta); drawing.add(tb); drawing.add(tc); // Create a frame with a drawing view and a drawing editor JFrame f = new JFrame("My Drawing"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(400, 300); DrawingView view = new DefaultDrawingView(); view.setDrawing(drawing); f.add(view.getComponent()); f.add(new JLabel("Press space bar to toggle handles."), BorderLayout.SOUTH); DrawingEditor editor = new DefaultDrawingEditor(); editor.add(view); editor.setTool(new DelegationSelectionTool()); f.setVisible(true); } });
editor.add(view);
f.getContentPane().add(view.getComponent()); DrawingEditor editor = new DefaultDrawingEditor(); editor.add(view); editor.setTool(new DelegationSelectionTool()); f.setVisible(true);
@Override public void run() { // Create a graphical composite figure. GraphicalCompositeFigure composite = new GraphicalCompositeFigure(); // Add child figures to the composite figure composite.add(new TextFigure("Above the line")); composite.add(new LineFigure()); composite.add(new TextFigure("Below the line")); // Set a layouter and perform the layout composite.setLayouter(new VerticalLayouter()); composite.layout(); // Add the composite figure to a drawing Drawing drawing = new DefaultDrawing(); drawing.add(composite); // Create a frame with a drawing view and a drawing editor JFrame f = new JFrame("My Drawing"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(400, 300); DrawingView view = new DefaultDrawingView(); view.setDrawing(drawing); f.getContentPane().add(view.getComponent()); DrawingEditor editor = new DefaultDrawingEditor(); editor.add(view); editor.setTool(new DelegationSelectionTool()); f.setVisible(true); } });
editor.add(view); editor.setTool(new DelegationSelectionTool());
drawingEditor.add(drawingView); toolDelegator = new ToolDelegator(); toolDelegator.setSelection(false);
undoManager = new UndoRedoManager(); editor = new DefaultDrawingEditor(); editor.add(view);
undoManager = new UndoRedoManager(); editor = new DefaultDrawingEditor(); editor.add(view);
undoManager = new UndoRedoManager(); editor = new DefaultDrawingEditor(); editor.add(view);
undoManager = new UndoRedoManager(); editor = new DefaultDrawingEditor(); editor.add(view);
drawingEditor.add(drawingView); toolDelegator = new ToolDelegator(); drawingEditor.setTool(toolDelegator);
public void setEditor(@Nullable DrawingEditor newValue) { DrawingEditor oldValue = editor; if (oldValue != null) { oldValue.remove(view); } editor = newValue; if (newValue != null) { newValue.add(view); } creationToolBar.setEditor(editor); fillToolBar.setEditor(editor); strokeToolBar.setEditor(editor); actionToolBar.setUndoManager(undoManager); actionToolBar.setEditor(editor); alignToolBar.setEditor(editor); arrangeToolBar.setEditor(editor); fontToolBar.setEditor(editor); figureToolBar.setEditor(editor); linkToolBar.setEditor(editor); DrawingView temp = (editor == null) ? null : editor.getActiveView(); if (editor != null) { editor.setActiveView(view); } canvasToolBar.setEditor(editor); viewToolBar.setEditor(editor); if (editor != null) { editor.setActiveView(temp); } }