code: 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();
      }
docs: Add a graphical shape to the canvas.