Changeset 25349 in osm for applications


Ignore:
Timestamp:
2011-02-18T09:43:44+01:00 (14 years ago)
Author:
stoecker
Message:

fix dos line endings

Location:
applications/editors/josm/plugins/pdfimport/src/pdfimport
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pdfimport/src/pdfimport/LayerContents.java

    r23991 r25349  
    11/**
    2  * 
     2 *
    33 */
    44package pdfimport;
  • applications/editors/josm/plugins/pdfimport/src/pdfimport/OrthogonalShapesFilter.java

    r24654 r25349  
    99                tolerance = Math.toRadians(toleranceDegrees);
    1010        }
    11        
     11
    1212        public boolean isOrthogonal(PdfPath path) {
    13                
     13
    1414                if (path.points.size() < 3)
    1515                        return false;
    16                
     16
    1717                int targetPos = path.isClosed() ? path.points.size(): path.points.size() - 1;
    18                
     18
    1919                for(int pos = 1; pos < targetPos; pos++) {
    2020                        Point2D p1 = path.points.get(pos -1);
    2121                        Point2D p2 = path.points.get(pos);
    2222                        Point2D p3 = pos+1 == path.points.size() ? path.points.get(1) : path.points.get(pos+1);
    23                        
     23
    2424                        double angle1 = Math.atan2(p2.getY() - p1.getY(),p2.getX() - p1.getX());
    2525                        double angle2 = Math.atan2(p3.getY() - p2.getY(),p3.getX() - p2.getX());
    26                        
     26
    2727                        double angleDifference = angle1 - angle2;
    2828                        while (angleDifference < 0) angleDifference += Math.PI;
     
    3030                        //test straight angles
    3131                        boolean hasGoodVariant = false;
    32                        
    33                         for (int quadrant = 0; quadrant <= 4; quadrant ++) { 
     32
     33                        for (int quadrant = 0; quadrant <= 4; quadrant ++) {
    3434                                double difference = angleDifference - Math.PI / 2 * quadrant;
    3535                                if (Math.abs(difference) <= tolerance)
    3636                                        hasGoodVariant = true;
    3737                        }
    38                        
     38
    3939                        if (!hasGoodVariant)
    4040                                return false;
    4141                }
    42                
     42
    4343                return true;
    4444        }
  • applications/editors/josm/plugins/pdfimport/src/pdfimport/PathOptimizer.java

    r24654 r25349  
    586586        {
    587587                if (!closed && !single) {
    588                         return Collections.singletonList(layer);                       
    589                 }
    590                
     588                        return Collections.singletonList(layer);
     589                }
     590
    591591                OrthogonalShapesFilter of = new OrthogonalShapesFilter(10);
    592592
     
    601601                        boolean pathUnclosed = !path.isClosed() && closed;
    602602                        boolean pathSingleSegment = path.points.size() <= 3 && single;
    603                        
     603
    604604                        if (pathSingleSegment) {
    605605                                singleSegmentPaths.add(path);
    606606                        }
    607607                        else if (pathUnclosed) {
    608                                
     608
    609609                                if (pathOrthgonal) {
    610610                                        orthogonalPaths.add(path);
     
    616616                        else {
    617617                                if (pathOrthgonal) {
    618                                         orthogonalClosedPaths.add(path);       
     618                                        orthogonalClosedPaths.add(path);
    619619                                }
    620620                                else
     
    622622                                        closedPaths.add(path);
    623623                                }
    624                                
     624
    625625                        }
    626626                }
     
    642642                        layers.add(l);
    643643                }
    644                
     644
    645645
    646646                if (orthogonalPaths.size() > 0) {
     
    650650                        layers.add(l);
    651651                }
    652                
     652
    653653                if (orthogonalClosedPaths.size() > 0) {
    654654                        LayerContents l = new LayerContents();
  • applications/editors/josm/plugins/pdfimport/src/pdfimport/PdfImportPlugin.java

    r23702 r25349  
    1515public class PdfImportPlugin extends Plugin {
    1616
    17     protected String name;
     17        protected String name;
    1818
    19     public PdfImportPlugin(PluginInformation info) {
    20         super(info);
    21         name = tr("Import PDf file");
    22         JMenu toolsMenu = null;
    23         for (int i = 0; i < Main.main.menu.getMenuCount() && toolsMenu == null; i++) {
    24             JMenu menu = Main.main.menu.getMenu(i);
    25             String name = menu.getText();
    26             if (name != null && name.equals(tr("Tools"))) {
    27                 toolsMenu = menu;
    28             }
    29         }
     19        public PdfImportPlugin(PluginInformation info) {
     20                super(info);
     21                name = tr("Import PDf file");
     22                JMenu toolsMenu = null;
     23                for (int i = 0; i < Main.main.menu.getMenuCount() && toolsMenu == null; i++) {
     24                        JMenu menu = Main.main.menu.getMenu(i);
     25                        String name = menu.getText();
     26                        if (name != null && name.equals(tr("Tools"))) {
     27                                toolsMenu = menu;
     28                        }
     29                }
    3030
    31         if (toolsMenu == null) {
    32             toolsMenu = new JMenu(name);
    33             toolsMenu.add(new JMenuItem(new PdfImportAction()));
    34             Main.main.menu.add(toolsMenu, 2);
    35         } else {
    36             toolsMenu.addSeparator();
    37             toolsMenu.add(new JMenuItem(new PdfImportAction()));
    38         }
    39     }
     31                if (toolsMenu == null) {
     32                        toolsMenu = new JMenu(name);
     33                        toolsMenu.add(new JMenuItem(new PdfImportAction()));
     34                        Main.main.menu.add(toolsMenu, 2);
     35                } else {
     36                        toolsMenu.addSeparator();
     37                        toolsMenu.add(new JMenuItem(new PdfImportAction()));
     38                }
     39        }
    4040}
  • applications/editors/josm/plugins/pdfimport/src/pdfimport/PdfMultiPath.java

    r23702 r25349  
    1111                paths = paths2;
    1212        }
    13                
     13
    1414}
  • applications/editors/josm/plugins/pdfimport/src/pdfimport/pdfbox/PageDrawer.java

    r24189 r25349  
    186186         *
    187187         * @param newStroke The current stroke.
    188          * 
     188         *
    189189         */
    190190        public void setStroke(BasicStroke newStroke)
     
    217217         * @param awtImage The image to draw.
    218218         * @param at The transformation to use when drawing.
    219          * 
     219         *
    220220         */
    221221        public void drawImage(){
     
    257257         *
    258258         * @param windingRule The winding rule this path will use.
    259          * 
     259         *
    260260         */
    261261        public void setClippingPath(int windingRule)
  • applications/editors/josm/plugins/pdfimport/src/pdfimport/pdfbox/operators/ClosePath.java

    r23991 r25349  
    3838         * @param operator The operator that is being executed.
    3939         * @param arguments List
    40          * 
     40         *
    4141         * @throws IOException if something went wrong during logging
    4242         */
Note: See TracChangeset for help on using the changeset viewer.