Changeset 7661 in josm for trunk/src/org


Ignore:
Timestamp:
2014-10-27T23:25:38+01:00 (5 years ago)
Author:
Don-vip
Message:

see #10668 - code refactoring to avoid hacks in merge-overlap plugin

Location:
trunk/src/org/openstreetmap/josm/gui/conflict/tags
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r7129 r7661  
    187187
    188188    protected JPanel buildRelationMemberConflictResolverPanel() {
    189         pnlRelationMemberConflictResolver = new RelationMemberConflictResolver();
     189        pnlRelationMemberConflictResolver = new RelationMemberConflictResolver(new RelationMemberConflictResolverModel());
    190190        return pnlRelationMemberConflictResolver;
    191191    }
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java

    r6890 r7661  
    4444    private AutoCompletingTextField tfValue;
    4545    private JCheckBox cbTagRelations;
    46     private RelationMemberConflictResolverModel model;
     46    private final RelationMemberConflictResolverModel model;
    4747    private RelationMemberConflictResolverTable tblResolver;
    4848    private JMultilineLabel lblHeader;
     
    5959        gc.insets = new Insets(5,5,5,5);
    6060        add(pnl, gc);
    61         model = new RelationMemberConflictResolverModel();
    6261
    6362        gc.gridy = 1;
     
    118117    /**
    119118     * Constructs a new {@code RelationMemberConflictResolver}.
     119     * @param model model managing a list of conflicting relation members
     120     * @since 7661
    120121     */
    121     public RelationMemberConflictResolver() {
     122    public RelationMemberConflictResolver(RelationMemberConflictResolverModel model) {
     123        this.model = model;
    122124        build();
    123125    }
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModel.java

    r7129 r7661  
    3131
    3232    /** the list of conflict decisions */
    33     private List<RelationMemberConflictDecision> decisions;
     33    protected final List<RelationMemberConflictDecision> decisions;
    3434    /** the collection of relations for which we manage conflicts */
    35     private Collection<Relation> relations;
     35    protected Collection<Relation> relations;
    3636    /** the number of conflicts */
    3737    private int numConflicts;
    38     private PropertyChangeSupport support;
     38    private final PropertyChangeSupport support;
    3939
    4040    /**
    4141     * Replies true if each {@link MultiValueResolutionDecision} is decided.
    4242     *
    43      * @return true if each {@link MultiValueResolutionDecision} is decided; false
    44      * otherwise
     43     * @return true if each {@link MultiValueResolutionDecision} is decided; false otherwise
    4544     */
    4645    public boolean isResolvedCompletely() {
     
    7271        numConflicts = count;
    7372        if (numConflicts != oldValue) {
    74             support.firePropertyChange(NUM_CONFLICTS_PROP, oldValue, numConflicts);
    75         }
     73            support.firePropertyChange(getProperty(), oldValue, numConflicts);
     74        }
     75    }
     76
     77    protected String getProperty() {
     78        return NUM_CONFLICTS_PROP;
    7679    }
    7780
     
    307310     */
    308311    public Set<Relation> getModifiedRelations(OsmPrimitive newPrimitive) {
    309         HashSet<Relation> ret = new HashSet<>();
     312        Set<Relation> ret = new HashSet<>();
    310313        for (Relation relation: relations) {
    311314            if (isChanged(relation, newPrimitive)) {
Note: See TracChangeset for help on using the changeset viewer.