1 30 package com.genimen.djeneric.tools.modeler.dialogs; 31 32 import java.awt.BorderLayout ; 33 import java.awt.Dimension ; 34 import java.awt.Toolkit ; 35 import java.awt.event.ActionEvent ; 36 37 import javax.swing.JButton ; 38 import javax.swing.JDialog ; 39 import javax.swing.JPanel ; 40 41 import com.genimen.djeneric.language.Messages; 42 import com.genimen.djeneric.repository.DjPersistenceManager; 43 import com.genimen.djeneric.ui.Util; 44 import com.genimen.djeneric.util.DjLogger; 45 46 public class PackageEditorDialog extends JDialog 47 { 48 private static final long serialVersionUID = 1L; 49 JPanel panel1 = new JPanel (); 50 BorderLayout borderLayout1 = new BorderLayout (); 51 JPanel jPanel1 = new JPanel (); 52 PackageEditorPanel _pnlEditor; 53 BorderLayout borderLayout2 = new BorderLayout (); 54 JPanel jPanel2 = new JPanel (); 55 JButton _butOk = new JButton (); 56 57 public PackageEditorDialog(DjPersistenceManager mgr) 58 { 59 super(Util.findActiveFrame(), Messages.getString("PackageEditorDialog.title"), true); 60 try 61 { 62 _pnlEditor = new PackageEditorPanel(mgr); 63 jbInit(); 64 setSize(500, 500); 65 66 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 67 Dimension frameSize = getSize(); 68 setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); 69 70 setVisible(true); 71 } 72 catch (Exception ex) 73 { 74 DjLogger.log(ex); 75 } 76 } 77 78 private void jbInit() throws Exception 79 { 80 panel1.setLayout(borderLayout1); 81 jPanel1.setLayout(borderLayout2); 82 _butOk.setText("OK"); 83 _butOk.addActionListener(new PackageEditorDialog__butOk_actionAdapter(this)); 84 getContentPane().add(panel1); 85 panel1.add(jPanel1, BorderLayout.SOUTH); 86 panel1.add(_pnlEditor, BorderLayout.CENTER); 87 jPanel1.add(jPanel2, BorderLayout.EAST); 88 jPanel2.add(_butOk, null); 89 } 90 91 void _butOk_actionPerformed(ActionEvent e) 92 { 93 setVisible(false); 94 } 95 } 96 97 class PackageEditorDialog__butOk_actionAdapter implements java.awt.event.ActionListener 98 { 99 PackageEditorDialog adaptee; 100 101 PackageEditorDialog__butOk_actionAdapter(PackageEditorDialog adaptee) 102 { 103 this.adaptee = adaptee; 104 } 105 106 public void actionPerformed(ActionEvent e) 107 { 108 adaptee._butOk_actionPerformed(e); 109 } 110 } | Popular Tags |