Changeset 16862 in osm for applications
- Timestamp:
- 2009-08-04T22:03:04+02:00 (15 years ago)
- Location:
- applications/editors/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/Preferences.form
r15649 r16862 40 40 <EmptySpace max="-2" attributes="0"/> 41 41 <Component id="addNewTagValueField" min="-2" pref="125" max="-2" attributes="0"/> 42 <EmptySpace pref="1 08" max="-2" attributes="0"/>42 <EmptySpace pref="121" max="-2" attributes="0"/> 43 43 </Group> 44 <Component id="buildingCheckBox" alignment="0" pref="400" max="32767" attributes="0"/> 44 45 </Group> 45 46 <EmptySpace max="-2" attributes="0"/> … … 61 62 <Component id="addNewTagValueField" alignment="3" min="-2" max="-2" attributes="0"/> 62 63 </Group> 63 <EmptySpace pref="183" max="32767" attributes="0"/> 64 <EmptySpace type="unrelated" max="-2" attributes="0"/> 65 <Component id="buildingCheckBox" min="-2" max="-2" attributes="0"/> 66 <EmptySpace pref="155" max="32767" attributes="0"/> 64 67 </Group> 65 68 </Group> … … 69 72 <Component class="javax.swing.JCheckBox" name="addNewTagCheckBox"> 70 73 <Properties> 71 <Property name="text" type="java.lang.String" value=" Přidávat následující tag při vytváření adresního bodu"/>74 <Property name="text" type="java.lang.String" value="Novým primitivám přidávat tag:"/> 72 75 </Properties> 73 76 <Events> … … 110 113 </Properties> 111 114 </Component> 115 <Component class="javax.swing.JCheckBox" name="buildingCheckBox"> 116 <Properties> 117 <Property name="text" type="java.lang.String" value="Nově polygonům přidávat tag "building=yes""/> 118 </Properties> 119 <Events> 120 <EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="buildingCheckBoxaddNewTagChanged"/> 121 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buildingCheckBoxActionPerformed"/> 122 </Events> 123 </Component> 112 124 </SubComponents> 113 125 </Container> -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/Preferences.java
r15649 r16862 16 16 private String KEY_OPTIMIZE = "czechaddress.opzimize"; 17 17 18 public boolean addBuildingTag; 19 20 private String KEY_BUILDINGTAG = "czechaddress.buildingtag"; 21 18 22 public boolean addNewTag; 19 23 public String addNewTagKey; … … 34 38 private Preferences() { 35 39 initComponents(); 36 addNewTag = Main.pref.getBoolean(KEY_ADDNEWTAG, addNewTagCheckBox.isSelected()); 37 addNewTagKey = Main.pref.get(KEY_ADDNEWTAGKEY, addNewTagKeyField.getText()); 38 addNewTagValue = Main.pref.get(KEY_ADDNEWTAGVALUE, addNewTagValueField.getText()); 39 optimize = Main.pref.getInteger(KEY_OPTIMIZE, optimizeComboBox.getSelectedIndex()); 40 addBuildingTag = Main.pref.getBoolean(KEY_BUILDINGTAG, buildingCheckBox.isSelected()); 41 addNewTag = Main.pref.getBoolean(KEY_ADDNEWTAG, addNewTagCheckBox.isSelected()); 42 addNewTagKey = Main.pref.get( KEY_ADDNEWTAGKEY, addNewTagKeyField.getText()); 43 addNewTagValue = Main.pref.get( KEY_ADDNEWTAGVALUE, addNewTagValueField.getText()); 44 optimize = Main.pref.getInteger(KEY_OPTIMIZE, optimizeComboBox.getSelectedIndex()); 40 45 } 41 46 42 47 public void reloadSettings() { 48 buildingCheckBox.setSelected(addBuildingTag); 49 43 50 addNewTagCheckBox.setSelected(addNewTag); 44 51 addNewTagKeyField.setText(addNewTagKey); … … 64 71 jLabel2 = new javax.swing.JLabel(); 65 72 optimizeComboBox = new javax.swing.JComboBox(); 73 buildingCheckBox = new javax.swing.JCheckBox(); 66 74 67 75 setLayout(new java.awt.GridLayout(1, 0)); 68 76 69 addNewTagCheckBox.setText(" Přidávat následující tag při vytváření adresního bodu");77 addNewTagCheckBox.setText("Novým primitivám přidávat tag:"); 70 78 addNewTagCheckBox.addChangeListener(new javax.swing.event.ChangeListener() { 71 79 public void stateChanged(javax.swing.event.ChangeEvent evt) { … … 92 100 optimizeComboBox.setSelectedIndex(1); 93 101 optimizeComboBox.setEnabled(false); 102 103 buildingCheckBox.setText("Nově polygonům přidávat tag \"building=yes\""); 104 buildingCheckBox.addChangeListener(new javax.swing.event.ChangeListener() { 105 public void stateChanged(javax.swing.event.ChangeEvent evt) { 106 buildingCheckBoxaddNewTagChanged(evt); 107 } 108 }); 109 buildingCheckBox.addActionListener(new java.awt.event.ActionListener() { 110 public void actionPerformed(java.awt.event.ActionEvent evt) { 111 buildingCheckBoxActionPerformed(evt); 112 } 113 }); 94 114 95 115 javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel); … … 111 131 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 112 132 .addComponent(addNewTagValueField, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE) 113 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 108, javax.swing.GroupLayout.PREFERRED_SIZE))) 133 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 121, javax.swing.GroupLayout.PREFERRED_SIZE)) 134 .addComponent(buildingCheckBox, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)) 114 135 .addContainerGap()) 115 136 ); … … 127 148 .addComponent(jLabel1) 128 149 .addComponent(addNewTagValueField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 129 .addContainerGap(183, Short.MAX_VALUE)) 150 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 151 .addComponent(buildingCheckBox) 152 .addContainerGap(155, Short.MAX_VALUE)) 130 153 ); 131 154 … … 139 162 140 163 private void addNewTagCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addNewTagCheckBoxActionPerformed 141 // TODO add your handling code here: 164 142 165 }//GEN-LAST:event_addNewTagCheckBoxActionPerformed 166 167 private void buildingCheckBoxaddNewTagChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_buildingCheckBoxaddNewTagChanged 168 169 }//GEN-LAST:event_buildingCheckBoxaddNewTagChanged 170 171 private void buildingCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buildingCheckBoxActionPerformed 172 173 }//GEN-LAST:event_buildingCheckBoxActionPerformed 143 174 144 175 public void addGui(PreferenceDialog gui) { … … 151 182 152 183 public boolean ok() { 184 addBuildingTag = buildingCheckBox.isSelected(); 185 Main.pref.put(KEY_BUILDINGTAG, addBuildingTag); 186 153 187 addNewTag = addNewTagCheckBox.isSelected(); 154 188 Main.pref.put(KEY_ADDNEWTAG, addNewTag); … … 171 205 private javax.swing.JTextField addNewTagKeyField; 172 206 private javax.swing.JTextField addNewTagValueField; 207 private javax.swing.JCheckBox buildingCheckBox; 173 208 private javax.swing.JLabel jLabel1; 174 209 private javax.swing.JLabel jLabel2; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java
r16750 r16862 13 13 import org.openstreetmap.josm.data.osm.Node; 14 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 import org.openstreetmap.josm.data.osm.Way; 15 16 import org.openstreetmap.josm.gui.ExtendedDialog; 16 17 import org.openstreetmap.josm.plugins.czechaddress.CzechAddressPlugin; … … 316 317 p.addNewTagKey, p.addNewTagValue)); 317 318 319 if (p.addBuildingTag && proposalContainer.getTarget() instanceof Way 320 && proposalContainer.getTarget().get("building") == null) 321 proposalContainer.addProposal(new AddKeyValueProposal("building", "yes")); 322 323 318 324 }//GEN-LAST:event_matchChanged 319 325
Note:
See TracChangeset
for help on using the changeset viewer.