~yrke/tapaal/slimImageIcons-2

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/gui/components/TransitionFireingComponent.java

  • Committer: Jiri Srba
  • Date: 2020-04-28 19:15:28 UTC
  • mfrom: (998.2.376 testbranch)
  • Revision ID: srba@cs.aau.dk-20200428191528-3xxjqa1r4jcob5ur
merged in lp:~yrke/tapaal/testbranch doing majour refactoring of the GUI

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import java.awt.Dimension;
4
4
import java.awt.GridBagConstraints;
5
5
import java.awt.GridBagLayout;
6
 
import java.awt.event.ActionEvent;
7
 
import java.awt.event.ActionListener;
8
6
import java.awt.event.KeyAdapter;
9
7
import java.awt.event.KeyEvent;
10
8
 
42
40
 
43
41
                settingsButton = new JButton("Settings");
44
42
                settingsButton.setPreferredSize(new Dimension(0, settingsButton.getPreferredSize().height)); //Make the two buttons equal in size
45
 
                settingsButton.addActionListener(new ActionListener() {
46
 
                        public void actionPerformed(ActionEvent e) {
47
 
                                AnimationSettings.showAnimationSettings();
48
 
                        }
49
 
                });
 
43
                settingsButton.addActionListener(e -> AnimationSettings.showAnimationSettings());
50
44
 
51
45
                fireButton = new JButton("Delay & Fire");
52
46
                fireButton.setPreferredSize(new Dimension(0, fireButton.getPreferredSize().height)); //Make the two buttons equal in size
53
 
                fireButton.addActionListener(new ActionListener() {
54
 
                        public void actionPerformed(ActionEvent e) {
55
 
                                if(SimulationControl.getInstance().randomSimulation() && CreateGui.getApp().isShowingDelayEnabledTransitions()){
56
 
                                        SimulationControl.startSimulation();
57
 
                                } else {
58
 
                                        fireSelectedTransition();
59
 
                                }
 
47
                fireButton.addActionListener(e -> {
 
48
                        if(SimulationControl.getInstance().randomSimulation() && CreateGui.getApp().isShowingDelayEnabledTransitions()){
 
49
                                SimulationControl.startSimulation();
 
50
                        } else {
 
51
                                fireSelectedTransition();
60
52
                        }
61
53
                });
62
54
                fireButton.addKeyListener(new KeyAdapter() {