You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GrafikMenuView.java 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package mvcgrafik.view;
  7. /**
  8. *
  9. * @author hd
  10. */
  11. public class GrafikMenuView extends javax.swing.JFrame
  12. {
  13. /**
  14. * @return the jPanel1
  15. */
  16. public javax.swing.JPanel getjPanel1()
  17. {
  18. return jPanel1;
  19. }
  20. /**
  21. * Creates new form GrafikMenuView
  22. */
  23. public GrafikMenuView()
  24. {
  25. initComponents();
  26. }
  27. /**
  28. * This method is called from within the constructor to initialize the form.
  29. * WARNING: Do NOT modify this code. The content of this method is always
  30. * regenerated by the Form Editor.
  31. */
  32. @SuppressWarnings("unchecked")
  33. // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  34. private void initComponents()
  35. {
  36. jFileChooser1 = new javax.swing.JFileChooser();
  37. jPanel1 = new javax.swing.JPanel();
  38. grafikView1 = new mvcgrafik.view.GrafikView();
  39. jMenuBar1 = new javax.swing.JMenuBar();
  40. jMenu1 = new javax.swing.JMenu();
  41. btnOpen = new javax.swing.JMenuItem();
  42. btnSafe = new javax.swing.JMenuItem();
  43. jMenu2 = new javax.swing.JMenu();
  44. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  45. setTitle("Zeichentool");
  46. javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  47. jPanel1.setLayout(jPanel1Layout);
  48. jPanel1Layout.setHorizontalGroup(
  49. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  50. .addComponent(grafikView1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
  51. );
  52. jPanel1Layout.setVerticalGroup(
  53. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  54. .addComponent(grafikView1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
  55. );
  56. getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
  57. jMenu1.setText("File");
  58. btnOpen.setText("Open");
  59. btnOpen.addActionListener(new java.awt.event.ActionListener()
  60. {
  61. public void actionPerformed(java.awt.event.ActionEvent evt)
  62. {
  63. btnOpenActionPerformed(evt);
  64. }
  65. });
  66. jMenu1.add(btnOpen);
  67. btnSafe.setText("Safe");
  68. btnSafe.addActionListener(new java.awt.event.ActionListener()
  69. {
  70. public void actionPerformed(java.awt.event.ActionEvent evt)
  71. {
  72. btnSafeActionPerformed(evt);
  73. }
  74. });
  75. jMenu1.add(btnSafe);
  76. jMenuBar1.add(jMenu1);
  77. jMenu2.setText("Edit");
  78. jMenuBar1.add(jMenu2);
  79. setJMenuBar(jMenuBar1);
  80. pack();
  81. }// </editor-fold>//GEN-END:initComponents
  82. private void btnOpenActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnOpenActionPerformed
  83. {//GEN-HEADEREND:event_btnOpenActionPerformed
  84. // TODO add your handling code here:
  85. }//GEN-LAST:event_btnOpenActionPerformed
  86. private void btnSafeActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSafeActionPerformed
  87. {//GEN-HEADEREND:event_btnSafeActionPerformed
  88. // TODO add your handling code here:
  89. }//GEN-LAST:event_btnSafeActionPerformed
  90. /**
  91. * @param args the command line arguments
  92. */
  93. public static void main(String args[])
  94. {
  95. /* Set the Nimbus look and feel */
  96. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  97. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  98. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  99. */
  100. try
  101. {
  102. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
  103. {
  104. if ("Nimbus".equals(info.getName()))
  105. {
  106. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  107. break;
  108. }
  109. }
  110. }
  111. catch (ClassNotFoundException ex)
  112. {
  113. java.util.logging.Logger.getLogger(GrafikMenuView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  114. }
  115. catch (InstantiationException ex)
  116. {
  117. java.util.logging.Logger.getLogger(GrafikMenuView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  118. }
  119. catch (IllegalAccessException ex)
  120. {
  121. java.util.logging.Logger.getLogger(GrafikMenuView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  122. }
  123. catch (javax.swing.UnsupportedLookAndFeelException ex)
  124. {
  125. java.util.logging.Logger.getLogger(GrafikMenuView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  126. }
  127. //</editor-fold>
  128. /* Create and display the form */
  129. java.awt.EventQueue.invokeLater(new Runnable()
  130. {
  131. public void run()
  132. {
  133. new GrafikMenuView().setVisible(true);
  134. }
  135. });
  136. }
  137. // Variables declaration - do not modify//GEN-BEGIN:variables
  138. private javax.swing.JMenuItem btnOpen;
  139. private javax.swing.JMenuItem btnSafe;
  140. private mvcgrafik.view.GrafikView grafikView1;
  141. private javax.swing.JFileChooser jFileChooser1;
  142. private javax.swing.JMenu jMenu1;
  143. private javax.swing.JMenu jMenu2;
  144. private javax.swing.JMenuBar jMenuBar1;
  145. private javax.swing.JPanel jPanel1;
  146. // End of variables declaration//GEN-END:variables
  147. /**
  148. * @return the grafikView1
  149. */
  150. public mvcgrafik.view.GrafikView getGrafikView1()
  151. {
  152. return grafikView1;
  153. }
  154. /**
  155. * @return the jFileChooser1
  156. */
  157. public javax.swing.JFileChooser getjFileChooser1()
  158. {
  159. return jFileChooser1;
  160. }
  161. /**
  162. * @return the btnOpen
  163. */
  164. public javax.swing.JMenuItem getBtnOpen()
  165. {
  166. return btnOpen;
  167. }
  168. /**
  169. * @return the btnSafe
  170. */
  171. public javax.swing.JMenuItem getBtnSafe()
  172. {
  173. return btnSafe;
  174. }
  175. }