public JumpshipMapSet(JComponent c, UnitDisplay unitDisplay) { this.unitDisplay = unitDisplay; comp = c; setAreas(); setLabels(); setBackGround(); translateAreas(); setContent(); }
public void setEntity(Entity e){ Jumpship t = (Jumpship) e; int a = 1; int a0 = 1; //TODO: change this back to locations for(int i = 0; i < t.locations(); i++){ a = t.getArmor(i); a0 = t.getOArmor(i); vLabels[i].setValue(t.getArmorString(i)); WidgetUtils.setAreaColor(areas[i], vLabels[i], (double)a/(double)a0); } a = t.getSI(); a0 = t.get0SI(); vLabels[6].setValue(Integer.toString(t.getSI())); WidgetUtils.setAreaColor(areas[6], vLabels[6], (double)a/(double)a0); //now for the vitals vLabels[7].setValue(getCriticalHitTally(t.getAvionicsHits(),3)); vLabels[8].setValue(getCriticalHitTally(t.getCICHits(),3)); vLabels[9].setValue(getCriticalHitTally(t.getEngineHits(),t.getMaxEngineHits())); vLabels[10].setValue(getCriticalHitTally(t.getSensorHits(),3)); vLabels[11].setValue(getCriticalHitTally(t.getLeftThrustHits(),3)); vLabels[12].setValue(getCriticalHitTally(t.getRightThrustHits(),3)); }
@Override public void addNotify() { super.addNotify(); tank = new TankMapSet(this, unitDisplay); mech = new MechMapSet(this, unitDisplay); infantry = new InfantryMapSet(this); battleArmor = new BattleArmorMapSet(this); proto = new ProtomechMapSet(this, unitDisplay); vtol = new VTOLMapSet(this, unitDisplay); quad = new QuadMapSet(this, unitDisplay); tripod = new TripodMechMapSet(this, unitDisplay); gunEmplacement = new GunEmplacementMapSet(this); armless = new ArmlessMechMapSet(this, unitDisplay); largeSupportTank = new LargeSupportTankMapSet(this, unitDisplay); superHeavyTank = new SuperHeavyTankMapSet(this, unitDisplay); aero = new AeroMapSet(this, unitDisplay); capFighter = new CapitalFighterMapSet(this); sphere = new SpheroidMapSet(this, unitDisplay); jump = new JumpshipMapSet(this, unitDisplay); warship = new WarshipMapSet(this, unitDisplay); squad = new SquadronMapSet(this, game); }