Initialize the contents of the frame.
()
| 333 | * Initialize the contents of the frame. |
| 334 | */ |
| 335 | private void initialize() { |
| 336 | this.setLookAndFeel(); |
| 337 | |
| 338 | this.frmTesttitle = new JFrame(); |
| 339 | this.frmTesttitle.setIconImage(Toolkit.getDefaultToolkit() |
| 340 | .getImage(".\\resources\\hammer_icon.jpg")); |
| 341 | this.frmTesttitle.setTitle(this.title); |
| 342 | this.frmTesttitle.getContentPane() |
| 343 | .setFont(Gui.DEFAULT_FONT); |
| 344 | this.frmTesttitle.setBounds(100, 100, WIDTH, HEIGHT); |
| 345 | this.frmTesttitle.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
| 346 | |
| 347 | this.tabbedPane = new JTabbedPane(JTabbedPane.BOTTOM); |
| 348 | this.tabbedPane.setBorder(null); |
| 349 | this.tabbedPane.setFont(Gui.DEFAULT_FONT); |
| 350 | this.tabbedPane.addChangeListener(arg0 -> { |
| 351 | // |
| 352 | }); |
| 353 | final JTabbedPane tabbedPaneFinal = this.tabbedPane; |
| 354 | this.frmTesttitle.getContentPane() |
| 355 | .add(this.tabbedPane, BorderLayout.CENTER); |
| 356 | |
| 357 | // setup Panel |
| 358 | this.setupPanel = new SetupPanel(); |
| 359 | this.setupPanel.setUponContinue(() -> { |
| 360 | tabbedPaneFinal.setSelectedIndex(1); // index of input |
| 361 | }); |
| 362 | this.tabbedPane.addTab(SETUP, null, this.setupPanel, null); |
| 363 | |
| 364 | // input Panel |
| 365 | this.inputPanel = new InputPanel(); |
| 366 | this.inputPanel.setUponContinue(() -> { |
| 367 | if (this.inputPanel.getWorld() == null) { |
| 368 | return; |
| 369 | } |
| 370 | if (this.validatePlaceIntern.run(this.inputPanel.getPlaceFromCoordinates())) { |
| 371 | tabbedPaneFinal.setSelectedIndex(2); |
| 372 | } |
| 373 | }); |
| 374 | this.tabbedPane.addTab(INPUT, null, this.inputPanel, null); |
| 375 | |
| 376 | // output Panel |
| 377 | this.outputPanel = new OutputPanel(); |
| 378 | this.outputPanel.setUponContinue(() -> { |
| 379 | tabbedPaneFinal.setSelectedIndex(3); // index of details |
| 380 | }); |
| 381 | this.tabbedPane.addTab(OUTPUT, null, this.outputPanel, null); |
| 382 | |
| 383 | // details Panel |
| 384 | this.detailsPanel = new DetailsPanel(); |
| 385 | this.tabbedPane.addTab(DETAILS, null, this.detailsPanel, null); |
| 386 | |
| 387 | // result |
| 388 | this.resultPanel = new ResultPanel(); |
| 389 | this.tabbedPane.addTab(RESULT, null, this.resultPanel, null); |
| 390 | this.tabbedPane.setEnabledAt(4, false); |
| 391 | } |
| 392 |
no test coverage detected