Merge lp:~tapaal-contributor/tapaal/bug959196 into lp:tapaal

Proposed by Mathias Andersen
Status: Merged
Approved by: Kenneth Yrke Jørgensen
Approved revision: 699
Merged at revision: 701
Proposed branch: lp:~tapaal-contributor/tapaal/bug959196
Merge into: lp:tapaal
Diff against target: 136 lines (+44/-36)
2 files modified
src/pipe/gui/widgets/AnnotationPanel.java (+43/-36)
src/pipe/gui/widgets/ConstantsDialogPanel.java (+1/-0)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/bug959196
Reviewer Review Type Date Requested Status
Kenneth Yrke Jørgensen Approve
Jiri Srba Approve
Review via email: mp+104016@code.launchpad.net

Commit message

The buttons of the edit annotation dialog has been modified to have a look and feel similar to other dialogs.

Description of the change

The buttons of the edit annotation dialog has been modified to have a look and feel similar to other dialogs.

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) wrote :

Make new annotation, don't write anything and click "Cancel". The dialog is closed
but an empty square is created on the editing panel.

review: Needs Fixing
Revision history for this message
Jiri Srba (srba) wrote :

I will make a separate bug report for this. The branch improves the layout of the
buttons, so it can be merged to trunk and 2.1 now.

review: Approve
Revision history for this message
Kenneth Yrke Jørgensen (yrke) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/pipe/gui/widgets/AnnotationPanel.java'
2--- src/pipe/gui/widgets/AnnotationPanel.java 2011-09-23 21:23:31 +0000
3+++ src/pipe/gui/widgets/AnnotationPanel.java 2012-04-29 12:32:18 +0000
4@@ -1,8 +1,14 @@
5 package pipe.gui.widgets;
6
7 import java.awt.BorderLayout;
8+import java.awt.Color;
9 import java.awt.Dimension;
10+import java.awt.GridBagConstraints;
11+import java.awt.GridBagLayout;
12+import java.awt.Insets;
13+import java.awt.event.KeyEvent;
14
15+import javax.swing.JPanel;
16 import javax.swing.JSplitPane;
17
18 import pipe.gui.graphicElements.AnnotationNote;
19@@ -41,6 +47,10 @@
20 // <editor-fold defaultstate="collapsed"
21 // desc=" Generated Code ">//GEN-BEGIN:initComponents
22 private void initComponents() {
23+ JPanel container;
24+ container = new JPanel();
25+ container.setLayout(new GridBagLayout());
26+
27 java.awt.GridBagConstraints gridBagConstraints;
28
29 panel = new javax.swing.JPanel();
30@@ -66,11 +76,11 @@
31 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
32 gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
33 buttonPanel.setLayout(new java.awt.GridBagLayout());
34-
35 okButton.setText("OK");
36- okButton.setMaximumSize(new java.awt.Dimension(75, 25));
37- okButton.setMinimumSize(new java.awt.Dimension(75, 25));
38- okButton.setPreferredSize(new java.awt.Dimension(75, 25));
39+ okButton.setMaximumSize(new java.awt.Dimension(100, 25));
40+ okButton.setMinimumSize(new java.awt.Dimension(100, 25));
41+ okButton.setPreferredSize(new java.awt.Dimension(100, 25));
42+ okButton.setMnemonic(KeyEvent.VK_O);
43 okButton.addActionListener(new java.awt.event.ActionListener() {
44 public void actionPerformed(java.awt.event.ActionEvent evt) {
45 okButtonActionPerformed(evt);
46@@ -78,50 +88,47 @@
47 });
48
49 gridBagConstraints = new java.awt.GridBagConstraints();
50- gridBagConstraints.gridx = 6;
51+ gridBagConstraints.gridx = 1;
52 gridBagConstraints.gridy = 0;
53- gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
54- gridBagConstraints.insets = new java.awt.Insets(6, 6, 6, 6);
55+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
56+ gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
57 buttonPanel.add(okButton, gridBagConstraints);
58-
59+
60 cancelButton.setText("Cancel");
61- cancelButton.setMaximumSize(new java.awt.Dimension(75, 25));
62- cancelButton.setMinimumSize(new java.awt.Dimension(75, 25));
63- cancelButton.setPreferredSize(new java.awt.Dimension(75, 25));
64+ cancelButton.setMaximumSize(new java.awt.Dimension(100, 25));
65+ cancelButton.setMinimumSize(new java.awt.Dimension(100, 25));
66+ cancelButton.setPreferredSize(new java.awt.Dimension(100, 25));
67+ cancelButton.setMnemonic(KeyEvent.VK_C);
68 cancelButton.addActionListener(new java.awt.event.ActionListener() {
69 public void actionPerformed(java.awt.event.ActionEvent evt) {
70 cancelButtonActionPerformed(evt);
71 }
72 });
73-
74 gridBagConstraints = new java.awt.GridBagConstraints();
75+ gridBagConstraints.gridx = 0;
76+ gridBagConstraints.gridy = 0;
77+ gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE;
78 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
79 gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 6);
80 buttonPanel.add(cancelButton, gridBagConstraints);
81-
82- JSplitPaneFix split = new JSplitPaneFix(JSplitPane.VERTICAL_SPLIT,
83- panel, buttonPanel) {
84- /**
85- *
86- */
87- private static final long serialVersionUID = -3436043116983340340L;
88-
89- @Override
90- public int getMinimumDividerLocation() {
91- return lastDividerLocation;
92- }
93-
94- @Override
95- public int getMaximumDividerLocation() {
96- return lastDividerLocation;
97- }
98- };
99- split.setResizeWeight(1.0);
100- split.setDividerLocation(0.88);
101- split.setContinuousLayout(true);
102- split.setDividerSize(0);
103- add(split);
104- this.setPreferredSize(new Dimension(400, 300));
105+
106+ GridBagConstraints gbc = new GridBagConstraints();
107+ gbc.gridx = 0;
108+ gbc.gridy = 0;
109+ gbc.weightx = 3;
110+ gbc.weighty= 3;
111+ gbc.gridwidth = 2;
112+ gbc.fill = GridBagConstraints.BOTH;
113+ container.add(panel,gbc);
114+
115+ gbc = new GridBagConstraints();
116+ gbc.gridx = 1;
117+ gbc.gridy = 1;
118+ gbc.gridwidth = 1;
119+ gbc.anchor = GridBagConstraints.EAST;
120+ container.add(buttonPanel,gbc);
121+
122+ add(container); this.setPreferredSize(new Dimension(400, 300));
123 }// </editor-fold>//GEN-END:initComponents
124
125 private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_cancelButtonActionPerformed
126
127=== modified file 'src/pipe/gui/widgets/ConstantsDialogPanel.java'
128--- src/pipe/gui/widgets/ConstantsDialogPanel.java 2012-02-28 21:26:27 +0000
129+++ src/pipe/gui/widgets/ConstantsDialogPanel.java 2012-04-29 12:32:18 +0000
130@@ -1,5 +1,6 @@
131 package pipe.gui.widgets;
132
133+import java.awt.Color;
134 import java.awt.Dimension;
135 import java.awt.GridBagConstraints;
136 import java.awt.GridBagLayout;

Subscribers

People subscribed via source and target branches