org.gnu.gtk
Class Calendar

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.GObject
          extended by org.gnu.gtk.GtkObject
              extended by org.gnu.gtk.Widget
                  extended by org.gnu.gtk.Calendar

public class Calendar
extends Widget

A Calendar is a widget that displays a calendar one month at a time.


Constructor Summary
Calendar()
          Create a new Calendar object with the current date selected.
Calendar(org.gnu.glib.Handle handle)
          Construct a calendar using a handle to a native resource.
 
Method Summary
 void addListener(CalendarListener listener)
          Register an object to handle calendar events.
 void clearMarks()
          Remove all visual marks.
 void freeze()
          Deprecated.  
static Calendar getCalendar(org.gnu.glib.Handle handle)
          Internal static factory method to be used by Java-Gnome only.
 java.util.Calendar getDate()
          Deprecated. the form returning java.util.Calendar is deprecated and will be replaced. Use getYearMonthDay() as a workaround until libgtk-java 2.10, when getDate() will return an int[3] instead.
 CalendarDisplayOptions getDisplayOptions()
          Gets the display options (whether to display the heading and the month headings.
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 EventType getEventType(java.lang.String signal)
           
static Type getType()
          Retrieve the runtime type used by the GLib library.
 int[] getYearMonthDay()
          Gets the selected date from a Calendar.
 void markDay(int day)
          Places a visual marker on a particular day.
 void removeListener(CalendarListener listener)
          Removes a listener
 void selectDay(int day)
          Selects a day from the current month.
 void selectMonth(int month, int year)
          Shifts the calendar to a different month.
 void setDisplayOptions(CalendarDisplayOptions displayOptions)
          Sets the display options (whether to display the heading and the month headings.
 void thaw()
          Deprecated.  
 void unmarkDay(int day)
          Removes the visual marker from a particular day.
 
Methods inherited from class org.gnu.gtk.Widget
activate, addAccelerator, addEvents, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, canActivateAccel, createContext, createLayout, draw, drawArea, drawArea, finish, getAccessible, getAllocation, getCanFocus, getColormap, getContext, getData, getDisplay, getDragData, getExtensionEvents, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getWidget, getWindow, grabDefault, grabFocus, hasFocus, hasScreen, hide, hideAll, highlight, highlight, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeAccelerator, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setCanFocus, setColormap, setDoubleBuffered, setDragDestination, setDragIcon, setDragIconPixbuf, setDragIconStock, setDragSource, setEvents, setExtensionEvents, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll, unHighlight, unHighlight
 
Methods inherited from class org.gnu.gtk.GtkObject
destroy, sink
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class org.gnu.glib.Struct
equals, getHandle, getNullHandle, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Calendar

public Calendar()
Create a new Calendar object with the current date selected.


Calendar

public Calendar(org.gnu.glib.Handle handle)
Construct a calendar using a handle to a native resource.

Method Detail

getCalendar

public static Calendar getCalendar(org.gnu.glib.Handle handle)
Internal static factory method to be used by Java-Gnome only.


selectMonth

public void selectMonth(int month,
                        int year)
Shifts the calendar to a different month.

Parameters:
month - The month to select. This value is zero based.
year - The year the month is in.

selectDay

public void selectDay(int day)
Selects a day from the current month.

Parameters:
day - A day number between 1 and 31, or 0 to unselect the currently selected day.

markDay

public void markDay(int day)
Places a visual marker on a particular day.

Parameters:
day - The day number to mark between 1 and 31.

unmarkDay

public void unmarkDay(int day)
Removes the visual marker from a particular day.

Parameters:
day - The day number to unmark between 1 and 31.

clearMarks

public void clearMarks()
Remove all visual marks.


setDisplayOptions

public void setDisplayOptions(CalendarDisplayOptions displayOptions)
Sets the display options (whether to display the heading and the month headings.

Parameters:
displayOptions - The options to set.

getDisplayOptions

public CalendarDisplayOptions getDisplayOptions()
Gets the display options (whether to display the heading and the month headings.


getDate

public java.util.Calendar getDate()
Deprecated. the form returning java.util.Calendar is deprecated and will be replaced. Use getYearMonthDay() as a workaround until libgtk-java 2.10, when getDate() will return an int[3] instead.

Gets the selected date from the Calendar widget.

Returns:
A Calendar object that represents the date selected in the widget.

getYearMonthDay

public int[] getYearMonthDay()
Gets the selected date from a Calendar.

Returns:
a three wide array of integers: the array at [0] is the year (4 digits), the array at [1] is the month (range from 1-12), and the array at [2] is the numeric day (range from 1-{28,29,30,31}).

freeze

public void freeze()
Deprecated. 

Locks the display of the Calendar until it is thawed with the thaw() method.


thaw

public void thaw()
Deprecated. 

Defrosts a Calendar. All changes made since the last freeze() are displayed.


addListener

public void addListener(CalendarListener listener)
Register an object to handle calendar events.

See Also:
CalendarListener

removeListener

public void removeListener(CalendarListener listener)
Removes a listener

See Also:
addListener(CalendarListener)

getEventListenerClass

public java.lang.Class getEventListenerClass(java.lang.String signal)
Overrides:
getEventListenerClass in class Widget

getEventType

public EventType getEventType(java.lang.String signal)
Overrides:
getEventType in class Widget

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.