Changeset 15203 in osm
- Timestamp:
- 2009-05-25T02:34:09+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/czechaddress
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/czechaddress/build.xml
r15201 r15203 34 34 <attribute name="Author" value="Radomír Černoch"/> 35 35 <attribute name="Plugin-Description" value="Creating and handling address nodes and buildings within Czech Republic."/> 36 <attribute name="Plugin-Mainversion" value="1 566"/>37 <attribute name="Plugin-Version" value="0.1 "/>36 <attribute name="Plugin-Mainversion" value="1607"/> 37 <attribute name="Plugin-Version" value="0.1.1"/> 38 38 <attribute name="Plugin-Class" value="${plugin.basepackage}.CzechAddressPlugin"/> 39 39 </manifest> … … 97 97 <pathelement path="${java.class.path}"/> 98 98 </classpath> 99 < arg value="/home/radek/Desktop/Hustopeče.osm"/>99 <!--<arg value="/home/radek/Desktop/Hustopeče.osm"/>--> 100 100 </java> 101 101 </target> -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/CzechAddressPlugin.java
r15201 r15203 27 27 import org.openstreetmap.josm.plugins.czechaddress.actions.ModifierAction; 28 28 import org.openstreetmap.josm.plugins.czechaddress.actions.SplitAreaByEmptyWayAction; 29 import org.openstreetmap.josm.plugins.czechaddress.gui.DatabaseModifier; 29 30 import org.openstreetmap.josm.plugins.czechaddress.gui.FactoryDialog; 30 31 import org.openstreetmap.josm.plugins.czechaddress.intelligence.Reasoner; … … 70 71 final MvcrParser parser = new MvcrParser(); 71 72 //parser.setFilter(null, null, null, ""); 72 parser.setFilter("HUSTOPEČE", "HUSTOPEČE", null, null);73 //parser.setFilter("HUSTOPEČE", "HUSTOPEČE", null, null); 73 74 parser.setTargetDatabase(mainDatabase); 74 75 parser.setStorageDir(pluginDir); … … 119 120 for (House house : houses) pool.add(house); 120 121 121 122 /*Capitalizator cap = new Capitalizator(Main.ds.allPrimitives(), 123 location.getStreets()); 124 for (Street s : cap.getClassifiedItems()) 125 System.out.println(s.toString() + " --> " + cap.translate(s).getName());*/ 122 // Update database according to the map 123 (new DatabaseModifier()).setVisible(true); 126 124 127 125 // And add them to the reasoner. -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/AddressElement.java
r15201 r15203 40 40 throw new NullPointerException("You must specify the name of this AddressElement"); 41 41 this.name = capitalize(name); 42 } 43 44 /** 45 * Sets the new name of this element. 46 * 47 * <p><b>NOTE:</b> Unlike in the default constructor, the name is <b>not</b> 48 * capitalized.</p> 49 */ 50 public void setName(String newName) { 51 name = newName; 42 52 } 43 53 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/House.java
r15201 r15203 199 199 // If we have added any proposal so far, add the source info as well. 200 200 if (props.size() > 0) 201 props.add(getListFieldDiff("source ", prim.get("source:addr"), "mvcr:adresa"));201 props.add(getListFieldDiff("source:addr", prim.get("source:addr"), "mvcr:adresa")); 202 202 203 203 return props; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/DatabaseModifier.java
r15201 r15203 59 59 60 60 streetTable.setModel(streetModel); 61 streetTable.setDefaultRenderer( Street.class,62 new StreetRenderer());61 streetTable.setDefaultRenderer( AddressElement.class, 62 new AddressElementRenderer()); 63 63 64 64 // And finalize initializing the form. 65 65 setupDialog(mainPanel, new String[] { "ok.png", "cancel.png" }); 66 setAlwaysOnTop(false);67 68 // TODO: Why does it always crash if the modality is set in constructor?69 setModal(false);70 66 } 71 67 … … 73 69 protected void buttonAction(ActionEvent evt) { 74 70 super.buttonAction(evt); 71 72 if (getValue() == 1) { 73 assert streetModel.elems.size() == streetModel.names.size(); 74 75 for(int i=0; i<streetModel.elems.size(); i++) 76 streetModel.elems.get(i).setName(streetModel.names.get(i)); 77 } 78 75 79 setVisible(false); 76 80 } … … 151 155 // End of variables declaration//GEN-END:variables 152 156 153 private class StreetRenderer extends DefaultTableCellRenderer { 157 private class AddressElementRenderer extends DefaultTableCellRenderer { 158 159 public AddressElementRenderer() {} 154 160 155 161 @Override 156 public Component getTableCellRendererComponent(JTable table, 157 Object value, boolean isSelected, boolean hasFocus, 158 int row, int column) { 159 Component c = super.getTableCellRendererComponent(table, value, 160 isSelected, hasFocus, row, column); 161 162 System.out.println("Tady som! " + value); 162 protected void setValue(Object value) { 163 super.setValue(value); 163 164 164 165 if (value instanceof AddressElement) 165 166 setText(((AddressElement) value).getName() ); 166 167 return c;168 167 } 169 168 } -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java
r15166 r15203 31 31 * Dialog for adding/editing an address of a single primitive. 32 32 * 33 * <p><b>TODO:</b> This dialog does not dispose and disconnect from 34 * message handling system after being closed. Reproduce: Create a node 35 * using this dialog, delete it and update reasoner.</p> 36 * 33 37 * @author radomir.cernoch@gmail.com 34 38 */ 35 39 public class PointManipulatorDialog extends ExtendedDialog implements StatusListener { 36 40 37 private Timer updateMatchesTime s= null;41 private Timer updateMatchesTimer = null; 38 42 private Action updateMatchesAction; 39 43 private ProposalContainer proposalContainer; … … 88 92 super.buttonAction(evt); 89 93 if (getValue() == 1) { 94 95 if (updateMatchesTimer.isRunning()) { 96 updateMatchesTimer.stop(); 97 updateMatches(); 98 } 99 90 100 proposalContainer.applyAll(); 91 101 … … 291 301 292 302 private void keyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_keyReleased 293 if (updateMatchesTime s!= null)294 updateMatchesTime s.stop();295 296 updateMatchesTime s= new Timer(300, updateMatchesAction);297 updateMatchesTime s.setRepeats(false);298 updateMatchesTime s.start();303 if (updateMatchesTimer != null) 304 updateMatchesTimer.stop(); 305 306 updateMatchesTimer = new Timer(300, updateMatchesAction); 307 updateMatchesTimer.setRepeats(false); 308 updateMatchesTimer.start(); 299 309 }//GEN-LAST:event_keyReleased 300 310
Note:
See TracChangeset
for help on using the changeset viewer.