From d4374d13fdcabaa92c11036e88087d3e54e66671 Mon Sep 17 00:00:00 2001 From: schuhmannje82308 Date: Mon, 4 Dec 2023 13:24:11 +0100 Subject: [PATCH] =?UTF-8?q?Bisschen=20Men=C3=BC=20ged=C3=B6ns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mvcgrafik/view/GrafikFrame.form | 45 ++++++++++++++-- src/mvcgrafik/view/GrafikFrame.java | 84 ++++++++++++++++++++++++----- 2 files changed, 114 insertions(+), 15 deletions(-) diff --git a/src/mvcgrafik/view/GrafikFrame.form b/src/mvcgrafik/view/GrafikFrame.form index 70c71e8..0c50687 100644 --- a/src/mvcgrafik/view/GrafikFrame.form +++ b/src/mvcgrafik/view/GrafikFrame.form @@ -1,10 +1,51 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31,9 +72,7 @@ - - - + diff --git a/src/mvcgrafik/view/GrafikFrame.java b/src/mvcgrafik/view/GrafikFrame.java index e0c31a1..5a15727 100644 --- a/src/mvcgrafik/view/GrafikFrame.java +++ b/src/mvcgrafik/view/GrafikFrame.java @@ -32,18 +32,59 @@ public class GrafikFrame extends javax.swing.JFrame * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() - { + // //GEN-BEGIN:initComponents + private void initComponents() { - gZeichenflaeche = new mvcgrafik.view.GrafikView(); + gZeichenflaeche = new mvcgrafik.view.GrafikView(); + jMenuBar1 = new javax.swing.JMenuBar(); + jMenu1 = new javax.swing.JMenu(); + miSave = new javax.swing.JMenuItem(); + miOpen = new javax.swing.JMenuItem(); + jMenu2 = new javax.swing.JMenu(); - setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - getContentPane().add(gZeichenflaeche, java.awt.BorderLayout.CENTER); + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - setSize(new java.awt.Dimension(540, 412)); - setLocationRelativeTo(null); - }// //GEN-END:initComponents + gZeichenflaeche.setLayout(new java.awt.BorderLayout()); + getContentPane().add(gZeichenflaeche, java.awt.BorderLayout.CENTER); + + jMenu1.setText("File"); + + miSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_DOWN_MASK)); + miSave.setText("Speichern"); + miSave.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + miSaveActionPerformed(evt); + } + }); + jMenu1.add(miSave); + + miOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_DOWN_MASK)); + miOpen.setText("Öffnen"); + miOpen.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + miOpenActionPerformed(evt); + } + }); + jMenu1.add(miOpen); + + jMenuBar1.add(jMenu1); + + jMenu2.setText("Edit"); + jMenuBar1.add(jMenu2); + + setJMenuBar(jMenuBar1); + + setSize(new java.awt.Dimension(540, 412)); + setLocationRelativeTo(null); + }// //GEN-END:initComponents + + private void miSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miSaveActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_miSaveActionPerformed + + private void miOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miOpenActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_miOpenActionPerformed /** * @param args the command line arguments @@ -94,7 +135,26 @@ public class GrafikFrame extends javax.swing.JFrame }); } - // Variables declaration - do not modify//GEN-BEGIN:variables - private mvcgrafik.view.GrafikView gZeichenflaeche; - // End of variables declaration//GEN-END:variables + // Variables declaration - do not modify//GEN-BEGIN:variables + private mvcgrafik.view.GrafikView gZeichenflaeche; + private javax.swing.JMenu jMenu1; + private javax.swing.JMenu jMenu2; + private javax.swing.JMenuBar jMenuBar1; + private javax.swing.JMenuItem miOpen; + private javax.swing.JMenuItem miSave; + // End of variables declaration//GEN-END:variables + + /** + * @return the miOpen + */ + public javax.swing.JMenuItem getMiOpen() { + return miOpen; + } + + /** + * @return the miSave + */ + public javax.swing.JMenuItem getMiSave() { + return miSave; + } }