Changeset 1028 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2008-10-06T00:24:38+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
r999 r1028 6 6 7 7 import java.awt.Dimension; 8 import java.awt.Graphics; 8 9 import java.awt.GridBagLayout; 9 10 import java.awt.event.ActionEvent; … … 27 28 import javax.swing.BorderFactory; 28 29 import javax.swing.Box; 30 import javax.swing.BoxLayout; 29 31 import javax.swing.DefaultListModel; 30 32 import javax.swing.JButton; … … 78 80 79 81 private Map<PluginDescription, Boolean> pluginMap; 80 private Box pluginPanel = Box.createVerticalBox();81 82 private JPanel plugin; 83 private class MyBox extends Box { 84 int lastwidth; 85 int offset = 40; 86 public MyBox() 87 { 88 super(BoxLayout.Y_AXIS); 89 } 90 public int myGetWidth() 91 { 92 int w = plugin.getWidth()-offset; 93 if(w <= 0) w = 450; 94 lastwidth = w; 95 return w; 96 } 97 public void paint(Graphics g) 98 { 99 if(lastwidth != plugin.getWidth()-offset) 100 refreshPluginPanel(gui); 101 super.paint(g); 102 } 103 } 104 private MyBox pluginPanel = new MyBox(); 82 105 private PreferenceDialog gui; 83 106 … … 209 232 pluginMap = new HashMap<PluginDescription, Boolean>(); 210 233 pluginPanel.removeAll(); 234 int width = pluginPanel.myGetWidth(); 211 235 212 236 // the following could probably be done more elegantly? … … 246 270 JLabel label = new JLabel("<html><i>"+(plugin.description==null?tr("no description available"):plugin.description)+"</i></html>"); 247 271 label.setBorder(BorderFactory.createEmptyBorder(0,20,0,0)); 248 label.setMaximumSize(new Dimension( 450,1000));272 label.setMaximumSize(new Dimension(width,1000)); 249 273 pluginPanel.add(label); 250 274 pluginPanel.add(Box.createVerticalStrut(5));
Note:
See TracChangeset
for help on using the changeset viewer.