public DrawingPad() { super(true); // Add the mouse sensor mouse = new MouseSensorAction(this); // add the properties update listeners this.addMouseListener(new PropertyUpdateAction()); // start the painter thread new Painter().start(); // other intializations circuit = new DigitalCircuit(); this.setCursor(DigitalShape.DEFAULT_CURSOR); this.setBackground(Color.WHITE); circuit.setDrawingPad(this); }
public void add(DigitalShape s) { circuit.setDrawingPad(this); circuit.add(s); }
public void setCircuit(DigitalCircuit circuit) { this.circuit = circuit; circuit.setDrawingPad(this); repaint(); }