Changeset 158 in josm for src/org/openstreetmap/josm/gui


Ignore:
Timestamp:
2006-10-08T21:45:13+02:00 (19 years ago)
Author:
imi
Message:
  • added possibility to support a locale in .josm/lang/*.jar
  • fixed bug that displayed the layer's context menu at wrong place
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r155 r158  
    66import java.awt.Component;
    77import java.awt.GridLayout;
     8import java.awt.Point;
    89import java.awt.event.ActionEvent;
    910import java.awt.event.ActionListener;
     
    4950         */
    5051        static JList instance;
    51 
     52        private JScrollPane listScrollPane;
     53       
    5254        public final static class DeleteLayerAction extends AbstractAction {
    5355
     
    120122                super(tr("Layers"), "layerlist", tr("Open a list of all loaded layers."), KeyEvent.VK_L, 100);
    121123                instance = new JList(model);
    122                 add(new JScrollPane(instance), BorderLayout.CENTER);
     124                listScrollPane = new JScrollPane(instance);
     125                add(listScrollPane, BorderLayout.CENTER);
    123126                instance.setBackground(UIManager.getColor("Button.background"));
    124127                instance.setCellRenderer(new DefaultListCellRenderer(){
     
    160163                                Layer layer = (Layer)instance.getModel().getElementAt(index);
    161164                                LayerListPopup menu = new LayerListPopup(instance, layer);
    162                                 menu.show(LayerListDialog.this, e.getX(), e.getY());
     165                                Point p = listScrollPane.getMousePosition();
     166                                menu.show(listScrollPane, p.x, p.y-3);
    163167                        }
    164168                        @Override public void mousePressed(MouseEvent e) {
Note: See TracChangeset for help on using the changeset viewer.