📄 randommapdialog.java
字号:
setProperLocation(); } } private void setupButtons() { panButtons.add(butOK); panButtons.add(butAdvanced); panButtons.add(butSave); panButtons.add(butLoad); } private void createComponents() { butOK = new JButton(Messages.getString("Okay")); //$NON-NLS-1$ butOK.addActionListener(this); butAdvanced = new JButton(Messages.getString("RandomMapDialog.Advanced")); //$NON-NLS-1$ butAdvanced.addActionListener(this); butSave = new JButton(Messages.getString("RandomMapDialog.Save")); //$NON-NLS-1$ butSave.addActionListener(this); butLoad = new JButton(Messages.getString("RandomMapDialog.Load")); //$NON-NLS-1$ butLoad.addActionListener(this); panButtons = new JPanel(); panButtons.setLayout(new FlowLayout()); panOptions = new JPanel(); gridbag = new GridBagLayout(); panOptions.setLayout(gridbag); labBoardSize = new JLabel(Messages.getString("RandomMapDialog.BoardSize"), JLabel.LEFT); //$NON-NLS-1$ texBoardWidth = new JTextField(2); texBoardWidth.addFocusListener(this); texBoardHeight = new JTextField(2); texBoardHeight.addFocusListener(this); slBoardSize = new SimpleLine(NORMAL_LINE_WIDTH); // Normal setting components... labElevation = new JLabel(Messages.getString("RandomMapDialog.labElevation"), JLabel.LEFT); //$NON-NLS-1$ choElevation = new JComboBox(); fillChoice(choElevation); slElevation = new SimpleLine(NORMAL_LINE_WIDTH); labCliffs = new JLabel(Messages.getString("RandomMapDialog.labCliffs"), JLabel.LEFT); //$NON-NLS-1$ choCliffs = new JComboBox(); fillChoice(choCliffs); slCliffs = new SimpleLine(NORMAL_LINE_WIDTH); labWoods = new JLabel(Messages.getString("RandomMapDialog.labWoods"), JLabel.LEFT); //$NON-NLS-1$ choWoods = new JComboBox(); fillChoice(choWoods); slWoods = new SimpleLine(NORMAL_LINE_WIDTH); labLakes = new JLabel(Messages.getString("RandomMapDialog.labLakes"), JLabel.LEFT); //$NON-NLS-1$ choLakes = new JComboBox(); fillChoice(choLakes); slLakes = new SimpleLine(NORMAL_LINE_WIDTH); labRough = new JLabel(Messages.getString("RandomMapDialog.labRough"), JLabel.LEFT); //$NON-NLS-1$ choRough = new JComboBox(); fillChoice(choRough); slRough = new SimpleLine(NORMAL_LINE_WIDTH); labSwamp = new JLabel(Messages.getString("RandomMapDialog.labSwamp"), JLabel.LEFT); //$NON-NLS-1$ choSwamp = new JComboBox(); fillChoice(choSwamp); slSwamp = new SimpleLine(NORMAL_LINE_WIDTH); labPavement = new JLabel(Messages.getString("RandomMapDialog.labPavement"), JLabel.LEFT); choPavement = new JComboBox(); fillChoice(choPavement); slPavement = new SimpleLine(NORMAL_LINE_WIDTH); labRubble = new JLabel(Messages.getString("RandomMapDialog.labRubble"), JLabel.LEFT); choRubble = new JComboBox(); fillChoice(choRubble); slRubble = new SimpleLine(NORMAL_LINE_WIDTH); labFortified = new JLabel(Messages.getString("RandomMapDialog.labFortified"), JLabel.LEFT); choFortified = new JComboBox(); fillChoice(choFortified); slFortified = new SimpleLine(NORMAL_LINE_WIDTH); labIce = new JLabel(Messages.getString("RandomMapDialog.labIce"), JLabel.LEFT); choIce = new JComboBox(); fillChoice(choIce); slIce = new SimpleLine(NORMAL_LINE_WIDTH); labCraters = new JLabel(Messages.getString("RandomMapDialog.labCraters"), JLabel.LEFT); choCraters = new JComboBox(); fillChoice(choCraters); slCraters = new SimpleLine(NORMAL_LINE_WIDTH); labRivers = new JLabel(Messages.getString("RandomMapDialog.labRivers"), JLabel.LEFT); //$NON-NLS-1$ choRivers = new JComboBox(); fillChoice(choRivers); slRivers = new SimpleLine(NORMAL_LINE_WIDTH); labRoads = new JLabel(Messages.getString("RandomMapDialog.labRoads"), JLabel.LEFT); //$NON-NLS-1$ choRoads = new JComboBox(); fillChoice(choRoads); slRoads = new SimpleLine(NORMAL_LINE_WIDTH); labCity = new JLabel(Messages.getString("RandomMapDialog.labCity"), JLabel.LEFT); //$NON-NLS-1$ choCity = new JComboBox(); choCity.addItem(NONE); choCity.addItem("HUB"); choCity.addItem("GRID"); choCity.addItem("METRO"); choCity.addItem("TOWN"); slCity = new SimpleLine(NORMAL_LINE_WIDTH); labMountain = new JLabel(Messages.getString("RandomMapDialog.labMountain"), JLabel.LEFT); //$NON-NLS-1$ choMountain = new JComboBox(); fillChoice(choMountain); slMountain = new SimpleLine(NORMAL_LINE_WIDTH); // Advanced setting components... labTheme = new JLabel(Messages.getString("RandomMapDialog.labTheme"), JLabel.LEFT); texTheme = new JTextField(20); /** how much hills there should be, Range 0..99 */ labHilliness = new JLabel(Messages.getString("RandomMapDialog.labHilliness"), JLabel.LEFT); //$NON-NLS-1$ texHilliness = new JTextField(2); texHilliness.addFocusListener(this); /** Maximum level of the map */ labRange = new JLabel(Messages.getString("RandomMapDialog.labRange"), JLabel.LEFT); //$NON-NLS-1$ texRange = new JTextField(2); texRange.addFocusListener(this); labProbInvert = new JLabel(Messages.getString("RandomMapDialog.labProbInvert"), JLabel.LEFT); //$NON-NLS-1$ texProbInvert = new JTextField(2); texProbInvert.addFocusListener(this); labCliffsAd = new JLabel(Messages.getString("RandomMapDialog.labCliffs"), JLabel.LEFT); //$NON-NLS-1$ texCliffs = new JTextField(2); texCliffs.addFocusListener(this); //mountain labMountainHeight = new JLabel(Messages.getString("RandomMapDialog.labMountainHeight"), JLabel.LEFT); //$NON-NLS-1$ labMountainWidth = new JLabel(Messages.getString("RandomMapDialog.labMountainWidth"), JLabel.LEFT); //$NON-NLS-1$ labMountainPeaks = new JLabel(Messages.getString("RandomMapDialog.labMountainPeaks"), JLabel.LEFT); //$NON-NLS-1$ labMountainStyle = new JLabel(Messages.getString("RandomMapDialog.labMountainStyle"), JLabel.LEFT); //$NON-NLS-1$ texMountainPeaks = new JTextField(2); texMountainPeaks.addFocusListener(this); texMountainHeightMin = new JTextField(2); texMountainHeightMin.addFocusListener(this); texMountainHeightMax = new JTextField(2); texMountainHeightMax.addFocusListener(this); texMountainWidthMin = new JTextField(2); texMountainWidthMin.addFocusListener(this); texMountainWidthMax = new JTextField(2); texMountainWidthMax.addFocusListener(this); texMountainStyle = new JTextField(2); texMountainStyle.addFocusListener(this); /** how much Lakes at least */ labWaterSpots = new JLabel(Messages.getString("RandomMapDialog.labWaterSpots"), JLabel.LEFT); //$NON-NLS-1$ texMinWaterSpots = new JTextField(2); texMinWaterSpots.addFocusListener(this); /** how much Lakes at most */ texMaxWaterSpots = new JTextField(2); texMaxWaterSpots.addFocusListener(this); /** minimum size of a lake */ labWaterSize = new JLabel(Messages.getString("RandomMapDialog.labWaterSize"), JLabel.LEFT); //$NON-NLS-1$ texMinWaterSize = new JTextField(2); texMinWaterSize.addFocusListener(this); /** maximum Size of a lake */ texMaxWaterSize = new JTextField(2); texMaxWaterSize.addFocusListener(this); /** probability for water deeper than lvl1, Range 0..100 */ labProbDeep = new JLabel(Messages.getString("RandomMapDialog.labProbDeep"), JLabel.LEFT); //$NON-NLS-1$ texProbDeep = new JTextField(2); texProbDeep.addFocusListener(this); /** how much forests at least */ labForestSpots = new JLabel(Messages.getString("RandomMapDialog.labForestSpots"), JLabel.LEFT); //$NON-NLS-1$ texMinForestSpots = new JTextField(2); texMinForestSpots.addFocusListener(this); /** how much forests at most */ texMaxForestSpots = new JTextField(2); texMaxForestSpots.addFocusListener(this); /** minimum size of a forest */ labForestSize = new JLabel(Messages.getString("RandomMapDialog.labForestSize"), JLabel.LEFT); //$NON-NLS-1$ texMinForestSize = new JTextField(2); texMinForestSize.addFocusListener(this); /** maximum Size of a forest */ texMaxForestSize = new JTextField(2); texMaxForestSize.addFocusListener(this); /** probability for heavy wood, Range 0..100 */ labProbHeavy = new JLabel(Messages.getString("RandomMapDialog.labProbHeavy"), JLabel.LEFT); //$NON-NLS-1$ texProbHeavy = new JTextField(2); texProbHeavy.addFocusListener(this); /** rough */ labRoughSpots = new JLabel(Messages.getString("RandomMapDialog.labRoughSpots"), JLabel.LEFT); //$NON-NLS-1$ texMinRoughSpots = new JTextField(2); texMinRoughSpots.addFocusListener(this); texMaxRoughSpots = new JTextField(2); texMaxRoughSpots.addFocusListener(this); labRoughSize = new JLabel(Messages.getString("RandomMapDialog.labRoughSize"), JLabel.LEFT); //$NON-NLS-1$ texMinRoughSize = new JTextField(2); texMinRoughSize.addFocusListener(this); texMaxRoughSize = new JTextField(2); texMaxRoughSize.addFocusListener(this); /** swamp */ labSwampSpots = new JLabel(Messages.getString("RandomMapDialog.labSwampSpots"), JLabel.LEFT); //$NON-NLS-1$ texMinSwampSpots = new JTextField(2); texMinSwampSpots.addFocusListener(this); texMaxSwampSpots = new JTextField(2); texMaxSwampSpots.addFocusListener(this); labSwampSize = new JLabel(Messages.getString("RandomMapDialog.labSwampSize"), JLabel.LEFT); //$NON-NLS-1$ texMinSwampSize = new JTextField(2); texMinSwampSize.addFocusListener(this); texMaxSwampSize = new JTextField(2); texMaxSwampSize.addFocusListener(this); /** pavement */ labPavementSpots = new JLabel(Messages.getString("RandomMapDialog.labPavementSpots"), JLabel.LEFT); texMinPavementSpots = new JTextField(2); texMinPavementSpots.addFocusListener(this); texMaxPavementSpots = new JTextField(2); texMaxPavementSpots.addFocusListener(this); labPavementSize = new JLabel(Messages.getString("RandomMapDialog.labPavementSize"), JLabel.LEFT); texMinPavementSize = new JTextField(2); texMinPavementSize.addFocusListener(this); texMaxPavementSize = new JTextField(2); texMaxPavementSize.addFocusListener(this); /** Rubble */ labRubbleSpots = new JLabel(Messages.getString("RandomMapDialog.labRubbleSpots"), JLabel.LEFT); texMinRubbleSpots = new JTextField(2); texMinRubbleSpots.addFocusListener(this); texMaxRubbleSpots = new JTextField(2); texMaxRubbleSpots.addFocusListener(this); labRubbleSize = new JLabel(Messages.getString("RandomMapDialog.labRubbleSize"), JLabel.LEFT); texMinRubbleSize = new JTextField(2); texMinRubbleSize.addFocusListener(this); texMaxRubbleSize = new JTextField(2); texMaxRubbleSize.addFocusListener(this); /** Fortified */ labFortifiedSpots = new JLabel(Messages.getString("RandomMapDialog.labFortifiedSpots"), JLabel.LEFT); texMinFortifiedSpots = new JTextField(2); texMinFortifiedSpots.addFocusListener(this); texMaxFortifiedSpots = new JTextField(2); texMaxFortifiedSpots.addFocusListener(this); labFortifiedSize = new JLabel(Messages.getString("RandomMapDialog.labFortifiedSize"), JLabel.LEFT); texMinFortifiedSize = new JTextField(2); texMinFortifiedSize.addFocusListener(this); texMaxFortifiedSize = new JTextField(2); texMaxFortifiedSize.addFocusListener(this); /** ice */ labIceSpots = new JLabel(Messages.getString("RandomMapDialog.labIceSpots"), JLabel.LEFT); texMinIceSpots = new JTextField(2); texMinIceSpots.addFocusListener(this); texMaxIceSpots = new JTextField(2); texMaxIceSpots.addFocusListener(this); labIceSize = new JLabel(Messages.getString("RandomMapDialog.labIceSize"), JLabel.LEFT); texMinIceSize = new JTextField(2); texMinIceSize.addFocusListener(this); texMaxIceSize = new JTextField(2); texMaxIceSize.addFocusListener(this); /** probability for a road, range 0..100 */ labProbRoad = new JLabel(Messages.getString("RandomMapDialog.labProbRoad"), JLabel.LEFT); //$NON-NLS-1$ texProbRoad = new JTextField(2); texProbRoad.addFocusListener(this); /** probability for a river, range 0..100 */ labProbRiver = new JLabel(Messages.getString("RandomMapDialog.labProbRiver"), JLabel.LEFT); //$NON-NLS-1$ texProbRiver = new JTextField(2); texProbRiver.addFocusListener(this); /* Craters */ labProbCrater = new JLabel(Messages.getString("RandomMapDialog.labProbCrater"), JLabel.LEFT); //$NON-NLS-1$ texProbCrater = new JTextField(2); texProbCrater.addFocusListener(this); labRadius = new JLabel(Messages.getString("RandomMapDialog.labRadius"), JLabel.LEFT); //$NON-NLS-1$ texMinRadius = new JTextField(2); texMinRadius.addFocusListener(this);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -