Package java.awt

Examples of java.awt.Graphics.drawPolygon()


            case MovePath.STEP_ROLL:
                // draw arrows showing the facing
                myPoly = new Polygon(facingPoly.xpoints, facingPoly.ypoints, facingPoly.npoints);
                graph.setColor(Color.darkGray);
                myPoly.translate(stepPos.x + 1, stepPos.y + 1);
                graph.drawPolygon(myPoly);
                graph.setColor(col);
                myPoly.translate(-1, -1);
                graph.drawPolygon(myPoly);
                if(game.useVectorMove()) {
                    drawMovementCost(step, stepPos, graph, col, false);
View Full Code Here


                graph.setColor(Color.darkGray);
                myPoly.translate(stepPos.x + 1, stepPos.y + 1);
                graph.drawPolygon(myPoly);
                graph.setColor(col);
                myPoly.translate(-1, -1);
                graph.drawPolygon(myPoly);
                if(game.useVectorMove()) {
                    drawMovementCost(step, stepPos, graph, col, false);
                }
                break;
            case MovePath.STEP_LOAD:
View Full Code Here

            // fill with key color
            graph.setColor(new Color(TRANSPARENT));
            graph.fillRect(0, 0, bounds.width, bounds.height);
            // draw attack poly
            graph.setColor(color);
            graph.drawPolygon(hexPoly);

            // create final image
            if (zoomIndex == BASE_ZOOM_INDEX) {
                image = createImage(new FilteredImageSource(tempImage
                        .getSource(), new KeyAlphaFilter(TRANSPARENT)));
View Full Code Here

            graph.setColor(Color.white);
            if ((entity.getFacing() != -1)
                    && !((entity instanceof Infantry) && (((Infantry) entity).getDugIn() == Infantry.DUG_IN_NONE))
                    && !((entity instanceof Aero) && ((Aero) entity).isSpheroid() && game.getBoard()
                            .inAtmosphere())) {
                graph.drawPolygon(facingPolys[entity.getFacing()]);
            }

            // determine secondary facing for non-mechs & flipped arms
            int secFacing = entity.getFacing();
            if (!((entity instanceof Mech) || (entity instanceof Protomech))) {
View Full Code Here

                secFacing = (entity.getFacing() + 3) % 6;
            }
            // draw red secondary facing arrow if necessary
            if ((secFacing != -1) && (secFacing != entity.getFacing())) {
                graph.setColor(Color.red);
                graph.drawPolygon(facingPolys[secFacing]);
            }

            // Determine if the entity has a locked turret,
            // and if it is a gun emplacement
            boolean turretLocked = false;
View Full Code Here

            if ((entity.getFacing() != -1)
                    && !((entity instanceof Infantry) && (((Infantry) entity)
                            .getDugIn() == Infantry.DUG_IN_NONE))
                            && !((entity instanceof Aero) && ((Aero)entity).isSpheroid()
                                    && game.getBoard().inAtmosphere())) {
                graph.drawPolygon(facingPolys[entity.getFacing()]);
            }

            // determine secondary facing for non-mechs & flipped arms
            int secFacing = entity.getFacing();
            if (!((entity instanceof Mech) || (entity instanceof Protomech))) {
View Full Code Here

                secFacing = (entity.getFacing() + 3) % 6;
            }
            // draw red secondary facing arrow if necessary
            if ((secFacing != -1) && (secFacing != entity.getFacing())) {
                graph.setColor(Color.red);
                graph.drawPolygon(facingPolys[secFacing]);
            }

            // Determine if the entity has a locked turret,
            // and if it is a gun emplacement
            boolean turretLocked = false;
View Full Code Here

            // fill with key color
            graph.setColor(new Color(TRANSPARENT));
            graph.fillRect(0, 0, bounds.width, bounds.height);
            // draw attack poly
            graph.setColor(color);
            graph.drawPolygon(hexPoly);

            // create final image
            image = createImage(new FilteredImageSource(tempImage.getSource(), new KeyAlphaFilter(
                    TRANSPARENT)));
            graph.dispose();
View Full Code Here

        xp = new int[] { xb, x1, x1, xb, xb, x0, xb  };
        yp = new int[] { y0, y0, y1, y1, mw, 0,  -mw };
      }
    }
    GraphicsUtil.switchToWidth(g, 2);
    g.drawPolygon(xp, yp, xp.length);
  }

  @Override
  public void paintInstance(InstancePainter painter) {
    Location loc = painter.getLocation();
View Full Code Here

                int[] xs = { x - offs, x, x + offs, x };
                int[] ys = { y, y - offs, y, y + offs };
                gCopy.setColor(Color.WHITE);
                gCopy.fillPolygon(xs, ys, 4);
                gCopy.setColor(Color.BLACK);
                gCopy.drawPolygon(xs, ys, 4);
            }
        }

        switch (action) {
        case RECT_SELECT:
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.