Changeset 15585 in osm for applications/editors/josm/plugins/czechaddress/src
- Timestamp:
- 2009-06-04T01:45:05+02:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress
- Files:
-
- 3 deleted
- 25 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/MapUtils.java
r15166 r15585 20 20 public abstract class MapUtils { 21 21 22 static final double NODE_ZOOM_LEVEL = 0.00000007; 22 /** 23 * Zoom level used for zooming to a single node. 24 */ 25 public static final double NODE_ZOOM_LEVEL = 0.00000007; 23 26 24 27 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/NotNullList.java
r15166 r15585 31 31 } 32 32 33 /** 34 * Checks each item and if it isn't {@code null}, it is added. 35 */ 33 36 @Override 34 37 public boolean addAll(Collection<? extends E> c) { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/PrimUtils.java
r15584 r15585 27 27 KEY_ADDR_STREET, KEY_ADDR_CO, KEY_ADDR_CP }; 28 28 29 /** 30 * Comparator for {@link OsmPrimitive}, which looks at 'addr:*' tags. 31 */ 29 32 public static final Comparator<OsmPrimitive> comparator = 30 33 new Comparator<OsmPrimitive>() { 31 32 34 public int compare(OsmPrimitive o1, OsmPrimitive o2) { 33 35 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/StatusListener.java
r15558 r15585 3 3 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.AddressElement; 4 4 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.Database; 5 import org.openstreetmap.josm.plugins.czechaddress.intelligence.Reasoner;6 5 7 6 /** -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/ManagerAction.java
r15582 r15585 8 8 9 9 /** 10 * Shows the manager window for editing the database. 10 11 * 11 12 * @author Radomír Černoch, radomir.cernoch@gmail.com 13 * 14 * @see ManagerDialog 12 15 */ 13 16 public class ManagerAction extends JosmAction { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/AddressElement.java
r15584 r15585 13 13 * The most general element of the houses and streets database. 14 14 * 15 * <p>Every element must hav a name and may have a parent element.</p>15 * <p>Every element must have a <i>name</i> and may have a <i>parent</i>.</p> 16 16 * 17 17 * @author Radomír Černoch radomir.cernoch@gmail.com … … 193 193 } 194 194 195 /** 196 * Does the same as {@code matchField()}, but allows the string to contain 197 * abbreviations. 198 * 199 * <p>For detailed description see {@code matchField()}.</p> 200 */ 195 201 public static int matchFieldAbbrev(String elemValue, String primValue) { 196 202 … … 212 218 } 213 219 220 /** 221 * Makes the given primitive have the same key-values as the current element. 222 */ 214 223 public List<Proposal> getDiff(OsmPrimitive prim) { 215 224 return null; 216 225 } 217 226 227 /** 228 * Returns the "quality" of a element-primitive match. 229 * 230 * <p>Returns a value from {@link Reasoner}{@code .MATCH_*}, which 231 * describes how well does the given primitive match to this element.</p> 232 */ 218 233 public int getQ(OsmPrimitive primitive) { 219 234 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/Database.java
r15558 r15585 2 2 3 3 import java.util.ArrayList; 4 import org.openstreetmap.josm.plugins.czechaddress.parser.DatabaseParser; 4 5 5 6 /** 6 * Stores the whole database of all regions, municipalities, suburbs, streets 7 * and houses in the Czech republic. The database can be feeded via 8 * XML and is capable of downloading it from www.mvcr.cz 7 * Stores the whole database. 8 * 9 * <p>Contains the tree of all regions, municipalities, suburbs, streets 10 * and houses in the Czech republic.</p> 9 11 * 10 12 * @see AddressElement 11 13 * @see DatabaseParser 12 14 13 * @author Radom ir Cernoch radomir.cernoch@gmail.com15 * @author Radomír Černoch radomir.cernoch@gmail.com 14 16 */ 15 17 public class Database { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ElementWithStreets.java
r15582 r15585 1 /*2 * To change this template, choose Tools | Templates3 * and open the template in the editor.4 */5 6 1 package org.openstreetmap.josm.plugins.czechaddress.addressdatabase; 7 2 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/House.java
r15582 r15585 200 200 } 201 201 202 /** 203 * Determies whether the given primitive can be matched to a House. 204 */ 202 205 public static boolean isMatchable(OsmPrimitive prim) { 203 206 for (String key : prim.keySet()) -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ParentResolver.java
r15582 r15585 1 /*2 * To change this template, choose Tools | Templates3 * and open the template in the editor.4 */5 6 1 package org.openstreetmap.josm.plugins.czechaddress.addressdatabase; 7 2 8 3 /** 4 * Disassemles the <i>parent</i>-><i>parent</i>... branch of an AddressElement. 9 5 * 10 6 * @author Radomír Černoch, radomir.cernoch@gmail.com … … 40 36 } 41 37 38 /** 39 * Returns the value for the 'is_in=*' tag. 40 */ 42 41 public String getIsIn() { 43 42 String result = ""; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/Region.java
r15582 r15585 2 2 3 3 import java.util.ArrayList; 4 import org.openstreetmap.josm.data.osm.OsmPrimitive;5 4 6 5 /** -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ConflictResolver.java
r15582 r15585 1 1 package org.openstreetmap.josm.plugins.czechaddress.gui; 2 2 3 import java.awt.Component;4 import java.awt.Font;5 3 import java.util.ArrayList; 6 4 import java.util.Collections; … … 12 10 import javax.swing.ComboBoxModel; 13 11 import javax.swing.DefaultComboBoxModel; 14 import javax.swing.JList;15 12 import javax.swing.event.ListDataListener; 16 13 import javax.swing.Icon; … … 24 21 import org.openstreetmap.josm.plugins.czechaddress.PrimUtils; 25 22 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.AddressElement; 26 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.ElementWithHouses;27 23 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.House; 28 24 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.Street; … … 33 29 34 30 /** 35 * Dialog for displaying and handling getConflicts.31 * Dialog for displaying and handling conflicts. 36 32 * 37 33 * @author Radomír Černoch, radomir.cernoch@gmail.com … … 57 53 58 54 mainField.setModel(conflictModel); 59 // conflictModel.addListDataListener(mainField);60 61 55 Reasoner.getInstance().addListener(new ReasonerHook()); 62 56 … … 297 291 //============================================================================== 298 292 293 /** 294 * Listenes to the {@link Reasoner} and updates data models. 295 */ 299 296 private class ReasonerHook implements ReasonerListener { 300 297 … … 567 564 } 568 565 } 569 570 private class CandidatesRenderer extends UniversalListRenderer {571 572 @Override573 public Component getListCellRendererComponent(JList list, Object value,574 int index, boolean isSelected, boolean cellHasFocus) {575 Component c = super.getListCellRendererComponent(list, value, index,576 isSelected, cellHasFocus);577 578 if ( (value instanceof AddressElement &&579 Reasoner.getInstance().translate((AddressElement) value) != null)580 || (value instanceof OsmPrimitive &&581 Reasoner.getInstance().translate((OsmPrimitive) value) != null) )582 setFont(getFont().deriveFont(Font.BOLD));583 584 return c;585 }586 }587 588 /*589 private class ElemTreeModel extends HalfCookedTreeModel {590 591 public ElemTreeModel() {592 root = "Konflikty podle objektů v databázi";593 }594 595 public Object getChild(Object parent, int index) {596 try {597 Reasoner r = CzechAddressPlugin.getReasoner();598 599 if (parent == root)600 return r.getElementsInConflict().get(index);601 602 if (parent instanceof AddressElement)603 return r.getConflicts((AddressElement) parent).get(index).prim;604 605 } catch (Exception e) { }606 return null;607 }608 609 public int getChildCount(Object parent) {610 try {611 Reasoner r = CzechAddressPlugin.getReasoner();612 613 if (parent == root)614 return r.getElementsInConflict().size();615 616 if (parent instanceof AddressElement)617 return r.getConflicts((AddressElement) parent).size();618 619 } catch (Exception exp) { }620 return 0;621 }622 623 public int getIndexOfChild(Object parent, Object child) {624 try{625 Reasoner r = CzechAddressPlugin.getReasoner();626 627 if (parent == root)628 return r.getElementsInConflict().indexOf(child);629 630 if (parent instanceof AddressElement)631 return r.getConflicts((AddressElement) parent).indexOf(child);632 633 } catch (Exception exp) { }634 return -1;635 }636 }637 638 639 private class PrimTreeModel extends HalfCookedTreeModel {640 641 public PrimTreeModel() {642 root = "Podle objeků databáze";643 }644 645 public Object getChild(Object parent, int index) {646 try {647 Reasoner r = CzechAddressPlugin.getReasoner();648 649 if (parent == root)650 return r.getPrimitivesInConflict().get(index);651 652 if (parent instanceof OsmPrimitive)653 return r.getConflictsconflictsve) parent).get(index).elem;654 655 } catch (Exception exp) { }656 return null;657 }658 659 public int getChildCount(Object parent) {660 661 try {662 Reasoner r = CzechAddressPlugin.getReasoner();663 664 if (parent == root)665 return r.getPrimitivesInConflict().size();666 if (parent instanceof OsmPrimitive)667 return r.getConflictsconflictsve) parent).size();668 669 } catch (Exception exp) { }670 return 0;671 }672 673 public int getIndexOfChild(Object parent, Object child) {674 675 try {676 Reasoner r = CzechAddressPlugin.getReasoner();677 678 if (parent == root) {679 return r.getPrimitivesInConflict().indexOf(child);680 681 } else if (parent instanceof OsmPrimitive)682 return r.getConflictsconflictsve) parent).indexOf(child);683 684 } catch (Exception exp) { }685 return -1;686 }687 }*/688 566 } -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/FactoryDialog.java
r15582 r15585 1 1 package org.openstreetmap.josm.plugins.czechaddress.gui; 2 2 3 import org.openstreetmap.josm.plugins.czechaddress.gui.utils.HalfCookedListModel; 4 import org.openstreetmap.josm.plugins.czechaddress.gui.utils.HalfCookedComboBoxModel; 3 5 import org.openstreetmap.josm.plugins.czechaddress.StringUtils; 4 6 import java.awt.Component; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/GroupManipulatorDialog.java
r15582 r15585 10 10 import org.openstreetmap.josm.gui.ExtendedDialog; 11 11 import org.openstreetmap.josm.plugins.czechaddress.CzechAddressPlugin; 12 import org.openstreetmap.josm.plugins.czechaddress.StatusListener;13 12 import org.openstreetmap.josm.plugins.czechaddress.intelligence.Reasoner; 14 13 import org.openstreetmap.josm.plugins.czechaddress.intelligence.ReasonerListener; … … 21 20 * proposals, delete or confirm them. 22 21 * 23 * Apart from proposals, it also shows a list of conflicts, which arouse24 * during the address completion. 22 * <p>Apart from proposals, it also shows a list of conflicts, which arouse 23 * during the address completion.</p> 25 24 * 26 25 * @author Radomír Černoch radomir.cernoch@gmail.com -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java
r15582 r15585 66 66 67 67 /** 68 * Hardly ever working method for autodetecting the current location. 69 * 68 70 * @deprecated 69 71 */ -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ManagerDialog.java
r15582 r15585 1 1 package org.openstreetmap.josm.plugins.czechaddress.gui; 2 2 3 import java.awt.Component; 4 import java.awt.event.MouseEvent; 3 import org.openstreetmap.josm.plugins.czechaddress.gui.utils.HalfCookedTreeModel; 5 4 import java.util.ArrayList; 6 5 import java.util.List; 7 import javax.swing.DefaultComboBoxModel;8 import javax.swing.JComboBox;9 import javax.swing.JTable;10 6 import javax.swing.event.TableModelListener; 11 7 import javax.swing.table.DefaultTableCellRenderer; 12 8 import javax.swing.table.TableModel; 13 import org.openstreetmap.josm.plugins.czechaddress.gui.utils.UniversalTreeRenderer;14 9 import org.openstreetmap.josm.Main; 15 10 import org.openstreetmap.josm.gui.ExtendedDialog; … … 23 18 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.ViToCi; 24 19 import org.openstreetmap.josm.plugins.czechaddress.gui.databaseeditors.StreetEditor; 20 import org.openstreetmap.josm.plugins.czechaddress.gui.utils.UniversalTreeRenderer; 25 21 import org.openstreetmap.josm.plugins.czechaddress.intelligence.Capitalizator; 26 22 import org.openstreetmap.josm.plugins.czechaddress.intelligence.Reasoner; 27 23 24 /** 25 * Editing the database of {@link AddressElement}s. 26 * 27 * <p>Currently allows to display the current location + its children and 28 * automatic street renaming.</p> 29 * 30 * @author Radomír Černoch radomir.cernoch@gmail.com 31 */ 28 32 public class ManagerDialog extends ExtendedDialog { 29 33 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java
r15584 r15585 1 1 package org.openstreetmap.josm.plugins.czechaddress.gui; 2 2 3 import org.openstreetmap.josm.plugins.czechaddress.gui.utils.HalfCookedComboBoxModel; 3 4 import java.awt.event.ActionEvent; 4 5 import java.awt.event.KeyEvent; … … 22 23 import org.openstreetmap.josm.plugins.czechaddress.proposal.Proposal; 23 24 import org.openstreetmap.josm.plugins.czechaddress.proposal.ProposalContainer; 24 import org.openstreetmap.josm.tools.ImageProvider;25 25 26 26 /** -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/StreetEditor.form
r15584 r15585 1 1 <?xml version="1.0" encoding="UTF-8" ?> 2 2 3 <Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> 3 <Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> 4 <SyntheticProperties> 5 <SyntheticProperty name="formSizePolicy" type="int" value="2"/> 6 </SyntheticProperties> 4 7 <AuxValues> 5 8 <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/StreetEditor.java
r15584 r15585 1 /*2 * To change this template, choose Tools | Templates3 * and open the template in the editor.4 */5 6 /*7 * StreetEditor.java8 *9 * Created on 3.6.2009, 20:50:4510 */11 12 1 package org.openstreetmap.josm.plugins.czechaddress.gui.databaseeditors; 13 2 … … 20 9 21 10 /** 11 * Dialog for editing a {@link Street} 22 12 * 23 * @author radek13 * @author Radomír Černoch radomir.cernoch@gmail.com 24 14 */ 25 15 public class StreetEditor extends ExtendedDialog { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedComboBoxModel.java
r15460 r15585 1 package org.openstreetmap.josm.plugins.czechaddress.gui ;1 package org.openstreetmap.josm.plugins.czechaddress.gui.utils; 2 2 3 3 import java.util.ArrayList; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedListModel.java
r15460 r15585 1 package org.openstreetmap.josm.plugins.czechaddress.gui ;1 package org.openstreetmap.josm.plugins.czechaddress.gui.utils; 2 2 3 3 import java.util.ArrayList; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedTreeModel.java
r15460 r15585 1 package org.openstreetmap.josm.plugins.czechaddress.gui ;1 package org.openstreetmap.josm.plugins.czechaddress.gui.utils; 2 2 3 3 import java.util.ArrayList; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/UniversalListRenderer.java
r15558 r15585 1 /*2 * To change this template, choose Tools | Templates3 * and open the template in the editor.4 */5 6 1 package org.openstreetmap.josm.plugins.czechaddress.gui.utils; 7 2 … … 11 6 12 7 /** 8 * List renderer for AddressElements and OsmPrimitives. 13 9 * 14 10 * @author Radomír Černoch, radomir.cernoch@gmail.com -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/UniversalRenderer.java
r15558 r15585 1 /*2 * To change this template, choose Tools | Templates3 * and open the template in the editor.4 */5 6 1 package org.openstreetmap.josm.plugins.czechaddress.gui.utils; 7 2 … … 21 16 22 17 /** 18 * Helper for getting icons and texts for {@code Universal*} renderers. 23 19 * 24 20 * @author Radomír Černoch, radomir.cernoch@gmail.com … … 31 27 private static final ImageIcon nodeIcon = ImageProvider.get("data/node.png"); 32 28 private static final ImageIcon wayIcon = ImageProvider.get("data/way.png"); 33 // private static final ImageIcon closedWayIcon = ImageProvider.get("Mf_closedway.png");34 29 private static final ImageIcon relationIcon = ImageProvider.get("data/relation.png"); 35 30 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/UniversalTreeRenderer.java
r15582 r15585 6 6 import org.openstreetmap.josm.data.osm.OsmPrimitive; 7 7 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.AddressElement; 8 import org.openstreetmap.josm.plugins.czechaddress.gui.utils.UniversalRenderer;9 8 10 9 /** -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/intelligence/ReasonerListener.java
r15558 r15585 5 5 6 6 /** 7 * Interface capable of sensing changes in the {@link Reasoner}. 7 8 * 8 9 * @author Radomír Černoch, radomir.cernoch@gmail.com -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/intelligence/SelectionMonitor.java
r15582 r15585 10 10 11 11 /** 12 * Listenes to the current selection for reasoning12 * Listenes to the current selection and updates all selected elements. 13 13 * 14 14 * <p>Currently JOSM has no way of giving notice about a changed or deleted -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/parser/XMLParser.java
r15166 r15585 1 1 package org.openstreetmap.josm.plugins.czechaddress.parser; 2 2 3 import org.openstreetmap.josm.plugins.czechaddress.parser.DatabaseParser;4 3 import java.io.IOException; 5 4 import org.openstreetmap.josm.plugins.czechaddress.DatabaseLoadException;
Note:
See TracChangeset
for help on using the changeset viewer.