Merge lp:~tapaal-contributor/tapaal/cut-names-1923011 into lp:tapaal
- cut-names-1923011
- Merge into trunk
Proposed by
Peter Haahr Taankvist
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Jiri Srba | ||||
Approved revision: | 1129 | ||||
Merged at revision: | 1128 | ||||
Proposed branch: | lp:~tapaal-contributor/tapaal/cut-names-1923011 | ||||
Merge into: | lp:tapaal | ||||
Diff against target: |
321 lines (+44/-36) 11 files modified
src/dk/aau/cs/gui/SharedPlaceNamePanel.java (+2/-2) src/dk/aau/cs/gui/SharedTransitionNamePanel.java (+2/-2) src/dk/aau/cs/gui/TemplateExplorer.java (+6/-6) src/net/tapaal/swinghelpers/CustomJSpinner.java (+1/-3) src/net/tapaal/swinghelpers/SwingHelper.java (+8/-0) src/pipe/gui/GuiFrame.java (+3/-4) src/pipe/gui/widgets/ConstantsDialogPanel.java (+3/-3) src/pipe/gui/widgets/GuardDialogue.java (+11/-10) src/pipe/gui/widgets/NewTAPNPanel.java (+2/-2) src/pipe/gui/widgets/PlaceEditorPanel.java (+3/-2) src/pipe/gui/widgets/TAPNTransitionEditor.java (+3/-2) |
||||
To merge this branch: | bzr merge lp:~tapaal-contributor/tapaal/cut-names-1923011 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jiri Srba | Approve | ||
Kenneth Yrke Jørgensen | code | Approve | |
Review via email: mp+400775@code.launchpad.net |
Commit message
Let java control height of text fields so that it works for all distributions.
Description of the change
To post a comment you must log in.
Revision history for this message
Peter Haahr Taankvist (ptaank) wrote : | # |
It happens several places, but now it only happens for buttons and panels. Should this also be changed?
Revision history for this message
Kenneth Yrke Jørgensen (yrke) wrote : | # |
For now just focus on button and panels :)
Revision history for this message
Jiri Srba (srba) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/dk/aau/cs/gui/SharedPlaceNamePanel.java' | |||
2 | --- src/dk/aau/cs/gui/SharedPlaceNamePanel.java 2020-07-13 13:58:47 +0000 | |||
3 | +++ src/dk/aau/cs/gui/SharedPlaceNamePanel.java 2021-04-08 08:40:30 +0000 | |||
4 | @@ -15,6 +15,7 @@ | |||
5 | 15 | import javax.swing.JRootPane; | 15 | import javax.swing.JRootPane; |
6 | 16 | import javax.swing.JTextField; | 16 | import javax.swing.JTextField; |
7 | 17 | 17 | ||
8 | 18 | import net.tapaal.swinghelpers.SwingHelper; | ||
9 | 18 | import pipe.dataLayer.TAPNQuery; | 19 | import pipe.dataLayer.TAPNQuery; |
10 | 19 | import dk.aau.cs.TCTL.visitors.RenameSharedPlaceVisitor; | 20 | import dk.aau.cs.TCTL.visitors.RenameSharedPlaceVisitor; |
11 | 20 | import dk.aau.cs.gui.SharedPlacesAndTransitionsPanel.SharedPlacesListModel; | 21 | import dk.aau.cs.gui.SharedPlacesAndTransitionsPanel.SharedPlacesListModel; |
12 | @@ -80,8 +81,7 @@ | |||
13 | 80 | 81 | ||
14 | 81 | String initialText = (placeToEdit == null) ? "" : placeToEdit.name(); | 82 | String initialText = (placeToEdit == null) ? "" : placeToEdit.name(); |
15 | 82 | nameField = new JTextField(initialText); | 83 | nameField = new JTextField(initialText); |
18 | 83 | nameField.setMinimumSize(new Dimension(330, 25)); | 84 | SwingHelper.setPreferredWidth(nameField,330); |
17 | 84 | nameField.setPreferredSize(new Dimension(330, 25)); | ||
19 | 85 | nameField.addActionListener(e -> { | 85 | nameField.addActionListener(e -> { |
20 | 86 | okButton.requestFocusInWindow(); | 86 | okButton.requestFocusInWindow(); |
21 | 87 | okButton.doClick(); | 87 | okButton.doClick(); |
22 | 88 | 88 | ||
23 | === modified file 'src/dk/aau/cs/gui/SharedTransitionNamePanel.java' | |||
24 | --- src/dk/aau/cs/gui/SharedTransitionNamePanel.java 2020-07-13 13:58:47 +0000 | |||
25 | +++ src/dk/aau/cs/gui/SharedTransitionNamePanel.java 2021-04-08 08:40:30 +0000 | |||
26 | @@ -15,6 +15,7 @@ | |||
27 | 15 | import javax.swing.JRootPane; | 15 | import javax.swing.JRootPane; |
28 | 16 | import javax.swing.JTextField; | 16 | import javax.swing.JTextField; |
29 | 17 | 17 | ||
30 | 18 | import net.tapaal.swinghelpers.SwingHelper; | ||
31 | 18 | import pipe.gui.undo.UndoManager; | 19 | import pipe.gui.undo.UndoManager; |
32 | 19 | import pipe.dataLayer.TAPNQuery; | 20 | import pipe.dataLayer.TAPNQuery; |
33 | 20 | import dk.aau.cs.TCTL.visitors.RenameSharedTransitionVisitor; | 21 | import dk.aau.cs.TCTL.visitors.RenameSharedTransitionVisitor; |
34 | @@ -86,8 +87,7 @@ | |||
35 | 86 | 87 | ||
36 | 87 | String initialText = (transitionToEdit == null) ? "" : transitionToEdit.name(); | 88 | String initialText = (transitionToEdit == null) ? "" : transitionToEdit.name(); |
37 | 88 | nameField = new JTextField(initialText); | 89 | nameField = new JTextField(initialText); |
40 | 89 | nameField.setMinimumSize(new Dimension(330, 25)); | 90 | SwingHelper.setPreferredWidth(nameField,330); |
39 | 90 | nameField.setPreferredSize(new Dimension(330, 25)); | ||
41 | 91 | nameField.addActionListener(e -> { | 91 | nameField.addActionListener(e -> { |
42 | 92 | okButton.requestFocusInWindow(); | 92 | okButton.requestFocusInWindow(); |
43 | 93 | okButton.doClick(); | 93 | okButton.doClick(); |
44 | 94 | 94 | ||
45 | === modified file 'src/dk/aau/cs/gui/TemplateExplorer.java' | |||
46 | --- src/dk/aau/cs/gui/TemplateExplorer.java 2020-08-04 08:53:19 +0000 | |||
47 | +++ src/dk/aau/cs/gui/TemplateExplorer.java 2021-04-08 08:40:30 +0000 | |||
48 | @@ -39,6 +39,7 @@ | |||
49 | 39 | import dk.aau.cs.gui.undo.MoveElementDownCommand; | 39 | import dk.aau.cs.gui.undo.MoveElementDownCommand; |
50 | 40 | import dk.aau.cs.gui.undo.MoveElementUpCommand; | 40 | import dk.aau.cs.gui.undo.MoveElementUpCommand; |
51 | 41 | import net.tapaal.resourcemanager.ResourceManager; | 41 | import net.tapaal.resourcemanager.ResourceManager; |
52 | 42 | import net.tapaal.swinghelpers.SwingHelper; | ||
53 | 42 | import pipe.dataLayer.DataLayer; | 43 | import pipe.dataLayer.DataLayer; |
54 | 43 | import pipe.dataLayer.TAPNQuery; | 44 | import pipe.dataLayer.TAPNQuery; |
55 | 44 | import pipe.dataLayer.Template; | 45 | import pipe.dataLayer.Template; |
56 | @@ -551,9 +552,9 @@ | |||
57 | 551 | nameContainer.setLayout(new GridBagLayout()); | 552 | nameContainer.setLayout(new GridBagLayout()); |
58 | 552 | size = new Dimension(330, 25); | 553 | size = new Dimension(330, 25); |
59 | 553 | 554 | ||
63 | 554 | nameTextField = new javax.swing.JTextField(); | 555 | nameTextField = new javax.swing.JTextField(); |
64 | 555 | nameTextField.setPreferredSize(size); | 556 | SwingHelper.setPreferredWidth(nameTextField,330); |
65 | 556 | nameTextField.setText(nameToShow); | 557 | nameTextField.setText(nameToShow); |
66 | 557 | nameTextField.addAncestorListener(new RequestFocusListener()); | 558 | nameTextField.addAncestorListener(new RequestFocusListener()); |
67 | 558 | nameTextField.addActionListener(e -> { | 559 | nameTextField.addActionListener(e -> { |
68 | 559 | okButton.requestFocusInWindow(); | 560 | okButton.requestFocusInWindow(); |
69 | @@ -659,10 +660,9 @@ | |||
70 | 659 | container.setLayout(new GridBagLayout()); | 660 | container.setLayout(new GridBagLayout()); |
71 | 660 | nameContainer = new JPanel(); | 661 | nameContainer = new JPanel(); |
72 | 661 | nameContainer.setLayout(new GridBagLayout()); | 662 | nameContainer.setLayout(new GridBagLayout()); |
73 | 662 | size = new Dimension(330, 25); | ||
74 | 663 | 663 | ||
77 | 664 | nameTextField = new javax.swing.JTextField(); | 664 | nameTextField = new javax.swing.JTextField(); |
78 | 665 | nameTextField.setPreferredSize(size); | 665 | SwingHelper.setPreferredWidth(nameTextField,330); |
79 | 666 | nameTextField.setText(oldname); | 666 | nameTextField.setText(oldname); |
80 | 667 | nameTextField.addAncestorListener(new RequestFocusListener()); | 667 | nameTextField.addAncestorListener(new RequestFocusListener()); |
81 | 668 | nameTextField.addActionListener(e -> { | 668 | nameTextField.addActionListener(e -> { |
82 | 669 | 669 | ||
83 | === modified file 'src/net/tapaal/swinghelpers/CustomJSpinner.java' | |||
84 | --- src/net/tapaal/swinghelpers/CustomJSpinner.java 2020-04-18 12:30:50 +0000 | |||
85 | +++ src/net/tapaal/swinghelpers/CustomJSpinner.java 2021-04-08 08:40:30 +0000 | |||
86 | @@ -104,9 +104,7 @@ | |||
87 | 104 | ((JSpinner)e.getSource()).setValue(maximumValue); | 104 | ((JSpinner)e.getSource()).setValue(maximumValue); |
88 | 105 | } | 105 | } |
89 | 106 | }); | 106 | }); |
93 | 107 | this.setPreferredSize(new Dimension(100, 25)); | 107 | SwingHelper.setPreferredWidth(this, 100); |
91 | 108 | this.setMaximumSize(new Dimension(100, 25)); | ||
92 | 109 | this.setMinimumSize(new Dimension(100, 25)); | ||
94 | 110 | 108 | ||
95 | 111 | final JSpinner spinner = this; | 109 | final JSpinner spinner = this; |
96 | 112 | 110 | ||
97 | 113 | 111 | ||
98 | === added file 'src/net/tapaal/swinghelpers/SwingHelper.java' | |||
99 | --- src/net/tapaal/swinghelpers/SwingHelper.java 1970-01-01 00:00:00 +0000 | |||
100 | +++ src/net/tapaal/swinghelpers/SwingHelper.java 2021-04-08 08:40:30 +0000 | |||
101 | @@ -0,0 +1,8 @@ | |||
102 | 1 | package net.tapaal.swinghelpers; | ||
103 | 2 | import java.awt.*; | ||
104 | 3 | public class SwingHelper { | ||
105 | 4 | public static void setPreferredWidth(Component c, int width) { | ||
106 | 5 | var pSize = c.getPreferredSize(); | ||
107 | 6 | c.setPreferredSize(new Dimension(width, pSize.height)); | ||
108 | 7 | } | ||
109 | 8 | } | ||
110 | 0 | \ No newline at end of file | 9 | \ No newline at end of file |
111 | 1 | 10 | ||
112 | === modified file 'src/pipe/gui/GuiFrame.java' | |||
113 | --- src/pipe/gui/GuiFrame.java 2020-12-16 08:38:28 +0000 | |||
114 | +++ src/pipe/gui/GuiFrame.java 2021-04-08 08:40:30 +0000 | |||
115 | @@ -27,6 +27,7 @@ | |||
116 | 27 | import net.tapaal.helpers.Reference.MutableReference; | 27 | import net.tapaal.helpers.Reference.MutableReference; |
117 | 28 | import net.tapaal.helpers.Reference.Reference; | 28 | import net.tapaal.helpers.Reference.Reference; |
118 | 29 | import net.tapaal.swinghelpers.ExtendedJTabbedPane; | 29 | import net.tapaal.swinghelpers.ExtendedJTabbedPane; |
119 | 30 | import net.tapaal.swinghelpers.SwingHelper; | ||
120 | 30 | import net.tapaal.swinghelpers.ToggleButtonWithoutText; | 31 | import net.tapaal.swinghelpers.ToggleButtonWithoutText; |
121 | 31 | import org.jetbrains.annotations.NotNull; | 32 | import org.jetbrains.annotations.NotNull; |
122 | 32 | import pipe.dataLayer.TAPNQuery; | 33 | import pipe.dataLayer.TAPNQuery; |
123 | @@ -866,7 +867,7 @@ | |||
124 | 866 | * for generic addition of comboboxes | 867 | * for generic addition of comboboxes |
125 | 867 | */ | 868 | */ |
126 | 868 | private void addZoomComboBox(JToolBar toolBar, Action action) { | 869 | private void addZoomComboBox(JToolBar toolBar, Action action) { |
128 | 869 | Dimension zoomComboBoxDimension = new Dimension(75, 28); | 870 | Dimension zoomComboBoxDimension = new Dimension(100, 28); |
129 | 870 | 871 | ||
130 | 871 | String[] zoomExamplesStrings = new String[zoomLevels.length]; | 872 | String[] zoomExamplesStrings = new String[zoomLevels.length]; |
131 | 872 | int i; | 873 | int i; |
132 | @@ -878,9 +879,7 @@ | |||
133 | 878 | zoomComboBox.setEditable(true); | 879 | zoomComboBox.setEditable(true); |
134 | 879 | zoomComboBox.setSelectedItem("100%"); | 880 | zoomComboBox.setSelectedItem("100%"); |
135 | 880 | zoomComboBox.setMaximumRowCount(zoomLevels.length); | 881 | zoomComboBox.setMaximumRowCount(zoomLevels.length); |
139 | 881 | zoomComboBox.setMaximumSize(zoomComboBoxDimension); | 882 | SwingHelper.setPreferredWidth(zoomComboBox,zoomComboBoxDimension.width); |
137 | 882 | zoomComboBox.setMinimumSize(zoomComboBoxDimension); | ||
138 | 883 | zoomComboBox.setPreferredSize(zoomComboBoxDimension); | ||
140 | 884 | zoomComboBox.setAction(action); | 883 | zoomComboBox.setAction(action); |
141 | 885 | zoomComboBox.setFocusable(false); | 884 | zoomComboBox.setFocusable(false); |
142 | 886 | toolBar.add(zoomComboBox); | 885 | toolBar.add(zoomComboBox); |
143 | 887 | 886 | ||
144 | === modified file 'src/pipe/gui/widgets/ConstantsDialogPanel.java' | |||
145 | --- src/pipe/gui/widgets/ConstantsDialogPanel.java 2020-07-20 09:36:10 +0000 | |||
146 | +++ src/pipe/gui/widgets/ConstantsDialogPanel.java 2021-04-08 08:40:30 +0000 | |||
147 | @@ -17,6 +17,7 @@ | |||
148 | 17 | 17 | ||
149 | 18 | import net.tapaal.swinghelpers.CustomJSpinner; | 18 | import net.tapaal.swinghelpers.CustomJSpinner; |
150 | 19 | import net.tapaal.swinghelpers.RequestFocusListener; | 19 | import net.tapaal.swinghelpers.RequestFocusListener; |
151 | 20 | import net.tapaal.swinghelpers.SwingHelper; | ||
152 | 20 | import pipe.gui.CreateGui; | 21 | import pipe.gui.CreateGui; |
153 | 21 | import dk.aau.cs.gui.undo.Command; | 22 | import dk.aau.cs.gui.undo.Command; |
154 | 22 | import dk.aau.cs.model.tapn.Constant; | 23 | import dk.aau.cs.model.tapn.Constant; |
155 | @@ -75,9 +76,8 @@ | |||
156 | 75 | private void initComponents() { | 76 | private void initComponents() { |
157 | 76 | container = new JPanel(); | 77 | container = new JPanel(); |
158 | 77 | container.setLayout(new GridBagLayout()); | 78 | container.setLayout(new GridBagLayout()); |
162 | 78 | size = new Dimension(330, 25); | 79 | nameTextField = new javax.swing.JTextField(); |
163 | 79 | nameTextField = new javax.swing.JTextField(); | 80 | SwingHelper.setPreferredWidth(nameTextField,330); |
161 | 80 | nameTextField.setPreferredSize(size); | ||
164 | 81 | nameTextField.addAncestorListener(new RequestFocusListener()); | 81 | nameTextField.addAncestorListener(new RequestFocusListener()); |
165 | 82 | nameTextField.addActionListener(e -> { | 82 | nameTextField.addActionListener(e -> { |
166 | 83 | okButton.requestFocusInWindow(); | 83 | okButton.requestFocusInWindow(); |
167 | 84 | 84 | ||
168 | === modified file 'src/pipe/gui/widgets/GuardDialogue.java' | |||
169 | --- src/pipe/gui/widgets/GuardDialogue.java 2020-09-24 15:33:08 +0000 | |||
170 | +++ src/pipe/gui/widgets/GuardDialogue.java 2021-04-08 08:40:30 +0000 | |||
171 | @@ -29,6 +29,7 @@ | |||
172 | 29 | 29 | ||
173 | 30 | import dk.aau.cs.gui.TabContent; | 30 | import dk.aau.cs.gui.TabContent; |
174 | 31 | import dk.aau.cs.model.tapn.*; | 31 | import dk.aau.cs.model.tapn.*; |
175 | 32 | import net.tapaal.swinghelpers.SwingHelper; | ||
176 | 32 | import net.tapaal.swinghelpers.WidthAdjustingComboBox; | 33 | import net.tapaal.swinghelpers.WidthAdjustingComboBox; |
177 | 33 | import pipe.gui.CreateGui; | 34 | import pipe.gui.CreateGui; |
178 | 34 | import pipe.gui.graphicElements.PetriNetObject; | 35 | import pipe.gui.graphicElements.PetriNetObject; |
179 | @@ -233,11 +234,11 @@ | |||
180 | 233 | gridBagConstraints.anchor = GridBagConstraints.WEST; | 234 | gridBagConstraints.anchor = GridBagConstraints.WEST; |
181 | 234 | gridBagConstraints.insets = new Insets(3, 3, 3, 3); | 235 | gridBagConstraints.insets = new Insets(3, 3, 3, 3); |
182 | 235 | weightEditPanel.add(label, gridBagConstraints); | 236 | weightEditPanel.add(label, gridBagConstraints); |
184 | 236 | 237 | ||
185 | 237 | Dimension intervalBoxDims = new Dimension(190, 25); | 238 | Dimension intervalBoxDims = new Dimension(190, 25); |
186 | 238 | 239 | ||
187 | 239 | weightNumber = new JSpinner(); | 240 | weightNumber = new JSpinner(); |
189 | 240 | weightNumber.setPreferredSize(intervalBoxDims); | 241 | SwingHelper.setPreferredWidth(weightNumber,intervalBoxDims.width); |
190 | 241 | weightNumber.addChangeListener(e -> { | 242 | weightNumber.addChangeListener(e -> { |
191 | 242 | if((Integer) weightNumber.getValue() < 1){ | 243 | if((Integer) weightNumber.getValue() < 1){ |
192 | 243 | weightNumber.setValue(1); | 244 | weightNumber.setValue(1); |
193 | @@ -271,8 +272,8 @@ | |||
194 | 271 | weightConstantsComboBox.setModel(new DefaultComboBoxModel<>(constantArray)); | 272 | weightConstantsComboBox.setModel(new DefaultComboBoxModel<>(constantArray)); |
195 | 272 | weightConstantsComboBox.setMaximumRowCount(20); | 273 | weightConstantsComboBox.setMaximumRowCount(20); |
196 | 273 | weightConstantsComboBox.setVisible(false); | 274 | weightConstantsComboBox.setVisible(false); |
199 | 274 | weightConstantsComboBox.setPreferredSize(intervalBoxDims); | 275 | SwingHelper.setPreferredWidth(weightConstantsComboBox,intervalBoxDims.width); |
200 | 275 | 276 | ||
201 | 276 | gridBagConstraints = new GridBagConstraints(); | 277 | gridBagConstraints = new GridBagConstraints(); |
202 | 277 | gridBagConstraints.gridx = 1; | 278 | gridBagConstraints.gridx = 1; |
203 | 278 | gridBagConstraints.gridy = 1; | 279 | gridBagConstraints.gridy = 1; |
204 | @@ -379,7 +380,7 @@ | |||
205 | 379 | firstIntervalNumber = new JSpinner(); | 380 | firstIntervalNumber = new JSpinner(); |
206 | 380 | // firstIntervalNumber.setMaximumSize(intervalBoxDims); | 381 | // firstIntervalNumber.setMaximumSize(intervalBoxDims); |
207 | 381 | // firstIntervalNumber.setMinimumSize(intervalBoxDims); | 382 | // firstIntervalNumber.setMinimumSize(intervalBoxDims); |
209 | 382 | firstIntervalNumber.setPreferredSize(intervalBoxDims); | 383 | SwingHelper.setPreferredWidth(firstIntervalNumber,intervalBoxDims.width); |
210 | 383 | firstIntervalNumber.addChangeListener(this::firstSpinnerStateChanged); | 384 | firstIntervalNumber.addChangeListener(this::firstSpinnerStateChanged); |
211 | 384 | GridBagConstraints gridBagConstraints = new GridBagConstraints(); | 385 | GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
212 | 385 | gridBagConstraints.gridx = 2; | 386 | gridBagConstraints.gridx = 2; |
213 | @@ -393,9 +394,8 @@ | |||
214 | 393 | guardEditPanel.add(new JLabel(" , "), gridBagConstraints); | 394 | guardEditPanel.add(new JLabel(" , "), gridBagConstraints); |
215 | 394 | 395 | ||
216 | 395 | secondIntervalNumber = new JSpinner(); | 396 | secondIntervalNumber = new JSpinner(); |
220 | 396 | secondIntervalNumber.setMaximumSize(intervalBoxDims); | 397 | |
221 | 397 | secondIntervalNumber.setMinimumSize(intervalBoxDims); | 398 | SwingHelper.setPreferredWidth(secondIntervalNumber,intervalBoxDims.width); |
219 | 398 | secondIntervalNumber.setPreferredSize(intervalBoxDims); | ||
222 | 399 | secondIntervalNumber.addChangeListener(this::secondSpinnerStateChanged); | 399 | secondIntervalNumber.addChangeListener(this::secondSpinnerStateChanged); |
223 | 400 | 400 | ||
224 | 401 | gridBagConstraints.gridx = 4; | 401 | gridBagConstraints.gridx = 4; |
225 | @@ -430,7 +430,8 @@ | |||
226 | 430 | leftConstantsComboBox.setVisible(false); | 430 | leftConstantsComboBox.setVisible(false); |
227 | 431 | // leftConstantsComboBox.setMaximumSize(intervalBoxDims); | 431 | // leftConstantsComboBox.setMaximumSize(intervalBoxDims); |
228 | 432 | // leftConstantsComboBox.setMinimumSize(intervalBoxDims); | 432 | // leftConstantsComboBox.setMinimumSize(intervalBoxDims); |
230 | 433 | leftConstantsComboBox.setPreferredSize(intervalBoxDims); | 433 | SwingHelper.setPreferredWidth(leftConstantsComboBox,intervalBoxDims.width); |
231 | 434 | //leftConstantsComboBox.setPreferredSize(intervalBoxDims); | ||
232 | 434 | leftConstantsComboBox.addItemListener(e -> { | 435 | leftConstantsComboBox.addItemListener(e -> { |
233 | 435 | if (e.getStateChange() == ItemEvent.SELECTED) { | 436 | if (e.getStateChange() == ItemEvent.SELECTED) { |
234 | 436 | updateRightConstantComboBox(); | 437 | updateRightConstantComboBox(); |
235 | @@ -462,7 +463,7 @@ | |||
236 | 462 | rightConstantsComboBox.setVisible(false); | 463 | rightConstantsComboBox.setVisible(false); |
237 | 463 | // rightConstantsComboBox.setMaximumSize(intervalBoxDims); | 464 | // rightConstantsComboBox.setMaximumSize(intervalBoxDims); |
238 | 464 | // rightConstantsComboBox.setMinimumSize(intervalBoxDims); | 465 | // rightConstantsComboBox.setMinimumSize(intervalBoxDims); |
240 | 465 | rightConstantsComboBox.setPreferredSize(intervalBoxDims); | 466 | SwingHelper.setPreferredWidth(rightConstantsComboBox,intervalBoxDims.width); |
241 | 466 | gridBagConstraints = new GridBagConstraints(); | 467 | gridBagConstraints = new GridBagConstraints(); |
242 | 467 | rightConstantsComboBox.addItemListener(e -> { | 468 | rightConstantsComboBox.addItemListener(e -> { |
243 | 468 | if (e.getStateChange() == ItemEvent.SELECTED) { | 469 | if (e.getStateChange() == ItemEvent.SELECTED) { |
244 | 469 | 470 | ||
245 | === modified file 'src/pipe/gui/widgets/NewTAPNPanel.java' | |||
246 | --- src/pipe/gui/widgets/NewTAPNPanel.java 2020-08-04 08:53:19 +0000 | |||
247 | +++ src/pipe/gui/widgets/NewTAPNPanel.java 2021-04-08 08:40:30 +0000 | |||
248 | @@ -11,6 +11,7 @@ | |||
249 | 11 | import javax.swing.*; | 11 | import javax.swing.*; |
250 | 12 | 12 | ||
251 | 13 | import dk.aau.cs.gui.TabContent; | 13 | import dk.aau.cs.gui.TabContent; |
252 | 14 | import net.tapaal.swinghelpers.SwingHelper; | ||
253 | 14 | import pipe.gui.CreateGui; | 15 | import pipe.gui.CreateGui; |
254 | 15 | import pipe.gui.Grid; | 16 | import pipe.gui.Grid; |
255 | 16 | import pipe.gui.GuiFrame; | 17 | import pipe.gui.GuiFrame; |
256 | @@ -127,8 +128,7 @@ | |||
257 | 127 | String defaultName = String.format("New Petri net %1$d", frame | 128 | String defaultName = String.format("New Petri net %1$d", frame |
258 | 128 | .getNameCounter()); | 129 | .getNameCounter()); |
259 | 129 | nameTextBox = new JTextField(defaultName); | 130 | nameTextBox = new JTextField(defaultName); |
262 | 130 | Dimension size = new Dimension(330, 25); | 131 | SwingHelper.setPreferredWidth(nameTextBox,330); |
261 | 131 | nameTextBox.setPreferredSize(size); | ||
263 | 132 | gbc = new GridBagConstraints(); | 132 | gbc = new GridBagConstraints(); |
264 | 133 | gbc.gridx = 1; | 133 | gbc.gridx = 1; |
265 | 134 | gbc.gridy = 0; | 134 | gbc.gridy = 0; |
266 | 135 | 135 | ||
267 | === modified file 'src/pipe/gui/widgets/PlaceEditorPanel.java' | |||
268 | --- src/pipe/gui/widgets/PlaceEditorPanel.java 2020-08-10 09:34:06 +0000 | |||
269 | +++ src/pipe/gui/widgets/PlaceEditorPanel.java 2021-04-08 08:40:30 +0000 | |||
270 | @@ -25,6 +25,7 @@ | |||
271 | 25 | import dk.aau.cs.gui.TabContent; | 25 | import dk.aau.cs.gui.TabContent; |
272 | 26 | import net.tapaal.swinghelpers.CustomJSpinner; | 26 | import net.tapaal.swinghelpers.CustomJSpinner; |
273 | 27 | import net.tapaal.swinghelpers.GridBagHelper; | 27 | import net.tapaal.swinghelpers.GridBagHelper; |
274 | 28 | import net.tapaal.swinghelpers.SwingHelper; | ||
275 | 28 | import net.tapaal.swinghelpers.WidthAdjustingComboBox; | 29 | import net.tapaal.swinghelpers.WidthAdjustingComboBox; |
276 | 29 | import pipe.dataLayer.Template; | 30 | import pipe.dataLayer.Template; |
277 | 30 | import pipe.gui.CreateGui; | 31 | import pipe.gui.CreateGui; |
278 | @@ -251,11 +252,11 @@ | |||
279 | 251 | basicPropertiesPanel.add(nameLabel, gridBagConstraints); | 252 | basicPropertiesPanel.add(nameLabel, gridBagConstraints); |
280 | 252 | 253 | ||
281 | 253 | nameTextField = new javax.swing.JTextField(); | 254 | nameTextField = new javax.swing.JTextField(); |
283 | 254 | nameTextField.setPreferredSize(new Dimension(290,27)); | 255 | SwingHelper.setPreferredWidth(nameTextField,290); |
284 | 255 | 256 | ||
285 | 256 | sharedPlacesComboBox = new WidthAdjustingComboBox(maxNumberOfPlacesToShowAtOnce); | 257 | sharedPlacesComboBox = new WidthAdjustingComboBox(maxNumberOfPlacesToShowAtOnce); |
286 | 257 | 258 | ||
288 | 258 | sharedPlacesComboBox.setPreferredSize(new Dimension(290,27)); | 259 | SwingHelper.setPreferredWidth(sharedPlacesComboBox,290); |
289 | 259 | 260 | ||
290 | 260 | sharedPlacesComboBox.addItemListener(e -> { | 261 | sharedPlacesComboBox.addItemListener(e -> { |
291 | 261 | SharedPlace place = (SharedPlace)e.getItem(); | 262 | SharedPlace place = (SharedPlace)e.getItem(); |
292 | 262 | 263 | ||
293 | === modified file 'src/pipe/gui/widgets/TAPNTransitionEditor.java' | |||
294 | --- src/pipe/gui/widgets/TAPNTransitionEditor.java 2020-08-10 09:34:06 +0000 | |||
295 | +++ src/pipe/gui/widgets/TAPNTransitionEditor.java 2021-04-08 08:40:30 +0000 | |||
296 | @@ -18,6 +18,7 @@ | |||
297 | 18 | import javax.swing.event.CaretListener; | 18 | import javax.swing.event.CaretListener; |
298 | 19 | import net.tapaal.swinghelpers.GridBagHelper; | 19 | import net.tapaal.swinghelpers.GridBagHelper; |
299 | 20 | import dk.aau.cs.gui.undo.*; | 20 | import dk.aau.cs.gui.undo.*; |
300 | 21 | import net.tapaal.swinghelpers.SwingHelper; | ||
301 | 21 | import net.tapaal.swinghelpers.WidthAdjustingComboBox; | 22 | import net.tapaal.swinghelpers.WidthAdjustingComboBox; |
302 | 22 | import pipe.gui.CreateGui; | 23 | import pipe.gui.CreateGui; |
303 | 23 | import pipe.gui.graphicElements.tapn.TimedTransitionComponent; | 24 | import pipe.gui.graphicElements.tapn.TimedTransitionComponent; |
304 | @@ -66,7 +67,7 @@ | |||
305 | 66 | transitionEditorPanel = new JPanel(); | 67 | transitionEditorPanel = new JPanel(); |
306 | 67 | nameLabel = new JLabel(); | 68 | nameLabel = new JLabel(); |
307 | 68 | nameTextField = new JTextField(); | 69 | nameTextField = new JTextField(); |
309 | 69 | nameTextField.setPreferredSize(new Dimension(290,27)); | 70 | SwingHelper.setPreferredWidth(nameTextField, 290); |
310 | 70 | rotationLabel = new JLabel(); | 71 | rotationLabel = new JLabel(); |
311 | 71 | rotationComboBox = new JComboBox<>(); | 72 | rotationComboBox = new JComboBox<>(); |
312 | 72 | buttonPanel = new JPanel(); | 73 | buttonPanel = new JPanel(); |
313 | @@ -80,7 +81,7 @@ | |||
314 | 80 | 81 | ||
315 | 81 | 82 | ||
316 | 82 | sharedTransitionsComboBox = new WidthAdjustingComboBox<>(maxNumberOfTransitionsToShowAtOnce); | 83 | sharedTransitionsComboBox = new WidthAdjustingComboBox<>(maxNumberOfTransitionsToShowAtOnce); |
318 | 83 | sharedTransitionsComboBox.setPreferredSize(new Dimension(290,27)); | 84 | SwingHelper.setPreferredWidth(sharedTransitionsComboBox,290); |
319 | 84 | sharedTransitionsComboBox.addActionListener(e -> { | 85 | sharedTransitionsComboBox.addActionListener(e -> { |
320 | 85 | if(((SharedTransition)sharedTransitionsComboBox.getSelectedItem()).transitions().isEmpty()){ | 86 | if(((SharedTransition)sharedTransitionsComboBox.getSelectedItem()).transitions().isEmpty()){ |
321 | 86 | ((SharedTransition)sharedTransitionsComboBox.getSelectedItem()).setUrgent(urgentCheckBox.isSelected()); | 87 | ((SharedTransition)sharedTransitionsComboBox.getSelectedItem()).setUrgent(urgentCheckBox.isSelected()); |
Before merging, could you make a search for something like "new Dimension(" to see if you can find other places where this could be an issue.