Ignore:
Timestamp:
2010-11-06T18:35:51+01:00 (14 years ago)
Author:
oliverw
Message:

INodeEntity -> IOSMEntity

Location:
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses
Files:
16 edited
1 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressEditContainer.java

    r24028 r24089  
    5858 * addresses with unknown streets ("unresolved addresses").
    5959 *
    60  * It listens to changes within instances of {@link INodeEntity} to notify clients on update.
     60 * It listens to changes within instances of {@link IOSMEntity} to notify clients on update.
    6161 *
    6262 * {@link AddressEditContainer} is the central class used within actions and UI models to show
     
    150150         * Notifies clients that an entity within the address container changed.
    151151         */
    152         protected void fireEntityChanged(INodeEntity entity) {
     152        protected void fireEntityChanged(IOSMEntity entity) {
    153153                if (entity == null) throw new RuntimeException("Entity must not be null");
    154154               
     
    256256         */
    257257        private void createNodeFromWay(Way w) {
    258                 INodeEntity ne = NodeFactory.createNodeFromWay(w);
     258                IOSMEntity ne = NodeFactory.createNodeFromWay(w);
    259259               
    260260                if (!processNode(ne, w)) {
     
    287287         * @return true, if node has been processed
    288288         */
    289         private boolean processNode(INodeEntity ne, Way w) {
     289        private boolean processNode(IOSMEntity ne, Way w) {
    290290                if (ne != null) {
    291291                        // Node is a street (segment)
     
    657657
    658658        /* (non-Javadoc)
    659          * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.INodeEntity)
    660          */
    661         @Override
    662         public void entityChanged(INodeEntity entity) {
     659         * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity)
     660         */
     661        @Override
     662        public void entityChanged(IOSMEntity entity) {
    663663                fireEntityChanged(entity);     
    664664        }
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressNode.java

    r24088 r24089  
    275275         */
    276276        @Override
    277         public int compareTo(INodeEntity o) {
     277        public int compareTo(IOSMEntity o) {
    278278                if (o == null || !(o instanceof AddressNode)) {
    279279                        return -1;
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAddressEditContainerListener.java

    r23933 r24089  
    2525         * Notifies clients that an entity has been changed.
    2626         */
    27         public void entityChanged(INodeEntity node);
     27        public void entityChanged(IOSMEntity node);
    2828}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ICommandListener.java

    r24088 r24089  
    2323         * @param command The command instance to process by the enclosing command listener.
    2424         */
    25         public void commandIssued(INodeEntity entity, Command command);
     25        public void commandIssued(IOSMEntity entity, Command command);
    2626}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IOSMEntity.java

    r24087 r24089  
    2626 */
    2727
    28 public interface INodeEntity extends Comparable<INodeEntity> {
     28public interface IOSMEntity extends Comparable<IOSMEntity> {
    2929        /**
    3030         * Gets the underlying OSM object.
     
    4949         * @return
    5050         */
    51         public List<INodeEntity> getChildren();
     51        public List<IOSMEntity> getChildren();
    5252       
    5353        /**
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/NodeEntityBase.java

    r24088 r24089  
    2828
    2929/**
    30  * The class NodeEntityBase provides a base implementation for the {@link INodeEntity} interface.
     30 * The class NodeEntityBase provides a base implementation for the {@link IOSMEntity} interface.
    3131 *
    3232 * The implementation comprises
     
    3737 * </ol>
    3838 */
    39 public class NodeEntityBase implements INodeEntity, Comparable<INodeEntity> {
     39public class NodeEntityBase implements IOSMEntity, Comparable<IOSMEntity> {
    4040        public static final String ANONYMOUS = tr("No name");
    4141        private static List<IAddressEditContainerListener> containerListeners = new ArrayList<IAddressEditContainerListener>();
     
    7878         * Notifies clients that the address container changed.
    7979         */
    80         protected static void fireEntityChanged(INodeEntity entity) {
     80        protected static void fireEntityChanged(IOSMEntity entity) {
    8181                for (IAddressEditContainerListener listener : containerListeners) {
    8282                        listener.entityChanged(entity);
     
    121121
    122122        @Override
    123         public List<INodeEntity> getChildren() {
     123        public List<IOSMEntity> getChildren() {
    124124                return null;
    125125        }
     
    188188         */
    189189        @Override
    190         public int compareTo(INodeEntity o) {
     190        public int compareTo(IOSMEntity o) {
    191191                if (o == null || !(o instanceof NodeEntityBase)) return -1;
    192192                return this.getName().compareTo(o.getName());
     
    194194
    195195        /* (non-Javadoc)
    196          * @see org.openstreetmap.josm.plugins.fixAddresses.INodeEntity#getCoor()
     196         * @see org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity#getCoor()
    197197         */
    198198        @Override
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/NodeFactory.java

    r23967 r24089  
    4949         * @return The new node instance or null; if given way is inappropriate.
    5050         */
    51         public static INodeEntity createNodeFromWay(Way way) {
     51        public static IOSMEntity createNodeFromWay(Way way) {
    5252                if (TagUtils.hasHighwayTag(way)) {
    5353                        return new StreetSegmentNode(way);
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/StreetNode.java

    r23933 r24089  
    2727 */
    2828public class StreetNode extends NodeEntityBase {
    29         private List<INodeEntity> children;
     29        private List<IOSMEntity> children;
    3030        private List<AddressNode> addresses;
    3131                       
     
    3737        }
    3838
    39         public List<INodeEntity> getChildren() {
     39        public List<IOSMEntity> getChildren() {
    4040                return children;
    4141        }
     
    5454        private void lazyCreateChildren() {
    5555                if (children == null) {
    56                         children = new ArrayList<INodeEntity>();
     56                        children = new ArrayList<IOSMEntity>();
    5757                }
    5858        }
     
    9999               
    100100                int sc = 0;
    101                 for (INodeEntity node : children) {
     101                for (IOSMEntity node : children) {
    102102                        if (node instanceof StreetSegmentNode) {
    103103                                sc++;
     
    115115                List<String> types = new ArrayList<String>();
    116116               
    117                 for (INodeEntity seg : getChildren()) {
     117                for (IOSMEntity seg : getChildren()) {
    118118                        OsmPrimitive osmPrim = seg.getOsmObject();
    119119                        if (TagUtils.hasHighwayTag(osmPrim)) {
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/StreetSegmentNode.java

    r23933 r24089  
    3333
    3434        @Override
    35         public List<INodeEntity> getChildren() {
     35        public List<IOSMEntity> getChildren() {
    3636                return null;
    3737        }
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AbstractAddressEditAction.java

    r23970 r24089  
    2525import org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener;
    2626import org.openstreetmap.josm.plugins.fixAddresses.ICommandListener;
    27 import org.openstreetmap.josm.plugins.fixAddresses.INodeEntity;
     27import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
    2828import org.openstreetmap.josm.plugins.fixAddresses.StringUtils;
    2929
     
    170170
    171171        /* (non-Javadoc)
    172          * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.INodeEntity)
    173          */
    174         @Override
    175         public void entityChanged(INodeEntity node) {
     172         * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity)
     173         */
     174        @Override
     175        public void entityChanged(IOSMEntity node) {
    176176                updateEnabledState();           
    177177        }
     
    213213         * @param entity the entity
    214214         */
    215         public void beginObjectTransaction(INodeEntity entity) {
     215        public void beginObjectTransaction(IOSMEntity entity) {
    216216                if (entity != null) {
    217217                        entity.addCommandListener(this);
     
    226226         * @param entity the entity
    227227         */
    228         public void finishObjectTransaction(INodeEntity entity) {
     228        public void finishObjectTransaction(IOSMEntity entity) {
    229229                if (entity != null) {
    230230                        entity.removeCommandListener(this);
     
    235235       
    236236        /* (non-Javadoc)
    237          * @see org.openstreetmap.josm.plugins.fixAddresses.ICommandListener#commandIssued(org.openstreetmap.josm.plugins.fixAddresses.INodeEntity, org.openstreetmap.josm.command.Command)
    238          */
    239         @Override
    240         public void commandIssued(INodeEntity entity, Command command) {
     237         * @see org.openstreetmap.josm.plugins.fixAddresses.ICommandListener#commandIssued(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity, org.openstreetmap.josm.command.Command)
     238         */
     239        @Override
     240        public void commandIssued(IOSMEntity entity, Command command) {
    241241                if (commands == null) {
    242242                        throw new RuntimeException("No command list available. Did you forget to call beginTransaction?");
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java

    r24024 r24089  
    5252import org.openstreetmap.josm.plugins.fixAddresses.AddressNode;
    5353import org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener;
    54 import org.openstreetmap.josm.plugins.fixAddresses.INodeEntity;
     54import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
    5555import org.openstreetmap.josm.plugins.fixAddresses.StreetNode;
    5656import org.openstreetmap.josm.plugins.fixAddresses.StringUtils;
     
    264264                                               
    265265                        //mapViewer.addMapRectangle(new BBoxMapRectangle(bb));
    266                         for (INodeEntity seg : sNode.getChildren()) {
     266                        for (IOSMEntity seg : sNode.getChildren()) {
    267267                                Way way = (Way) seg.getOsmObject();
    268268                                //BBox bb = way.getBBox();
     
    316316
    317317        @Override
    318         public void entityChanged(INodeEntity entity) {
     318        public void entityChanged(IOSMEntity entity) {
    319319                updateHeaders();
    320320        }
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditModel.java

    r23933 r24089  
    2323
    2424import org.openstreetmap.josm.plugins.fixAddresses.AddressNode;
    25 import org.openstreetmap.josm.plugins.fixAddresses.INodeEntity;
     25import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
    2626import org.openstreetmap.josm.plugins.fixAddresses.StreetNode;
    2727
     
    5757                               
    5858                                // Add street segment(s)
    59                                 for (INodeEntity child : sNode.getChildren()) {
     59                                for (IOSMEntity child : sNode.getChildren()) {
    6060                                        segmentsNode.add(new DefaultMutableTreeNode(child));
    6161                                }
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditTableModel.java

    r23961 r24089  
    1818import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
    1919import org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener;
    20 import org.openstreetmap.josm.plugins.fixAddresses.INodeEntity;
     20import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
    2121
    2222public abstract class AddressEditTableModel extends DefaultTableModel implements IAddressEditContainerListener{
     
    4040
    4141        @Override
    42         public void entityChanged(INodeEntity entity) {
     42        public void entityChanged(IOSMEntity entity) {
    4343                int row = getRowOfEntity(entity);
    4444                if (row != -1) { // valid row? -> update model
     
    5353         * @return
    5454         */
    55         public abstract INodeEntity getEntityOfRow(int row);
     55        public abstract IOSMEntity getEntityOfRow(int row);
    5656       
    5757        /**
     
    6060         * @return
    6161         */
    62         public abstract int getRowOfEntity(INodeEntity entity);
     62        public abstract int getRowOfEntity(IOSMEntity entity);
    6363}
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/ApplyAllGuessesAction.java

    r24018 r24089  
    2626import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
    2727import org.openstreetmap.josm.plugins.fixAddresses.AddressNode;
    28 import org.openstreetmap.josm.plugins.fixAddresses.INodeEntity;
     28import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
    2929
    3030/**
     
    8787                        if (model != null) {
    8888                                int row = table.rowAtPoint(p);
    89                                 INodeEntity node = model.getEntityOfRow(row);
     89                                IOSMEntity node = model.getEntityOfRow(row);
    9090                                if (node instanceof AddressNode) {
    9191                                        beginTransaction(tr("Applied guessed values for ") + node.getOsmObject());
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/IncompleteAddressesTableModel.java

    r24025 r24089  
    1818import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
    1919import org.openstreetmap.josm.plugins.fixAddresses.AddressNode;
    20 import org.openstreetmap.josm.plugins.fixAddresses.INodeEntity;
     20import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
    2121
    2222public class IncompleteAddressesTableModel extends AddressEditTableModel  {
     
    9595
    9696        @Override
    97         public INodeEntity getEntityOfRow(int row) {
     97        public IOSMEntity getEntityOfRow(int row) {
    9898                if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) {
    9999                        return null;
     
    106106
    107107        @Override
    108         public int getRowOfEntity(INodeEntity entity) {
     108        public int getRowOfEntity(IOSMEntity entity) {
    109109                if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) {
    110110                        return -1;
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/StreetTableModel.java

    r23961 r24089  
    1717
    1818import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
    19 import org.openstreetmap.josm.plugins.fixAddresses.INodeEntity;
     19import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
    2020import org.openstreetmap.josm.plugins.fixAddresses.StreetNode;
    2121
     
    107107
    108108        @Override
    109         public INodeEntity getEntityOfRow(int row) {
     109        public IOSMEntity getEntityOfRow(int row) {
    110110                if (addressContainer == null || addressContainer.getStreetList() == null) {
    111111                        return null;
     
    118118       
    119119        @Override
    120         public int getRowOfEntity(INodeEntity entity) {
     120        public int getRowOfEntity(IOSMEntity entity) {
    121121                if (addressContainer == null || addressContainer.getStreetList() == null) {
    122122                        return -1;
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/UnresolvedAddressesTableModel.java

    r24018 r24089  
    3333import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
    3434import org.openstreetmap.josm.plugins.fixAddresses.AddressNode;
    35 import org.openstreetmap.josm.plugins.fixAddresses.INodeEntity;
     35import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity;
    3636import org.openstreetmap.josm.plugins.fixAddresses.StringUtils;
    3737import org.openstreetmap.josm.plugins.fixAddresses.TagUtils;
     
    144144         */
    145145        @Override
    146         public INodeEntity getEntityOfRow(int row) {
     146        public IOSMEntity getEntityOfRow(int row) {
    147147                if (addressContainer == null || addressContainer.getUnresolvedAddresses() == null) {
    148148                        return null;
     
    155155       
    156156        @Override
    157         public int getRowOfEntity(INodeEntity entity) {
     157        public int getRowOfEntity(IOSMEntity entity) {
    158158                if (addressContainer == null || addressContainer.getUnresolvedAddresses() == null) {
    159159                        return -1;
Note: See TracChangeset for help on using the changeset viewer.