Package java.awt

Examples of java.awt.Graphics2D.drawGlyphVector()


      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.MAX));
      gv = OpenPatricianPainter.createGlyphVector(g2d, "Max", 18); //externalize
      xPadding = ImageUtil.computeCenterAlignX(x, waxSeal.getWidth(), (int)gv.getVisualBounds().getWidth());
      g2d.drawGlyphVector(gv, xPadding, y); // centeralign
      x += footerWidth/4;
      // close
      g2d.drawImage(waxSeal, x,y-(int)(positions.lineHeight*0.8), null);
      polygon = new NamedPolygon("Close");
      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 CloseAction(this));
      gv = OpenPatricianPainter.createGlyphVector(g2d, "X", 18);
      xPadding = ImageUtil.computeCenterAlignX(x, waxSeal.getWidth(), (int)gv.getVisualBounds().getWidth());
      g2d.drawGlyphVector(gv, xPadding, y); // centeralign


    } catch (FontFormatException e1) {
      e1.printStackTrace();
    } catch (IOException e1) {
View Full Code Here

      int leftBorderX = getBounds().x+getInset().left;
      int x = leftBorderX + 20;
      ICity cityModel = city.getCity();
      GlyphVector gv = OpenPatricianPainter.createGlyphVector(g2d, cityModel.getName()+" "+cityModel.getPopulation(), 18);
      y += (int)Math.rint(positions.titleHeigth*2/3);
      g2d.drawGlyphVector(gv, x, y);
     
      // Barrel icon
      x += (int)Math.rint(gv.getVisualBounds().getWidth())+50;
      BufferedImage barrel = loader.getImage("barrel_icon");
      BufferedImage bale = loader.getImage("bale_icon");
View Full Code Here

      x += 50;
      IShip ship = city.getActiveShip();
      StringBuilder sb = new StringBuilder();
      sb.append(ship.getLoad()).append(" / ").append(ship.getSize()).append(" ").append(ship.getName());
      gv = OpenPatricianPainter.createGlyphVector(g2d, sb.toString(), 18);
      g2d.drawGlyphVector(gv, x, y); // TODO this is a dynamic line
     
      BufferedImage waxSeal = loader.getImage("waxseal");
      // Table header
      y += positions.lineHeight; // more space to the title
      y += positions.lineHeight;
View Full Code Here

        AmountablePrice<EWare> wareInCity = cityModel.getWare(ware);
        int availableAmount = wareInCity.getAmount();
        int value = availableAmount; // amount available
        if (value>0){
          gv = OpenPatricianPainter.createGlyphVector(g2d, String.valueOf(value), 18);
          g2d.drawGlyphVector(gv, positions.xCity, y);
          // draw barrel or burden
          if (ware.getSizeAsBarrels()==1){
            // barrel
            g2d.drawImage(barrel, (int)(positions.xCity+gv.getVisualBounds().getWidth())+5, y-positions.lineHeight*2/3, null);
          } else {
View Full Code Here

        } else {
          value = 0; // cannot buy anything if nothing is there
        }
        gv = OpenPatricianPainter.createGlyphVector(g2d, String.valueOf(value), 18);
        int xPadding = ImageUtil.computeCenterAlignX(positions.xBuy, waxSeal.getWidth(), (int)gv.getVisualBounds().getWidth());
        g2d.drawGlyphVector(gv, xPadding, y);
        // sell
        if (movableAmount==ETransferAmount.MAX){
          value = ware.getMaxValueSell();
        } else {
          value = ware.computeSellPrice(availableAmount, getAmount(availableAmount));
View Full Code Here

        } else {
          value = ware.computeSellPrice(availableAmount, getAmount(availableAmount));
        }
        gv = OpenPatricianPainter.createGlyphVector(g2d, String.valueOf(value), 18);
        xPadding = ImageUtil.computeCenterAlignX(positions.xSell, waxSeal.getWidth(), (int)gv.getVisualBounds().getWidth());
        g2d.drawGlyphVector(gv, xPadding, y);
        g2d.setColor(Color.BLACK);
        // amount loaded
        value = city.getActiveShip().getWare(ware).getAmount(); // differ between ship and convoi
        if (value>0){
          gv = OpenPatricianPainter.createGlyphVector(g2d, String.valueOf(value), 18);
View Full Code Here

        g2d.setColor(Color.BLACK);
        // amount loaded
        value = city.getActiveShip().getWare(ware).getAmount(); // differ between ship and convoi
        if (value>0){
          gv = OpenPatricianPainter.createGlyphVector(g2d, String.valueOf(value), 18);
          g2d.drawGlyphVector(gv, positions.xShip, y); // this value is dynamic
          // draw barrel or burden
        }
        if (ship.getWare(ware).getAmount()>0){
          value = ship.getWare(ware).getAVGPrice();
          gv = OpenPatricianPainter.createGlyphVector(g2d, String.valueOf(value), 18);
View Full Code Here

          // draw barrel or burden
        }
        if (ship.getWare(ware).getAmount()>0){
          value = ship.getWare(ware).getAVGPrice();
          gv = OpenPatricianPainter.createGlyphVector(g2d, String.valueOf(value), 18);
          g2d.drawGlyphVector(gv, positions.xPrice+10, y);
        }
      } // end for wares
     
    } catch (FontFormatException e) {
      e.printStackTrace();
View Full Code Here

            Font f = g2.getFont();
            GlyphVector gvec
                = f.createGlyphVector(g2.getFontRenderContext(), text);
            startTest("text-glyph-vector", n);
            for ( int i=0; i<n; ++i ) {
                g2.drawGlyphVector(gvec, xf+2, hf/2);
            }
            endTest(print);
           
            if ( print ) {
                s_logger.info("Rendering Benchmarks: "+testSuite+'\n'
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.