Обновлена форма DailyPad
This commit is contained in:
parent
c3d1cabb2b
commit
851eca861b
@ -85,6 +85,10 @@
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="eventName">
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="descriptionLabel">
|
||||
<Properties>
|
||||
@ -103,6 +107,10 @@
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
@ -117,26 +125,43 @@
|
||||
<SpinnerModel initial="now" stepSize="2" type="date"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="importantCheckBox">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Важное"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="applyButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Применить"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="applyButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="prevButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="<<"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="prevButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="nextButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value=">>"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="nextButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
@ -3,12 +3,16 @@
|
||||
|
||||
package tse.lr4;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ArrayList;
|
||||
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.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JSpinner;
|
||||
import javax.swing.JTextArea;
|
||||
@ -20,32 +24,26 @@ import javax.swing.SpinnerDateModel;
|
||||
*
|
||||
* @author aNNiMON
|
||||
*/
|
||||
public class PadPanel extends javax.swing.JPanel {
|
||||
public class PadPanel extends JPanel {
|
||||
|
||||
private int padIndex;
|
||||
|
||||
/**
|
||||
* Creates new form PadPanel
|
||||
*/
|
||||
public PadPanel() {
|
||||
padIndex = 0;
|
||||
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();
|
||||
eventName = new JTextField();
|
||||
JLabel descriptionLabel = new JLabel();
|
||||
JScrollPane jScrollPane1 = new JScrollPane();
|
||||
JTextArea descriptionTextArea = new JTextArea();
|
||||
descriptionTextArea = new JTextArea();
|
||||
JLabel dateTimeLabel = new JLabel();
|
||||
JSpinner dateSpinner = new JSpinner();
|
||||
JCheckBox importantCheckBox = new JCheckBox();
|
||||
dateSpinner = new JSpinner();
|
||||
importantCheckBox = new JCheckBox();
|
||||
JButton applyButton = new JButton();
|
||||
JButton prevButton = new JButton();
|
||||
JButton nextButton = new JButton();
|
||||
@ -65,10 +63,25 @@ public class PadPanel extends javax.swing.JPanel {
|
||||
importantCheckBox.setText("Важное");
|
||||
|
||||
applyButton.setText("Применить");
|
||||
applyButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
applyButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
prevButton.setText("<<");
|
||||
prevButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
prevButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
nextButton.setText(">>");
|
||||
nextButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
nextButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
GroupLayout layout = new GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
@ -124,7 +137,53 @@ public class PadPanel extends javax.swing.JPanel {
|
||||
);
|
||||
}//GEN-END:initComponents
|
||||
|
||||
private void applyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_applyButtonActionPerformed
|
||||
// TODO add your handling code here:
|
||||
|
||||
}//GEN-LAST:event_applyButtonActionPerformed
|
||||
|
||||
private void prevButtonActionPerformed(ActionEvent evt) {//GEN-FIRST:event_prevButtonActionPerformed
|
||||
// TODO add your handling code here:
|
||||
selectPreviousNotePad();
|
||||
}//GEN-LAST:event_prevButtonActionPerformed
|
||||
|
||||
private void nextButtonActionPerformed(ActionEvent evt) {//GEN-FIRST:event_nextButtonActionPerformed
|
||||
// TODO add your handling code here:
|
||||
selectNextNotePad();
|
||||
}//GEN-LAST:event_nextButtonActionPerformed
|
||||
|
||||
private void selectPreviousNotePad() {
|
||||
if (padIndex <= 0) return;
|
||||
padIndex--;
|
||||
selectNotePad(getNotePad());
|
||||
}
|
||||
|
||||
private void selectNextNotePad() {
|
||||
if (padIndex >= getNotepads().size() - 1) return;
|
||||
padIndex++;
|
||||
selectNotePad(getNotePad());
|
||||
}
|
||||
|
||||
private void selectNotePad(NotePad pad) {
|
||||
if (pad == null) return;
|
||||
eventName.setText(pad.getName());
|
||||
descriptionTextArea.setText(pad.getDescription());
|
||||
dateSpinner.setValue(pad.getDate());
|
||||
importantCheckBox.setSelected(pad.isImportant());
|
||||
}
|
||||
|
||||
private NotePad getNotePad() {
|
||||
return NotePadManager.getInstance().getNotepads().get(padIndex);
|
||||
}
|
||||
|
||||
private ArrayList<NotePad> getNotepads() {
|
||||
return NotePadManager.getInstance().getNotepads();
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private JSpinner dateSpinner;
|
||||
private JTextArea descriptionTextArea;
|
||||
private JTextField eventName;
|
||||
private JCheckBox importantCheckBox;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user