Changeset 31312 in osm for applications


Ignore:
Timestamp:
2015-06-26T10:14:04+02:00 (9 years ago)
Author:
nokutu
Message:

Code cleaned and commented

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java

    r31311 r31312  
    66import org.openstreetmap.josm.data.cache.ICachedLoaderListener;
    77import org.openstreetmap.josm.plugins.mapillary.cache.MapillaryCache;
     8import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryFilterDialog;
     9import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryToggleDialog;
    810
    911import java.util.ArrayList;
     
    129131                if (!TEST_MODE)
    130132                        Main.map.mapView.repaint();
     133                MapillaryFilterDialog.getInstance().refresh();
     134                MapillaryToggleDialog.getInstance().updateImage();
    131135        }
    132136
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterChooseSigns.java

    r31311 r31312  
    1313
    1414public class MapillaryFilterChooseSigns extends JPanel implements
    15         ActionListener {
     15                ActionListener {
    1616
    17     public final JCheckBox maxspeed = new JCheckBox();
    18     public final JCheckBox stop = new JCheckBox();
    19     public final JCheckBox giveWay = new JCheckBox();
    20     public final JCheckBox roundabout = new JCheckBox();
    21     public final JCheckBox access = new JCheckBox();
    22     public final JCheckBox intersection = new JCheckBox();
    23     public final JCheckBox direction = new JCheckBox();
     17        public final JCheckBox maxspeed = new JCheckBox();
     18        public final JCheckBox stop = new JCheckBox();
     19        public final JCheckBox giveWay = new JCheckBox();
     20        public final JCheckBox roundabout = new JCheckBox();
     21        public final JCheckBox access = new JCheckBox();
     22        public final JCheckBox intersection = new JCheckBox();
     23        public final JCheckBox direction = new JCheckBox();
    2424
    25     private static MapillaryFilterChooseSigns INSTANCE;
     25        private static MapillaryFilterChooseSigns INSTANCE;
    2626
    27     public MapillaryFilterChooseSigns() {
    28         maxspeed.setSelected(true);
    29         stop.setSelected(true);
    30         giveWay.setSelected(true);
    31         roundabout.setSelected(true);
    32         access.setSelected(true);
    33         intersection.setSelected(true);
    34         direction.setSelected(true);
     27        public MapillaryFilterChooseSigns() {
     28                maxspeed.setSelected(true);
     29                stop.setSelected(true);
     30                giveWay.setSelected(true);
     31                roundabout.setSelected(true);
     32                access.setSelected(true);
     33                intersection.setSelected(true);
     34                direction.setSelected(true);
    3535
    36        
    37         // Max speed sign
    38         JPanel maxspeedPanel = new JPanel();
    39         JLabel maxspeedLabel = new JLabel(tr("Speed limit"));
    40         maxspeedLabel.setIcon(new ImageProvider(
    41                 "signs/speed.png").get());
    42         maxspeedPanel.add(maxspeedLabel);
    43         maxspeedPanel.add(maxspeed);
    44         this.add(maxspeedPanel);
     36                // Max speed sign
     37                JPanel maxspeedPanel = new JPanel();
     38                JLabel maxspeedLabel = new JLabel(tr("Speed limit"));
     39                maxspeedLabel.setIcon(new ImageProvider("signs/speed.png").get());
     40                maxspeedPanel.add(maxspeedLabel);
     41                maxspeedPanel.add(maxspeed);
     42                this.add(maxspeedPanel);
    4543
    46         // Stop sign
    47         JPanel stopPanel = new JPanel();
    48         JLabel stopLabel = new JLabel(tr("Stop"));
    49         stopLabel.setIcon(new ImageProvider(
    50                 "signs/stop.png").get());
    51         stopPanel.add(stopLabel);
    52         stopPanel.add(stop);
    53         this.add(stopPanel);
     44                // Stop sign
     45                JPanel stopPanel = new JPanel();
     46                JLabel stopLabel = new JLabel(tr("Stop"));
     47                stopLabel.setIcon(new ImageProvider("signs/stop.png").get());
     48                stopPanel.add(stopLabel);
     49                stopPanel.add(stop);
     50                this.add(stopPanel);
    5451
    55         // Give way sign
    56         JPanel giveWayPanel = new JPanel();
    57         JLabel giveWayLabel = new JLabel(tr("Give way"));
    58         giveWayLabel.setIcon(new ImageProvider(
    59                 "signs/right_of_way.png").get());
    60         giveWayPanel.add(giveWayLabel);
    61         giveWayPanel.add(giveWay);
    62         this.add(giveWayPanel);
     52                // Give way sign
     53                JPanel giveWayPanel = new JPanel();
     54                JLabel giveWayLabel = new JLabel(tr("Give way"));
     55                giveWayLabel.setIcon(new ImageProvider("signs/right_of_way.png").get());
     56                giveWayPanel.add(giveWayLabel);
     57                giveWayPanel.add(giveWay);
     58                this.add(giveWayPanel);
    6359
    64         // Roundabout sign
    65         JPanel roundaboutPanel = new JPanel();
    66         JLabel roundaboutLabel = new JLabel(tr("Give way"));
    67         roundaboutLabel.setIcon(new ImageProvider(
    68                 "signs/roundabout_right.png")
    69                 .get());
    70         roundaboutPanel.add(roundaboutLabel);
    71         roundaboutPanel.add(roundabout);
    72         this.add(roundaboutPanel);
     60                // Roundabout sign
     61                JPanel roundaboutPanel = new JPanel();
     62                JLabel roundaboutLabel = new JLabel(tr("Give way"));
     63                roundaboutLabel.setIcon(new ImageProvider("signs/roundabout_right.png")
     64                                .get());
     65                roundaboutPanel.add(roundaboutLabel);
     66                roundaboutPanel.add(roundabout);
     67                this.add(roundaboutPanel);
    7368
    74         // No entry sign
    75         // TODO need icon
    76         JPanel noEntryPanel = new JPanel();
    77         JLabel noEntryLabel = new JLabel(tr("No entry"));
    78         noEntryLabel.setIcon(new ImageProvider(
    79                 "signs/no_entry.png").get());
    80         noEntryPanel.add(noEntryLabel);
    81         noEntryPanel.add(access);
    82         this.add(noEntryPanel);
    83        
    84         // Danger intersection
    85         JPanel intersectionPanel = new JPanel();
    86         JLabel intersectionLabel = new JLabel(tr("Intersection danger"));
    87         intersectionLabel.setIcon(new ImageProvider(
    88                 "signs/intersection_danger.png").get());
    89         intersectionPanel.add(intersectionLabel);
    90         intersectionPanel.add(intersection);
    91         this.add(intersectionPanel);
    92        
    93         // Mandatory direction
    94         JPanel directionPanel = new JPanel();
    95         JLabel directionLabel = new JLabel(tr("Mandatory direction (any)"));
    96         directionLabel.setIcon(new ImageProvider(
    97                 "signs/only_straight_on.png").get());
    98         directionPanel.add(directionLabel);
    99         directionPanel.add(direction);
    100         this.add(directionPanel);
    101     }
     69                // No entry sign
     70                JPanel noEntryPanel = new JPanel();
     71                JLabel noEntryLabel = new JLabel(tr("No entry"));
     72                noEntryLabel.setIcon(new ImageProvider("signs/no_entry.png").get());
     73                noEntryPanel.add(noEntryLabel);
     74                noEntryPanel.add(access);
     75                this.add(noEntryPanel);
    10276
    103     public static MapillaryFilterChooseSigns getInstance() {
    104         if (INSTANCE == null)
    105             INSTANCE = new MapillaryFilterChooseSigns();
    106         return INSTANCE;
    107     }
     77                // Danger intersection
     78                JPanel intersectionPanel = new JPanel();
     79                JLabel intersectionLabel = new JLabel(tr("Intersection danger"));
     80                intersectionLabel.setIcon(new ImageProvider(
     81                                "signs/intersection_danger.png").get());
     82                intersectionPanel.add(intersectionLabel);
     83                intersectionPanel.add(intersection);
     84                this.add(intersectionPanel);
    10885
    109     @Override
    110     public void actionPerformed(ActionEvent arg0) {
    111         // TODO Auto-generated method stub
     86                // Mandatory direction
     87                JPanel directionPanel = new JPanel();
     88                JLabel directionLabel = new JLabel(tr("Mandatory direction (any)"));
     89                directionLabel.setIcon(new ImageProvider("signs/only_straight_on.png")
     90                                .get());
     91                directionPanel.add(directionLabel);
     92                directionPanel.add(direction);
     93                this.add(directionPanel);
     94        }
    11295
    113     }
     96        public static MapillaryFilterChooseSigns getInstance() {
     97                if (INSTANCE == null)
     98                        INSTANCE = new MapillaryFilterChooseSigns();
     99                return INSTANCE;
     100        }
     101
     102        @Override
     103        public void actionPerformed(ActionEvent arg0) {
     104                // TODO Auto-generated method stub
     105
     106        }
    114107
    115108}
Note: See TracChangeset for help on using the changeset viewer.