summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--build.xml6
-rw-r--r--libs/FLib/JCalendar/doc/example/Example1.java196
-rw-r--r--libs/FLib/JCalendar/doc/example/Example2.java182
-rw-r--r--libs/FLib/JCalendar/org/freixas/jcalendar/DateEvent.java76
-rw-r--r--libs/FLib/JCalendar/org/freixas/jcalendar/DateListener.java18
-rw-r--r--libs/FLib/JCalendar/org/freixas/jcalendar/JCalendar.java2675
-rw-r--r--libs/FLib/JCalendar/org/freixas/jcalendar/JCalendarCombo.java2010
-rw-r--r--libs/FLib/JWizard/doc/example/Example1.java945
-rw-r--r--libs/FLib/JWizard/org/freixas/jwizard/JWizardDialog.java1536
-rw-r--r--libs/FLib/JWizard/org/freixas/jwizard/JWizardPanel.java622
-rw-r--r--libs/FLib/TableLayout/doc/example/Example1.java242
-rw-r--r--libs/FLib/TableLayout/doc/example/TableExplorer.java2118
-rw-r--r--libs/FLib/TableLayout/org/freixas/tablelayout/TableLayout.java3114
-rw-r--r--sources/client/NetCalendarClient.java11
15 files changed, 6888 insertions, 6864 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index ea00c53..bd6b8ec 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,5 +1,6 @@
Changes from 1.0 -> 1.1 SVN
+* Added JCalendar library for nice Calendar displaying
* Addaed the current time to the bottom right of the GUI
* Added a few key shortcuts
* conf.txt has been renamed into netcalendar.conf
diff --git a/build.xml b/build.xml
index 9baf726..7f8ddc4 100644
--- a/build.xml
+++ b/build.xml
@@ -6,6 +6,7 @@
<property name="dist" location="dist" />
<property name="jar" location="jar" />
<property name="classes" location="classes" />
+ <property name="jcalendar" location="libs/FLib/JCalendar/build/jcalendar.jar" />
<target name="init">
<tstamp />
@@ -14,6 +15,10 @@
<target name="compile" depends="init" description="compile the source" >
<javac srcdir="${sources}" destdir="${classes}">
+ <classpath>
+ <pathelement path="${classpath}"/>
+ <pathelement location="${jcalendar}"/>
+ </classpath>
<compilerarg value="-Xlint:deprecation" />
</javac>
<copy todir="${classes}/icons">
@@ -23,6 +28,7 @@
<fileset dir="images" />
</copy>
<copy file="netcalendar.conf" tofile="${classes}/netcalendar.conf" />
+ <copy file="${jcalendar}" tofile="${classes}/jcalendar.jar" />
</target>
<target name="jar" depends="compile" description="generate the jar" >
diff --git a/libs/FLib/JCalendar/doc/example/Example1.java b/libs/FLib/JCalendar/doc/example/Example1.java
index 57e3b87..c64e64c 100644
--- a/libs/FLib/JCalendar/doc/example/Example1.java
+++ b/libs/FLib/JCalendar/doc/example/Example1.java
@@ -33,146 +33,146 @@ import org.freixas.jcalendar.*;
// All Rights Reserved.
public class Example1
- extends JFrame
+ extends JFrame
{
//**********************************************************************
// main
//**********************************************************************
-public static void
-main(
- String[] args)
-{
- new Example1();
-}
+ public static void
+ main(
+ String[] args)
+ {
+ new Example1();
+ }
//**********************************************************************
// Constructors
//**********************************************************************
-/**
- * Create various instances of a JCalendar.
- */
+ /**
+ * Create various instances of a JCalendar.
+ */
-public
-Example1()
-{
- // Set up the frame
+ public
+ Example1()
+ {
+ // Set up the frame
- setTitle("Example1");
- setDefaultCloseOperation(EXIT_ON_CLOSE);
+ setTitle("Example1");
+ setDefaultCloseOperation(EXIT_ON_CLOSE);
- Container contentPane = getContentPane();
- contentPane.setLayout(new GridLayout(2, 2, 5, 5));
+ Container contentPane = getContentPane();
+ contentPane.setLayout(new GridLayout(2, 2, 5, 5));
- // Create a border for all calendars
+ // Create a border for all calendars
- Border etchedBorder =
- BorderFactory.createEtchedBorder();
- Border emptyBorder =
- BorderFactory.createEmptyBorder(10, 10, 10, 10);
- Border compoundBorder =
- BorderFactory.createCompoundBorder(etchedBorder, emptyBorder);
+ Border etchedBorder =
+ BorderFactory.createEtchedBorder();
+ Border emptyBorder =
+ BorderFactory.createEmptyBorder(10, 10, 10, 10);
+ Border compoundBorder =
+ BorderFactory.createCompoundBorder(etchedBorder, emptyBorder);
- // Create a date listener to be used for all calendars
+ // Create a date listener to be used for all calendars
- MyDateListener listener = new MyDateListener();
+ MyDateListener listener = new MyDateListener();
- // Display date and time using the default calendar and locale.
- // Display today's date at the bottom.
+ // Display date and time using the default calendar and locale.
+ // Display today's date at the bottom.
- JCalendar calendar1 =
- new JCalendar(
- JCalendar.DISPLAY_DATE | JCalendar.DISPLAY_TIME,
- true);
- calendar1.addDateListener(listener);
- calendar1.setBorder(compoundBorder);
+ JCalendar calendar1 =
+ new JCalendar(
+ JCalendar.DISPLAY_DATE | JCalendar.DISPLAY_TIME,
+ true);
+ calendar1.addDateListener(listener);
+ calendar1.setBorder(compoundBorder);
- // Set fonts rather than using defaults
+ // Set fonts rather than using defaults
- calendar1.setTitleFont(new Font("Serif", Font.BOLD|Font.ITALIC, 24));
- calendar1.setDayOfWeekFont(new Font("SansSerif", Font.ITALIC, 12));
- calendar1.setDayFont(new Font("SansSerif", Font.BOLD, 16));
- calendar1.setTimeFont(new Font("DialogInput", Font.PLAIN, 10));
- calendar1.setTodayFont(new Font("Dialog", Font.PLAIN, 14));
+ calendar1.setTitleFont(new Font("Serif", Font.BOLD|Font.ITALIC, 24));
+ calendar1.setDayOfWeekFont(new Font("SansSerif", Font.ITALIC, 12));
+ calendar1.setDayFont(new Font("SansSerif", Font.BOLD, 16));
+ calendar1.setTimeFont(new Font("DialogInput", Font.PLAIN, 10));
+ calendar1.setTodayFont(new Font("Dialog", Font.PLAIN, 14));
- // Display date only
+ // Display date only
- JCalendar calendar2 = new JCalendar(JCalendar.DISPLAY_DATE, false);
- calendar2.addDateListener(listener);
- calendar2.setBorder(compoundBorder);
+ JCalendar calendar2 = new JCalendar(JCalendar.DISPLAY_DATE, false);
+ calendar2.addDateListener(listener);
+ calendar2.setBorder(compoundBorder);
- // Display time only and set the time pattern to use as a duration
- // from 00:00 to 23:59
+ // Display time only and set the time pattern to use as a duration
+ // from 00:00 to 23:59
- JCalendar calendar3 =
- new JCalendar(
- Calendar.getInstance(),
- Locale.getDefault(),
- JCalendar.DISPLAY_TIME,
- false,
- "HH:mm");
- calendar3.addDateListener(listener);
- calendar3.setBorder(compoundBorder);
+ JCalendar calendar3 =
+ new JCalendar(
+ Calendar.getInstance(),
+ Locale.getDefault(),
+ JCalendar.DISPLAY_TIME,
+ false,
+ "HH:mm");
+ calendar3.addDateListener(listener);
+ calendar3.setBorder(compoundBorder);
- // Display a French calendar
+ // Display a French calendar
- JCalendar calendar4 =
- new JCalendar(
- Calendar.getInstance(Locale.FRENCH),
- Locale.FRENCH,
- JCalendar.DISPLAY_DATE | JCalendar.DISPLAY_TIME,
- false);
- calendar4.addDateListener(listener);
- calendar4.setBorder(compoundBorder);
+ JCalendar calendar4 =
+ new JCalendar(
+ Calendar.getInstance(Locale.FRENCH),
+ Locale.FRENCH,
+ JCalendar.DISPLAY_DATE | JCalendar.DISPLAY_TIME,
+ false);
+ calendar4.addDateListener(listener);
+ calendar4.setBorder(compoundBorder);
- // Add all the calendars to the content pane
+ // Add all the calendars to the content pane
- JPanel panel1 = new JPanel(new FlowLayout());
- panel1.add(calendar1);
- contentPane.add(panel1);
+ JPanel panel1 = new JPanel(new FlowLayout());
+ panel1.add(calendar1);
+ contentPane.add(panel1);
- JPanel panel2 = new JPanel(new FlowLayout());
- panel2.add(calendar2);
- contentPane.add(panel2);
+ JPanel panel2 = new JPanel(new FlowLayout());
+ panel2.add(calendar2);
+ contentPane.add(panel2);
- JPanel panel3 = new JPanel(new FlowLayout());
- panel3.add(calendar3);
- contentPane.add(panel3);
+ JPanel panel3 = new JPanel(new FlowLayout());
+ panel3.add(calendar3);
+ contentPane.add(panel3);
- JPanel panel4 = new JPanel(new FlowLayout());
- panel4.add(calendar4);
- contentPane.add(panel4);
+ JPanel panel4 = new JPanel(new FlowLayout());
+ panel4.add(calendar4);
+ contentPane.add(panel4);
- // Make the window visible
+ // Make the window visible
- pack();
- setVisible(true);
-}
+ pack();
+ setVisible(true);
+ }
//**********************************************************************
// Inner Classes
//**********************************************************************
-private class MyDateListener
- implements DateListener
-{
+ private class MyDateListener
+ implements DateListener
+ {
+
+ public void
+ dateChanged(
+ DateEvent e)
+ {
+ Calendar c = e.getSelectedDate();
+ if (c != null) {
+ System.out.println(c.getTime());
+ }
+ else {
+ System.out.println("No time selected.");
+ }
+ }
-public void
-dateChanged(
- DateEvent e)
-{
- Calendar c = e.getSelectedDate();
- if (c != null) {
- System.out.println(c.getTime());
- }
- else {
- System.out.println("No time selected.");
}
-}
-
-}
//**********************************************************************
// End Inner Classes
diff --git a/libs/FLib/JCalendar/doc/example/Example2.java b/libs/FLib/JCalendar/doc/example/Example2.java
index 0866447..0299ef9 100644
--- a/libs/FLib/JCalendar/doc/example/Example2.java
+++ b/libs/FLib/JCalendar/doc/example/Example2.java
@@ -33,138 +33,138 @@ import org.freixas.jcalendar.*;
// All Rights Reserved.
class Example2
- extends JFrame
+ extends JFrame
{
//**********************************************************************
// main
//**********************************************************************
-public static void
-main(
- String[] args)
-{
- new Example2();
-}
+ public static void
+ main(
+ String[] args)
+ {
+ new Example2();
+ }
//**********************************************************************
// Constructors
//**********************************************************************
-/**
- * Create various instances of a JCalendarCombo.
- */
+ /**
+ * Create various instances of a JCalendarCombo.
+ */
-public
-Example2()
-{
- // Set up the frame
+ public
+ Example2()
+ {
+ // Set up the frame
- setTitle("Example2");
- setDefaultCloseOperation(EXIT_ON_CLOSE);
+ setTitle("Example2");
+ setDefaultCloseOperation(EXIT_ON_CLOSE);
- Container contentPane = getContentPane();
- contentPane.setLayout(new GridLayout(2, 2, 5, 5));
+ Container contentPane = getContentPane();
+ contentPane.setLayout(new GridLayout(2, 2, 5, 5));
- // Create a date listener to be used for all calendars
+ // Create a date listener to be used for all calendars
- MyDateListener listener = new MyDateListener();
+ MyDateListener listener = new MyDateListener();
- // Display date and time using the default calendar and locale.
- // Display today's date at the bottom. Allow editing
+ // Display date and time using the default calendar and locale.
+ // Display today's date at the bottom. Allow editing
- JCalendarCombo calendar1 =
- new JCalendarCombo(
- JCalendarCombo.DISPLAY_DATE | JCalendarCombo.DISPLAY_TIME,
- true);
- calendar1.setEditable(true);
- calendar1.addDateListener(listener);
+ JCalendarCombo calendar1 =
+ new JCalendarCombo(
+ JCalendarCombo.DISPLAY_DATE | JCalendarCombo.DISPLAY_TIME,
+ true);
+ calendar1.setEditable(true);
+ calendar1.addDateListener(listener);
- // Set fonts rather than using defaults
+ // Set fonts rather than using defaults
- calendar1.setFont(new Font("DialogInput", Font.PLAIN, 16));
+ calendar1.setFont(new Font("DialogInput", Font.PLAIN, 16));
- calendar1.setTitleFont(new Font("Serif", Font.BOLD|Font.ITALIC, 24));
- calendar1.setDayOfWeekFont(new Font("SansSerif", Font.ITALIC, 12));
- calendar1.setDayFont(new Font("SansSerif", Font.BOLD, 16));
- calendar1.setTimeFont(new Font("DialogInput", Font.PLAIN, 10));
- calendar1.setTodayFont(new Font("Dialog", Font.PLAIN, 14));
+ calendar1.setTitleFont(new Font("Serif", Font.BOLD|Font.ITALIC, 24));
+ calendar1.setDayOfWeekFont(new Font("SansSerif", Font.ITALIC, 12));
+ calendar1.setDayFont(new Font("SansSerif", Font.BOLD, 16));
+ calendar1.setTimeFont(new Font("DialogInput", Font.PLAIN, 10));
+ calendar1.setTodayFont(new Font("Dialog", Font.PLAIN, 14));
- // Display date only
+ // Display date only
- JCalendarCombo calendar2 =
- new JCalendarCombo(JCalendarCombo.DISPLAY_DATE, false);
- calendar2.addDateListener(listener);
+ JCalendarCombo calendar2 =
+ new JCalendarCombo(JCalendarCombo.DISPLAY_DATE, false);
+ calendar2.addDateListener(listener);
- // Display time only and set the time pattern to use as a duration
- // from 00:00 to 23:59
+ // Display time only and set the time pattern to use as a duration
+ // from 00:00 to 23:59
- JCalendarCombo calendar3 =
- new JCalendarCombo(
- Calendar.getInstance(),
- Locale.getDefault(),
- JCalendarCombo.DISPLAY_TIME,
- false,
- "HH:mm:ss");
- calendar3.setDateFormat(new SimpleDateFormat("HH:mm:ss"));
- calendar3.addDateListener(listener);
+ JCalendarCombo calendar3 =
+ new JCalendarCombo(
+ Calendar.getInstance(),
+ Locale.getDefault(),
+ JCalendarCombo.DISPLAY_TIME,
+ false,
+ "HH:mm:ss");
+ calendar3.setDateFormat(new SimpleDateFormat("HH:mm:ss"));
+ calendar3.addDateListener(listener);
- // Display a French calendar
+ // Display a French calendar
- JCalendarCombo calendar4 =
- new JCalendarCombo(
- Calendar.getInstance(Locale.FRENCH),
- Locale.FRENCH,
- JCalendarCombo.DISPLAY_DATE | JCalendarCombo.DISPLAY_TIME,
- false);
- calendar4.addDateListener(listener);
+ JCalendarCombo calendar4 =
+ new JCalendarCombo(
+ Calendar.getInstance(Locale.FRENCH),
+ Locale.FRENCH,
+ JCalendarCombo.DISPLAY_DATE | JCalendarCombo.DISPLAY_TIME,
+ false);
+ calendar4.addDateListener(listener);
- // Add all the calendars to the content pane
+ // Add all the calendars to the content pane
- JPanel panel1 = new JPanel(new BorderLayout());
- panel1.add(calendar1, BorderLayout.NORTH);
- contentPane.add(panel1);
+ JPanel panel1 = new JPanel(new BorderLayout());
+ panel1.add(calendar1, BorderLayout.NORTH);
+ contentPane.add(panel1);
- JPanel panel2 = new JPanel(new BorderLayout());
- panel2.add(calendar2, BorderLayout.NORTH);
- contentPane.add(panel2);
+ JPanel panel2 = new JPanel(new BorderLayout());
+ panel2.add(calendar2, BorderLayout.NORTH);
+ contentPane.add(panel2);
- JPanel panel3 = new JPanel(new BorderLayout());
- panel3.add(calendar3, BorderLayout.NORTH);
- contentPane.add(panel3);
+ JPanel panel3 = new JPanel(new BorderLayout());
+ panel3.add(calendar3, BorderLayout.NORTH);
+ contentPane.add(panel3);
- JPanel panel4 = new JPanel(new BorderLayout());
- panel4.add(calendar4, BorderLayout.NORTH);
- contentPane.add(panel4);
+ JPanel panel4 = new JPanel(new BorderLayout());
+ panel4.add(calendar4, BorderLayout.NORTH);
+ contentPane.add(panel4);
- // Make the window visible
+ // Make the window visible
- pack();
- setVisible(true);
-}
+ pack();
+ setVisible(true);
+ }
//**********************************************************************
// Inner Classes
//**********************************************************************
-private class MyDateListener
- implements DateListener
-{
+ private class MyDateListener
+ implements DateListener
+ {
+
+ public void
+ dateChanged(
+ DateEvent e)
+ {
+ Calendar c = e.getSelectedDate();
+ if (c != null) {
+ System.out.println(c.getTime());
+ }
+ else {
+ System.out.println("No time selected.");
+ }
+ }
-public void
-dateChanged(
- DateEvent e)
-{
- Calendar c = e.getSelectedDate();
- if (c != null) {
- System.out.println(c.getTime());
- }
- else {
- System.out.println("No time selected.");
}
-}
-
-}
//**********************************************************************
// End Inner Classes
diff --git a/libs/FLib/JCalendar/org/freixas/jcalendar/DateEvent.java b/libs/FLib/JCalendar/org/freixas/jcalendar/DateEvent.java
index dfd4f9f..9058dc4 100644
--- a/libs/FLib/JCalendar/org/freixas/jcalendar/DateEvent.java
+++ b/libs/FLib/JCalendar/org/freixas/jcalendar/DateEvent.java
@@ -24,63 +24,63 @@ import java.util.Calendar;
// All Rights Reserved.
public class DateEvent
- extends EventObject
+ extends EventObject
{
//**********************************************************************
// Private Members
//**********************************************************************
-private Calendar selectedDate;
+ private Calendar selectedDate;
//**********************************************************************
// Constructors
//**********************************************************************
-/**
- * Create a date event.
- *
- * @param source The object on which the event occurred.
- * @param selectedDate The selected date.
- */
-
-public
-DateEvent(
- Object source,
- Calendar selectedDate)
-{
- super(source);
- this.selectedDate = selectedDate;
-}
+ /**
+ * Create a date event.
+ *
+ * @param source The object on which the event occurred.
+ * @param selectedDate The selected date.
+ */
+
+ public
+ DateEvent(
+ Object source,
+ Calendar selectedDate)
+ {
+ super(source);
+ this.selectedDate = selectedDate;
+ }
//**********************************************************************
// Public
//**********************************************************************
-/**
- * Return the selected date.
- *
- * @return The selected date.
- */
+ /**
+ * Return the selected date.
+ *
+ * @return The selected date.
+ */
-public Calendar
-getSelectedDate()
-{
- return selectedDate;
-}
+ public Calendar
+ getSelectedDate()
+ {
+ return selectedDate;
+ }
//The default equals and hashCode methods are acceptable.
-/**
- * {@inheritDoc}
- */
-
-public String
-toString()
-{
- return
- super.toString() + ",selectedDate=" +
- selectedDate.getTime().toString();
-}
+ /**
+ * {@inheritDoc}
+ */
+
+ public String
+ toString()
+ {
+ return
+ super.toString() + ",selectedDate=" +
+ selectedDate.getTime().toString();
+ }
}
diff --git a/libs/FLib/JCalendar/org/freixas/jcalendar/DateListener.java b/libs/FLib/JCalendar/org/freixas/jcalendar/DateListener.java
index 7d3f723..3d29476 100644
--- a/libs/FLib/JCalendar/org/freixas/jcalendar/DateListener.java
+++ b/libs/FLib/JCalendar/org/freixas/jcalendar/DateListener.java
@@ -22,7 +22,7 @@ import java.util.EventListener;
// All Rights Reserved.
public interface DateListener
- extends EventListener
+ extends EventListener
{
//**********************************************************************
@@ -33,14 +33,14 @@ public interface DateListener
// Public
//**********************************************************************
-/**
- * This method is called each time a date in a calendar changes.
- *
- * @param e The date event information.
- */
+ /**
+ * This method is called each time a date in a calendar changes.
+ *
+ * @param e The date event information.
+ */
-public void
-dateChanged(
- DateEvent e);
+ public void
+ dateChanged(
+ DateEvent e);
}
diff --git a/libs/FLib/JCalendar/org/freixas/jcalendar/JCalendar.java b/libs/FLib/JCalendar/org/freixas/jcalendar/JCalendar.java
index 5e305f1..7843669 100644
--- a/libs/FLib/JCalendar/org/freixas/jcalendar/JCalendar.java
+++ b/libs/FLib/JCalendar/org/freixas/jcalendar/JCalendar.java
@@ -95,33 +95,33 @@ import java.util.ResourceBundle;
// All Rights Reserved.
public class JCalendar
- extends JPanel
+ extends JPanel
{
//**********************************************************************
// Public Constants
//**********************************************************************
-/**
- * Used to indicate that this component should display the date.
- */
+ /**
+ * Used to indicate that this component should display the date.
+ */
-public static final int DISPLAY_DATE = 0x01;
+ public static final int DISPLAY_DATE = 0x01;
-/**
- * Used to indicate that this component should display the time.
- */
+ /**
+ * Used to indicate that this component should display the time.
+ */
-public static final int DISPLAY_TIME = 0x02;
+ public static final int DISPLAY_TIME = 0x02;
//**********************************************************************
// Private Constants
//**********************************************************************
-private static final int MONTH_DECR_BUTTON = 0;
-private static final int MONTH_INCR_BUTTON = 1;
-private static final int YEAR_DECR_BUTTON = 2;
-private static final int YEAR_INCR_BUTTON = 3;
+ private static final int MONTH_DECR_BUTTON = 0;
+ private static final int MONTH_INCR_BUTTON = 1;
+ private static final int YEAR_DECR_BUTTON = 2;
+ private static final int YEAR_INCR_BUTTON = 3;
//**********************************************************************
// Private Members
@@ -130,1364 +130,1365 @@ private static final int YEAR_INCR_BUTTON = 3;
// This determines the components being displayed: the calendar, the
// time spinner, or both
-private int selectedComponents;
+ private int selectedComponents;
// The calendar containing a selected day. The selected day may not be
// always be displayed
-private Calendar selectedCalendar;
-private int selectedYear = -1;
-private int selectedMonth = -1;
-private int selectedDay = -1;
-private int selectedHour = -1;
-private int selectedMinute = -1;
-private int selectedSecond = -1;
+ private Calendar selectedCalendar;
+ private int selectedYear = -1;
+ private int selectedMonth = -1;
+ private int selectedDay = -1;
+ private int selectedHour = -1;
+ private int selectedMinute = -1;
+ private int selectedSecond = -1;
// The calendar we display
-private Calendar displayCalendar;
-private int displayYear;
-private int displayMonth;
+ private Calendar displayCalendar;
+ private int displayYear;
+ private int displayMonth;
// The locale to use
-private Locale locale;
+ private Locale locale;
// True if we display today's date
-private boolean isTodayDisplayed = false;
+ private boolean isTodayDisplayed = false;
// A null date is equivalent to having no date selected. Note that the
// constructor selects the current date (today)
-private boolean isNullAllowed = true;
-private boolean isNullDate = true;
+ private boolean isNullAllowed = true;
+ private boolean isNullDate = true;
// The time pattern used to set the format of the time spinner
-private String timePattern;
+ private String timePattern;
// Components
-private JButton yearDecrButton;
-private JButton monthDecrButton;
-private JLabel monthYearLabel;
-private JButton monthIncrButton;
-private JButton yearIncrButton;
+ private JButton yearDecrButton;
+ private JButton monthDecrButton;
+ private JLabel monthYearLabel;
+ private JButton monthIncrButton;
+ private JButton yearIncrButton;
-private JLabel[] dayOfWeekLabels;
-private JToggleButton[][] dayButtons;
-private JToggleButton offScreenButton;
-private ButtonGroup dayGroup;
+ private JLabel[] dayOfWeekLabels;
+ private JToggleButton[][] dayButtons;
+ private JToggleButton offScreenButton;
+ private ButtonGroup dayGroup;
-private SpinnerDateModel spinnerDateModel;
-private JSpinner spinner;
+ private SpinnerDateModel spinnerDateModel;
+ private JSpinner spinner;
-private JLabel todaysLabel;
+ private JLabel todaysLabel;
// Fonts
-private Font titleFont;
-private Font dayOfWeekFont;
-private Font dayFont;
-private Font timeFont;
-private Font todayFont;
+ private Font titleFont;
+ private Font dayOfWeekFont;
+ private Font dayFont;
+ private Font timeFont;
+ private Font todayFont;
// Date formats
-private DateFormat formatMonth;
-private DateFormat formatWeekDay;
+ private DateFormat formatMonth;
+ private DateFormat formatWeekDay;
-private String lastMonth;
-private String lastYear;
+ private String lastMonth;
+ private String lastYear;
// These maps are used to bind keyboard keys to methods
-static InputMap inputMap = new InputMap();
-static ActionMap actionMap = new ActionMap();
+ static InputMap inputMap = new InputMap();
+ static ActionMap actionMap = new ActionMap();
// The input map maps a key to a name. The action map maps a name to
// an action. The actions below map the action to a method call
-private static Action yearBackward = new AbstractAction("yearBackward") {
- public void actionPerformed(ActionEvent e) {
- ((JCalendar)e.getSource()).yearBackward();
- }
-};
-
-private static Action yearForward = new AbstractAction("yearForward") {
- public void actionPerformed(ActionEvent e) {
- ((JCalendar)e.getSource()).yearForward();
- }
-};
-
-private static Action monthBackward = new AbstractAction("montBackward") {
- public void actionPerformed(ActionEvent e) {
- ((JCalendar)e.getSource()).monthBackward();
- }
-};
-
-private static Action monthForward = new AbstractAction("monthForward") {
- public void actionPerformed(ActionEvent e) {
- ((JCalendar)e.getSource()).monthForward();
- }
-};
-
-private static Action setNullDate = new AbstractAction("setNullDate") {
- public void actionPerformed(ActionEvent e) {
- ((JCalendar)e.getSource()).setDate(null);
- }
-};
+ private static Action yearBackward = new AbstractAction("yearBackward") {
+ public void actionPerformed(ActionEvent e) {
+ ((JCalendar)e.getSource()).yearBackward();
+ }
+ };
+
+ private static Action yearForward = new AbstractAction("yearForward") {
+ public void actionPerformed(ActionEvent e) {
+ ((JCalendar)e.getSource()).yearForward();
+ }
+ };
+
+ private static Action monthBackward = new AbstractAction("montBackward") {
+ public void actionPerformed(ActionEvent e) {
+ ((JCalendar)e.getSource()).monthBackward();
+ }
+ };
+
+ private static Action monthForward = new AbstractAction("monthForward") {
+ public void actionPerformed(ActionEvent e) {
+ ((JCalendar)e.getSource()).monthForward();
+ }
+ };
+
+ private static Action setNullDate = new AbstractAction("setNullDate") {
+ public void actionPerformed(ActionEvent e) {
+ ((JCalendar)e.getSource()).setDate(null);
+ }
+ };
// The resource bundle
-private static ResourceBundle bundle =
- ResourceBundle.getBundle("org.freixas.jcalendar.Bundle");
+ private static ResourceBundle bundle =
+ ResourceBundle.getBundle("org.freixas.jcalendar.Bundle");
//**********************************************************************
// Static Constructors
//**********************************************************************
-static
-{
- // Set up the input map that will be shared by all instances
-
- inputMap.put(KeyStroke.getKeyStroke("BACK_SPACE"), "setNullDate");
- inputMap.put(KeyStroke.getKeyStroke("DELETE"), "setNullDate");
- inputMap.put(KeyStroke.getKeyStroke("shift LEFT"), "yearBackward");
- inputMap.put(KeyStroke.getKeyStroke("shift RIGHT"), "yearForward");
- inputMap.put(KeyStroke.getKeyStroke("LEFT"), "monthBackward");
- inputMap.put(KeyStroke.getKeyStroke("RIGHT"), "monthForward");
-
- actionMap.put("setNullDate", setNullDate);
- actionMap.put("yearBackward", yearBackward);
- actionMap.put("yearForward", yearForward);
- actionMap.put("monthBackward", monthBackward);
- actionMap.put("monthForward", monthForward);
-}
+ static
+ {
+ // Set up the input map that will be shared by all instances
+
+ inputMap.put(KeyStroke.getKeyStroke("BACK_SPACE"), "setNullDate");
+ inputMap.put(KeyStroke.getKeyStroke("DELETE"), "setNullDate");
+ inputMap.put(KeyStroke.getKeyStroke("shift LEFT"), "yearBackward");
+ inputMap.put(KeyStroke.getKeyStroke("shift RIGHT"), "yearForward");
+ inputMap.put(KeyStroke.getKeyStroke("LEFT"), "monthBackward");
+ inputMap.put(KeyStroke.getKeyStroke("RIGHT"), "monthForward");
+
+ actionMap.put("setNullDate", setNullDate);
+ actionMap.put("yearBackward", yearBackward);
+ actionMap.put("yearForward", yearForward);
+ actionMap.put("monthBackward", monthBackward);
+ actionMap.put("monthForward", monthForward);
+ }
//**********************************************************************
// Constructors
//**********************************************************************
-/**
- * Create an instance of JCalendar using the default calendar and
- * locale. Display the date but not the time. Don't display today's
- * date at the bottom of the panel.
- */
-
-public
-JCalendar()
-{
- this(Calendar.getInstance(),
- Locale.getDefault(),
- DISPLAY_DATE,
- false,
- null);
-}
-
-/**
- * Create an instance of JCalendar using the default calendar and
- * locale. Display a calendar and/or a time spinner as requested (to
- * display both use DISPLAY_DATE | DISPLAY_TIME). Display today's
- * date if requested. Use the defult pattern to display the time in the
- * time spinner field (if there is one).
- *
- * @param selectedComponents Use DISPLAY_DATE, DISPLAY_TIME or
- * (DISPLAY_DATE | DISPLAY_TIME).
- * @param isTodayDisplayed True if today's date should be displayed at