Changeset 23271 in osm for applications/editors/josm
- Timestamp:
- 2010-09-19T15:54:17+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/src/smed
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/src/smed/menu/SmedMenuBar.java
r23262 r23271 1 1 package smed.menu; 2 2 3 import java.awt.event.ActionEvent; 4 import java.awt.event.ActionListener; 3 5 import java.awt.event.KeyEvent; 4 6 7 import javax.swing.JDialog; 5 8 import javax.swing.JMenu; 6 9 import javax.swing.JMenuBar; 7 10 import javax.swing.JMenuItem; 8 11 import javax.swing.JPanel; 12 import javax.swing.SwingUtilities; 9 13 10 14 import smed.menu.file.HideAction; … … 35 39 36 40 public void actionPerformed(java.awt.event.ActionEvent e) { 37 JPanel panelHide = new HideAction(); 38 panelHide.setVisible(true); 41 HideAction hideAction = new HideAction(); 42 43 JDialog dialogHide = hideAction.getHideDialog(); 44 45 dialogHide.setVisible(true); 39 46 } 40 47 }); -
applications/editors/josm/plugins/smed/src/smed/menu/file/HideAction.java
r23262 r23271 1 1 package smed.menu.file; 2 2 3 4 import java.awt.Dialog; 5 6 import javax.swing.JCheckBoxMenuItem; 7 import javax.swing.JDialog; 3 8 import javax.swing.JPanel; 4 import java.awt. GridBagLayout;9 import java.awt.BorderLayout; 5 10 import java.awt.Dimension; 6 11 import javax.swing.JButton; 12 import java.awt.Rectangle; 13 import javax.swing.JList; 14 import javax.swing.border.BevelBorder; 15 import javax.swing.border.Border; 16 import javax.swing.border.LineBorder; 17 18 import java.awt.GridBagLayout; 7 19 import java.awt.GridBagConstraints; 8 import javax.swing.JList; 9 import java.awt.Rectangle; 10 11 public class HideAction extends JPanel { 20 public class HideAction { 12 21 13 22 /** … … 15 24 */ 16 25 private static final long serialVersionUID = 1L; 17 private JPanel jPanel = null; // @jve:decl-index=0:visual-constraint="80,35" 18 private JButton jButton = null; 19 private JList jList = null; 26 private JDialog hideDialog = null; // @jve:decl-index=0:visual-constraint="62,8" 27 private JPanel jContentPane = null; 28 private JButton okButton = null; 29 private JList hideList = null; 20 30 /** 21 * This method initializes jPanel 31 * This method initializes hideDialog 32 * 33 * @return javax.swing.JDialog 34 */ 35 public JDialog getHideDialog() { 36 if (hideDialog == null) { 37 hideDialog = new JDialog(); 38 hideDialog.setResizable(false); 39 hideDialog.setSize(new Dimension(360, 480)); 40 hideDialog.setModal(false); 41 hideDialog.setTitle("Hide Tab"); 42 hideDialog.setContentPane(getJContentPane()); 43 } 44 return hideDialog; 45 } 46 /** 47 * This method initializes jContentPane 22 48 * 23 49 * @return javax.swing.JPanel 24 50 */ 25 private JPanel getJPanel() { 26 if (jPanel == null) { 27 jPanel = new JPanel(); 28 jPanel.setLayout(null); 29 jPanel.setSize(new Dimension(296, 443)); 30 jPanel.add(getJButton(), null); 31 jPanel.add(getJList(), null); 51 private JPanel getJContentPane() { 52 if (jContentPane == null) { 53 jContentPane = new JPanel(); 54 jContentPane.setLayout(null); 55 jContentPane.add(getOkButton(), null); 56 jContentPane.add(getHideList(), null); 32 57 } 33 return j Panel;58 return jContentPane; 34 59 } 35 60 /** 36 * This method initializes jButton61 * This method initializes okButton 37 62 * 38 63 * @return javax.swing.JButton 39 64 */ 40 private JButton getJButton() { 41 if (jButton == null) { 42 jButton = new JButton(); 43 jButton.setBounds(new Rectangle(90, 391, 114, 35)); 44 jButton.setText("Ok"); 65 private JButton getOkButton() { 66 if (okButton == null) { 67 okButton = new JButton(); 68 okButton.setBounds(new Rectangle(115, 400, 110, 20)); 69 okButton.setName(""); 70 okButton.setText("Ok"); 71 okButton.addActionListener(new java.awt.event.ActionListener() { 72 public void actionPerformed(java.awt.event.ActionEvent e) { 73 hideDialog.dispose(); 74 } 75 }); 45 76 } 46 return jButton;77 return okButton; 47 78 } 48 79 /** 49 * This method initializes jList80 * This method initializes hideList 50 81 * 51 82 * @return javax.swing.JList 52 83 */ 53 private JList getJList() { 54 if (jList == null) { 55 jList = new JList(); 56 jList.setBounds(new Rectangle(34, 43, 230, 307)); 84 private JList getHideList() { 85 if (hideList == null) { 86 hideList = new JList(); 87 hideList.setBounds(new Rectangle(20, 15, 315, 370)); 88 hideList.setBorder(LineBorder.createBlackLineBorder()); 89 JCheckBoxMenuItem item = new JCheckBoxMenuItem(); 57 90 } 58 return jList;91 return hideList; 59 92 } 60 61 93 } -
applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabAction.java
r23259 r23271 22 22 * 23 23 */ 24 24 private static final long serialVersionUID = 1L; 25 25 26 26 public SmedTabAction() {
Note:
See TracChangeset
for help on using the changeset viewer.