use of java.awt.font.TextAttribute in project megameklab by MegaMek.
the class ImageHelper method printC3sName.
public static void printC3sName(Graphics2D g2d, float lineStart, float linePoint, Font font, boolean isArmored, boolean mixed) {
Font c3Font = font.deriveFont(font.getStyle(), font.getSize2D());
HashMap<TextAttribute, Integer> attrMap = new HashMap<TextAttribute, Integer>();
attrMap.put(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER);
int stringWidth;
if (isArmored) {
g2d.drawString("O C Slave" + (mixed ? " (IS)" : ""), lineStart, linePoint);
stringWidth = ImageHelper.getStringWidth(g2d, "O C", c3Font);
} else {
g2d.drawString("C Slave" + (mixed ? " (IS)" : ""), lineStart, linePoint);
stringWidth = ImageHelper.getStringWidth(g2d, "C", c3Font);
}
// stringWidth = ImageHelper.getStringWidth(g2d, "C", font);
c3Font = font.deriveFont(attrMap);
g2d.setFont(c3Font);
g2d.drawString("3", lineStart + stringWidth, linePoint);
g2d.setFont(font);
}
use of java.awt.font.TextAttribute in project megameklab by MegaMek.
the class ImageHelper method printC3RemoteSensorAmmoName.
public static void printC3RemoteSensorAmmoName(Graphics2D g2d, float lineStart, float linePoint, Font font) {
Font c3Font = font.deriveFont(font.getStyle(), font.getSize2D());
HashMap<TextAttribute, Integer> attrMap = new HashMap<TextAttribute, Integer>();
attrMap.put(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER);
int stringWidth;
g2d.drawString("Ammo (C Remote Sensor) 4", lineStart, linePoint);
stringWidth = ImageHelper.getStringWidth(g2d, "Ammo (C", c3Font);
c3Font = font.deriveFont(attrMap);
g2d.setFont(c3Font);
g2d.drawString("3", lineStart + stringWidth, linePoint);
g2d.setFont(font);
}
use of java.awt.font.TextAttribute in project megameklab by MegaMek.
the class ImageHelper method printNavalC3Name.
public static void printNavalC3Name(Graphics2D g2d, float lineStart, float linePoint, Font font, boolean isArmored, boolean mixed) {
Font c3Font = font.deriveFont(font.getStyle(), font.getSize2D());
HashMap<TextAttribute, Integer> attrMap = new HashMap<TextAttribute, Integer>();
attrMap.put(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER);
int stringWidth;
if (isArmored) {
g2d.drawString("O Naval C CPU" + (mixed ? " (IS)" : ""), lineStart, linePoint);
stringWidth = ImageHelper.getStringWidth(g2d, "O Naval C", c3Font);
} else {
g2d.drawString("Naval C CPU" + (mixed ? " (IS)" : ""), lineStart, linePoint);
stringWidth = ImageHelper.getStringWidth(g2d, "Naval C", c3Font);
}
c3Font = font.deriveFont(attrMap);
g2d.setFont(c3Font);
g2d.drawString("3", lineStart + stringWidth, linePoint);
g2d.setFont(font);
}
use of java.awt.font.TextAttribute in project megameklab by MegaMek.
the class ImageHelper method printC3RemoteSensorName.
public static void printC3RemoteSensorName(Graphics2D g2d, float lineStart, float linePoint, Font font, boolean isArmored, boolean mixed) {
Font c3Font = font.deriveFont(font.getStyle(), font.getSize2D());
HashMap<TextAttribute, Integer> attrMap = new HashMap<TextAttribute, Integer>();
attrMap.put(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER);
int stringWidth;
if (isArmored) {
g2d.drawString("O C Remote Sensor Launcher" + (mixed ? " (IS)" : ""), lineStart, linePoint);
stringWidth = ImageHelper.getStringWidth(g2d, "O C", c3Font);
} else {
g2d.drawString("C Remote Sensor Launcher" + (mixed ? " (IS)" : ""), lineStart, linePoint);
stringWidth = ImageHelper.getStringWidth(g2d, "C", c3Font);
}
c3Font = font.deriveFont(attrMap);
g2d.setFont(c3Font);
g2d.drawString("3", lineStart + stringWidth, linePoint);
g2d.setFont(font);
}
use of java.awt.font.TextAttribute in project megameklab by MegaMek.
the class ImageHelper method printC3iName.
public static void printC3iName(Graphics2D g2d, float lineStart, float linePoint, Font font, boolean isArmored, boolean mixed) {
Font c3Font = font.deriveFont(font.getStyle(), font.getSize2D());
HashMap<TextAttribute, Integer> attrMap = new HashMap<TextAttribute, Integer>();
attrMap.put(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER);
int stringWidth;
if (isArmored) {
g2d.drawString("O Improved C CPU" + (mixed ? " (IS)" : ""), lineStart, linePoint);
stringWidth = ImageHelper.getStringWidth(g2d, "O Improved C", c3Font);
} else {
g2d.drawString("Improved C CPU" + (mixed ? " (IS)" : ""), lineStart, linePoint);
stringWidth = ImageHelper.getStringWidth(g2d, "Improved C", c3Font);
}
c3Font = font.deriveFont(attrMap);
g2d.setFont(c3Font);
g2d.drawString("3", lineStart + stringWidth, linePoint);
g2d.setFont(font);
}
Aggregations