Changeset 6708 in josm for trunk/src/org
- Timestamp:
- 2014-01-17T01:49:03+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java
r6380 r6708 5 5 import static org.openstreetmap.josm.tools.I18n.tr; 6 6 7 import java.awt.Component; 8 import java.awt.Dimension; 7 9 import java.awt.event.ActionEvent; 8 10 import java.util.ArrayList; … … 17 19 18 20 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.gui.ExtendedDialog; 19 22 import org.openstreetmap.josm.gui.layer.Layer; 20 23 import org.openstreetmap.josm.gui.layer.Layer.LayerAction; … … 30 33 public final static class InfoAction extends AbstractAction { 31 34 private final Layer layer; 35 36 /** 37 * Constructs a new {@code InfoAction} for the given layer. 38 * @param layer The layer 39 */ 32 40 public InfoAction(Layer layer) { 33 41 super(tr("Info"), ImageProvider.get("info")); … … 35 43 this.layer = layer; 36 44 } 45 37 46 @Override 38 47 public void actionPerformed(ActionEvent e) { 39 JOptionPane.showMessageDialog( 40 Main.parent, 41 layer.getInfoComponent(), 42 tr("Information about layer"), 43 JOptionPane.INFORMATION_MESSAGE 44 ); 48 Object object = layer.getInfoComponent(); 49 if (object instanceof Component) { 50 ExtendedDialog ed = new ExtendedDialog( 51 Main.parent, tr("Information about layer"), 52 new String[] {tr("OK")}); 53 ed.setButtonIcons(new String[] {"ok"}); 54 ed.setIcon(JOptionPane.INFORMATION_MESSAGE); 55 ed.setContent((Component) object); 56 ed.setResizable(layer.isInfoResizable()); 57 ed.setMinimumSize(new Dimension(270, 170)); 58 ed.showDialog(); 59 } else { 60 JOptionPane.showMessageDialog( 61 Main.parent, object, 62 tr("Information about layer"), 63 JOptionPane.INFORMATION_MESSAGE 64 ); 65 } 45 66 } 46 67 } -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r6666 r6708 221 221 222 222 final JScrollPane sp = new JScrollPane(new HtmlPanel(info.toString())); 223 sp.setPreferredSize(new Dimension(sp.getPreferredSize().width , 350));223 sp.setPreferredSize(new Dimension(sp.getPreferredSize().width+20, 370)); 224 224 SwingUtilities.invokeLater(new Runnable() { 225 225 @Override … … 229 229 }); 230 230 return sp; 231 } 232 233 @Override 234 public boolean isInfoResizable() { 235 return true; 231 236 } 232 237 -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r6084 r6708 184 184 185 185 /** 186 * Determines if info dialog can be resized (false by default). 187 * @return {@code true} if the info dialog can be resized, {@code false} otherwise 188 * @since 6708 189 */ 190 public boolean isInfoResizable() { 191 return false; 192 } 193 194 /** 186 195 * Returns list of actions. Action can implement LayerAction interface when it needs to be represented by other 187 196 * menu component than JMenuItem or when it supports multiple layers. Actions that support multiple layers should also
Note:
See TracChangeset
for help on using the changeset viewer.