Ignore:
Timestamp:
2009-11-24T10:45:04+01:00 (14 years ago)
Author:
stoecker
Message:

i18n updated, fixed files to reduce problems when applying patches, fix #4017

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java

    r2387 r2512  
    4343    /** the list of bookmarks */
    4444    private BookmarkList bookmarks;
    45    
     45
    4646    /** the parent download GUI */
    4747    private DownloadDialog parent;
    48    
     48
    4949    /** displays information about the current download area */
    5050    private JMultilineLabel lblCurrentDownloadArea;
    5151    /** the add action */
    5252    private AddAction actAdd;
    53    
     53
    5454    /**
    55      * Creates the panel with the action buttons on the left 
    56      * 
     55     * Creates the panel with the action buttons on the left
     56     *
    5757     * @return the panel with the action buttons on the left
    5858     */
     
    7878        return pnl;
    7979    }
    80    
     80
    8181    protected JPanel buildDownloadAreaAddPanel() {
    8282        JPanel pnl = new JPanel();
    8383        pnl.setLayout(new GridBagLayout());
    84        
     84
    8585        GridBagConstraints  gc = new GridBagConstraints();
    8686        gc.anchor = GridBagConstraints.NORTHWEST;
     
    8989        gc.weighty = 1.0;
    9090        gc.insets = new Insets(5,5,5,5);
    91        
     91
    9292        pnl.add(lblCurrentDownloadArea = new JMultilineLabel(""), gc);
    93        
     93
    9494        gc.anchor = GridBagConstraints.NORTHEAST;
    9595        gc.fill = GridBagConstraints.HORIZONTAL;
     
    100100        return pnl;
    101101    }
    102  
     102
    103103    public void addGui(final DownloadDialog gui) {
    104104        JPanel dlg = new JPanel(new GridBagLayout());
    105105        gui.addDownloadAreaSelector(dlg, tr("Bookmarks"));
    106106        GridBagConstraints gc = new GridBagConstraints();
    107      
    108        
     107
    109108        bookmarks = new BookmarkList();
    110109        bookmarks.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
     
    117116        });
    118117        bookmarks.addMouseListener(new DoubleClickAdapter());
    119        
     118
    120119        gc.fill = GridBagConstraints.HORIZONTAL;
    121120        gc.weightx = 1.0;
    122         gc.weighty = 0.0;       
     121        gc.weighty = 0.0;
    123122        gc.gridwidth = 2;
    124123        dlg.add(buildDownloadAreaAddPanel(),gc);
    125                
     124
    126125        gc.gridwidth = 1;
    127126        gc.gridx = 0;
     
    129128        gc.fill = GridBagConstraints.VERTICAL;
    130129        gc.weightx = 0.0;
    131         gc.weighty = 1.0;       
     130        gc.weighty = 1.0;
    132131        dlg.add(buildButtonPanel(),gc);
    133132
     
    137136        gc.fill = GridBagConstraints.BOTH;
    138137        gc.weightx = 1.0;
    139         gc.weighty = 1.0;   
     138        gc.weighty = 1.0;
    140139        gc.gridx = 1;
    141         dlg.add(new JScrollPane(bookmarks), gc);       
    142        
     140        dlg.add(new JScrollPane(bookmarks), gc);
     141
    143142        this.parent = gui;
    144143    }
    145    
     144
    146145    protected void updateDownloadAreaLabel() {
    147146        if (currentArea == null) {
     
    154153                    currentArea.getMax().lonToString(CoordinateFormat.DECIMAL_DEGREES)
    155154                    )
    156             );                   
    157         }
    158     }
    159    
     155            );
     156        }
     157    }
     158
    160159    /**
    161      * Sets the current download area 
    162      * 
    163      * @param area the download area. 
     160     * Sets the current download area
     161     *
     162     * @param area the download area.
    164163     */
    165164    public void setDownloadArea(Bounds area) {
     
    170169        actAdd.setEnabled(area != null);
    171170    }
    172    
     171
    173172    /**
    174173     * The action to add a new bookmark for the current download area.
     
    181180            putValue(SHORT_DESCRIPTION, tr("Add a bookmark for the currently selected download area"));
    182181        }
    183        
     182
    184183        public void actionPerformed(ActionEvent e) {
    185184            if (currentArea == null) {
     
    203202                ((DefaultListModel)bookmarks.getModel()).addElement(b);
    204203                bookmarks.save();
    205             }           
    206         }
    207     }
    208    
     204            }
     205        }
     206    }
     207
    209208    class RemoveAction extends AbstractAction implements ListSelectionListener{
    210209        public RemoveAction() {
     
    214213            updateEnabledState();
    215214        }
    216        
     215
    217216        public void actionPerformed(ActionEvent e) {
    218217            Object[] sels = bookmarks.getSelectedValues();
     
    230229        public void valueChanged(ListSelectionEvent e) {
    231230            updateEnabledState();
    232         }       
    233     }
    234    
     231        }
     232    }
     233
    235234    class RenameAction extends AbstractAction implements ListSelectionListener{
    236235        public RenameAction() {
     
    240239            updateEnabledState();
    241240        }
    242        
     241
    243242        public void actionPerformed(ActionEvent e) {
    244243            Object[] sels = bookmarks.getSelectedValues();
     
    247246            }
    248247            Bookmark b = (Bookmark)sels[0];
    249             Object value = 
     248            Object value =
    250249                    JOptionPane.showInputDialog(
    251250                    Main.parent,tr("Please enter a name for the bookmarked download area."),
     
    257256                    );
    258257            if (value != null) {
    259                 b.setName(value.toString());           
     258                b.setName(value.toString());
    260259                bookmarks.save();
    261260                bookmarks.repaint();
     
    267266        public void valueChanged(ListSelectionEvent e) {
    268267            updateEnabledState();
    269         }       
    270     }
    271    
     268        }
     269    }
     270
    272271    class DoubleClickAdapter extends MouseAdapter {
    273272        @Override
    274273        public void mouseClicked(MouseEvent e) {
    275             if (!(SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2)) 
     274            if (!(SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2))
    276275                return;
    277276            int idx = bookmarks.locationToIndex(e.getPoint());
     
    279278                return;
    280279            Bookmark b = (Bookmark)bookmarks.getModel().getElementAt(idx);
    281             parent.startDownload(b.getArea());           
    282         }       
    283     }   
     280            parent.startDownload(b.getArea());
     281        }
     282    }
    284283}
Note: See TracChangeset for help on using the changeset viewer.