Example #1
0
 /** Dessine l'icone de la grille */
 protected static void drawGrid(Graphics g, int x, int y, Color c) {
   g.setColor(c);
   for (int i = 0; i < TX.length; i++)
     g.drawLine(TX[i][0] + x, TX[i][2] + y, TX[i][1] + x, TX[i][2] + y);
   for (int i = 0; i < TY.length; i++)
     g.drawLine(TY[i][2] + x, TY[i][0] + y, TY[i][2] + x, TY[i][1] + y);
 }
  /** Paint it. */
  public void paint(Graphics g) {
    Dimension d = getSize();
    g.setColor(Color.black);
    int xoff = d.width / 3;
    int yoff = d.height / 3;
    g.drawLine(xoff, 0, xoff, d.height);
    g.drawLine(2 * xoff, 0, 2 * xoff, d.height);
    g.drawLine(0, yoff, d.width, yoff);
    g.drawLine(0, 2 * yoff, d.width, 2 * yoff);

    int i = 0;
    for (int r = 0; r < 3; r++) {
      for (int c = 0; c < 3; c++, i++) {
        if ((white & (1 << i)) != 0) {
          g.drawImage(notImage, c * xoff + 1, r * yoff + 1, this);
        } else if ((black & (1 << i)) != 0) {
          g.drawImage(crossImage, c * xoff + 1, r * yoff + 1, this);
        }
      }
    }
  }
Example #3
0
 /** Dessine l'icone d'un SED */
 protected static void drawSED(Graphics g, int x, int y, Color c) {
   g.setColor(c);
   for (int i = 0; i < SY2.length; i++)
     g.drawLine(SY2[i][0] + x, SY2[i][2] + y, SY2[i][1] + x, SY2[i][2] + y);
 }
Example #4
0
 /** Dessine lle fond de l'icone de la grille d'un MOC */
 protected static void fillMOC(Graphics g, int x, int y, Color c) {
   g.setColor(c);
   for (int i = 0; i < TY2BG.length; i++)
     g.drawLine(TY2BG[i][0] + x, TY2BG[i][2] + y, TY2BG[i][1] + x, TY2BG[i][2] + y);
 }
Example #5
0
 /** Dessine l'icone de la grille de polarisation */
 protected static void drawPolar(Graphics g, int x, int y, Color c) {
   g.setColor(c);
   for (int i = 0; i < TY1.length; i++)
     g.drawLine(TY1[i][1] + x, TY1[i][0] + y, TY1[i][2] + x, TY1[i][0] + y);
 }