Package java.awt

Examples of java.awt.Graphics2D.drawGlyphVector()


      GlyphVector gv = OpenPatricianPainter.createGlyphVector(g2d, "Trade goods", 24); // TODO externalize
      double titleHeight = gv.getVisualBounds().getHeight();
      int length = (int) Math.rint(gv.getVisualBounds().getWidth());
      int x = ((bg.getWidth()-getInset().left-getInset().right)-length)/2;
      int y = getInset().top+10+(int)Math.rint(titleHeight*2/3);
      g2d.drawGlyphVector(gv, x, y);
      // Dynamic row
      y += titleHeight;
      y += (int)Math.rint(titleHeight*2/3);
     
      BufferedImage waxSeal = loader.getImage("waxseal");
View Full Code Here


      // draw the table header
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Ware", 19); // TODO externalize
      x = xWare-(int)Math.rint(gv.getVisualBounds().getWidth());
      y += positions.lineHeight; // more space to the title
      y += positions.lineHeight;
      g2d.drawGlyphVector(gv, x, y);

      gv = OpenPatricianPainter.createGlyphVector(g2d, "City", 19);
      g2d.drawGlyphVector(gv, xCity, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Buy", 19);
      g2d.drawGlyphVector(gv, xBuy, y);
View Full Code Here

      y += positions.lineHeight; // more space to the title
      y += positions.lineHeight;
      g2d.drawGlyphVector(gv, x, y);

      gv = OpenPatricianPainter.createGlyphVector(g2d, "City", 19);
      g2d.drawGlyphVector(gv, xCity, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Buy", 19);
      g2d.drawGlyphVector(gv, xBuy, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Sell", 19);
      g2d.drawGlyphVector(gv, xSell, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Ship", 19); // TODO differenciate between ship and convoi
View Full Code Here

      g2d.drawGlyphVector(gv, x, y);

      gv = OpenPatricianPainter.createGlyphVector(g2d, "City", 19);
      g2d.drawGlyphVector(gv, xCity, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Buy", 19);
      g2d.drawGlyphVector(gv, xBuy, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Sell", 19);
      g2d.drawGlyphVector(gv, xSell, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Ship", 19); // TODO differenciate between ship and convoi
      g2d.drawGlyphVector(gv, xShip, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, Character.toChars(0x00D8)[0]+"-Price", 19); // TODO do better
View Full Code Here

      gv = OpenPatricianPainter.createGlyphVector(g2d, "City", 19);
      g2d.drawGlyphVector(gv, xCity, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Buy", 19);
      g2d.drawGlyphVector(gv, xBuy, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Sell", 19);
      g2d.drawGlyphVector(gv, xSell, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Ship", 19); // TODO differenciate between ship and convoi
      g2d.drawGlyphVector(gv, xShip, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, Character.toChars(0x00D8)[0]+"-Price", 19); // TODO do better
      g2d.drawGlyphVector(gv, xPrice, y);
     
View Full Code Here

      gv = OpenPatricianPainter.createGlyphVector(g2d, "Buy", 19);
      g2d.drawGlyphVector(gv, xBuy, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Sell", 19);
      g2d.drawGlyphVector(gv, xSell, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Ship", 19); // TODO differenciate between ship and convoi
      g2d.drawGlyphVector(gv, xShip, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, Character.toChars(0x00D8)[0]+"-Price", 19); // TODO do better
      g2d.drawGlyphVector(gv, xPrice, y);
     
      // Table
      EWare[] wares = EWare.values();
View Full Code Here

      gv = OpenPatricianPainter.createGlyphVector(g2d, "Sell", 19);
      g2d.drawGlyphVector(gv, xSell, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Ship", 19); // TODO differenciate between ship and convoi
      g2d.drawGlyphVector(gv, xShip, y);
      gv = OpenPatricianPainter.createGlyphVector(g2d, Character.toChars(0x00D8)[0]+"-Price", 19); // TODO do better
      g2d.drawGlyphVector(gv, xPrice, y);
     
      // Table
      EWare[] wares = EWare.values();
      for (EWare ware : wares) {
        // Ware name
View Full Code Here

      for (EWare ware : wares) {
        // Ware name
        y += positions.lineHeight;
        gv = OpenPatricianPainter.createGlyphVector(g2d, ware.getLocalDisplayName(), 18);
        x = xWare-(int)Math.rint(gv.getVisualBounds().getWidth());
        g2d.drawGlyphVector(gv, x, y);
        // Amount available
       
        // Buy button
        g2d.drawImage(waxSeal, xBuy,y-(int)(positions.lineHeight*0.8), null);
        NamedPolygon polygon = new NamedPolygon(ware.name()+"Buy");
View Full Code Here

      polygon.addPoint(topLeft.x+x+waxSeal.getWidth(), topLeft.y+y-(int)(positions.lineHeight*0.8)+waxSeal.getHeight());
      polygon.addPoint(topLeft.x+x, topLeft.y+y-(int)(positions.lineHeight*0.8)+waxSeal.getHeight());
      footerPolygons.add(polygon, new TransferAmountChangeAction(ETransferAmount.ONE));
      gv = OpenPatricianPainter.createGlyphVector(g2d, "1", 18);
      int xPadding = ImageUtil.computeCenterAlignX(x, waxSeal.getWidth(), (int)gv.getVisualBounds().getWidth());
      g2d.drawGlyphVector(gv, xPadding, y);
      x += footerWidth/4;
      // 5 items
      g2d.drawImage(waxSeal, x,y-(int)(positions.lineHeight*0.8), null);
      polygon = new NamedPolygon("five");
      polygon.addPoint(topLeft.x+x, topLeft.y+y-(int)(positions.lineHeight*0.8));
 
View Full Code Here

      polygon.addPoint(topLeft.x+x+waxSeal.getWidth(), topLeft.y+y-(int)(positions.lineHeight*0.8)+waxSeal.getHeight());
      polygon.addPoint(topLeft.x+x, topLeft.y+y-(int)(positions.lineHeight*0.8)+waxSeal.getHeight());
      footerPolygons.add(polygon, new TransferAmountChangeAction(ETransferAmount.FIVE));
      gv = OpenPatricianPainter.createGlyphVector(g2d, "5", 18);
      xPadding = ImageUtil.computeCenterAlignX(x, waxSeal.getWidth(), (int)gv.getVisualBounds().getWidth());
      g2d.drawGlyphVector(gv, xPadding, y); // centeralign
      x += footerWidth/4;
      // Max item
      g2d.drawImage(waxSeal, x,y-(int)(positions.lineHeight*0.8), null);
      polygon = new NamedPolygon("Max");
      polygon.addPoint(topLeft.x+x, topLeft.y+y-(int)(positions.lineHeight*0.8));
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.