private FormationTypesCard currentCard() { if (getUnitType() != null && getUnitType() >= UnitType.CONV_FIGHTER) { return airCard; } return groundCard; }
public void optionsChanged() { if (getUnitType() != null) { ((CardLayout)getLayout()).show(this, getUnitType() < UnitType.CONV_FIGHTER? "Ground" : "Air"); } currentCard().updateUnitType(getUnitType()); }
private void showAnalysis() { List<UnitTable.Parameters> params = new ArrayList<>(); FormationType ft = FormationType.getFormationType(getFormation()); Parameters p = new UnitTable.Parameters(getFaction(), getUnitType(), ratGenYear, (String)cbRating.getSelectedItem(), IntStream.rangeClosed(ft.getMinWeightClass(), ft.getMaxWeightClass()) .mapToObj(Integer::valueOf).collect(Collectors.toList()), ModelRecord.NETWORK_NONE, EnumSet.noneOf(EntityMovementMode.class), ft.getMissionRoles(), 2, getFaction()); params.add(p); int numUnits = getNumUnits(); if (getOtherUnitType() >= 0) { p = p.copy(); p.setUnitType(getOtherUnitType()); params.add(p); numUnits += numOtherUnits(); } AnalyzeFormationDialog afd = new AnalyzeFormationDialog(null, generatedUnits, FormationType.getFormationType(getFormation()), params, numUnits, getNetwork()); afd.setVisible(true); }
List<UnitTable.Parameters> params = new ArrayList<>(); params.add(new UnitTable.Parameters(fRec, m_pFormationOptions.getUnitType(), m_pFormationOptions.getYear(), m_pFormationOptions.getRating(), null,
@SuppressWarnings("unchecked") private void generateRAT() { FactionRecord fRec = m_pRATGenOptions.getFaction(); if (fRec != null) { generatedRAT = UnitTable.findTable(fRec, m_pRATGenOptions.getUnitType(), m_pRATGenOptions.getYear(), m_pRATGenOptions.getRating(), (List<Integer>)m_pRATGenOptions.getListOption("weightClasses"), m_pRATGenOptions.getIntegerOption("networkMask"), (List<EntityMovementMode>)m_pRATGenOptions.getListOption("motiveTypes"), (List<MissionRole>)m_pRATGenOptions.getListOption("roles"), m_pRATGenOptions.getIntegerOption("roleStrictness")); ratModel.refreshData(); } }