Changeset 26290 in osm for applications/editors/josm


Ignore:
Timestamp:
2011-07-10T08:55:51+02:00 (13 years ago)
Author:
zverik
Message:

implemented most TODO requests, fixed some bugs

Location:
applications/editors/josm/plugins/reltoolbox
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/TODO

    r26285 r26290  
    44- Solve width problem for narrows buttons when "fix" and "download" appear simultaneously
    55- "Reverse multipolygon": create a closed area out of outer members, move tags, delete relation and empty ways
    6 - Fix tags for public_transport relations
    7 - âûêëþ÷àòü ïîäñâåòêó âûáðàííîãî îòíîøåíèÿ ïðè âûêëþ÷åíèè ñëîÿ ñ äàííûìè
    8 - èêîíêà â ïàíåëè ñëåâà íå ðàáîòàåò, à ÷åêáîêñ (åñëè íà >> íàæàòü) âêëþ÷àåò ïàíåëü ñî âòîðîãî ðàçà
    9 - ðåæèì äëÿ ñîçäàíèÿ ìóëüòèïîëèãîíîâ áåç òðåáîâàíèÿ ïðèñóòñòâèÿ òåãîâ íà âñåõ ëèíèÿõ,
    10   êîãäà ïëîùàäíûå òýãè ñîáèðàþòñÿ ñ êóñêîâ äàæå åñëè îíè ïðèñóòñòâóþò íå íà âñåõ (íàñòðîéêà)
    11 - êîãäà ñîçäà¸òñÿ ìóëüòèïîëèãîí è âêëþ÷åíî "ïåðåìåñòèòü òåãè", íî òåãè òîëüêî íà îäíîé ëèíèè, òî fail
    12 - ïðè ñîçäàíèè ãðàíèö äîáàâëÿåòñÿ òîëüêî admin_level, íî íå boundary
    13 - ïóíêò â ìåíþ äëÿ äóáëèðîâàíèÿ îòíîøåíèÿ
     6? èêîíêà â ïàíåëè ñëåâà íå ðàáîòàåò, à ÷åêáîêñ (åñëè íà >> íàæàòü) âêëþ÷àåò ïàíåëü ñî âòîðîãî ðàçà
     7? êîãäà ñîçäà¸òñÿ ìóëüòèïîëèãîí è âêëþ÷åíî "ïåðåìåñòèòü òåãè", íî òåãè òîëüêî íà îäíîé ëèíèè, òî fail
    148
    159== NEW ALGORITHM ==
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/ChosenRelation.java

    r25751 r26290  
    101101        // todo: dim chosen relation when changing layer
    102102        // todo: check this WTF!
     103        System.out.println("editLayerChanged() oldLayer=" + oldLayer + ", newLayer=" + newLayer);
    103104        clear();
    104105        if( newLayer != null && oldLayer == null ) {
     
    114115        }
    115116
     117        OsmDataLayer dataLayer = Main.map.mapView.getEditLayer();
     118        float opacity = dataLayer == null ? 0.0f : !dataLayer.isVisible() ? 0.0f : (float)dataLayer.getOpacity();
     119        if( opacity < 0.01 )
     120            return;
     121
    116122        Stroke oldStroke = g.getStroke();
    117123        Composite oldComposite = g.getComposite();
    118124        g.setColor(Color.yellow);
    119125        g.setStroke(new BasicStroke(9, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
    120         g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f));
     126        g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f * opacity));
    121127        for( OsmPrimitive element : chosenRelation.getMemberPrimitives() ) {
    122128            if( element.getType() == OsmPrimitiveType.NODE ) {
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java

    r26125 r26290  
    453453            add(new SelectMembersAction(chosenRelation));
    454454            add(new SelectRelationAction(chosenRelation));
     455            add(new DuplicateChosenRelationAction(chosenRelation));
    455456            add(new DeleteChosenRelationAction(chosenRelation));
    456457            add(new DownloadParentsAction(chosenRelation));
     
    514515            addMenuItem("boundaryways", tr("Add tags boundary and admin_level to boundary relation ways"));
    515516            addMenuItem("tags", tr("Move area tags from contour to relation"));
     517            addMenuItem("alltags", tr("When moving tags, consider even non-repeating ones"));
    516518        }
    517519
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/CreateMultipolygonAction.java

    r25727 r26290  
    4444        else if( property.equals("boundaryways") ) return true;
    4545        else if( property.equals("tags") ) return true;
     46        else if( property.equals("alltags") ) return false;
    4647        else if( property.equals("single") ) return true;
    4748        throw new IllegalArgumentException(property);
     
    7475                rel.addMember(new RelationMember("inner", w));
    7576        List<Command> list = removeTagsFromInnerWays(rel);
     77        if( !list.isEmpty() && isBoundary ) {
     78            Main.main.undoRedo.add(new SequenceCommand(tr("Move tags from ways to relation"), list));
     79            list = new ArrayList<Command>();
     80        }
    7681        if( isBoundary ) {
    7782            if( !askForAdminLevelAndName(rel) )
     
    231236
    232237        // filter out empty key conflicts - we need second iteration
     238        boolean isBoundary = getPref("boundary");
     239        if( isBoundary || !getPref("alltags") )
    233240        for( RelationMember m: relation.getMembers() )
    234241            if( m.hasRole() && m.getRole().equals("outer") && m.isWay() )
     
    246253            values.remove("natural");
    247254
    248         boolean isBoundary = getPref("boundary");
    249255        String name = values.get("name");
    250         String adminLevel = values.get("admin_level");
    251256        if( isBoundary ) {
    252257            Set<String> keySet = new TreeSet<String>(values.keySet());
Note: See TracChangeset for help on using the changeset viewer.