Esempio n. 1
0
  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);
  }
Esempio n. 2
0
 public void add(DigitalShape s) {
   circuit.setDrawingPad(this);
   circuit.add(s);
 }
Esempio n. 3
0
 public void setCircuit(DigitalCircuit circuit) {
   this.circuit = circuit;
   circuit.setDrawingPad(this);
   repaint();
 }