@Override public String getShortName() { if (shortName.trim().length() < 1) { return getName(); } return shortName; }
@Override public StringBuffer printAmmo(StringBuffer buff, int posLoc, int posWeight) { for (Mounted m : getEntity().getAmmo()) { AmmoType mt = (AmmoType) m.getType(); buff.append(StringUtil.makeLength(mt.getName(), 20)); buff.append(" ").append( StringUtil.makeLength(getLocationAbbr(m.getLocation()), getPrintSize() - 5 - 20)) .append(TestEntity.makeWeightString( Math.ceil(mt.getKgPerShot() * m.getBaseShotsLeft()) / 1000.0)).append("\n"); } return buff; }
ammoBins.insertItemAt("(" + ammoBin.getEntity().getLocationAbbr(ammoBin.getLocation()) + ") " + selectedAmmoType.getName(), index);
public StringBuffer printAmmo(StringBuffer buff, int posLoc, int posWeight) { for (Mounted m : getEntity().getAmmo()) { AmmoType mt = (AmmoType) m.getType(); // Don't think this can happen, but ... if (m.getLocation() == Entity.LOC_NONE) { continue; } buff.append(StringUtil.makeLength(mt.getName(), 20)); buff.append(" ").append( StringUtil.makeLength(getLocationAbbr(m.getLocation()), getPrintSize() - 5 - 20)) .append(TestEntity.makeWeightString(mt .getTonnage(getEntity()))).append("\n"); } return buff; }
String.format("%s (%d %s)", at.getName(), at.getShots() * count, Messages.getString("TROView.shots")))); retVal.put("weapons", weapons); retVal.put("heat", heat);
if (atype.getTonnage(entity) > 1) { spn.setToolTipText(String.format(Messages.getString("CustomMechDialog.formatMissileTonnage"), atype.getName(), atype.getTonnage(entity))); } else { spn.setToolTipText(String.format(Messages.getString("CustomMechDialog.formatShotsPerTon"), atype.getName(), atype.getShots()));
String key2 = atype.getName() + ";" + key;
String key2 = atype.getName() + ";" + key;
bvText.append(atype.getName()); bvText.append(endColumn); bvText.append(startColumn);
buff.append(StringUtil.makeLength(at.getName(), 30)); buff.append("1\n"); foundAmmo.put(at.getAmmoType() + ":" + at.getRackSize(), true);
default: throw new EntityLoadingException(ammoType.getName() + " has " + ammoType.getShots() + " shots per ton, but " + name + " " + model + " wants " + weaponAmmo + " shots.");
for (int x = 0; e.hasNext(); x++) { AmmoType at = e.next(); m_choice.addItem(at.getName()); if (at.getInternalName() == curType.getInternalName()) { m_choice.setSelectedIndex(x);