Beispiel #1
0
 public PanelColor(int id, Fenetre f, DisplayColor dc, Button backButton, int w, int h) {
   this.estConstructeurBis = true;
   this.bgColor = dc.getBackground();
   this.dc = dc;
   this.setBounds(0, 0, w, h);
   this.lastButton = backButton;
   this.setBackground(this.bgColor);
   this.add(colorB);
   this.add(colorG);
   this.add(colorR);
   System.out.println(this.lastButton);
   this.colorB.setColor("" + this.lastButton.getColor().getBlue());
   this.colorR.setColor("" + this.lastButton.getColor().getRed());
   this.colorG.setColor("" + this.lastButton.getColor().getGreen());
   this.colorChoice.setBackground(lastButton.getColor());
   this.next.setId(lastButton.getId());
   choseColor.addMouseListener(this);
   this.add(choseColor);
   // this.add(this.numColor);
   this.frame = f;
   this.setSize(new Dimension(w, h));
   this.setLayout(null);
   this.addMouseListener(this);
   // carreColor.setMaximumSize(new Dimension(200, 200));
   this.add(carreColor);
   validColor(colorR.getColor(), colorG.getColor(), colorB.getColor());
   this.add(colorChoice);
   this.next.addMouseListener(this);
   this.add(next);
   neededGrey = maxGrey / (frame.getNmbColor());
   frame.setNeededGrey(neededGrey);
 }
Beispiel #2
0
 public PanelColor(Fenetre f, String name, int nbColor, Color c, int w, int h) {
   this.bgColor = c;
   choseColor.addMouseListener(this);
   this.add(choseColor);
   this.nmbColor = nbColor - 1;
   this.numColor.setText(this.numColor.getText() + this.nmbColor + " couleur(s)");
   this.add(this.numColor);
   this.frame = f;
   this.setBackground(this.bgColor);
   this.setSize(new Dimension(w, h));
   this.setName(name);
   this.setLayout(null);
   this.addMouseListener(this);
   // carreColor.setMaximumSize(new Dimension(200, 200));
   this.add(carreColor);
   System.out.println(this.carreColor.getBackground());
   this.add(colorR);
   validColor(colorR.getColor(), colorG.getColor(), colorB.getColor());
   this.add(colorChoice);
   this.next.addMouseListener(this);
   this.add(next);
   this.add(colorB);
   this.add(colorG);
   neededGrey = maxGrey / (frame.getNmbColor());
   frame.setNeededGrey(neededGrey);
   frame.map.put(frame.getGreyIndicator(), this);
 }