123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package view;
-
- /**
- *
- * @author matthias
- */
- public class gui extends javax.swing.JFrame {
- /**
- * @return the btnUndo
- */
- public javax.swing.JButton getBtnUndo()
- {
- return btnUndo;
- }
- /**
- * @return the contentTable1
- */
- public view.ContentTable getContentTable1()
- {
- return contentTable1;
- }
- /**
- * @return the FileChooser
- */
- public javax.swing.JFileChooser getFileChooser()
- {
- return FileChooser;
- }
- /**
- * @return the lblFilePath
- */
- public javax.swing.JLabel getLblFilePath()
- {
- return lblFilePath;
- }
-
- /**
- * @return the miNewFile
- */
- public javax.swing.JMenuItem getMiNewFile()
- {
- return miNewFile;
- }
-
- /**
- * @return the miOpen
- */
- public javax.swing.JMenuItem getMiOpen()
- {
- return miOpen;
- }
-
- /**
- * @return the miOpen_popup
- */
- public javax.swing.JMenuItem getMiOpen_popup()
- {
- return miOpen_popup;
- }
- /**
- * @return the FileDialog
- */
- public javax.swing.JDialog getFileDialog()
- {
- return FileDialog;
- }
-
- /**
- * @return the btnOpen
- */
- public javax.swing.JButton getBtnOpen()
- {
- return btnOpen;
- }
-
- /**
- * @return the btnSave
- */
- public javax.swing.JButton getBtnSave()
- {
- return btnSave;
- }
-
- /**
- * @return the miSave
- */
- public javax.swing.JMenuItem getMiSave()
- {
- return miSave;
- }
-
- /**
- * @return the miSave_popup
- */
- public javax.swing.JMenuItem getMiSave_popup()
- {
- return miSave_popup;
- }
-
- /**
- * Creates new form NewJFrame
- */
- public gui() {
- initComponents();
- }
-
- /**
- * This method is called from within the constructor to initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is always
- * regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
- private void initComponents()
- {
-
- jPopupMenu1 = new javax.swing.JPopupMenu();
- miSave_popup = new javax.swing.JMenuItem();
- miOpen_popup = new javax.swing.JMenuItem();
- FileDialog = new javax.swing.JDialog();
- FileDialogP1 = new javax.swing.JPanel();
- FileChooser = new javax.swing.JFileChooser();
- jToolBar1 = new javax.swing.JToolBar();
- btnOpen = new javax.swing.JButton();
- btnSave = new javax.swing.JButton();
- btnUndo = new javax.swing.JButton();
- lblFilePath = new javax.swing.JLabel();
- contentTable1 = new view.ContentTable();
- jMenuBar1 = new javax.swing.JMenuBar();
- jmFile = new javax.swing.JMenu();
- miSave = new javax.swing.JMenuItem();
- jmOpenPU = new javax.swing.JMenu();
- miNewFile = new javax.swing.JMenuItem();
- miOpen = new javax.swing.JMenuItem();
- jmEdit = new javax.swing.JMenu();
-
- jPopupMenu1.setComponentPopupMenu(jPopupMenu1);
-
- miSave_popup.setMnemonic('s');
- miSave_popup.setText("save");
- miSave_popup.setToolTipText("save this file");
- jPopupMenu1.add(miSave_popup);
-
- miOpen_popup.setMnemonic('o');
- miOpen_popup.setText("open");
- miOpen_popup.setToolTipText("open a file");
- jPopupMenu1.add(miOpen_popup);
-
- javax.swing.GroupLayout FileDialogP1Layout = new javax.swing.GroupLayout(FileDialogP1);
- FileDialogP1.setLayout(FileDialogP1Layout);
- FileDialogP1Layout.setHorizontalGroup(
- FileDialogP1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 0, Short.MAX_VALUE)
- .addGroup(FileDialogP1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(FileDialogP1Layout.createSequentialGroup()
- .addGap(0, 0, Short.MAX_VALUE)
- .addComponent(FileChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, Short.MAX_VALUE)))
- );
- FileDialogP1Layout.setVerticalGroup(
- FileDialogP1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 0, Short.MAX_VALUE)
- .addGroup(FileDialogP1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(FileDialogP1Layout.createSequentialGroup()
- .addGap(0, 0, Short.MAX_VALUE)
- .addComponent(FileChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, Short.MAX_VALUE)))
- );
-
- javax.swing.GroupLayout FileDialogLayout = new javax.swing.GroupLayout(FileDialog.getContentPane());
- FileDialog.getContentPane().setLayout(FileDialogLayout);
- FileDialogLayout.setHorizontalGroup(
- FileDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 400, Short.MAX_VALUE)
- .addGroup(FileDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(FileDialogLayout.createSequentialGroup()
- .addGap(0, 0, Short.MAX_VALUE)
- .addComponent(FileDialogP1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, Short.MAX_VALUE)))
- );
- FileDialogLayout.setVerticalGroup(
- FileDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 300, Short.MAX_VALUE)
- .addGroup(FileDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(FileDialogLayout.createSequentialGroup()
- .addGap(0, 0, Short.MAX_VALUE)
- .addComponent(FileDialogP1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, Short.MAX_VALUE)))
- );
-
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- setTitle("Adressverwalter");
- setSize(new java.awt.Dimension(600, 600));
-
- jToolBar1.setRollover(true);
-
- btnOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/icons/Open24.gif"))); // NOI18N
- btnOpen.setMnemonic('O');
- btnOpen.setToolTipText("Open a file");
- btnOpen.setFocusable(false);
- btnOpen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnOpen.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
- jToolBar1.add(btnOpen);
-
- btnSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/icons/Save24.gif"))); // NOI18N
- btnSave.setMnemonic('S');
- btnSave.setToolTipText("Save this file");
- btnSave.setFocusable(false);
- btnSave.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnSave.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
- jToolBar1.add(btnSave);
-
- btnUndo.setText("undo");
- btnUndo.setFocusable(false);
- btnUndo.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnUndo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
- jToolBar1.add(btnUndo);
-
- getContentPane().add(jToolBar1, java.awt.BorderLayout.PAGE_START);
-
- lblFilePath.setText("/");
- lblFilePath.setToolTipText("File location");
- getContentPane().add(lblFilePath, java.awt.BorderLayout.PAGE_END);
-
- contentTable1.setComponentPopupMenu(jPopupMenu1);
- getContentPane().add(contentTable1, java.awt.BorderLayout.CENTER);
-
- jmFile.setText("File");
-
- miSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
- miSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/icons/Save24.gif"))); // NOI18N
- miSave.setMnemonic('s');
- miSave.setText("Save");
- miSave.setToolTipText("Save current file");
- jmFile.add(miSave);
-
- jmOpenPU.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/icons/Open24.gif"))); // NOI18N
- jmOpenPU.setMnemonic('O');
- jmOpenPU.setText("Open");
-
- miNewFile.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
- miNewFile.setMnemonic('n');
- miNewFile.setText("new");
- miNewFile.setToolTipText("create a new file");
- jmOpenPU.add(miNewFile);
-
- miOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
- miOpen.setMnemonic('o');
- miOpen.setText("open");
- miOpen.setToolTipText("open a existing file");
- jmOpenPU.add(miOpen);
-
- jmFile.add(jmOpenPU);
-
- jMenuBar1.add(jmFile);
-
- jmEdit.setText("Edit");
- jMenuBar1.add(jmEdit);
-
- setJMenuBar(jMenuBar1);
-
- setSize(new java.awt.Dimension(564, 425));
- setLocationRelativeTo(null);
- }// </editor-fold>//GEN-END:initComponents
-
- /**
- * @param args the command line arguments
- */
- public static void main(String args[]) {
- /* Set the Nimbus look and feel */
- //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
- /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
- * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
- */
- try {
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (ClassNotFoundException ex) {
- java.util.logging.Logger.getLogger(gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- //</editor-fold>
- //</editor-fold>
-
- /* Create and display the form */
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new gui().setVisible(true);
- }
- });
- }
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JFileChooser FileChooser;
- private javax.swing.JDialog FileDialog;
- private javax.swing.JPanel FileDialogP1;
- private javax.swing.JButton btnOpen;
- private javax.swing.JButton btnSave;
- private javax.swing.JButton btnUndo;
- private view.ContentTable contentTable1;
- private javax.swing.JMenuBar jMenuBar1;
- private javax.swing.JPopupMenu jPopupMenu1;
- private javax.swing.JToolBar jToolBar1;
- private javax.swing.JMenu jmEdit;
- private javax.swing.JMenu jmFile;
- private javax.swing.JMenu jmOpenPU;
- private javax.swing.JLabel lblFilePath;
- private javax.swing.JMenuItem miNewFile;
- private javax.swing.JMenuItem miOpen;
- private javax.swing.JMenuItem miOpen_popup;
- private javax.swing.JMenuItem miSave;
- private javax.swing.JMenuItem miSave_popup;
- // End of variables declaration//GEN-END:variables
- }
|