📄 randommapdialog.java
字号:
maxWaterSpots = Integer.parseInt(texMaxWaterSpots.getText()); minWaterSize = Integer.parseInt(texMinWaterSize.getText()); maxWaterSize = Integer.parseInt(texMaxWaterSize.getText()); minForestSpots = Integer.parseInt(texMinForestSpots.getText()); maxForestSpots = Integer.parseInt(texMaxForestSpots.getText()); minForestSize = Integer.parseInt(texMinForestSize.getText()); maxForestSize = Integer.parseInt(texMaxForestSize.getText()); minRoughSpots = Integer.parseInt(texMinRoughSpots.getText()); maxRoughSpots = Integer.parseInt(texMaxRoughSpots.getText()); minRoughSize = Integer.parseInt(texMinRoughSize.getText()); maxRoughSize = Integer.parseInt(texMaxRoughSize.getText()); minSwampSpots = Integer.parseInt(texMinSwampSpots.getText()); maxSwampSpots = Integer.parseInt(texMaxSwampSpots.getText()); minSwampSize = Integer.parseInt(texMinSwampSize.getText()); maxSwampSize = Integer.parseInt(texMaxSwampSize.getText()); minPavementSpots = Integer.parseInt(texMinPavementSpots.getText()); maxPavementSpots = Integer.parseInt(texMaxPavementSpots.getText()); minPavementSize = Integer.parseInt(texMinPavementSize.getText()); maxPavementSize = Integer.parseInt(texMaxPavementSize.getText()); minRubbleSpots = Integer.parseInt(texMinRubbleSpots.getText()); maxRubbleSpots = Integer.parseInt(texMaxRubbleSpots.getText()); minRubbleSize = Integer.parseInt(texMinRubbleSize.getText()); maxRubbleSize = Integer.parseInt(texMaxRubbleSize.getText()); minFortifiedSpots = Integer.parseInt(texMinFortifiedSpots.getText()); maxFortifiedSpots = Integer.parseInt(texMaxFortifiedSpots.getText()); minFortifiedSize = Integer.parseInt(texMinFortifiedSize.getText()); maxFortifiedSize = Integer.parseInt(texMaxFortifiedSize.getText()); minIceSpots = Integer.parseInt(texMinIceSpots.getText()); maxIceSpots = Integer.parseInt(texMaxIceSpots.getText()); minIceSize = Integer.parseInt(texMinIceSize.getText()); maxIceSize = Integer.parseInt(texMaxIceSize.getText()); probRoad = Integer.parseInt(texProbRoad.getText()); probRiver = Integer.parseInt(texProbRiver.getText()); probHeavy = Integer.parseInt(texProbHeavy.getText()); probDeep = Integer.parseInt(texProbDeep.getText()); probCrater = Integer.parseInt(texProbCrater.getText()); minRadius = Integer.parseInt(texMinRadius.getText()); maxRadius = Integer.parseInt(texMaxRadius.getText()); maxCraters = Integer.parseInt(texMaxCraters.getText()); minCraters = Integer.parseInt(texMinCraters.getText()); algorithmToUse = Integer.parseInt(texAlgorithmToUse.getText()); drought = Integer.parseInt(texProbDrought.getText()); fire = Integer.parseInt(texProbFire.getText()); freeze = Integer.parseInt(texProbFreeze.getText()); flood = Integer.parseInt(texProbFlood.getText()); fxmod = Integer.parseInt(texFxMod.getText()); cityBlocks = Integer.parseInt(texCityBlocks.getText()); cityMinCF = Integer.parseInt(texCityMinCF.getText()); cityMaxCF = Integer.parseInt(texCityMaxCF.getText()); cityMinFloors = Integer.parseInt(texCityMinFloors.getText()); cityMaxFloors = Integer.parseInt(texCityMaxFloors.getText()); cityDensity = Integer.parseInt(texCityDensity.getText()); mountainHeightMin = Integer.parseInt(texMountainHeightMin.getText()); mountainHeightMax = Integer.parseInt(texMountainHeightMax.getText()); mountainWidthMin = Integer.parseInt(texMountainWidthMin.getText()); mountainWidthMax = Integer.parseInt(texMountainWidthMax.getText()); mountainStyle = Integer.parseInt(texMountainStyle.getText()); mountainPeaks = Integer.parseInt(texMountainPeaks.getText()); invertNegative = Integer.parseInt(texInvertNegative.getText()); } catch (NumberFormatException ex) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.OnlyIntegersWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (hilliness < 0 || hilliness > 99) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.AmmountOfElevationWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (cliffs < 0 || cliffs > 100) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.CliffsWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (range < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.elevRangeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (probInvert < 0 || probInvert > 100) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.depressionWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minWaterSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinLakesWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxWaterSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxLakesWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxWaterSpots < minWaterSpots) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxLakesWarn2"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minWaterSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinLakeSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxWaterSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxLakeSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxWaterSize < minWaterSize) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxLakeSizeWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (probDeep < 0 || probDeep > 100) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.DeepWaterProbWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minForestSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinForestsWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxForestSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxForestsWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxForestSpots < minForestSpots) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxForestsWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minForestSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinForestSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxForestSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxForestSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxForestSize < minForestSize) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxForestSizeWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (probHeavy < 0 || probHeavy > 100) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.HeavyForestProbWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minRoughSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinRoughsWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxRoughSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxRoughsWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxRoughSpots < minRoughSpots) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxRoughsWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minRoughSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinRoughSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxRoughSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxRoughSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxRoughSize < minRoughSize) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxRoughSizeWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minSwampSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinSwampsWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxSwampSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxSwampsWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxSwampSpots < minSwampSpots) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxSwampsWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minSwampSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinSwampSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxSwampSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxSwampSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxSwampSize < minSwampSize) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxSwampSizeWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minPavementSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinPavementWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxPavementSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxPavementWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxPavementSpots < minPavementSpots) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxPavementWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minPavementSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinPavementSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxPavementSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxPavementSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxPavementSize < minPavementSize) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxPavementSizeWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minRubbleSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinRubbleWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxRubbleSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxRubbleWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxRubbleSpots < minRubbleSpots) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxRubbleWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minRubbleSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinRubbleSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxRubbleSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxRubbleSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxRubbleSize < minRubbleSize) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxRubbleSizeWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minFortifiedSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinFortifiedWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxFortifiedSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxFortifiedWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxFortifiedSpots < minFortifiedSpots) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxFortifiedWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minFortifiedSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinFortifiedSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxFortifiedSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxFortifiedSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxFortifiedSize < minFortifiedSize) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxFortifiedSizeWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minIceSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinIceWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxIceSpots < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxIceWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxIceSpots < minIceSpots) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxIceWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (minIceSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MinIceSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxIceSize < 0) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxIceSizeWarn"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return false; } if (maxIceSize < minIceSize) { JOptionPane.showMessageDialog(frame, Messages.getString("RandomMapDialog.MaxIceSizeWarn1"), INVALID_SETTING, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ return fal
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -