public static Color getColor(int colorIndex) { return getColor(colorIndex, true); }
public static int getAdvColorRGB(int colorIndex, int plrIndex) { if (colorIndex > advancedColorRGBs.length) { return getColorRGB(plrIndex); } return advancedColorRGBs[colorIndex]; }
/** * Used to determine the color that should be used to indicate ECM effects * for a given player * * @param player * @return */ public static Color getECMColor(IPlayer player) { final int alpha = GUIPreferences.getInstance().getInt( GUIPreferences.ADVANCED_ECM_TRANSPARENCY); Color tint; if (player != null) { tint = new Color(PlayerColors.getColorRGB(player.getColorIndex())); } else { tint = Color.gray; } // Create a new color by adding transparency to the tint return new Color(tint.getRed(), tint.getGreen(), tint.getBlue(), alpha); }
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 String getPlayerColor() { if (onlyDetectedBySensors()) { return "C0C0C0"; } else { return Integer.toHexString(PlayerColors.getColorRGB(entity .getOwner().getColorIndex())); } }
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(); } } }
public void loadPreviewImage(JLabel bp, Entity entity, IPlayer player) { Image camo = null; if (entity.getCamoFileName() != null) { camo = bv.getTilesetManager().getEntityCamo(entity); } else { camo = bv.getTilesetManager().getPlayerCamo(player); } int tint = PlayerColors.getColorRGB(player.getColorIndex()); Image icon = bv.getTilesetManager().loadPreviewImage(entity, camo, tint, bp); if (icon != null) { bp.setIcon(new ImageIcon(icon)); } else { bp.setIcon(null); } }
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 loadPreviewImage(JLabel bp, Entity entity, IPlayer player) { Image camo = null; if (entity.getCamoFileName() != null) { camo = bv.getTilesetManager().getEntityCamo(entity); } else { camo = bv.getTilesetManager().getPlayerCamo(player); } int tint = PlayerColors.getColorRGB(player.getColorIndex()); bp.setIcon(new ImageIcon(bv.getTilesetManager().loadPreviewImage( entity, camo, tint, bp))); }
BufferedImage.TYPE_INT_RGB); Graphics2D graphics = tempImage.createGraphics(); graphics.setColor(PlayerColors.getColor(colorInd)); graphics.fillRect(0, 0, 84, 72); btnCamo.setIcon(new ImageIcon(tempImage));
private Image getImageFor(Unit u, Component c) { if(null == mt) { return null; } Image base = mt.imageFor(u.getEntity(), c, -1); int tint = PlayerColors.getColorRGB(u.campaign.getColorIndex()); EntityImage entityImage = new EntityImage(base, tint, getCamo(u), c); return entityImage.loadPreviewImage(); }
BufferedImage.TYPE_INT_RGB); Graphics2D graphics = tempImage.createGraphics(); graphics.setColor(PlayerColors.getColor(colorInd)); graphics.fillRect(0, 0, 84, 72); btnCamo.setIcon(new ImageIcon(tempImage));
int tint = PlayerColors.getColorRGB(player.getColorIndex());
BufferedImage.TYPE_INT_RGB); Graphics2D graphics = tempImage.createGraphics(); graphics.setColor(PlayerColors.getColor(colorInd)); graphics.fillRect(0, 0, 84, 72); return new ImageIcon(tempImage);
g2.setColor(new Color(PlayerColors.getColorRGB( entity.getOwner().getColorIndex()))); g2.fill(form); PlayerColors.getColorRGB(entity.getOwner().getColorIndex())); g.setColor(pColor); g.fillOval(baseX - radius, baseY - radius, dia, dia); PlayerColors.getColorRGB(entity.getOwner().getColorIndex())); g.setColor(pColor); g.fillPolygon(xPoints, yPoints, xPoints.length);
public FlyOverSprite(BoardView1 boardView1, final Entity e) { super(boardView1); en = e; spriteColor = PlayerColors.getColor(e.getOwner().getColorIndex()); image = null; prepare(); }
cp = allP.nextElement(); if (board.isLegalDeployment(c, cp.getStartingPos())) { Color bC = new Color(PlayerColors.getColorRGB(cp.getColorIndex())); drawHexBorder(g, getHexLocation(c), bC, (bThickness+2)
VTOLAttackSprite(BoardView1 boardView, Entity en) { super(boardView); this.bv = boardView; this.entity = en; spriteColor = PlayerColors.getColor(en.getOwner().getColorIndex()); image = null; prepare(); }
protected Image getImageFor(Unit u) { if(null == icons.getMechTiles()) { return null; } Image base = icons.getMechTiles().imageFor(u.getEntity(), this, -1); if (null == base) { return null; } int tint = PlayerColors.getColorRGB(u.campaign.getColorIndex()); EntityImage entityImage = new EntityImage(base, tint, getCamo(u), this); return entityImage.loadPreviewImage(); }