Initialize the contents of the frame.
()
| 229 | * Initialize the contents of the frame. |
| 230 | */ |
| 231 | private void initialize() { |
| 232 | NumberFormat format = NumberFormat.getInstance(); |
| 233 | NumberFormatter formatter = new NumberFormatter(format); |
| 234 | formatter.setAllowsInvalid(false); |
| 235 | formatter.setValueClass(Integer.class); |
| 236 | formatter.setMinimum(Integer.MIN_VALUE); |
| 237 | formatter.setMaximum(Integer.MAX_VALUE); |
| 238 | |
| 239 | JPanel panel_Input = this; |
| 240 | this.sl_panel_Input = new SpringLayout(); |
| 241 | panel_Input.setLayout(this.sl_panel_Input); |
| 242 | |
| 243 | // continue button |
| 244 | JButton btnButton_InputContinue = new JButton(Gui.CONTINUE_TEXT); |
| 245 | this.configureContinueButton(btnButton_InputContinue); |
| 246 | btnButton_InputContinue.addActionListener(arg -> this.uponContinue.run()); |
| 247 | this.sl_panel_Input.putConstraint(SpringLayout.SOUTH, btnButton_InputContinue, -10, SpringLayout.SOUTH, panel_Input); |
| 248 | this.sl_panel_Input.putConstraint(SpringLayout.EAST, btnButton_InputContinue, -10, SpringLayout.EAST, panel_Input); |
| 249 | panel_Input.add(btnButton_InputContinue); |
| 250 | |
| 251 | JLabel lbl_Minecraftworld = new JLabel("Minecraft-World"); |
| 252 | this.sl_panel_Input.putConstraint(SpringLayout.NORTH, lbl_Minecraftworld, 10, SpringLayout.NORTH, panel_Input); |
| 253 | this.sl_panel_Input.putConstraint(SpringLayout.WEST, lbl_Minecraftworld, 10, SpringLayout.WEST, panel_Input); |
| 254 | lbl_Minecraftworld.setFont(Gui.DEFAULT_FONT); |
| 255 | panel_Input.add(lbl_Minecraftworld); |
| 256 | |
| 257 | this.comboBox_World = new JComboBox<>(); |
| 258 | this.comboBox_World.addActionListener(arg0 -> this.uponWorldSelected.run((World) this.comboBox_World.getSelectedItem())); |
| 259 | this.comboBox_World.setRenderer(new WorldComboboxRenderer()); |
| 260 | this.sl_panel_Input.putConstraint(SpringLayout.NORTH, this.comboBox_World, 6, SpringLayout.SOUTH, lbl_Minecraftworld); |
| 261 | this.sl_panel_Input.putConstraint(SpringLayout.WEST, this.comboBox_World, 0, SpringLayout.WEST, lbl_Minecraftworld); |
| 262 | this.sl_panel_Input.putConstraint(SpringLayout.EAST, this.comboBox_World, -6, SpringLayout.EAST, this); |
| 263 | this.comboBox_World.setFont(Gui.DEFAULT_FONT); |
| 264 | panel_Input.add(this.comboBox_World); |
| 265 | |
| 266 | JLabel lbl_Coordinates = new JLabel("Coordinates"); |
| 267 | this.sl_panel_Input.putConstraint(SpringLayout.NORTH, lbl_Coordinates, 20, SpringLayout.SOUTH, this.comboBox_World); |
| 268 | this.sl_panel_Input.putConstraint(SpringLayout.WEST, lbl_Coordinates, 10, SpringLayout.WEST, panel_Input); |
| 269 | lbl_Coordinates.setFont(Gui.DEFAULT_FONT); |
| 270 | panel_Input.add(lbl_Coordinates); |
| 271 | |
| 272 | this.comboBox_LabeledCoordinates = new JComboBox<>(); |
| 273 | this.sl_panel_Input.putConstraint(SpringLayout.NORTH, this.comboBox_LabeledCoordinates, 6, SpringLayout.SOUTH, lbl_Coordinates); |
| 274 | this.sl_panel_Input.putConstraint(SpringLayout.WEST, this.comboBox_LabeledCoordinates, 0, SpringLayout.WEST, lbl_Coordinates); |
| 275 | this.sl_panel_Input.putConstraint(SpringLayout.EAST, this.comboBox_LabeledCoordinates, -6, SpringLayout.EAST, this); |
| 276 | this.comboBox_LabeledCoordinates.setFont(Gui.DEFAULT_FONT); |
| 277 | panel_Input.add(this.comboBox_LabeledCoordinates); |
| 278 | |
| 279 | JLabel lblNewLabel_From = new JLabel(InputPanel.FROM); |
| 280 | this.sl_panel_Input.putConstraint(SpringLayout.NORTH, lblNewLabel_From, 10, SpringLayout.SOUTH, this.comboBox_LabeledCoordinates); |
| 281 | this.sl_panel_Input.putConstraint(SpringLayout.WEST, lblNewLabel_From, 40, SpringLayout.WEST, this); |
| 282 | panel_Input.add(lblNewLabel_From); |
| 283 | |
| 284 | this.textField_FromX = new JTextField(); |
| 285 | this.sl_panel_Input.putConstraint(SpringLayout.NORTH, this.textField_FromX, 10, SpringLayout.SOUTH, lblNewLabel_From); |
| 286 | this.sl_panel_Input.putConstraint(SpringLayout.WEST, this.textField_FromX, 0, SpringLayout.WEST, lblNewLabel_From); |
| 287 | this.textField_FromX.setHorizontalAlignment(SwingConstants.TRAILING); |
| 288 | this.textField_FromX.addActionListener(arg0 -> { |
no test coverage detected