Example #1
0
  private static Icon getThemeIcon(ColorScheme colorScheme, boolean square) {
    int iSize = SubstanceSizeUtils.getTitlePaneIconSize();
    BufferedImage result = SubstanceCoreUtilities.getBlankImage(iSize, iSize);
    Graphics2D graphics = (Graphics2D) result.getGraphics().create();
    graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

    Color color1 = (colorScheme == null) ? Color.red : colorScheme.getUltraDarkColor();
    Color color2 = (colorScheme == null) ? Color.green : colorScheme.getMidColor();
    Color color3 = (colorScheme == null) ? Color.blue : colorScheme.getExtraLightColor();

    graphics.setColor(color1);
    if (square) graphics.fillRect(5, 2, 6, 6);
    else graphics.fillOval(5, 2, 6, 6);
    graphics.setColor(color1.darker());
    if (square) graphics.drawRect(5, 2, 6, 6);
    else graphics.drawOval(5, 2, 6, 6);

    graphics.setColor(color2);
    if (square) graphics.fillRect(1, 9, 6, 6);
    else graphics.fillOval(1, 9, 6, 6);
    graphics.setColor(color2.darker());
    if (square) graphics.drawRect(1, 9, 6, 6);
    else graphics.drawOval(1, 9, 6, 6);

    graphics.setColor(color3);
    if (square) graphics.fillRect(9, 9, 6, 6);
    else graphics.fillOval(9, 9, 6, 6);
    graphics.setColor(color3.darker());
    if (square) graphics.drawRect(9, 9, 6, 6);
    else graphics.drawOval(9, 9, 6, 6);

    graphics.dispose();
    return new ImageIcon(result);
  }
Example #2
0
  @Override
  protected void paintWidget() {
    Graphics2D g = getGraphics();
    g.setStroke(Util.STROKE_2);
    g.setFont(getFont());
    Rectangle bounds = getBounds();

    String text = Util.node(this).toString();
    if (text.length() == 0) {
      g.setColor((Color) getBackground());
      g.fillOval(bounds.x, bounds.y, bounds.width - 1, bounds.height - 1);
      g.setColor(getForeground());
      g.drawOval(bounds.x, bounds.y, bounds.width - 1, bounds.height - 1);
    } else {
      g.setColor((Color) getBackground());
      int arc = (bounds.height - 1);
      g.fillRoundRect(bounds.x, bounds.y, bounds.width - 1, bounds.height - 1, arc, arc);
      g.setColor(getForeground());
      g.drawString(
          text,
          bounds.x + (bounds.height - 1) / 2,
          bounds.y + bounds.height - vborder - 1 - g.getFontMetrics().getMaxDescent());
      g.drawRoundRect(bounds.x, bounds.y, bounds.width - 1, bounds.height - 1, arc, arc);
    }
  }
 private void placerPostes(Graphics2D g) {
   g.setStroke(new BasicStroke());
   for (PlanSalle.Poste poste : modele.listerPostes()) {
     g.setColor(Color.gray);
     int xPoste = Parametres.posteX(poste.getPosition().getTravee(), poste.getOrientation());
     int yPoste = Parametres.posteY(poste.getPosition().getRangee(), poste.getOrientation());
     int xPersonne =
         Parametres.personneX(poste.getPosition().getTravee(), poste.getOrientation());
     int yPersonne =
         Parametres.personneY(poste.getPosition().getRangee(), poste.getOrientation());
     if (poste.getOrientation() == Orientation.NORD
         || poste.getOrientation() == Orientation.SUD) {
       g.fill3DRect(xPoste, yPoste, Parametres.LONGUEUR_POSTE, Parametres.LARGEUR_POSTE, true);
     } else {
       g.fill3DRect(xPoste, yPoste, Parametres.LARGEUR_POSTE, Parametres.LONGUEUR_POSTE, true);
     }
     g.drawOval(xPersonne, yPersonne, Parametres.LARGEUR_PERSONNE, Parametres.LARGEUR_PERSONNE);
     if (poste.peutVoir()) {
       g.setColor(Color.red);
     } else {
       g.setColor(Color.blue);
     }
     g.fillOval(xPersonne, yPersonne, 20, 20);
   }
 }
  @Override
  protected void paintIcon(JComponent c, Graphics2D g, Rectangle viewRect, Rectangle iconRect) {
    int rad = JBUI.scale(4);

    // Paint the radio button
    final int x = iconRect.x + (rad - (rad % 2 == 1 ? 1 : 0)) / 2;
    final int y = iconRect.y + (rad - (rad % 2 == 1 ? 1 : 0)) / 2;
    final int w = iconRect.width - rad;
    final int h = iconRect.height - rad;
    final boolean enabled = c.isEnabled();
    Color color = enabled ? Gray.x50 : Gray.xD3;
    g.translate(x, y);
    // setup AA for lines
    final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
    g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
    final boolean selected = ((AbstractButton) c).isSelected();
    g.setPaint(color);
    g.drawOval(0, 0, w, h);

    if (selected) {
      g.setColor(color);
      g.fillOval(JBUI.scale(3), JBUI.scale(3), w - 2 * JBUI.scale(3), h - 2 * JBUI.scale(3));
    }
    config.restore();
    g.translate(-x, -y);
  }
Example #5
0
  public void StaticObjNew(StaticObj so) {
    Graphics2D g = radarArea.backImage.createGraphics();
    g.setColor(so_color);

    if (so instanceof Beacon) {
      g.drawOval(
          convPos(so.pos.x) - grid_size / 6,
          convPos(so.pos.y) - grid_size / 6,
          grid_size / 3,
          grid_size / 3);
      JLabel sol = new JLabel(Integer.toString(so.id));
      sol.setForeground(so_text_color);
      sol.setBounds(
          convPos(so.pos.x) + grid_size / 6, convPos(so.pos.y), grid_size / 3, grid_size / 2);
      radarArea.add(sol, new Integer(1));
    }

    if (so instanceof Airfield) {
      int xa[] = new int[3], ya[] = new int[3];
      int l1 = grid_size / 2, l2 = grid_size / 6;
      xa[0] = convPos(so.pos.x);
      ya[0] = convPos(so.pos.y);
      xa[1] = convPos(so.pos.x) - l1 * so.dir.x - l2 * so.dir.y;
      ya[1] = convPos(so.pos.y) - l1 * so.dir.y + l2 * so.dir.x;
      xa[2] = convPos(so.pos.x) - l1 * so.dir.x + l2 * so.dir.y;
      ya[2] = convPos(so.pos.y) - l1 * so.dir.y - l2 * so.dir.x;
      g.drawPolygon(xa, ya, 3);
      JLabel sol = new JLabel(Integer.toString(so.id));
      sol.setForeground(so_text_color);
      sol.setBounds(
          convPos(so.pos.x) + grid_size / 6, convPos(so.pos.y), grid_size / 3, grid_size / 2);
      radarArea.add(sol, new Integer(1));
    }

    if (so instanceof Exit) {
      g.drawRect(
          convPos(so.pos.x) - grid_size / 6,
          convPos(so.pos.y) - grid_size / 6,
          grid_size / 3,
          grid_size / 3);
      JLabel sol = new JLabel(Integer.toString(so.id));
      sol.setForeground(so_text_color);
      sol.setBounds(
          convPos(so.pos.x) + grid_size / 6, convPos(so.pos.y), grid_size / 3, grid_size / 2);
      radarArea.add(sol, new Integer(1));
    }

    if (so instanceof Line) {
      g.setColor(line_color);
      g.drawLine(
          convPos(((Line) so).pos.x),
          convPos(((Line) so).pos.y),
          convPos(((Line) so).second_end.x),
          convPos(((Line) so).second_end.y));
    }

    radarArea.backIcon = new ImageIcon(radarArea.backImage);
    radarArea.back.setIcon(radarArea.backIcon);
  }
Example #6
0
  /** PaintComponent to draw everything. */
  @Override
  public void paintComponent(Graphics g) {
    super.paintComponent(g);
    setBackground(Color.WHITE);
    // If using images, use cool dragon background
    if (useImages) g.drawImage(background, 0, 0, 310, 300, null);

    // Use light gray to not overpower the background image
    g.setColor(Color.LIGHT_GRAY);
    for (int y = 1; y < ROWS; ++y)
      g.fillRoundRect(0, cellSize * y - 4, (cellSize * COLS) - 1, 8, 8, 8);
    for (int x = 1; x < COLS; ++x)
      g.fillRoundRect(cellSize * x - 4, 0, 8, (cellSize * ROWS) - 1, 8, 8);

    // Use graphics2d for when not using the images
    Graphics2D g2d = (Graphics2D) g;
    g2d.setStroke(new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
    for (int y = 0; y < ROWS; ++y) {
      for (int x = 0; x < COLS; ++x) {
        int x1 = x * cellSize + 16;
        int y1 = y * cellSize + 16;
        if (board[y][x] == Symbol.X) {
          // use image if set to true, otherwise use g2d
          // for thicker, better looking X's and O's
          if (useImages) g.drawImage(imageX, x1, y1, 75, 75, null);
          else {
            g2d.setColor(PURPLE);
            int x2 = (x + 1) * cellSize - 16;
            int y2 = (y + 1) * cellSize - 16;
            g2d.drawLine(x1, y1, x2, y2);
            g2d.drawLine(x2, y1, x1, y2);
          }
        } else if (board[y][x] == Symbol.O) {
          if (useImages) g.drawImage(imageO, x1, y1, 75, 75, null);
          else {
            g2d.setColor(Color.BLUE);
            g2d.drawOval(x1, y1, 70, 70);
          }
        }
      } // end for
    }

    // Set status bar based on gamestate.  If CONTINUE, show whose turn it is
    if (gameStatus == GameStatus.CONTINUE) {
      statusBar.setForeground(Color.BLACK);
      if (currentPlayer == Symbol.X) statusBar.setText("X's Turn");
      else statusBar.setText("O's Turn");
    } else if (gameStatus == GameStatus.DRAW) {
      statusBar.setForeground(Color.RED);
      statusBar.setText("Draw! Click to play again!");
    } else if (gameStatus == GameStatus.X_WIN) {
      statusBar.setForeground(Color.RED);
      statusBar.setText("X has won! Click to play again!");
    } else if (gameStatus == GameStatus.O_WIN) {
      statusBar.setForeground(Color.RED);
      statusBar.setText("O has won! Click to play again!");
    }
  }
    /**
     * @param points
     * @param color
     * @param g
     */
    private void paintSequence(
        Slot type, List<List<ValuePointColored>> points, Color color, Graphics2D g) {
      int i = 0;
      int size = points.size();

      if (size > 0) {
        double increment = 200 / size;

        for (List<ValuePointColored> valuePoints : points) {
          int alpha = (int) (i * increment) + 55;
          Color c = new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha);
          for (ValuePointColored valuePoint : valuePoints) {
            double[] coordinates = valuePoint.getPoint().toArray();
            int x = xToPix(coordinates[0]);
            int y = yToPix(coordinates[1]);
            // if minimum then red, else black
            if (valuePoint.getBest() == true) {
              g.setColor(Color.red);
            } else {
              g.setColor(c);
            }
            g.setStroke(LINE);

            switch (type) {
              case CIRCLE:
                g.drawOval(x - RADIUS / 2 - 3, y - RADIUS / 2 - 3, RADIUS * 2, RADIUS * 2);
                break;
              case SQUARE:
                g.drawRect(x - RADIUS / 2 - 2, y - RADIUS / 2 - 2, RADIUS * 2 - 2, RADIUS * 2 - 2);
                break;
              case TRIANGLE:
                GeneralPath polyline = new GeneralPath(GeneralPath.WIND_EVEN_ODD, 3);
                polyline.moveTo(x, y - RADIUS / 2 - 4);
                polyline.lineTo(x + RADIUS / 2 + 3, y + RADIUS / 2 + 1);
                polyline.lineTo(x - RADIUS / 2 - 3, y + RADIUS / 2 + 1);
                polyline.closePath();
                g.draw(polyline);
                break;
              case CROSS:
                int xLow = x - RADIUS / 2 - 1;
                int xHigh = x + RADIUS / 2 + 1;
                int yLow = y - RADIUS / 2 - 1;
                int yHigh = y + RADIUS / 2 + 1;
                g.drawLine(xLow, yLow, xHigh, yHigh);
                g.drawLine(xHigh, yLow, xLow, yHigh);
                break;
            }
          }
          i++;
        }
      }
    }
Example #8
0
 private void render(Graphics2D g2, int x, int y, int w, int h) {
   g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
   if (shadow != null) {
     int xOffset = (shadow.getWidth() - w) / 2;
     int yOffset = (shadow.getHeight() - h) / 2;
     g2.drawImage(shadow, x - xOffset, y - yOffset, null);
   }
   GradientPaint grad =
       new GradientPaint(
           new Point(0, 0),
           actualFillColor,
           new Point(0, getHeight()),
           new Color(255, 127, 36, 220));
   g2.setPaint(grad);
   g2.fillOval(x, y, w, h);
   g2.setStroke(new BasicStroke(2f));
   g2.setColor(borderColor);
   if (selected) {
     g2.setColor(new Color(243, 238, 39, 150));
   } else {
     g2.setColor(Color.WHITE);
   }
   g2.drawOval(x, y, w, h); // , arc, arc);
   g2.setColor(Color.WHITE);
   g2.setFont(new Font("Monospaced", Font.BOLD, 9));
   // g2.drawChars(title.toCharArray(), 0, title.length(), 0, 5);
   String[] titles = title.split(":");
   for (int i = 0; i < titles.length; i++) {
     g2.drawString(
         titles[i].trim(),
         (int) ((getWidth() / 2) - (title.trim().length() / 2) * 2.6),
         40 + i * 25);
     if (i != 0) {
       g2.drawString(":", (int) ((getWidth() / 2) - 1), 30 + (i * 25));
     }
   }
   // g2.drawString(title, (int)(getWidth()/2-title.length()*3),(getHeight()/2)+5);
   g2.dispose();
 }
Example #9
0
  public void paintComponent(Graphics g) {
    super.paintComponent(g);
    setBackground(Color.white);
    Graphics2D graphics2D = (Graphics2D) g;

    NumberFormat nf = NumberFormat.getInstance();
    nf.setMaximumFractionDigits(2);

    int nrpairs = 0;
    for (nrpairs = 0; nrpairs < pairs.length && pairs[nrpairs] != -1; nrpairs++) ;

    graphics2D.setColor(Color.red);
    graphics2D.drawString("Unknown shark: " + orig, 50, 30);
    graphics2D.setColor(Color.blue);
    graphics2D.drawString("Found shark: " + found, 50, 48);
    graphics2D.setColor(Color.black);
    graphics2D.drawString("Nr of spot pairs: " + nrpairs, 50, 66);
    graphics2D.drawString("Score: " + nf.format(score), 50, 84);

    graphics2D.setColor(Color.green);
    for (int i = 0; i < pairs.length; i++) {
      if (pairs[i] == -1) break;
      int index1 = pairs[i] % 1000;
      int index2 = pairs[i] / 1000;

      graphics2D.draw(new Line2D.Double(s1[index1].x, s1[index1].y, s2[index2].x, s2[index2].y));
    }

    graphics2D.setColor(Color.red);
    for (int i = 0; i < s1.length; i++)
      if (s1[i].empty() == false)
        graphics2D.fill(new Ellipse2D.Double(s1[i].x - 1, s1[i].y - 1, 3, 3));

    graphics2D.setColor(Color.blue);
    for (int i = 0; i < s2.length; i++)
      if (s2[i].empty() == false) graphics2D.drawOval((int) s2[i].x - 3, (int) s2[i].y - 3, 6, 6);
  }
Example #10
0
  public boolean paint(Graphics graphics) {
    if (!Game.isLoggedIn()) return false;
    try {
      Graphics2D g = (Graphics2D) graphics;
      PComponent clayout = null;
      try {
        clayout =
            new PColumnLayout(
                227,
                404,
                infoColumnValues,
                infoColumnData,
                new Font("Arial", 0, 9),
                PColumnLayout.ColorScheme.WHITE);
      } catch (Exception e) {
        e.printStackTrace();
      }
      getFrame("options").removeComponent(firstLayout);
      getFrame("options").removeComponent(secondLayout);
      int secondColx = -1;
      int bestLength = -1;
      firstColumn.clear();
      secondColumn.clear();
      if (checkBoxes.size() <= 6) firstColumn.putAll(checkBoxes);
      else {
        for (int i = 0; i < checkBoxes.size(); i++) {
          if (i <= 5) {
            String text;
            Iterator it = checkBoxes.keySet().iterator();
            for (int j = 0; j < i; j++) it.next();
            text = (String) it.next();
            int length = SwingUtilities.computeStringWidth(g.getFontMetrics(g.getFont()), text);
            if (length > bestLength) bestLength = length;
            firstColumn.put(text, checkBoxes.get(text));
          } else {
            String text;
            Iterator it = checkBoxes.keySet().iterator();
            for (int j = 0; j < i; j++) it.next();
            text = (String) it.next();
            secondColumn.put(text, checkBoxes.get(text));
          }
        }
      }
      secondColx = 8 + bestLength;
      firstLayout =
          new PCheckBoxLayout(
              8,
              407,
              firstColumn
                  .keySet()
                  .toArray(new String[(firstColumn.size() > 6) ? 6 : firstColumn.size()]),
              firstColumn
                  .values()
                  .toArray(new PCheckBox[(firstColumn.size() > 6) ? 6 : firstColumn.size()]),
              new Font("Arial", 0, 11),
              PCheckBoxLayout.ColorScheme.WHITE);
      secondLayout =
          new PCheckBoxLayout(
              secondColx + 12,
              407,
              secondColumn
                  .keySet()
                  .toArray(new String[(secondColumn.size() > 6) ? 6 : secondColumn.size()]),
              secondColumn
                  .values()
                  .toArray(new PCheckBox[(secondColumn.size() > 6) ? 6 : secondColumn.size()]),
              new Font("Arial", 0, 11),
              PCheckBoxLayout.ColorScheme.WHITE);
      getFrame("options").addComponent(firstLayout);
      getFrame("options").addComponent(secondLayout);
      if (showPaint) {
        Paint p = g.getPaint();
        g.setPaint(
            new GradientPaint(
                0, 1000, new Color(55, 55, 55, 240), 512, 472, new Color(15, 15, 15, 240)));
        g.fillRect(7, 396, 505, 128);
        final Point loc = Mouse.getLocation();
        if (Mouse.isPressed()) {
          g.fillOval(loc.x - 5, loc.y - 5, 10, 10);
          g.drawOval(loc.x - 5, loc.y - 5, 10, 10);
        }
        g.drawLine(0, loc.y + 1, 766, loc.y + 1);
        g.drawLine(0, loc.y - 1, 766, loc.y - 1);
        g.drawLine(loc.x + 1, 0, loc.x + 1, 505);
        g.drawLine(loc.x - 1, 0, loc.x - 1, 505);
        g.setPaint(p);
      }
      if (clayout != null) getFrame("info").addComponent(clayout);
      PaintController.onRepaint(graphics);
      if (clayout != null) getFrame("info").removeComponent(clayout);
      if (!showPaint) return false;
      String infoTxt = name + " - " + "v" + version;
      g.drawString(
          infoTxt,
          510 - SwingUtilities.computeStringWidth(g.getFontMetrics(g.getFont()), infoTxt),
          468);

      int offset = 0;
      for (Skill skill : skills) {
        if (skill.xpGained() > 0) {
          PSkill skillComp =
              new PSkill(8, 397 + offset, skill.getSkill(), PSkill.ColorScheme.GRAPHITE);
          if (!getFrame("info").containsComponent(skillComp)) {
            getFrame("info").addComponent(skillComp);
          }
          offset += 20;
        }
      }

      // == Mouse ==
      if (Mouse.isPressed()) {
        g.setColor(new Color(255, 252, 0, 150));

        g.setColor(new Color(255, 252, 0, 100));
      } else {
        g.setColor(new Color(255, 252, 0, 50));
      }

      g.setColor(new Color(0, 0, 0, 50));

      // == End mouse ==
    } catch (Exception ignored) {
      // if (Utils.isDevMode())
      //    ignored.printStackTrace();
    }
    return true;
  }
 private void drawCircle(int pix, int xCenter, int yCenter, int r) {
   Graphics2D g = res.createGraphics();
   g.setColor(Color.RED);
   g.drawOval(xCenter - r, yCenter - r, r * 2, r * 2);
   g.dispose();
 }
Example #12
0
 // also clip, transform, composite,
 // public boolean isOpaque(){return false;}//theOpaque!=null&&theOpaque;}
 // ---------------------------------------------------------
 private void doPaint(Graphics2D g, int s, Object o) {
   // process an operation from the buffer
   // System.out.println(s);
   Object o1 = null,
       o2 = null,
       o3 = null,
       o4 = null,
       o5 = null,
       o6 = null,
       o7 = null,
       o8 = null,
       o9 = null,
       o10 = null,
       o11 = null;
   if (o instanceof Object[]) {
     Object[] a = (Object[]) o;
     if (a.length > 0) o1 = a[0];
     if (a.length > 1) o2 = a[1];
     if (a.length > 2) o3 = a[2];
     if (a.length > 3) o4 = a[3];
     if (a.length > 4) o5 = a[4];
     if (a.length > 5) o6 = a[5];
     if (a.length > 6) o7 = a[6];
     if (a.length > 7) o8 = a[7];
     if (a.length > 8) o9 = a[8];
     if (a.length > 9) o10 = a[9];
     if (a.length > 10) o11 = a[10];
   }
   switch (s) {
     case clear:
       paintBackground(g, theBackground);
       break;
       // public void addRenderingHints(Map<?,?> hints)
       // {toBuffer("addRenderingHints",hints );}
     case addRenderingHints:
       g.addRenderingHints((Map<?, ?>) o);
       break;
     case clip1:
       g.clip((Shape) o);
       break;
     case draw1:
       g.draw((Shape) o);
       break;
     case draw3DRect:
       g.draw3DRect((Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4, (Boolean) o5);
       break;
     case drawGlyphVector:
       g.drawGlyphVector((GlyphVector) o1, (Float) o2, (Float) o3);
       break;
     case drawImage1:
       g.drawImage((BufferedImage) o1, (BufferedImageOp) o2, (Integer) o3, (Integer) o4);
       break;
     case drawImage2:
       g.drawImage((Image) o1, (AffineTransform) o2, (ImageObserver) o3);
       break;
     case drawRenderableImage:
       g.drawRenderableImage((RenderableImage) o1, (AffineTransform) o2);
       break;
     case drawRenderedImage:
       g.drawRenderedImage((RenderedImage) o1, (AffineTransform) o2);
       break;
     case drawString1:
       g.drawString((AttributedCharacterIterator) o1, (Float) o2, (Float) o3);
       break;
     case drawString2:
       g.drawString((AttributedCharacterIterator) o1, (Integer) o2, (Integer) o3);
       break;
     case drawString3:
       g.drawString((String) o1, (Float) o2, (Float) o3);
       break;
     case drawString4:
       g.drawString((String) o1, (Integer) o2, (Integer) o3);
       break;
     case fill:
       g.fill((Shape) o);
       break;
     case fill3DRect:
       g.fill3DRect((Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4, (Boolean) o5);
       break;
     case rotate1:
       g.rotate((Double) o);
       break;
     case rotate2:
       g.rotate((Double) o1, (Double) o2, (Double) o3);
       break;
     case scale1:
       g.scale((Double) o1, (Double) o2);
       break;
     case setBackground:
       g.setBackground(
           (Color) o); // paintBackground(g,(Color)o); /*super.setBackground((Color)o) ;*/
       break;
     case setComposite:
       g.setComposite((Composite) o);
       break;
     case setPaint:
       g.setPaint((Paint) o);
       break;
     case setRenderingHint:
       g.setRenderingHint((RenderingHints.Key) o1, o2);
       break;
     case setRenderingHints:
       g.setRenderingHints((Map<?, ?>) o);
       break;
     case setStroke:
       g.setStroke((Stroke) o);
       break;
     case setTransform:
       g.setTransform(makeTransform(o));
       break;
     case shear:
       g.shear((Double) o1, (Double) o2);
       break;
     case transform1:
       g.transform(makeTransform(o));
       break;
     case translate1:
       g.translate((Double) o1, (Double) o2);
       break;
     case translate2:
       g.translate((Integer) o1, (Integer) o2);
       break;
     case clearRect:
       g.clearRect((Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4);
       break;
     case copyArea:
       g.copyArea(
           (Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4, (Integer) o5, (Integer) o6);
       break;
     case drawArc:
       g.drawArc(
           (Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4, (Integer) o5, (Integer) o6);
       break;
     case drawBytes:
       g.drawBytes((byte[]) o1, (Integer) o2, (Integer) o3, (Integer) o4, (Integer) o5);
       break;
     case drawChars:
       g.drawChars((char[]) o1, (Integer) o2, (Integer) o3, (Integer) o4, (Integer) o5);
       break;
     case drawImage4:
       g.drawImage((Image) o1, (Integer) o2, (Integer) o3, (Color) o4, (ImageObserver) o5);
       break;
     case drawImage5:
       g.drawImage((Image) o1, (Integer) o2, (Integer) o3, (ImageObserver) o4);
       break;
     case drawImage6:
       g.drawImage(
           (Image) o1,
           (Integer) o2,
           (Integer) o3,
           (Integer) o4,
           (Integer) o5,
           (Color) o6,
           (ImageObserver) o7);
       break;
     case drawImage7:
       g.drawImage(
           (Image) o1, (Integer) o2, (Integer) o3, (Integer) o4, (Integer) o5, (ImageObserver) o6);
       break;
     case drawImage8:
       g.drawImage(
           (Image) o1,
           (Integer) o2,
           (Integer) o3,
           (Integer) o4,
           (Integer) o5,
           (Integer) o6,
           (Integer) o7,
           (Integer) o8,
           (Integer) o9,
           (Color) o10,
           (ImageObserver) o11);
       break;
     case drawImage9:
       g.drawImage(
           (Image) o1,
           (Integer) o2,
           (Integer) o3,
           (Integer) o4,
           (Integer) o5,
           (Integer) o6,
           (Integer) o7,
           (Integer) o8,
           (Integer) o9,
           (ImageObserver) o10);
       break;
     case drawLine:
       g.drawLine((Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4);
       break;
     case drawOval:
       g.drawOval((Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4);
       break;
     case drawPolygon1:
       g.drawPolygon((int[]) o1, (int[]) o2, (Integer) o3);
       break;
     case drawPolygon2:
       g.drawPolygon((Polygon) o);
       break;
     case drawPolyline:
       g.drawPolyline((int[]) o1, (int[]) o2, (Integer) o3);
       break;
     case drawRect:
       g.drawRect((Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4);
       break;
     case drawRoundRect:
       g.drawRoundRect(
           (Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4, (Integer) o5, (Integer) o6);
       break;
     case fillArc:
       g.fillArc(
           (Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4, (Integer) o5, (Integer) o6);
       break;
     case fillOval:
       g.fillOval((Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4);
       break;
       // {toBuffer("fillPolygon",mkArg(xPoints,  yPoints, nPoints) );}
     case fillPolygon1:
       g.fillPolygon((int[]) o1, (int[]) o2, (Integer) o3);
       break;
     case fillPolygon2:
       g.fillPolygon((Polygon) o);
       break;
     case fillRect:
       g.fillRect((Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4);
       break;
     case fillRoundRect:
       g.fillRoundRect(
           (Integer) o1, (Integer) o2, (Integer) o3, (Integer) o4, (Integer) o5, (Integer) o6);
       break;
     case setClip1:
       g.setClip((Shape) o);
       break;
     case setColor:
       g.setColor((Color) o);
       break;
     case setFont:
       g.setFont((Font) o);
       break;
     case setPaintMode:
       g.setPaintMode();
       break;
     case setXORMode:
       g.setXORMode((Color) o);
       break;
     case opaque:
       super.setOpaque((Boolean) o);
       break;
     case drawOutline: // g.drawString((String)o1, (Integer)o2, (Integer)o3) ;break;
       {
         FontRenderContext frc = g.getFontRenderContext();
         TextLayout tl = new TextLayout((String) o1, g.getFont(), frc);
         Shape s1 = tl.getOutline(null);
         AffineTransform af = g.getTransform();
         g.translate((Integer) o2, (Integer) o3);
         g.draw(s1);
         g.setTransform(af);
       }
       ;
       break;
     default:
       System.out.println("Unknown image operation " + s);
   }
 }