⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 randommapdialog.java

📁 MegaMek is a networked Java clone of BattleTech, a turn-based sci-fi boardgame for 2+ players. Fight
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
/* * MegaMek - Copyright (C) 2000-2003 Ben Mazur (bmazur@sev.org) *  *  This program is free software; you can redistribute it and/or modify it  *  under the terms of the GNU General Public License as published by the Free  *  Software Foundation; either version 2 of the License, or (at your option)  *  any later version. *  *  This program is distributed in the hope that it will be useful, but  *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY  *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License  *  for more details. */package megamek.client.ui.swing;import megamek.client.ui.swing.widget.SimpleLine;import megamek.common.MapSettings;import javax.swing.JButton;import javax.swing.JComboBox;import javax.swing.JDialog;import javax.swing.JFileChooser;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.JTextField;import javax.swing.filechooser.FileFilter;import java.awt.BorderLayout;import java.awt.Dimension;import java.awt.FlowLayout;import java.awt.GridBagConstraints;import java.awt.GridBagLayout;import java.awt.Insets;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.FocusEvent;import java.awt.event.FocusListener;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;public class RandomMapDialog        extends JDialog implements ActionListener, FocusListener {    private static final String NONE = Messages.getString("RandomMapDialog.elevNONE"); //$NON-NLS-1$    private static final String LOW = Messages.getString("RandomMapDialog.elevLow"); //$NON-NLS-1$    private static final String MEDIUM = Messages.getString("RandomMapDialog.elevMedium"); //$NON-NLS-1$    private static final String HIGH = Messages.getString("RandomMapDialog.elevHigh"); //$NON-NLS-1$    private static final String INVALID_SETTING = Messages.getString("RandomMapDialog.InvalidSetting"); //$NON-NLS-1$    private static final int NORMAL_LINE_WIDTH = 195;    private static final int ADVANCED_LINE_WIDTH = 295;    private JScrollPane scrAll;    private JButton butOK;    private JButton butAdvanced;    private JButton butSave;    private JButton butLoad;    private JPanel panButtons;    private JPanel panOptions;    private JLabel labBoardSize;    private JTextField texBoardWidth;    private JTextField texBoardHeight;    private JComboBox choElevation;    private JComboBox choCliffs;    private JComboBox choWoods;    private JComboBox choLakes;    private JComboBox choPavement;    private JComboBox choRubble;    private JComboBox choFortified;    private JComboBox choIce;    private JComboBox choRough;    private JComboBox choRoads;    private JComboBox choRivers;    private JComboBox choSwamp;    private JComboBox choCraters;    private JComboBox choCity;    private JComboBox choMountain;    private JLabel labElevation;    private JLabel labCliffs;    private JLabel labWoods;    private JLabel labLakes;    private JLabel labPavement;    private JLabel labRubble;    private JLabel labFortified;    private JLabel labIce;    private JLabel labRough;    private JLabel labRoads;    private JLabel labRivers;    private JLabel labSwamp;    private JLabel labTheme;    private JLabel labCraters;    private JLabel labCity;    private JLabel labMountain = null;    private SimpleLine slElevation;    private SimpleLine slCliffs;    private SimpleLine slWoods;    private SimpleLine slLakes;    private SimpleLine slPavement;    private SimpleLine slRubble;    private SimpleLine slFortified;    private SimpleLine slIce;    private SimpleLine slRough;    private SimpleLine slRoads;    private SimpleLine slRivers;    private SimpleLine slSwamp;    private SimpleLine slBoardSize;    private SimpleLine slCraters;    private SimpleLine slCity;    private SimpleLine slMountain;    private SimpleLine slElevationAd;    private SimpleLine slWoodsAd;    private SimpleLine slLakesAd;    private SimpleLine slPavementAd;    private SimpleLine slRubbleAd;    private SimpleLine slFortifiedAd;    private SimpleLine slIceAd;    private SimpleLine slRoughAd;    private SimpleLine slRoadsAd;    private SimpleLine slRiversAd;    private SimpleLine slSwampAd;    private SimpleLine slBoardSizeAd;    private SimpleLine slCratersAd;    private SimpleLine slCityAd;    private SimpleLine slInvertNegativeAd;    private JTextField texTheme;    /**     * how much hills there should be, Range 0..100     */    private JLabel labHilliness;    private JTextField texHilliness;    /**     * invert negative terrain? 1 yes, 0 no     */    private JLabel labInvertNegative;    private JTextField texInvertNegative;    /**     * Maximum level of the map     */    private JLabel labRange;    private JTextField texRange;    private JLabel labProbInvert;    private JTextField texProbInvert;    private JLabel labCliffsAd;    private JTextField texCliffs;    /**     * how much Lakes at least     */    private JLabel labWaterSpots;    private JTextField texMinWaterSpots;    /**     * how much Lakes at most     */    private JTextField texMaxWaterSpots;    /**     * minimum size of a lake     */    private JLabel labWaterSize;    private JTextField texMinWaterSize;    /**     * maximum Size of a lake     */    private JTextField texMaxWaterSize;    /**     * probability for water deeper than lvl1, Range 0..100     */    private JLabel labProbDeep;    private JTextField texProbDeep;    /**     * how much forests at least     */    private JLabel labForestSpots;    private JTextField texMinForestSpots;    /**     * how much forests at most     */    private JTextField texMaxForestSpots;    /**     * minimum size of a forest     */    private JLabel labForestSize;    private JTextField texMinForestSize;    /**     * maximum Size of a forest     */    private JTextField texMaxForestSize;    /**     * probability for heavy wood, Range 0..100     */    private JLabel labProbHeavy;    private JTextField texProbHeavy;    /**     * rough     */    private JLabel labRoughSpots;    private JTextField texMinRoughSpots;    private JTextField texMaxRoughSpots;    private JLabel labRoughSize;    private JTextField texMinRoughSize;    private JTextField texMaxRoughSize;    /**     * swamp     */    private JLabel labSwampSpots;    private JTextField texMinSwampSpots;    private JTextField texMaxSwampSpots;    private JLabel labSwampSize;    private JTextField texMinSwampSize;    private JTextField texMaxSwampSize;    /**     * pavement/ice     */    private JLabel labPavementSpots;    private JTextField texMinPavementSpots;    private JTextField texMaxPavementSpots;    private JLabel labPavementSize;    private JTextField texMinPavementSize;    private JTextField texMaxPavementSize;    private JLabel labIceSpots;    private JTextField texMinIceSpots;    private JTextField texMaxIceSpots;    private JLabel labIceSize;    private JTextField texMinIceSize;    private JTextField texMaxIceSize;    /**     * rubble / fortified     */    private JLabel labRubbleSpots;    private JTextField texMinRubbleSpots;    private JTextField texMaxRubbleSpots;    private JLabel labRubbleSize;    private JTextField texMinRubbleSize;    private JTextField texMaxRubbleSize;    private JLabel labFortifiedSpots;    private JTextField texMinFortifiedSpots;    private JTextField texMaxFortifiedSpots;    private JLabel labFortifiedSize;    private JTextField texMinFortifiedSize;    private JTextField texMaxFortifiedSize;    /**     * probability for a road, range 0..100     */    private JLabel labProbRoad;    private JTextField texProbRoad;    /**     * probability for a river, range 0..100     */    private JLabel labProbRiver;    private JTextField texProbRiver;    /* Craters */    private JLabel labProbCrater;    private JTextField texProbCrater;    private JLabel labRadius;    private JTextField texMinRadius;    private JTextField texMaxRadius;    private JLabel labMaxCraters;    private JTextField texMaxCraters;    private JTextField texMinCraters;    /*FX*/    private JLabel labProbDrought;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -