Ignore:
Timestamp:
2009-01-01T18:28:53+01:00 (16 years ago)
Author:
stoecker
Message:

removed tab stop usage

Location:
applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/JosmEdgeFactory.java

    r3686 r12778  
    11/**
    2  * 
     2 *
    33 */
    44package at.dallermassl.josm.plugin.navigator;
     
    1313public class JosmEdgeFactory implements EdgeFactory<Node, WayEdge> {
    1414
    15  
     15
    1616
    1717  /* (non-Javadoc)
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/NavigatorAction.java

    r3749 r12778  
    11/**
    2  * 
     2 *
    33 */
    44package at.dallermassl.josm.plugin.navigator;
     
    2828    super(tr("Navigate"));
    2929    this.navigatorPlugin = navigatorPlugin;
    30    
     30
    3131  }
    3232
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/NavigatorLayer.java

    r3891 r12778  
    11/**
    2  * 
     2 *
    33 */
    44package at.dallermassl.josm.plugin.navigator;
     
    2929/**
    3030 * @author cdaller
    31  * 
     31 *
    3232 */
    3333public class NavigatorLayer extends Layer {
     
    4343    /**
    4444     * Constructor
    45      * 
     45     *
    4646     * @param name
    4747     *            the name of the layer.
     
    5353    /*
    5454     * (non-Javadoc)
    55      * 
     55     *
    5656     * @see org.openstreetmap.josm.gui.layer.Layer#getIcon()
    5757     */
     
    6464    /*
    6565     * (non-Javadoc)
    66      * 
     66     *
    6767     * @see org.openstreetmap.josm.gui.layer.Layer#getInfoComponent()
    6868     */
     
    7474    /*
    7575     * (non-Javadoc)
    76      * 
     76     *
    7777     * @see org.openstreetmap.josm.gui.layer.Layer#getMenuEntries()
    7878     */
     
    8585    /*
    8686     * (non-Javadoc)
    87      * 
     87     *
    8888     * @see org.openstreetmap.josm.gui.layer.Layer#getToolTipText()
    8989     */
     
    9595    /*
    9696     * (non-Javadoc)
    97      * 
     97     *
    9898     * @see org.openstreetmap.josm.gui.layer.Layer#isMergable(org.openstreetmap.josm.gui.layer.Layer)
    9999     */
     
    105105    /*
    106106     * (non-Javadoc)
    107      * 
     107     *
    108108     * @see org.openstreetmap.josm.gui.layer.Layer#mergeFrom(org.openstreetmap.josm.gui.layer.Layer)
    109109     */
     
    115115    /*
    116116     * (non-Javadoc)
    117      * 
     117     *
    118118     * @see org.openstreetmap.josm.gui.layer.Layer#paint(java.awt.Graphics,
    119119     *      org.openstreetmap.josm.gui.MapView)
     
    125125            return;
    126126        }
    127        
     127
    128128        if(startIcon == null) {
    129129            startIcon = ImageProvider.get("navigation", "startflag");
     
    135135        Point screen = mv.getPoint(node.eastNorth);
    136136        startIcon.paintIcon(mv, g, screen.x, screen.y - startIcon.getIconHeight());
    137        
     137
    138138        // middle icons:
    139139        for(int index = 1; index < nodes.size() - 1; ++index) {
     
    148148            endIcon.paintIcon(mv, g, screen.x, screen.y - endIcon.getIconHeight());
    149149        }
    150        
     150
    151151        String colorString = Main.pref.get(KEY_ROUTE_COLOR);
    152152        if(colorString.length() == 0) {
     
    170170        }
    171171    }
    172    
     172
    173173    /**
    174174     * Draw a line with the given color.
     
    183183        } else {
    184184            from = mv.getPoint(edge.getSegment().to.eastNorth);
    185             to = mv.getPoint(edge.getSegment().from.eastNorth);           
    186         }
    187        
     185            to = mv.getPoint(edge.getSegment().from.eastNorth);
     186        }
     187
    188188        Rectangle screen = g.getClipBounds();
    189189        Line2D line = new Line2D.Double(from.x, from.y, to.x, to.y);
     
    206206    /*
    207207     * (non-Javadoc)
    208      * 
     208     *
    209209     * @see org.openstreetmap.josm.gui.layer.Layer#visitBoundingBox(org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor)
    210210     */
     
    225225
    226226    /**
    227      * 
     227     *
    228228     */
    229229    public void navigate() {
     
    235235            Main.pref.put(KEY_ROUTE_SELECT, selectString);
    236236        }
    237        
     237
    238238        if(Boolean.parseBoolean(selectString)) {
    239239            List<Segment> path = navigatorNodeModel.getSegmentPath();
     
    244244            }
    245245        }
    246         Main.map.repaint();       
     246        Main.map.repaint();
    247247    }
    248248
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/NavigatorModeAction.java

    r12707 r12778  
    11/**
    2  * 
     2 *
    33 */
    44package at.dallermassl.josm.plugin.navigator;
     
    2424    private NavigatorLayer navigatorLayer;
    2525    private boolean layerAdded;
    26    
     26
    2727    public NavigatorModeAction(MapFrame mapFrame, NavigatorModel navigatorModel, NavigatorLayer navigationLayer) {
    2828        super(tr("Navigator"), "navigation", tr("Set start/end for routing. Middle mouse button to reset."), KeyEvent.VK_F, mapFrame, ImageProvider.getCursor("crosshair", "selection"));
     
    3030        this.navigatorLayer = navigationLayer;
    3131    }
    32    
     32
    3333    @Override public void enterMode() {
    3434        super.enterMode();
     
    5050        if (e.getButton() == MouseEvent.BUTTON2) {
    5151            navigatorModel.reset();
    52         } else if (e.getButton() == MouseEvent.BUTTON1) {       
     52        } else if (e.getButton() == MouseEvent.BUTTON1) {
    5353            Node node = Main.map.mapView.getNearestNode(e.getPoint());
    5454            System.out.println("selected node " + node);
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/NavigatorModel.java

    r3865 r12778  
    11/**
    2  * 
     2 *
    33 */
    44package at.dallermassl.josm.plugin.navigator;
     
    3636        highwayWeight = new HashMap<String, Double>();
    3737    }
    38    
     38
    3939    /**
    4040     * Set the weight for the given highway type. The higher the weight is,
     
    4646        highwayWeight.put(type, weigth);
    4747    }
    48    
     48
    4949    /**
    5050     * @return the selectedNodes
     
    6767    }
    6868
    69    
    70     /**
    71      * 
     69
     70    /**
     71     *
    7272     */
    7373    public void calculateShortesPath() {
     
    9292            fullWeight += routing.getPathLength();
    9393        }
    94        
     94
    9595        edgePath = new ArrayList<SegmentEdge>();
    9696        edgePath.addAll(fullPath);
    97        
     97
    9898        System.out.println("shortest path found: " + fullPath + "\nweight: " + fullWeight);
    9999        System.out.println(getPathDescription());
     
    104104//        System.out.println("all added: " + weight2);
    105105    }
    106    
     106
    107107    public String getPathDescription() {
    108108        List<PathDescription> pathDescriptions = getPathDescriptions();
    109        
     109
    110110        // create text representation from description:
    111111        StringBuilder builder = new StringBuilder();
     
    137137        Way oldWay = null;
    138138        Way way = null;
    139        
     139
    140140        SegmentEdge edge;
    141141        for(int segIndex = 0; segIndex < edgePath.size(); ++segIndex) {
     
    150150                description = new PathDescription(oldWay, length); // add finished way
    151151                pathDescriptions.add(description);
    152                 length = 0;               
     152                length = 0;
    153153            }
    154154            if(segIndex == edgePath.size() - 1) {
    155155                description = new PathDescription(way, length);
    156                 pathDescriptions.add(description);               
     156                pathDescriptions.add(description);
    157157            }
    158158            oldWay = way;
    159159        }
    160        
    161        
     160
     161
    162162//        for(SegmentEdge edge : edgePath) {
    163163//            way = edge.getWay();
     
    216216        return this.edgePath;
    217217    }
    218    
     218
    219219    /**
    220220     * Resets all data (nodes, edges, segments).
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/NavigatorPlugin.java

    r3865 r12778  
    11/**
    2  * 
     2 *
    33 */
    44package at.dallermassl.josm.plugin.navigator;
     
    2121/**
    2222 * Plugin that allows navigation in josm
    23  * 
     23 *
    2424 * @author cdaller
    25  * 
     25 *
    2626 */
    2727public class NavigatorPlugin extends Plugin {
     
    3131
    3232    /**
    33      * 
     33     *
    3434     */
    3535    public NavigatorPlugin() {
     
    4040        navigatorLayer = new NavigatorLayer(tr("Navigation"));
    4141        navigatorLayer.setNavigatorNodeModel(navigatorModel);
    42        
     42
    4343        JMenuBar menu = Main.main.menu;
    4444        JMenu navigatorMenu = new JMenu(tr("Navigation"));
     
    5555        menu.add(navigatorMenu);
    5656    }
    57    
     57
    5858    /**
    5959     * Reads the weight values for the different highway types from the preferences.
     
    7070        }
    7171    }
    72    
     72
    7373    /**
    74      * Checks if there are any highway weights set in the preferences. If not, default 
     74     * Checks if there are any highway weights set in the preferences. If not, default
    7575     * values are used.
    7676     */
     
    8686        setDefaultWeight("footway", 0.0);
    8787    }
    88    
     88
    8989    private void setDefaultWeight(String type, double value) {
    9090        if(!Main.pref.hasKey(KEY_HIGHWAY_WEIGHT_PREFIX + type)) {
     
    9292        }
    9393    }
    94    
     94
    9595    /* (non-Javadoc)
    9696     * @see org.openstreetmap.josm.plugins.Plugin#mapFrameInitialized(org.openstreetmap.josm.gui.MapFrame, org.openstreetmap.josm.gui.MapFrame)
     
    9999    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    100100        if(newFrame != null) {
    101             IconToggleButton button = new IconToggleButton(new NavigatorModeAction(newFrame, navigatorModel, navigatorLayer)); 
     101            IconToggleButton button = new IconToggleButton(new NavigatorModeAction(newFrame, navigatorModel, navigatorLayer));
    102102            newFrame.toolBarActions.add(button);
    103103            newFrame.toolGroup.add(button);
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/OsmGraphCreator.java

    r3892 r12778  
    11/**
    2  * 
     2 *
    33 */
    44package at.dallermassl.josm.plugin.navigator;
     
    2323/**
    2424 * @author cdaller
    25  * 
     25 *
    2626 */
    2727public class OsmGraphCreator {
     
    3838        highwayWeight = new HashMap<String, Double>();
    3939    }
    40    
     40
    4141    /**
    4242     * Set the weight for the given highway type. The higher the weight is,
     
    5858        // iterate all ways and segments for all nodes:
    5959        for(Way way : Main.ds.ways) {
    60             if(way != null && !way.deleted) {               
     60            if(way != null && !way.deleted) {
    6161                for(Segment segment : way.segments) {
    6262                    if(segment != null && !segment.deleted && segment.from != null && segment.to != null) {
     
    6767                        graph.addEdge(segment.from, segment.to, edge);
    6868                        weight = getWeight(way, segment);
    69                         System.out.println("edge for segment " + segment.id + "(from node "+ segment.from.id + " to node " 
     69                        System.out.println("edge for segment " + segment.id + "(from node "+ segment.from.id + " to node "
    7070                            + segment.to.id + ") has weight: " + weight);
    7171                        graph.setEdgeWeight(edge, weight);
     
    7474                            edge.setWay(way);
    7575                            graph.addEdge(segment.to, segment.from, edge);
    76                             graph.setEdgeWeight(edge, weight);         
    77                             System.out.println("inverse segment " + segment.id + "(from node "+ segment.to.id + " to node " 
     76                            graph.setEdgeWeight(edge, weight);
     77                            System.out.println("inverse segment " + segment.id + "(from node "+ segment.to.id + " to node "
    7878                                + segment.from.id + ") has weight: " + weight);
    7979                        }
     
    105105        }
    106106        // deg to m (at equator :-):
    107         double distance = Math.sqrt(segment.from.coor.distance(segment.to.coor)) * 111000; 
     107        double distance = Math.sqrt(segment.from.coor.distance(segment.to.coor)) * 111000;
    108108        if(weight == 0.0) {
    109109            weight = 1E-20;
     
    191191    /**
    192192     * Returns the other segment for the given node (works only for non crossing nodes).
    193      * 
     193     *
    194194     * @param node
    195195     * @param segment
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/PathDescription.java

    r3833 r12778  
    11/**
    2  * 
     2 *
    33 */
    44package at.dallermassl.josm.plugin.navigator;
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/SegmentEdge.java

    r3834 r12778  
    11/**
    2  * 
     2 *
    33 */
    44package at.dallermassl.josm.plugin.navigator;
     
    1010/**
    1111 * @author cdaller
    12  * 
     12 *
    1313 */
    1414public class SegmentEdge extends DefaultWeightedEdge {
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/WayEdge.java

    r3686 r12778  
    11/**
    2  * 
     2 *
    33 */
    44package at.dallermassl.josm.plugin.navigator;
     
    1818  private Node endNode;
    1919  private List<Segment> segments;
    20  
     20
    2121  public WayEdge() {
    22    
     22
    2323  }
    24  
     24
    2525  public WayEdge(int length) {
    2626    this.length = length;
     
    8282    this.endNode = endNode;
    8383  }
    84  
    85  
     84
     85
    8686
    8787}
Note: See TracChangeset for help on using the changeset viewer.