Changeset 28648 in osm
- Timestamp:
- 2012-08-28T11:37:15+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/smed2
- Files:
-
- 6 added
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/build.xml
r28633 r28648 95 95 <manifest> 96 96 <attribute name="Author" value="Malcolm Herring"/> 97 <attribute name="Plugin-Class" value="smed .Smed"/>97 <attribute name="Plugin-Class" value="smed2.Smed2"/> 98 98 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 99 <attribute name="Plugin-Description" value=" Create and edit seamaps for OpenSeaMap"/>99 <attribute name="Plugin-Description" value="Edit features for OpenSeaMap"/> 100 100 <attribute name="Plugin-Icon" value="images/Smed.png"/> 101 101 <attribute name="Plugin-Link" value="http://openseamap.org/"/> -
applications/editors/josm/plugins/smed2/src/smed2/Smed2.java
r28640 r28648 1 package smed ;1 package smed2; 2 2 3 3 import org.openstreetmap.josm.Main; … … 7 7 8 8 public class Smed2 extends Plugin { 9 public Smed2(PluginInformation info) { 9 10 public Smed2(PluginInformation info) { 10 11 super(info); 11 MainMenu.add(Main.main.menu.toolsMenu, new Smed Action());12 MainMenu.add(Main.main.menu.toolsMenu, new Smed2Action()); 12 13 } 13 14 } -
applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
r28640 r28648 1 package smed ;1 package smed2; 2 2 3 import java.awt.Dimension; 3 4 import java.awt.event.ActionEvent; 4 5 6 import javax.swing.JFrame; 7 import javax.swing.SwingUtilities; 8 import javax.swing.WindowConstants; 9 10 import static org.openstreetmap.josm.tools.I18n.tr; 5 11 import org.openstreetmap.josm.actions.JosmAction; 6 12 7 public class SmedAction extends JosmAction { 13 import panels.PanelMain; 14 15 public class Smed2Action extends JosmAction { 8 16 9 17 private static final long serialVersionUID = 1L; 18 private static String editor = tr("SeaMap Editor"); 19 private JFrame frame = null; 20 private boolean isOpen = false; 21 public PanelMain panelMain = null; 10 22 11 public Smed Action() {12 23 public Smed2Action() { 24 super(editor, "Smed2", editor, null, true); 13 25 } 14 26 15 @Override27 @Override 16 28 public void actionPerformed(ActionEvent arg0) { 17 // TODO Auto-generated method stub 29 SwingUtilities.invokeLater(new Runnable() { 30 public void run() { 31 if (!isOpen) createFrame(); 32 else frame.toFront(); 33 isOpen = true; 34 } 35 }); 18 36 } 19 37 38 protected void createFrame() { 39 frame = new JFrame(editor); 40 frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 41 frame.setResizable(true); 42 frame.setAlwaysOnTop(false); 43 44 frame.addWindowListener(new java.awt.event.WindowAdapter() { 45 public void windowClosing(java.awt.event.WindowEvent e) { 46 closeDialog(); 47 } 48 }); 49 frame.setSize(new Dimension(480, 480)); 50 frame.setVisible(true); 51 panelMain = new PanelMain(); 52 frame.add(panelMain); 53 } 54 55 public void closeDialog() { 56 if (isOpen) { 57 frame.setVisible(false); 58 frame.dispose(); 59 } 60 isOpen = false; 61 } 62 20 63 } 21
Note:
See TracChangeset
for help on using the changeset viewer.