diff --git a/nbproject/project.properties b/nbproject/project.properties index b0fbfc5..68e47ad 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -29,7 +29,8 @@ endorsed.classpath= excludes= includes=** jar.compress=false -javac.classpath= +javac.classpath=\ + ${libs.absolutelayout.classpath} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false diff --git a/src/tse/LR_4.java b/src/tse/LR_4.java index 17d9f99..bd65b75 100644 --- a/src/tse/LR_4.java +++ b/src/tse/LR_4.java @@ -1,5 +1,6 @@ package tse; +import tse.lr4.DailyPad; import tse.lr4.LoginWindow; @@ -20,7 +21,7 @@ public class LR_4 implements ILabRab { new LoginWindow().setVisible(true); break; case 1: - + new DailyPad().setVisible(true); break; } } diff --git a/src/tse/lr4/DailyPad.java b/src/tse/lr4/DailyPad.java new file mode 100644 index 0000000..fa7e039 --- /dev/null +++ b/src/tse/lr4/DailyPad.java @@ -0,0 +1,96 @@ +package tse.lr4; + +import java.awt.BorderLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JToolBar; +import javax.swing.UIManager; + +/** + * Ежедневник. + * @author aNNiMON + */ +public class DailyPad extends JFrame { + + private PadPanel panel; + + public DailyPad() { + super("DailyPad"); + setLocationByPlatform(true); + setDefaultCloseOperation(HIDE_ON_CLOSE); + + addMenu(); + addToolBar(); + + panel = new PadPanel(); + add(panel, BorderLayout.CENTER); + pack(); + } + + private void addMenu() { + JMenuBar mainMenu = new JMenuBar(); + + JMenu fileMenu = new JMenu("File"); + fileMenu.setMnemonic(KeyEvent.VK_F); + JMenuItem newMenuItem = new JMenuItem("New"); + newMenuItem.setMnemonic(KeyEvent.VK_N); + newMenuItem.addActionListener(newActionListener); + fileMenu.add(newMenuItem); + fileMenu.add(new JMenuItem("Open")); + JMenuItem saveMenuItem = new JMenuItem("Save"); + saveMenuItem.setMnemonic(KeyEvent.VK_S); + saveMenuItem.addActionListener(openActionListener); + fileMenu.add(saveMenuItem); + fileMenu.add(new JMenuItem("Save As")); + JMenuItem exitMenuItem = new JMenuItem("Exit"); + exitMenuItem.setMnemonic(KeyEvent.VK_X); + exitMenuItem.addActionListener(exitActionListener); + fileMenu.add(exitMenuItem); + mainMenu.add(fileMenu); + + JMenu helpMenu = new JMenu("Help"); + helpMenu.add(new JMenuItem("About")); + mainMenu.add(helpMenu); + + setJMenuBar(mainMenu); + } + + private void addToolBar() { + JToolBar toolbar = new JToolBar(); + JButton newButton = new JButton(UIManager.getIcon("Tree.collapsedIcon")); + newButton.addActionListener(newActionListener); + toolbar.add(newButton); + JButton openButton = new JButton(UIManager.getIcon("Tree.openIcon")); + openButton.addActionListener(openActionListener); + toolbar.add(openButton); + JButton exitButton = new JButton(UIManager.getIcon("FileChooser.upFolderIcon")); + exitButton.addActionListener(exitActionListener); + toolbar.add(exitButton); + add(toolbar, BorderLayout.NORTH); + } + + private final ActionListener newActionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + } + }; + + private final ActionListener openActionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + } + }; + + private final ActionListener exitActionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + setVisible(false); + } + }; +} diff --git a/src/tse/lr4/PadPanel.form b/src/tse/lr4/PadPanel.form new file mode 100644 index 0000000..0c84ca6 --- /dev/null +++ b/src/tse/lr4/PadPanel.form @@ -0,0 +1,142 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/tse/lr4/PadPanel.java b/src/tse/lr4/PadPanel.java new file mode 100644 index 0000000..be39a23 --- /dev/null +++ b/src/tse/lr4/PadPanel.java @@ -0,0 +1,130 @@ +/* + */ + +package tse.lr4; + +import java.util.Calendar; +import java.util.Date; +import javax.swing.GroupLayout; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JScrollPane; +import javax.swing.JSpinner; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.LayoutStyle; +import javax.swing.SpinnerDateModel; + +/** + * + * @author aNNiMON + */ +public class PadPanel extends javax.swing.JPanel { + + /** + * Creates new form PadPanel + */ + public PadPanel() { + 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") + private void initComponents() {//GEN-BEGIN:initComponents + + JLabel eventLabel = new JLabel(); + JTextField eventName = new JTextField(); + JLabel descriptionLabel = new JLabel(); + JScrollPane jScrollPane1 = new JScrollPane(); + JTextArea descriptionTextArea = new JTextArea(); + JLabel dateTimeLabel = new JLabel(); + JSpinner dateSpinner = new JSpinner(); + JCheckBox importantCheckBox = new JCheckBox(); + JButton applyButton = new JButton(); + JButton prevButton = new JButton(); + JButton nextButton = new JButton(); + + eventLabel.setText("Название события:"); + + descriptionLabel.setText("Описание:"); + + descriptionTextArea.setColumns(20); + descriptionTextArea.setRows(5); + jScrollPane1.setViewportView(descriptionTextArea); + + dateTimeLabel.setText("Дата / время:"); + + dateSpinner.setModel(new SpinnerDateModel(new Date(), null, null, Calendar.MONTH)); + + importantCheckBox.setText("Важное"); + + applyButton.setText("Применить"); + + prevButton.setText("<<"); + + nextButton.setText(">>"); + + GroupLayout layout = new GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(eventLabel) + .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(eventName, GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addComponent(descriptionLabel) + .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jScrollPane1)) + .addGroup(layout.createSequentialGroup() + .addComponent(dateTimeLabel) + .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(dateSpinner) + .addGap(18, 18, 18) + .addComponent(importantCheckBox)) + .addGroup(layout.createSequentialGroup() + .addComponent(prevButton) + .addGap(18, 18, 18) + .addComponent(applyButton, GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE) + .addGap(18, 18, 18) + .addComponent(nextButton))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) + .addComponent(eventLabel) + .addComponent(eventName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addComponent(descriptionLabel) + .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE)) + .addGap(9, 9, 9) + .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) + .addComponent(dateSpinner, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) + .addComponent(dateTimeLabel) + .addComponent(importantCheckBox)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) + .addComponent(prevButton) + .addComponent(nextButton) + .addComponent(applyButton)) + .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + }//GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +}