Changeset 34005 in osm for applications/editors/josm/plugins/indoorhelper/src/views
- Timestamp:
- 2018-01-13T18:19:22+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/indoorhelper/src/views
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/indoorhelper/src/views/DialogPanel.java
r32637 r34005 68 68 powerButton = new JToggleButton(); 69 69 levelLabel = new JLabel(); 70 levelBox = new JosmComboBox< String>();70 levelBox = new JosmComboBox<>(); 71 71 levelTagLabel = new JLabel(); 72 72 levelTagField = new DisableShortcutsOnFocusGainedTextField(); … … 88 88 89 89 //======== dialogPane ======== 90 { 91 this.setBorder(new EmptyBorder(12, 12, 12, 12)); 92 this.setLayout(new BorderLayout()); 93 94 //======== contentPanel ======== 95 { 96 contentPanel.setLayout(new GridBagLayout()); 97 ((GridBagLayout) contentPanel.getLayout()).columnWidths = new int[] { 98 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 99 ((GridBagLayout) contentPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0, 0, 0}; 100 ((GridBagLayout) contentPanel.getLayout()).columnWeights = new double[] { 101 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; 102 ((GridBagLayout) contentPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; 103 104 //---- powerButton ---- 105 powerButton.setText(tr("POWER")); 106 powerButton.setToolTipText(tr("Activates the plug-in")); 107 contentPanel.add(powerButton, new GridBagConstraints(8, 0, 4, 1, 0.0, 0.0, 108 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 109 new Insets(0, 0, 5, 5), 0, 0)); 110 contentPanel.add(separator1, new GridBagConstraints(1, 1, 12, 1, 0.0, 0.0, 111 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 112 new Insets(0, 0, 5, 5), 0, 0)); 113 114 //---- levelLabel ---- 115 levelLabel.setText(tr("Working Level")); 116 contentPanel.add(levelLabel, new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0, 117 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 118 new Insets(0, 0, 5, 5), 0, 0)); 119 120 //---- levelBox ---- 121 levelBox.setEnabled(false); 122 levelBox.setEditable(false); 123 levelBox.setToolTipText(tr("Selects the working level.")); 124 contentPanel.add(levelBox, new GridBagConstraints(3, 2, 3, 1, 0.0, 0.0, 125 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 126 new Insets(0, 0, 5, 5), 0, 0)); 127 128 //---- levelTagLabel ---- 129 levelTagLabel.setText(tr("Level Name")); 130 contentPanel.add(levelTagLabel, new GridBagConstraints(7, 2, 1, 1, 0.0, 0.0, 131 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 132 new Insets(0, 0, 5, 5), 0, 0)); 133 134 //---- levelTagField ---- 135 levelTagField.setEnabled(false); 136 levelTagField.setColumns(6); 137 levelTagField.setToolTipText(tr("Optional name-tag for a level.")); 138 contentPanel.add(levelTagField, new GridBagConstraints(8, 2, 5, 1, 0.0, 0.0, 139 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 140 new Insets(0, 0, 5, 5), 0, 0)); 141 contentPanel.add(separator2, new GridBagConstraints(1, 3, 12, 1, 0.0, 0.0, 142 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 143 new Insets(0, 0, 5, 5), 0, 0)); 144 145 //---- objectLabel ---- 146 objectLabel.setText(tr("Object")); 147 contentPanel.add(objectLabel, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0, 148 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 149 new Insets(0, 0, 5, 5), 0, 0)); 150 151 //---- objectBox ---- 152 objectBox.setEnabled(false); 153 objectBox.setPrototypeDisplayValue(IndoorObject.CONCRETE_WALL); 154 objectBox.setToolTipText(tr("The object preset you want to tag.")); 155 contentPanel.add(objectBox, new GridBagConstraints(3, 4, 3, 1, 0.0, 0.0, 156 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 157 new Insets(0, 0, 5, 5), 0, 0)); 158 159 //---- nameLabel ---- 160 nameLabel.setText(tr("Name")); 161 contentPanel.add(nameLabel, new GridBagConstraints(0, 5, 3, 1, 0.0, 0.0, 162 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 163 new Insets(0, 0, 5, 5), 0, 0)); 164 165 //---- nameField ---- 166 nameField.setEnabled(false); 167 nameField.addFocusListener(new FocusListener() { 168 169 @Override 170 public void focusLost(FocusEvent e) {} 171 172 @Override 173 public void focusGained(FocusEvent e) { 174 nameField.selectAll(); 175 } 176 }); 177 nameField.setToolTipText(tr("Sets the name tag when the room-object is selected.")); 178 contentPanel.add(nameField, new GridBagConstraints(3, 5, 3, 1, 0.0, 0.0, 179 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 180 new Insets(0, 0, 5, 5), 0, 0)); 181 182 //---- refLabel ---- 183 refLabel.setText(tr("Reference")); 184 contentPanel.add(refLabel, new GridBagConstraints(0, 6, 3, 1, 0.0, 0.0, 185 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 186 new Insets(0, 0, 0, 5), 0, 0)); 187 188 //---- refField ---- 189 refField.setEnabled(false); 190 refField.addFocusListener(new FocusListener() { 191 192 @Override 193 public void focusLost(FocusEvent e) {} 194 195 @Override 196 public void focusGained(FocusEvent e) { 197 refField.selectAll(); 198 } 199 }); 200 refField.setToolTipText(tr("Sets the ref tag when the room-object is selected.")); 201 contentPanel.add(refField, new GridBagConstraints(3, 6, 3, 1, 0.0, 0.0, 202 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 203 new Insets(0, 0, 0, 5), 0, 0)); 90 91 this.setBorder(new EmptyBorder(12, 12, 12, 12)); 92 this.setLayout(new BorderLayout()); 93 94 //======== contentPanel ======== 95 96 contentPanel.setLayout(new GridBagLayout()); 97 ((GridBagLayout) contentPanel.getLayout()).columnWidths = new int[] { 98 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 99 ((GridBagLayout) contentPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0, 0, 0}; 100 ((GridBagLayout) contentPanel.getLayout()).columnWeights = new double[] { 101 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 102 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; 103 ((GridBagLayout) contentPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; 104 105 //---- powerButton ---- 106 powerButton.setText(tr("POWER")); 107 powerButton.setToolTipText(tr("Activates the plug-in")); 108 contentPanel.add(powerButton, new GridBagConstraints(8, 0, 4, 1, 0.0, 0.0, 109 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 110 new Insets(0, 0, 5, 5), 0, 0)); 111 contentPanel.add(separator1, new GridBagConstraints(1, 1, 12, 1, 0.0, 0.0, 112 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 113 new Insets(0, 0, 5, 5), 0, 0)); 114 115 //---- levelLabel ---- 116 levelLabel.setText(tr("Working Level")); 117 contentPanel.add(levelLabel, new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0, 118 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 119 new Insets(0, 0, 5, 5), 0, 0)); 120 121 //---- levelBox ---- 122 levelBox.setEnabled(false); 123 levelBox.setEditable(false); 124 levelBox.setToolTipText(tr("Selects the working level.")); 125 contentPanel.add(levelBox, new GridBagConstraints(3, 2, 3, 1, 0.0, 0.0, 126 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 127 new Insets(0, 0, 5, 5), 0, 0)); 128 129 //---- levelTagLabel ---- 130 levelTagLabel.setText(tr("Level Name")); 131 contentPanel.add(levelTagLabel, new GridBagConstraints(7, 2, 1, 1, 0.0, 0.0, 132 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 133 new Insets(0, 0, 5, 5), 0, 0)); 134 135 //---- levelTagField ---- 136 levelTagField.setEnabled(false); 137 levelTagField.setColumns(6); 138 levelTagField.setToolTipText(tr("Optional name-tag for a level.")); 139 contentPanel.add(levelTagField, new GridBagConstraints(8, 2, 5, 1, 0.0, 0.0, 140 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 141 new Insets(0, 0, 5, 5), 0, 0)); 142 contentPanel.add(separator2, new GridBagConstraints(1, 3, 12, 1, 0.0, 0.0, 143 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 144 new Insets(0, 0, 5, 5), 0, 0)); 145 146 //---- objectLabel ---- 147 objectLabel.setText(tr("Object")); 148 contentPanel.add(objectLabel, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0, 149 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 150 new Insets(0, 0, 5, 5), 0, 0)); 151 152 //---- objectBox ---- 153 objectBox.setEnabled(false); 154 objectBox.setPrototypeDisplayValue(IndoorObject.CONCRETE_WALL); 155 objectBox.setToolTipText(tr("The object preset you want to tag.")); 156 contentPanel.add(objectBox, new GridBagConstraints(3, 4, 3, 1, 0.0, 0.0, 157 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 158 new Insets(0, 0, 5, 5), 0, 0)); 159 160 //---- nameLabel ---- 161 nameLabel.setText(tr("Name")); 162 contentPanel.add(nameLabel, new GridBagConstraints(0, 5, 3, 1, 0.0, 0.0, 163 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 164 new Insets(0, 0, 5, 5), 0, 0)); 165 166 //---- nameField ---- 167 nameField.setEnabled(false); 168 nameField.addFocusListener(new FocusListener() { 169 170 @Override 171 public void focusLost(FocusEvent e) {} 172 173 @Override 174 public void focusGained(FocusEvent e) { 175 nameField.selectAll(); 204 176 } 205 this.add(contentPanel, BorderLayout.CENTER); 206 207 //======== buttonBar ======== 208 { 209 buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); 210 buttonBar.setLayout(new GridBagLayout()); 211 ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 80}; 212 ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0}; 213 214 //---- applyButton ---- 215 applyButton.setText(tr("Apply Tags")); 216 applyButton.setEnabled(false); 217 buttonBar.add(applyButton, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, 218 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 219 new Insets(0, 0, 0, 0), 0, 0)); 177 }); 178 nameField.setToolTipText(tr("Sets the name tag when the room-object is selected.")); 179 contentPanel.add(nameField, new GridBagConstraints(3, 5, 3, 1, 0.0, 0.0, 180 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 181 new Insets(0, 0, 5, 5), 0, 0)); 182 183 //---- refLabel ---- 184 refLabel.setText(tr("Reference")); 185 contentPanel.add(refLabel, new GridBagConstraints(0, 6, 3, 1, 0.0, 0.0, 186 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 187 new Insets(0, 0, 0, 5), 0, 0)); 188 189 //---- refField ---- 190 refField.setEnabled(false); 191 refField.addFocusListener(new FocusListener() { 192 193 @Override 194 public void focusLost(FocusEvent e) {} 195 196 @Override 197 public void focusGained(FocusEvent e) { 198 refField.selectAll(); 220 199 } 221 this.add(buttonBar, BorderLayout.SOUTH); 222 } 200 }); 201 refField.setToolTipText(tr("Sets the ref tag when the room-object is selected.")); 202 contentPanel.add(refField, new GridBagConstraints(3, 6, 3, 1, 0.0, 0.0, 203 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 204 new Insets(0, 0, 0, 5), 0, 0)); 205 206 this.add(contentPanel, BorderLayout.CENTER); 207 208 //======== buttonBar ======== 209 210 buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); 211 buttonBar.setLayout(new GridBagLayout()); 212 ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 80}; 213 ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0}; 214 215 //---- applyButton ---- 216 applyButton.setText(tr("Apply Tags")); 217 applyButton.setEnabled(false); 218 buttonBar.add(applyButton, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, 219 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 220 new Insets(0, 0, 0, 0), 0, 0)); 221 222 this.add(buttonBar, BorderLayout.SOUTH); 223 223 } 224 225 224 } -
applications/editors/josm/plugins/indoorhelper/src/views/FittingView.java
r32637 r34005 68 68 69 69 //======== dialogPane ======== 70 {71 dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));72 dialogPane.setLayout(new BorderLayout());73 70 74 //======== contentPanel ======== 75 { 76 contentPanel.setLayout(new FlowLayout()); 71 dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12)); 72 dialogPane.setLayout(new BorderLayout()); 77 73 78 //---- label1 ---- 79 label1.setText(tr("<html>Please mind to start fitting your building-plans now.<br>" + 80 "To do so, use the PicLayer plug-in, which you can install<br>" + 81 "using the JOSM plug-in management.</html>")); 82 contentPanel.add(label1); 83 } 84 dialogPane.add(contentPanel, BorderLayout.CENTER); 74 //======== contentPanel ======== 85 75 86 //======== buttonBar ======== 87 { 88 buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); 89 buttonBar.setLayout(new GridBagLayout()); 90 ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 80}; 91 ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0}; 76 contentPanel.setLayout(new FlowLayout()); 92 77 93 //---- okButton ---- 94 okButton.setText(tr("OK")); 95 buttonBar.add(okButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, 96 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 97 new Insets(0, 0, 0, 0), 0, 0)); 98 } 99 dialogPane.add(buttonBar, BorderLayout.SOUTH); 100 } 78 //---- label1 ---- 79 label1.setText(tr("<html>Please mind to start fitting your building-plans now.<br>" + 80 "To do so, use the PicLayer plug-in, which you can install<br>" + 81 "using the JOSM plug-in management.</html>")); 82 contentPanel.add(label1); 83 84 dialogPane.add(contentPanel, BorderLayout.CENTER); 85 86 //======== buttonBar ======== 87 88 buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); 89 buttonBar.setLayout(new GridBagLayout()); 90 ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 80}; 91 ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0}; 92 93 //---- okButton ---- 94 okButton.setText(tr("OK")); 95 buttonBar.add(okButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, 96 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 97 new Insets(0, 0, 0, 0), 0, 0)); 98 99 dialogPane.add(buttonBar, BorderLayout.SOUTH); 100 101 101 contentPane.add(dialogPane, BorderLayout.CENTER); 102 102 pack(); -
applications/editors/josm/plugins/indoorhelper/src/views/LevelSelectorView.java
r33997 r34005 46 46 public class LevelSelectorView extends JFrame { 47 47 48 49 48 private static final long serialVersionUID = 1L; 49 private JPanel dialogPane; 50 50 private JPanel contentPanel; 51 51 private JPanel infoBar; … … 78 78 79 79 //======== dialogPane ======== 80 {81 dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));82 dialogPane.setLayout(new BorderLayout());83 80 81 dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12)); 82 dialogPane.setLayout(new BorderLayout()); 84 83 85 //======== infoBar ======== 86 { 84 //======== infoBar ======== 87 85 88 //---- Label1 ---- 89 label1.setText(tr("<html> Please insert the new level number you want to add.<br> " 90 + " <i>Info</i>: <br> If the OK button got pressed you will switch to the drawing action.<br>" 91 + "To finish the new object please press the spacebar. The new level<br>will be tagged automatically. </html>")); 92 infoBar.add(label1); 93 } 94 dialogPane.add(infoBar,BorderLayout.NORTH); 86 //---- Label1 ---- 87 label1.setText(tr("<html> Please insert the new level number you want to add.<br> " 88 + " <i>Info</i>: <br> If the OK button got pressed you will switch to the drawing action.<br>" 89 + "To finish the new object please press the spacebar. The new level<br>will be tagged automatically. </html>")); 90 infoBar.add(label1); 91 dialogPane.add(infoBar, BorderLayout.NORTH); 95 92 93 //======== contentPanel ======== 96 94 97 //======== contentPanel ======== 98 { 99 contentPanel.setLayout(new GridBagLayout()); 100 ((GridBagLayout) contentPanel.getLayout()).columnWidths = new int[] {0, 0, 0, 0, 0}; 101 ((GridBagLayout) contentPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0}; 102 ((GridBagLayout) contentPanel.getLayout()).columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 1.0E-4}; 103 ((GridBagLayout) contentPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; 95 contentPanel.setLayout(new GridBagLayout()); 96 ((GridBagLayout) contentPanel.getLayout()).columnWidths = new int[] {0, 0, 0, 0, 0}; 97 ((GridBagLayout) contentPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0}; 98 ((GridBagLayout) contentPanel.getLayout()).columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 1.0E-4}; 99 ((GridBagLayout) contentPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; 104 100 101 //---- Label2 ---- 102 label2.setText(tr("level number:")); 103 contentPanel.add(label2, new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, 104 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 105 new Insets(5, 5, 5, 30), 0, 0)); 105 106 106 //---- Label2 ---- 107 label2.setText(tr("level number:")); 108 contentPanel.add(label2,new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, 109 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 110 new Insets(5, 5, 5, 30), 0, 0)); 107 //---- Field ---- 108 field.setToolTipText(tr("Example: '2' or '3'")); 109 field.addFocusListener(new FocusListener() { 111 110 112 //---- Field ---- 113 field.setToolTipText(tr("Example: '2' or '3'")); 114 field.addFocusListener(new FocusListener() { 111 @Override 112 public void focusLost(FocusEvent e) {} 115 113 116 @Override 117 public void focusLost(FocusEvent e) {} 114 @Override 115 public void focusGained(FocusEvent e) { 116 field.selectAll(); 117 } 118 }); 119 contentPanel.add(field, new GridBagConstraints(3, 0, 2, 1, 0.0, 0.0, 120 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 121 new Insets(5, 0, 5, 200), 0, 0)); 118 122 119 @Override 120 public void focusGained(FocusEvent e) { 121 field.selectAll(); 122 } 123 }); 124 contentPanel.add(field, new GridBagConstraints(3, 0, 2, 1, 0.0, 0.0, 125 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 126 new Insets(5, 0, 5, 200), 0, 0)); 123 dialogPane.add(contentPanel, BorderLayout.CENTER); 127 124 128 } 129 dialogPane.add(contentPanel, BorderLayout.CENTER); 125 //======== buttonBar ======== 130 126 131 //======== buttonBar ======== 132 { 133 buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); 134 buttonBar.setLayout(new GridBagLayout()); 135 ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 85, 80}; 136 ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0, 0.0}; 127 buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); 128 buttonBar.setLayout(new GridBagLayout()); 129 ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 85, 80}; 130 ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0, 0.0}; 137 131 138 139 140 141 142 132 //---- okButton ---- 133 okButton.setText(tr("OK")); 134 buttonBar.add(okButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, 135 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 136 new Insets(0, 0, 0, 5), 0, 0)); 143 137 144 145 146 147 148 149 } 150 151 } 138 //---- Button ---- 139 cancelButton.setText(tr("Cancel")); 140 buttonBar.add(cancelButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, 141 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 142 new Insets(0, 0, 0, 0), 0, 0)); 143 144 dialogPane.add(buttonBar, BorderLayout.SOUTH); 145 152 146 contentPane.add(dialogPane, BorderLayout.CENTER); 153 147 pack(); 154 148 setLocationRelativeTo(getOwner()); 155 156 149 } 157 150 158 /*************************************************159 * GETTER160 *161 */162 151 /** 163 152 * Getter for the level number field. … … 169 158 } 170 159 171 /************************************************* 172 * SELECTOR VIEW LISTENER 173 * 174 */ 175 176 /** 160 /** 177 161 * Set the listener for the OK button. 178 162 * … … 183 167 } 184 168 185 169 /** 186 170 * Set the listener for the Cancel button. 187 171 * … … 198 182 */ 199 183 public void setSelectorWindowListener(WindowListener l) { 200 184 this.addWindowListener(l); 201 185 } 202 203 /**204 *205 *206 *207 *208 *209 *210 *211 *212 */213 186 } -
applications/editors/josm/plugins/indoorhelper/src/views/PresetButton.java
r33997 r34005 29 29 * 30 30 */ 31 32 31 @SuppressWarnings("serial") 33 32 class PresetButton extends JButton { … … 48 47 this.setToolTipText("Fast Tag: "+indoorObject.toString()); 49 48 } 50 51 52 /**53 *54 *55 *56 *57 *58 *59 *60 *61 */62 49 } -
applications/editors/josm/plugins/indoorhelper/src/views/ToolBoxView.java
r33997 r34005 57 57 @SuppressWarnings("serial") 58 58 public class ToolBoxView extends ToggleDialog { 59 private JPanel dialogPanel; 60 private JPanel contentPanel; 61 private JLabel levelLabel; 62 private JCheckBox levelCheckBox; 63 private JLabel levelNameLabel; 64 private DisableShortcutsOnFocusGainedTextField levelNameField; 65 private JLabel repeatOnLabel; 66 private DisableShortcutsOnFocusGainedTextField repeatOnField; 67 private JLabel objectLabel; 68 private JosmComboBox<TagCatalog.IndoorObject> objectBox; 69 private JLabel nameLabel; 70 private DisableShortcutsOnFocusGainedTextField nameField; 71 private JLabel refLabel; 72 private DisableShortcutsOnFocusGainedTextField refField; 73 private JLabel multiLabel; 74 private JButton multiOuterButton; 75 private JButton multiInnerButton; 76 private JCheckBox multiCheckBox; 77 private JPanel buttonBar; 78 private JButton applyButton; 79 private JSeparator separator1; 80 private JSeparator separator2; 81 private PresetButton preset1; 82 private PresetButton preset2; 83 private PresetButton preset3; 84 private PresetButton preset4; 85 private JButton addLevelButton; 86 private JButton helpButton; 87 59 private JPanel dialogPanel; 60 private JPanel contentPanel; 61 private JLabel levelLabel; 62 private JCheckBox levelCheckBox; 63 private JLabel levelNameLabel; 64 private DisableShortcutsOnFocusGainedTextField levelNameField; 65 private JLabel repeatOnLabel; 66 private DisableShortcutsOnFocusGainedTextField repeatOnField; 67 private JLabel objectLabel; 68 private JosmComboBox<TagCatalog.IndoorObject> objectBox; 69 private JLabel nameLabel; 70 private DisableShortcutsOnFocusGainedTextField nameField; 71 private JLabel refLabel; 72 private DisableShortcutsOnFocusGainedTextField refField; 73 private JLabel multiLabel; 74 private JButton multiOuterButton; 75 private JButton multiInnerButton; 76 private JCheckBox multiCheckBox; 77 private JPanel buttonBar; 78 private JButton applyButton; 79 private JSeparator separator1; 80 private JSeparator separator2; 81 private PresetButton preset1; 82 private PresetButton preset2; 83 private PresetButton preset3; 84 private PresetButton preset4; 85 private JButton addLevelButton; 86 private JButton helpButton; 88 87 89 88 public ToolBoxView() { … … 94 93 } 95 94 96 /*************************************************97 * CREATES THE LAYOUT OF THE PLUG-IN.98 *99 */100 95 private void initComponents() { 101 96 dialogPanel = new JPanel(); … … 133 128 134 129 //======== dialogPane ======== 135 { 136 dialogPanel.setBorder(new EmptyBorder(12, 12, 12, 12)); 137 dialogPanel.setLayout(new BorderLayout()); 138 139 //======== contentPanel ======== 140 { 141 contentPanel.setLayout(new GridBagLayout()); 142 ((GridBagLayout) contentPanel.getLayout()).columnWidths = new int[] { 143 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 144 ((GridBagLayout) contentPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0, 0, 0}; 145 ((GridBagLayout) contentPanel.getLayout()).columnWeights = new double[] { 146 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; 147 ((GridBagLayout) contentPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; 148 149 150 //---- addLevelButton ---- 151 addLevelButton.setText(tr("Insert level")); 152 addLevelButton.setToolTipText(tr("Add a new level to layer.")); 153 addLevelButton.setEnabled(false); 154 contentPanel.add(addLevelButton, new GridBagConstraints(12, 1, 3, 1, 0.0, 1.0, 155 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 156 new Insets(0, 0, 5, 30), 0, 0)); 157 158 //---- helpButton ---- 159 helpButton.setText(tr("<html><b>?</strong></b>")); 160 helpButton.setToolTipText(tr("Show Help-Browser.")); 161 helpButton.setBackground(Color.LIGHT_GRAY); 162 helpButton.setEnabled(false); 163 contentPanel.add(helpButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, 164 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 165 new Insets(0, 0, 5, 0), 0, 0)); 166 167 //---- levelNameLabel ---- 168 levelNameLabel.setText(tr("Level name")); 169 contentPanel.add(levelNameLabel, new GridBagConstraints(0, 1, 3, 1, 0.0, 1.0, 170 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 171 new Insets(0, 0, 5, 5), 0, 0)); 172 173 //---- levelNameField ---- 174 levelNameField.setEnabled(false); 175 levelNameField.setToolTipText(tr("Sets optional name tag for a level.")); 176 contentPanel.add(levelNameField, new GridBagConstraints(3, 1, 3, 1, 0.0, 1.0, 177 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 178 new Insets(0, 0, 5, 30), 0, 0)); 179 180 //---- levelLabel ---- 181 levelLabel.setText(tr("Working level: NONE")); 182 levelLabel.setToolTipText(tr("Shows the current working level.")); 183 contentPanel.add(levelLabel, new GridBagConstraints(6, 1, 3, 1, 0.0, 1.0, 184 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 185 new Insets(0, 0, 5, 5), 0, 0)); 186 187 //---- levelCheckBox ---- 188 levelCheckBox.setToolTipText(tr("Deactivate automatic level tagging.")); 189 contentPanel.add(levelCheckBox, new GridBagConstraints(9, 1, 1, 1, 0.0, 1.0, 190 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 191 new Insets(0, 0, 5, 5), 0, 0)); 192 contentPanel.add(separator1, new GridBagConstraints(0, 2, 0, 1, 0.0, 0.0, 193 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 194 new Insets(0, 0, 5, 5), 0, 0)); 195 196 //---- objectLabel ---- 197 objectLabel.setText(tr("Object")); 198 contentPanel.add(objectLabel, new GridBagConstraints(0, 3, 3, 1, 0.0, 1.0, 199 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 200 new Insets(0, 0, 5, 5), 0, 0)); 201 202 //---- objectBox ---- 203 objectBox.setEnabled(false); 204 objectBox.setPrototypeDisplayValue(IndoorObject.CONCRETE_WALL); 205 objectBox.setToolTipText(tr("The object preset you want to tag.")); 206 contentPanel.add(objectBox, new GridBagConstraints(3, 3, 3, 1, 0.0, 1.0, 207 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 208 new Insets(0, 0, 5, 30), 0, 0)); 209 210 //---- nameLabel ---- 211 nameLabel.setText(tr("Name")); 212 contentPanel.add(nameLabel, new GridBagConstraints(0, 4, 3, 1, 0.0, 1.0, 213 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 214 new Insets(0, 0, 5, 5), 0, 0)); 215 216 //---- nameField ---- 217 nameField.setEnabled(false); 218 nameField.addFocusListener(new FocusListener() { 219 220 @Override 221 public void focusLost(FocusEvent e) {} 222 223 @Override 224 public void focusGained(FocusEvent e) { 225 nameField.selectAll(); 226 } 227 }); 228 nameField.setToolTipText(tr("Sets the name tag.")); 229 contentPanel.add(nameField, new GridBagConstraints(3, 4, 3, 1, 0.0, 1.0, 230 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 231 new Insets(0, 0, 5, 30), 0, 0)); 232 233 //---- refLabel ---- 234 refLabel.setText(tr("Reference")); 235 contentPanel.add(refLabel, new GridBagConstraints(0, 5, 3, 1, 0.0, 1.0, 236 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 237 new Insets(0, 0, 5, 5), 0, 0)); 238 239 //---- refField ---- 240 refField.setEnabled(false); 241 refField.addFocusListener(new FocusListener() { 242 243 @Override 244 public void focusLost(FocusEvent e) {} 245 246 @Override 247 public void focusGained(FocusEvent e) { 248 refField.selectAll(); 249 } 250 }); 251 refField.setToolTipText(tr("Sets the referance tag.")); 252 contentPanel.add(refField, new GridBagConstraints(3, 5, 3, 1, 0.0, 1.0, 253 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 254 new Insets(0, 0, 5, 30), 0, 0)); 255 256 //---- repeatOnLabel ---- 257 repeatOnLabel.setText(tr("Repeat on")); 258 contentPanel.add(repeatOnLabel, new GridBagConstraints(0, 6, 3, 1, 0.0, 1.0, 259 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 260 new Insets(0, 0, 5, 5), 0, 0)); 261 262 //---- repeatOnField ---- 263 repeatOnField.setEnabled(false); 264 repeatOnField.addFocusListener(new FocusListener() { 265 266 @Override 267 public void focusLost(FocusEvent e) {} 268 269 @Override 270 public void focusGained(FocusEvent e) { 271 repeatOnField.selectAll(); 272 } 273 }); 274 repeatOnField.setToolTipText(tr("Sets the repeat on tag when highway objects are selected. Please tag like this: -3-4 or -2--3 or 5-6 .")); 275 contentPanel.add(repeatOnField, new GridBagConstraints(3, 6, 3, 1, 0.0, 1.0, 276 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 277 new Insets(0, 0, 5, 30), 0, 0)); 278 contentPanel.add(separator2, new GridBagConstraints(0, 7, 0, 1, 0.0, 1.0, 279 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 280 new Insets(0, 0, 5, 5), 0, 0)); 281 282 //---- preset1 ---- 283 preset1.setEnabled(false); 284 contentPanel.add(preset1, new GridBagConstraints(6, 3, 1, 1, 0.0, 0.0, 285 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 286 new Insets(0, 0, 5, 5), 0, 0)); 287 //---- preset2 ---- 288 preset2.setEnabled(false); 289 contentPanel.add(preset2, new GridBagConstraints(6, 4, 1, 1, 0.0, 0.0, 290 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 291 new Insets(0, 0, 5, 5), 0, 0)); 292 293 //---- preset3 ---- 294 preset3.setEnabled(false); 295 contentPanel.add(preset3, new GridBagConstraints(6, 5, 1, 1, 0.0, 0.0, 296 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 297 new Insets(0, 0, 5, 5), 0, 0)); 298 299 //---- preset4 ---- 300 preset4.setEnabled(false); 301 contentPanel.add(preset4, new GridBagConstraints(6, 6, 1, 1, 0.0, 0.0, 302 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 303 new Insets(0, 0, 5, 5), 0, 0)); 304 305 //---- multiLabel ---- 306 multiLabel.setText(tr("Multipolygon")); 307 contentPanel.add(multiLabel, new GridBagConstraints(0, 8, 3, 1, 0.0, 1.0, 308 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 309 new Insets(0, 0, 5, 5), 0, 0)); 310 311 //---- multiOuterButton ---- 312 multiOuterButton.setText(tr("OUTER")); 313 multiOuterButton.setToolTipText(tr("Creation-Tool for multipolygon with role: outer. To finish press the spacebar.")); 314 multiOuterButton.setEnabled(false); 315 contentPanel.add(multiOuterButton, new GridBagConstraints(3, 8, 3, 1, 0.0, 1.0, 316 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 317 new Insets(0, 0, 5, 30), 0, 0)); 318 319 //---- multiInnerButton ---- 320 multiInnerButton.setText(tr("INNER")); 321 multiInnerButton.setToolTipText(tr("Creation-Tool for multipolygons with role: inner. To finish press spacebar. To add to relation select \"outer\" and press enter.")); 322 multiInnerButton.setEnabled(false); 323 contentPanel.add(multiInnerButton, new GridBagConstraints(6, 8, 1, 1, 0.0, 0.0, 324 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 325 new Insets(0, 0, 5, 5), 0, 0)); 326 327 //---- multiCheckBox ---- 328 multiCheckBox.setToolTipText(tr("Deactivate multipolygon function.")); 329 contentPanel.add(multiCheckBox, new GridBagConstraints(9, 8, 1, 1, 0.0, 1.0, 330 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 331 new Insets(0, 0, 5, 5), 0, 0)); 130 131 dialogPanel.setBorder(new EmptyBorder(12, 12, 12, 12)); 132 dialogPanel.setLayout(new BorderLayout()); 133 134 //======== contentPanel ======== 135 136 contentPanel.setLayout(new GridBagLayout()); 137 ((GridBagLayout) contentPanel.getLayout()).columnWidths = new int[] { 138 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 139 ((GridBagLayout) contentPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0, 0, 0}; 140 ((GridBagLayout) contentPanel.getLayout()).columnWeights = new double[] { 141 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 142 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; 143 ((GridBagLayout) contentPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; 144 145 //---- addLevelButton ---- 146 addLevelButton.setText(tr("Insert level")); 147 addLevelButton.setToolTipText(tr("Add a new level to layer.")); 148 addLevelButton.setEnabled(false); 149 contentPanel.add(addLevelButton, new GridBagConstraints(12, 1, 3, 1, 0.0, 1.0, 150 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 151 new Insets(0, 0, 5, 30), 0, 0)); 152 153 //---- helpButton ---- 154 helpButton.setText(tr("<html><b>?</strong></b>")); 155 helpButton.setToolTipText(tr("Show Help-Browser.")); 156 helpButton.setBackground(Color.LIGHT_GRAY); 157 helpButton.setEnabled(false); 158 contentPanel.add(helpButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, 159 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 160 new Insets(0, 0, 5, 0), 0, 0)); 161 162 //---- levelNameLabel ---- 163 levelNameLabel.setText(tr("Level name")); 164 contentPanel.add(levelNameLabel, new GridBagConstraints(0, 1, 3, 1, 0.0, 1.0, 165 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 166 new Insets(0, 0, 5, 5), 0, 0)); 167 168 //---- levelNameField ---- 169 levelNameField.setEnabled(false); 170 levelNameField.setToolTipText(tr("Sets optional name tag for a level.")); 171 contentPanel.add(levelNameField, new GridBagConstraints(3, 1, 3, 1, 0.0, 1.0, 172 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 173 new Insets(0, 0, 5, 30), 0, 0)); 174 175 //---- levelLabel ---- 176 levelLabel.setText(tr("Working level: NONE")); 177 levelLabel.setToolTipText(tr("Shows the current working level.")); 178 contentPanel.add(levelLabel, new GridBagConstraints(6, 1, 3, 1, 0.0, 1.0, 179 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 180 new Insets(0, 0, 5, 5), 0, 0)); 181 182 //---- levelCheckBox ---- 183 levelCheckBox.setToolTipText(tr("Deactivate automatic level tagging.")); 184 contentPanel.add(levelCheckBox, new GridBagConstraints(9, 1, 1, 1, 0.0, 1.0, 185 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 186 new Insets(0, 0, 5, 5), 0, 0)); 187 contentPanel.add(separator1, new GridBagConstraints(0, 2, 0, 1, 0.0, 0.0, 188 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 189 new Insets(0, 0, 5, 5), 0, 0)); 190 191 //---- objectLabel ---- 192 objectLabel.setText(tr("Object")); 193 contentPanel.add(objectLabel, new GridBagConstraints(0, 3, 3, 1, 0.0, 1.0, 194 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 195 new Insets(0, 0, 5, 5), 0, 0)); 196 197 //---- objectBox ---- 198 objectBox.setEnabled(false); 199 objectBox.setPrototypeDisplayValue(IndoorObject.CONCRETE_WALL); 200 objectBox.setToolTipText(tr("The object preset you want to tag.")); 201 contentPanel.add(objectBox, new GridBagConstraints(3, 3, 3, 1, 0.0, 1.0, 202 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 203 new Insets(0, 0, 5, 30), 0, 0)); 204 205 //---- nameLabel ---- 206 nameLabel.setText(tr("Name")); 207 contentPanel.add(nameLabel, new GridBagConstraints(0, 4, 3, 1, 0.0, 1.0, 208 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 209 new Insets(0, 0, 5, 5), 0, 0)); 210 211 //---- nameField ---- 212 nameField.setEnabled(false); 213 nameField.addFocusListener(new FocusListener() { 214 215 @Override 216 public void focusLost(FocusEvent e) {} 217 218 @Override 219 public void focusGained(FocusEvent e) { 220 nameField.selectAll(); 332 221 } 333 dialogPanel.add(contentPanel, BorderLayout.CENTER); 334 335 //======== buttonBar ======== 336 { 337 buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); 338 buttonBar.setLayout(new GridBagLayout()); 339 ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 80}; 340 ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0}; 341 342 //---- applyButton ---- 343 applyButton.setText(tr("Apply")); 344 applyButton.setToolTipText(tr("Add selected tags and/or relations to obeject.")); 345 applyButton.setEnabled(false); 346 buttonBar.add(applyButton, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0, 347 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 348 new Insets(0, 0, 0, 0), 0, 0)); 222 }); 223 nameField.setToolTipText(tr("Sets the name tag.")); 224 contentPanel.add(nameField, new GridBagConstraints(3, 4, 3, 1, 0.0, 1.0, 225 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 226 new Insets(0, 0, 5, 30), 0, 0)); 227 228 //---- refLabel ---- 229 refLabel.setText(tr("Reference")); 230 contentPanel.add(refLabel, new GridBagConstraints(0, 5, 3, 1, 0.0, 1.0, 231 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 232 new Insets(0, 0, 5, 5), 0, 0)); 233 234 //---- refField ---- 235 refField.setEnabled(false); 236 refField.addFocusListener(new FocusListener() { 237 238 @Override 239 public void focusLost(FocusEvent e) {} 240 241 @Override 242 public void focusGained(FocusEvent e) { 243 refField.selectAll(); 349 244 } 350 dialogPanel.add(buttonBar, BorderLayout.SOUTH); 351 } 245 }); 246 refField.setToolTipText(tr("Sets the referance tag.")); 247 contentPanel.add(refField, new GridBagConstraints(3, 5, 3, 1, 0.0, 1.0, 248 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 249 new Insets(0, 0, 5, 30), 0, 0)); 250 251 //---- repeatOnLabel ---- 252 repeatOnLabel.setText(tr("Repeat on")); 253 contentPanel.add(repeatOnLabel, new GridBagConstraints(0, 6, 3, 1, 0.0, 1.0, 254 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 255 new Insets(0, 0, 5, 5), 0, 0)); 256 257 //---- repeatOnField ---- 258 repeatOnField.setEnabled(false); 259 repeatOnField.addFocusListener(new FocusListener() { 260 261 @Override 262 public void focusLost(FocusEvent e) {} 263 264 @Override 265 public void focusGained(FocusEvent e) { 266 repeatOnField.selectAll(); 267 } 268 }); 269 repeatOnField.setToolTipText( 270 tr("Sets the repeat on tag when highway objects are selected. Please tag like this: -3-4 or -2--3 or 5-6 .")); 271 contentPanel.add(repeatOnField, new GridBagConstraints(3, 6, 3, 1, 0.0, 1.0, 272 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 273 new Insets(0, 0, 5, 30), 0, 0)); 274 contentPanel.add(separator2, new GridBagConstraints(0, 7, 0, 1, 0.0, 1.0, 275 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 276 new Insets(0, 0, 5, 5), 0, 0)); 277 278 //---- preset1 ---- 279 preset1.setEnabled(false); 280 contentPanel.add(preset1, new GridBagConstraints(6, 3, 1, 1, 0.0, 0.0, 281 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 282 new Insets(0, 0, 5, 5), 0, 0)); 283 //---- preset2 ---- 284 preset2.setEnabled(false); 285 contentPanel.add(preset2, new GridBagConstraints(6, 4, 1, 1, 0.0, 0.0, 286 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 287 new Insets(0, 0, 5, 5), 0, 0)); 288 289 //---- preset3 ---- 290 preset3.setEnabled(false); 291 contentPanel.add(preset3, new GridBagConstraints(6, 5, 1, 1, 0.0, 0.0, 292 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 293 new Insets(0, 0, 5, 5), 0, 0)); 294 295 //---- preset4 ---- 296 preset4.setEnabled(false); 297 contentPanel.add(preset4, new GridBagConstraints(6, 6, 1, 1, 0.0, 0.0, 298 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 299 new Insets(0, 0, 5, 5), 0, 0)); 300 301 //---- multiLabel ---- 302 multiLabel.setText(tr("Multipolygon")); 303 contentPanel.add(multiLabel, new GridBagConstraints(0, 8, 3, 1, 0.0, 1.0, 304 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 305 new Insets(0, 0, 5, 5), 0, 0)); 306 307 //---- multiOuterButton ---- 308 multiOuterButton.setText(tr("OUTER")); 309 multiOuterButton.setToolTipText(tr("Creation-Tool for multipolygon with role: outer. To finish press the spacebar.")); 310 multiOuterButton.setEnabled(false); 311 contentPanel.add(multiOuterButton, new GridBagConstraints(3, 8, 3, 1, 0.0, 1.0, 312 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 313 new Insets(0, 0, 5, 30), 0, 0)); 314 315 //---- multiInnerButton ---- 316 multiInnerButton.setText(tr("INNER")); 317 multiInnerButton.setToolTipText( 318 tr("Creation-Tool for multipolygons with role: inner. To finish press spacebar. To add to relation select \"outer\" and press enter.")); 319 multiInnerButton.setEnabled(false); 320 contentPanel.add(multiInnerButton, new GridBagConstraints(6, 8, 1, 1, 0.0, 0.0, 321 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 322 new Insets(0, 0, 5, 5), 0, 0)); 323 324 //---- multiCheckBox ---- 325 multiCheckBox.setToolTipText(tr("Deactivate multipolygon function.")); 326 contentPanel.add(multiCheckBox, new GridBagConstraints(9, 8, 1, 1, 0.0, 1.0, 327 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 328 new Insets(0, 0, 5, 5), 0, 0)); 329 330 dialogPanel.add(contentPanel, BorderLayout.CENTER); 331 332 //======== buttonBar ======== 333 buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); 334 buttonBar.setLayout(new GridBagLayout()); 335 ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 80}; 336 ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0}; 337 338 //---- applyButton ---- 339 applyButton.setText(tr("Apply")); 340 applyButton.setToolTipText(tr("Add selected tags and/or relations to obeject.")); 341 applyButton.setEnabled(false); 342 buttonBar.add(applyButton, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0, 343 GridBagConstraints.CENTER, GridBagConstraints.BOTH, 344 new Insets(0, 0, 0, 0), 0, 0)); 345 346 dialogPanel.add(buttonBar, BorderLayout.SOUTH); 347 352 348 this.createLayout(dialogPanel, true, null); 353 354 } 355 356 /************************************************* 357 * ENABLES OR DISABLES UI ELEMENTS 358 * 359 */ 349 } 350 360 351 /** 361 352 * Enables or disables the interactive UI elements of the toolbox. … … 364 355 */ 365 356 public void setAllUiElementsEnabled(boolean enabled) { 366 367 368 357 this.applyButton.setEnabled(enabled); 358 this.levelCheckBox.setEnabled(enabled); 359 this.helpButton.setEnabled(enabled); 369 360 this.objectBox.setEnabled(enabled); 370 361 this.levelNameField.setEnabled(enabled); … … 402 393 * Enables or disables the interactive text box element {@link #repeatOn}. 403 394 * @param enabled set this true for enabled elements 404 */ 405 public void setROUiElementsEnabled(boolean enabled){ 406 this.repeatOnField.setEnabled(enabled); 407 395 */ 396 public void setROUiElementsEnabled(boolean enabled) { 397 this.repeatOnField.setEnabled(enabled); 408 398 } 409 399 … … 411 401 * Enables or disables the interactive text box element {@link #levelName}. 412 402 * @param enabled set this true for enabled elements 413 403 */ 414 404 public void setLVLUiElementsEnabled(boolean enabled) { 415 416 405 this.levelNameField.setEnabled(enabled); 406 this.addLevelButton.setEnabled(enabled); 417 407 418 408 } … … 421 411 * Enables or disables the interactive ComboBoxes {@link #multiRoleBox} and {@link #multiEditBox }. 422 412 * @param enabled set this true for enabled elements 423 413 */ 424 414 public void setMultiUiElementsEnabled(boolean enabled) { 425 426 427 428 415 this.multiOuterButton.setEnabled(enabled); 416 this.multiInnerButton.setEnabled(enabled); 417 418 if (enabled == false) resetUiElements(); 429 419 } 430 420 … … 436 426 } 437 427 438 439 /*************************************************440 * GETTER and SETTER FOR THE INTERACTIVE UI BOXES441 *442 */443 428 /** 444 429 * Getter for the selected {@link IndoorObject} in the objectBox. … … 480 465 * Setter for the current level value tag 481 466 * 467 * @author rebsc 482 468 * @param current level value as String 483 * @author rebsc484 469 */ 485 470 public void setLevelLabel(String levelTag) { 486 if (getLevelCheckBoxStatus() == false) { 487 if(!levelTag.equals("")) { 488 this.levelLabel.setText((tr("Working level: {0}",levelTag))); 489 } 490 else { 491 this.levelLabel.setText((tr("Working level: NONE"))); 492 } 493 } 494 else { 495 this.levelLabel.setText((tr("Working level: NONE"))); 496 } 471 if (getLevelCheckBoxStatus() == false) { 472 if (!levelTag.equals("")) { 473 this.levelLabel.setText((tr("Working level: {0}", levelTag))); 474 } else { 475 this.levelLabel.setText((tr("Working level: NONE"))); 476 } 477 } else { 478 this.levelLabel.setText((tr("Working level: NONE"))); 479 } 497 480 } 498 481 … … 503 486 */ 504 487 public boolean getLevelCheckBoxStatus() { 505 488 return this.levelCheckBox.isSelected(); 506 489 } 507 490 … … 522 505 return this.repeatOnField.getText(); 523 506 } 524 525 526 /*************************************************527 * RESETER FOR THE INTERACTIVE UI BOXES528 *529 */530 507 531 508 /** … … 540 517 } 541 518 542 543 /*************************************************544 * SETTERS FOR THE BUTTON LISTENER545 *546 */547 548 519 /** 549 520 * Set the listener for the apply button. … … 560 531 */ 561 532 public void setLevelCheckBoxListener(ItemListener l) { 562 533 this.levelCheckBox.addItemListener(l); 563 534 } 564 535 … … 568 539 */ 569 540 public void setHelpButtonListener(ActionListener l) { 570 541 this.helpButton.addActionListener(l); 571 542 } 572 543 … … 576 547 */ 577 548 public void setAddLevelButtonListener(ActionListener l) { 578 549 this.addLevelButton.addActionListener(l); 579 550 } 580 551 … … 616 587 } 617 588 618 /*************************************************619 * PRESET BUTTON FUNCTION620 *621 */622 589 public void setPresetButtons(List<IndoorObject> objects) { 623 590 this.preset1.setIndoorObject(objects.get(0)); … … 658 625 return preset4.getIndoorObject(); 659 626 } 660 661 662 /**663 *664 *665 *666 *667 *668 *669 *670 *671 *672 */673 627 }
Note:
See TracChangeset
for help on using the changeset viewer.