/** * Add a graphical shape to the canvas. */ public void add(Plot p) { shapes.add(p); JComponent[] tb = p.getToolBar(); if (tb != null) { toolbar.addSeparator(); for (JComponent comp : tb) { toolbar.add(comp); } } repaint(); }
/** * Remove a graphical shape from the canvas. */ public void remove(Plot p) { shapes.remove(p); JComponent[] tb = p.getToolBar(); if (tb != null) { for (JComponent comp : tb) { toolbar.remove(comp); } } repaint(); }