public static Color getColor(int colorIndex) { return getColor(colorIndex, true); }
public static Color getAdvColor(int colorIndex, int plrIndex) { if (colorIndex > advancedColorRGBs.length) { return getColor(plrIndex); } int colour = advancedColorRGBs[colorIndex]; int transparency = GUIPreferences.getInstance().getInt( GUIPreferences.ADVANCED_ATTACK_ARROW_TRANSPARENCY); return new Color(colour | (transparency << 24), true); }
public void setImage(String category, String name, int colorInd) { if (null == category) { return; } if(Player.NO_CAMO.equals(category)) { if (colorInd == -1) { colorInd = 0; } BufferedImage tempImage = new BufferedImage(84, 72, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = tempImage.createGraphics(); graphics.setColor(PlayerColors.getColor(colorInd)); graphics.fillRect(0, 0, 84, 72); lblImage.setIcon(new ImageIcon(tempImage)); return; } // Try to get the camo file. try { // Translate the root camo directory name. if (Player.ROOT_CAMO.equals(category)) category = ""; //$NON-NLS-1$ Image camo = (Image) camos.getItem(category, name); lblImage.setIcon(new ImageIcon(camo)); } catch (Exception err) { err.printStackTrace(); } } // Variables declaration - do not modify//GEN-BEGIN:variables
public void setImage(String category, String name) { if (null == category) { return; } if (IPlayer.NO_CAMO.equals(category)) { BufferedImage tempImage = new BufferedImage(84, 72, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = tempImage.createGraphics(); graphics.setColor(PlayerColors.getColor(name)); graphics.fillRect(0, 0, 84, 72); lblImage.setIcon(new ImageIcon(tempImage)); return; } // Try to get the camo file. try { // Translate the root camo directory name. if (IPlayer.ROOT_CAMO.equals(category)) { category = ""; //$NON-NLS-1$ } Image camo = (Image) camos.getItem(category, name); lblImage.setIcon(new ImageIcon(camo)); } catch (Exception err) { err.printStackTrace(); } } }
BufferedImage.TYPE_INT_RGB); Graphics2D graphics = tempImage.createGraphics(); graphics.setColor(PlayerColors.getColor(colorInd)); graphics.fillRect(0, 0, 84, 72); btnCamo.setIcon(new ImageIcon(tempImage));
BufferedImage.TYPE_INT_RGB); Graphics2D graphics = tempImage.createGraphics(); graphics.setColor(PlayerColors.getColor(colorInd)); graphics.fillRect(0, 0, 84, 72); btnCamo.setIcon(new ImageIcon(tempImage));
BufferedImage.TYPE_INT_RGB); Graphics2D graphics = tempImage.createGraphics(); graphics.setColor(PlayerColors.getColor(colorInd)); graphics.fillRect(0, 0, 84, 72); return new ImageIcon(tempImage);
VTOLAttackSprite(BoardView1 boardView, Entity en) { super(boardView); this.bv = boardView; this.entity = en; spriteColor = PlayerColors.getColor(en.getOwner().getColorIndex()); image = null; prepare(); }
public FlyOverSprite(BoardView1 boardView1, final Entity e) { super(boardView1); en = e; spriteColor = PlayerColors.getColor(e.getOwner().getColorIndex()); image = null; prepare(); }
/** * Shortcut method for adding entity name and owner data at the same time. * Assumes that the entity name should be obscured, but the owner should * not. * * @param entity the entity you wish to add */ public void addDesc(Entity entity) { if (entity != null) { add("<font color='0xffffff'><a href=\"#entity:" + entity.getId() + "\">" + entity.getShortName() + "</a></font>", true); String colorcode = Integer.toHexString(PlayerColors.getColor( entity.getOwner().getColorIndex()).getRGB() & 0x00f0f0f0); add("<B><font color='" + colorcode + "'>" + entity.getOwner().getName() + "</font></B>"); } }
graph.setColor(PlayerColors.getColor( entity.getOwner().getColorIndex(), false)); Stroke oldStroke = graph.getStroke();
public C3Sprite(BoardView1 boardView1, final Entity e, final Entity m) { super(boardView1); entityE = e; entityM = m; entityId = e.getId(); masterId = m.getId(); spriteColor = PlayerColors.getColor(e.getOwner().getColorIndex()); if ((e.getPosition() == null) || (m.getPosition() == null)) { c3Poly = new Polygon(); c3Poly.addPoint(0, 0); c3Poly.addPoint(1, 0); c3Poly.addPoint(0, 1); bounds = new Rectangle(c3Poly.getBounds()); bounds.setSize(bounds.getSize().width + 1, bounds.getSize().height + 1); image = null; return; } makePoly(); // set bounds bounds = new Rectangle(c3Poly.getBounds()); bounds.setSize(bounds.getSize().width + 1, bounds.getSize().height + 1); // move poly to upper right of image c3Poly.translate(-bounds.getLocation().x, -bounds.getLocation().y); // set names & stuff // nullify image image = null; }
moveColor = PlayerColors.getColor(en.getOwner().getColorIndex());
String colorcode = Integer.toHexString(PlayerColors.getColor( tOwner.getColorIndex()).getRGB() & 0x00f0f0f0); newReports = server.damageBuilding(bldg, damage, " shields "
String colorcode = Integer.toHexString(PlayerColors.getColor( tOwner.getColorIndex()).getRGB() & 0x00f0f0f0); newReports = server.damageBuilding(bldg, numRounds, " shields "
attackColor = PlayerColors.getColor(ae.getOwner().getColorIndex());