private void setLabels() { FontMetrics fm = comp.getFontMetrics(FONT_LABEL); for (int i = 0; i < max_size; i++) { nameLabel[i] = new PMSimpleLabel("Unknown", fm, Color.white); //$NON-NLS-1$ armorVLabel[i] = new PMValueLabel(fm, Color.red.brighter()); avCritLabel[i] = new PMSimpleLabel("Avionics:", fm, Color.white); //$NON-NLS-1$ engineCritLabel[i] = new PMSimpleLabel("Engine:", fm, Color.white); //$NON-NLS-1$ fcsCritLabel[i] = new PMSimpleLabel("FCS:", fm, Color.white); //$NON-NLS-1$ sensorCritLabel[i] = new PMSimpleLabel("Sensors:", fm, Color.white); //$NON-NLS-1$ pilotCritLabel[i] = new PMSimpleLabel("Pilot hits:", fm, Color.white); //$NON-NLS-1$ } }
private void setLabels() { FontMetrics fm = comp.getFontMetrics(FONT_LABEL); armorLabel = new PMSimpleLabel("Armor:", fm, Color.white); armorVLabel = new PMValueLabel(fm, Color.red.brighter()); avCritLabel = new PMSimpleLabel("Avionics:", fm, Color.white); //$NON-NLS-1$ engineCritLabel = new PMSimpleLabel("Engine:", fm, Color.white); //$NON-NLS-1$ fcsCritLabel = new PMSimpleLabel("FCS:", fm, Color.white); //$NON-NLS-1$ sensorCritLabel = new PMSimpleLabel("Sensors:", fm, Color.white); //$NON-NLS-1$ pilotCritLabel = new PMSimpleLabel("Pilot hits:", fm, Color.white); //$NON-NLS-1$ }
public static PMSimpleLabel createLabel(String s, FontMetrics fm, Color color, int x, int y) { PMSimpleLabel l = new PMSimpleLabel(s, fm, color); centerLabelAt(l, x, y); return l; }
private PMSimpleLabel createLabel(String s, FontMetrics fm, int x, int y) { PMSimpleLabel l = new PMSimpleLabel(s, fm, Color.white); l.moveTo(x, y); return l; }
private PMSimpleLabel createLabel(String s, FontMetrics fm, int x, int y) { PMSimpleLabel l = new PMSimpleLabel(s, fm, Color.white); l.moveTo(x, y); return l; }
public MechSlotLabel(String s, FontMetrics fm, Image im, Color textColor, Color bgColor) { super(); PMPicArea pa = new PMPicArea(im); pa.setCursor(Cursor.getDefaultCursor()); addElement(pa); PMSimpleLabel l = new PMSimpleLabel(s, fm, textColor); addElement(l); l.moveTo(pa.getBounds().width + 5, (pa.getBounds().height - l .getBounds().height) / 2 + l.getSize().height - l.getDescent()); setContentMargins(MARGIN_WIDTH, MARGIN_WIDTH, MARGIN_WIDTH, MARGIN_WIDTH); setBackground(bgColor); addBgDrawer(bgd); drawBGImage(); }