All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tc.ui.CalendarPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----tc.ui.CalendarPanel

public class CalendarPanel
extends Panel
CalendarPanel is a special user interface component that allows showing and editing of calendar data in a two dimensional grid. The calendar panel also includes a status bar for showing status messages for the user.

Version:
0.30, 1998/04/01
Author:
FRED development team, Jukka Viljamaa, Antti Viljamaa
See Also:
TimeGrid

Variable Index

 o addedTimeSlices
The time slices that have been added by the user.
 o addItem
A menu item.
 o borderLayout
Layout for the calendar panel.
 o currentMarker
The current marker that can be used for adding new time slices.
 o frame
The frame that owns this panel.
 o grid
The user interface widget for showing the time grid.
 o markerDialog
The marker dialog.
 o markersItem
A menu item.
 o modifyDialog
The modify dialog.
 o modifyItem
A menu item.
 o nextPageItem
A menu item.
 o nextPageSize
The number of columns to move forwards (or backwards) when the user selects "Next Page" (or "Previous Page") in the popup menu.
 o popupMenu
The popup menu.
 o popupmenuActionAdapter
The action adapter for the popup menu.
 o prevPageItem
A menu item.
 o propertiesItem
A menu item.
 o propertyDialog
The property dialog.
 o removeDialog
The remove dialog.
 o removedTimeSlices
The time slices that have been removed by the user.
 o removeItem
A menu item.
 o statusBar
The status bar of the CalendarPanel.
 o timeGrid
The calendar information (the model) this calendar panel visualizes.

Constructor Index

 o CalendarPanel(Frame, TimeGrid)
Initializes the calendar panel with the given owner frame and time grid.

Method Index

 o actionAdd()
Adds new time slice(s) to the time grid (and to the visual grid component) according to the current selections in the visual grid.
 o actionMarkers()
Sets the current marker according to the selection made in the marker dialog.
 o actionModify()
Modifies time slice(s) in the time grid (and int the visual grid component) according to the current selections in the visual grid and the selections made by the user in the modify dialog.
 o actionNextPage()
Moves the visible part of the time grid forward (if the move will not go over grid edge).
 o actionPreviousPage()
Moves the visible part of the time grid backwards (if the move will not go over grid edge).
 o actionProperties()
Shows the property dialog and (if the user confirms the selections made in the dialog) sets time grid and calendar panel properties according to the selections.
 o actionRemove()
Removes time slice(s) from the time grid (and from the visual grid component) according to the current selections in the visual grid and the selections made by the user in the remove dialog.
 o addPopupMenuItem(String)
Adds a new item into the popup menu of this calendar panel.
 o copyTimeSlices(Vector, Vector)
Creates copies of time slices in a vector and puts them to another vector.
 o existingTimeSlices(MatrixLocation)
Returns a vector of those time slices that reside in the given matrix location (the location is given in visible window coordinates not in the time grid's internal grid coordinates).
 o getAddedTimeSlices()
Gets the time slices that have been added by the user.
 o getCurrentMarker()
Gets the current marker that can be used for adding new time slices.
 o getFrame()
Gets the frame that owns this panel.
 o getGrid()
Gets the user interface widget for showing the time grid.
 o getMarkerDialog()
Gets the marker dialog.
 o getModifyDialog()
Gets the modify dialog.
 o getNextPageSize()
Gets the number of columns to move forwards (or backwards) when the user selects "Next Page" (or "Previous Page") in the popup menu.
 o getPropertyDialog()
Gets the property dialog.
 o getRemoveDialog()
Gets the remove dialog.
 o getRemovedTimeSlices()
Gets the time slices that have been removed by the user.
 o getStatus()
Gets the status text from the status bar.
 o getStatusBar()
Gets the status bar.
 o getTimeGrid()
Gets the calendar information (the model) this calendar panel visualizes.
 o handlePopupMenuEvent(ActionEvent)
Handles selections from the popup menu.
 o jbInit()
Initializes the user interface.
 o mousePressed(MouseEvent)
Called when the mouse is pressed.
 o newTimeSlice(MatrixLocation, MatrixLocation, Marker)
Creates and returns a new time slice from the given start matrix location to the given end location for the given marker.
 o popupmenuActionPerformed(ActionEvent)
Called when the user selects an item from the popup menu.
 o refresh()
Refreshes the calendar's grid component.
 o selectionsToExistingTimeSlices(MatrixSelection)
Returns a vector of time slices that reside (partially or entirely) in the locations denoted by the given matrix selection.
 o selectionsToNewTimeSlices(MatrixSelection)
Returns a vector of new time slices that correspond to the locations denoted by the given matrix selection.
 o setAddedTimeSlices(Vector)
Sets the time slices that have been added by the user.
 o setCurrentMarker(Marker)
Sets the current marker that can be used for adding new time slices.
 o setFrame(Frame)
Sets the frame that owns this panel.
 o setMarkerDialog(MarkerDialog)
Sets the marker dialog.
 o setModifyDialog(ModifyDialog)
Sets the modify dialog.
 o setNextPageSize(int)
Sets the number of columns to move forwards (or backwards) when the user selects "Next Page" (or "Previous Page") in the popup menu.
 o setPropertyDialog(PropertyDialog)
Sets the property dialog.
 o setRemoveDialog(RemoveDialog)
Sets the remove dialog.
 o setRemovedTimeSlices(Vector)
Sets the time slices that have been removed by the user.
 o setStatus(String)
Sets the status text (of the status bar) to the given string.
 o setTimeGrid(TimeGrid)
Sets the calendar information (the model) this calendar panel visualizes.

Variables

 o addedTimeSlices
 private Vector addedTimeSlices
The time slices that have been added by the user. This information can be used, for example, to update an external data source, such as a database.

 o addItem
 private MenuItem addItem
A menu item.

 o borderLayout
 private BorderLayout borderLayout
Layout for the calendar panel.

 o currentMarker
 private Marker currentMarker
The current marker that can be used for adding new time slices.

 o frame
 private Frame frame
The frame that owns this panel.

 o grid
 private GridControl grid
The user interface widget for showing the time grid.

 o markerDialog
 private MarkerDialog markerDialog
The marker dialog.

 o markersItem
 private MenuItem markersItem
A menu item.

 o modifyDialog
 private ModifyDialog modifyDialog
The modify dialog.

 o modifyItem
 private MenuItem modifyItem
A menu item.

 o nextPageItem
 private MenuItem nextPageItem
A menu item.

 o nextPageSize
 private int nextPageSize
The number of columns to move forwards (or backwards) when the user selects "Next Page" (or "Previous Page") in the popup menu.

 o popupMenu
 private PopupMenu popupMenu
The popup menu.

 o popupmenuActionAdapter
 private CalendarPanelPopupmenuActionAdapter popupmenuActionAdapter
The action adapter for the popup menu.

 o prevPageItem
 private MenuItem prevPageItem
A menu item.

 o propertiesItem
 private MenuItem propertiesItem
A menu item.

 o propertyDialog
 private PropertyDialog propertyDialog
The property dialog.

 o removeDialog
 private RemoveDialog removeDialog
The remove dialog.

 o removedTimeSlices
 private Vector removedTimeSlices
The time slices that have been removed by the user. This information can be used, for example, to update an external data source, such as a database.

 o removeItem
 private MenuItem removeItem
A menu item.

 o statusBar
 private StatusBar statusBar
The status bar of the CalendarPanel.

 o timeGrid
 private TimeGrid timeGrid
The calendar information (the model) this calendar panel visualizes.

Constructors

 o CalendarPanel
 public CalendarPanel(Frame f,
                      TimeGrid tg)
Initializes the calendar panel with the given owner frame and time grid.

Parameters:
f - The frame that owns this panel.
tg - The time grid that holds the calendar information to be visualized.

Methods

 o getMarkerDialog
 public MarkerDialog getMarkerDialog()
Gets the marker dialog.

 o getNextPageSize
 public int getNextPageSize()
Gets the number of columns to move forwards (or backwards) when the user selects "Next Page" (or "Previous Page") in the popup menu.

 o getStatus
 public String getStatus()
Gets the status text from the status bar.

Returns:
The status string.
 o getTimeGrid
 public TimeGrid getTimeGrid()
Gets the calendar information (the model) this calendar panel visualizes.

 o refresh
 public void refresh()
Refreshes the calendar's grid component.

 o setNextPageSize
 public void setNextPageSize(int size)
Sets the number of columns to move forwards (or backwards) when the user selects "Next Page" (or "Previous Page") in the popup menu.

 o setStatus
 public void setStatus(String status)
Sets the status text (of the status bar) to the given string.

Parameters:
status - The new status string.
 o mousePressed
 void mousePressed(MouseEvent e)
Called when the mouse is pressed. If the user pressed the right mouse button the popup menu is opened in the mouse location.

 o popupmenuActionPerformed
 void popupmenuActionPerformed(ActionEvent event)
Called when the user selects an item from the popup menu. Calls handlePopupMenuEvent(ActionEvent event).

 o addPopupMenuItem
 protected void addPopupMenuItem(String itemName)
Adds a new item into the popup menu of this calendar panel.

Parameters:
itemName - The name of the new item. The name is also used for separating the selections in the method handlePopupMenuEvent(ActionEvent event). If the given argument is null a separator is added to the menu.
 o getAddedTimeSlices
 protected Vector getAddedTimeSlices()
Gets the time slices that have been added by the user. This information can be used, for example, to update an external data source, such as a database.

 o getFrame
 protected Frame getFrame()
Gets the frame that owns this panel.

 o getRemovedTimeSlices
 protected Vector getRemovedTimeSlices()
Gets the time slices that have been removed by the user. This information can be used, for example, to update an external data source, such as a database.

 o handlePopupMenuEvent
 protected void handlePopupMenuEvent(ActionEvent event)
Handles selections from the popup menu. The subclasses should override this method (and usually also call it) to handle menu items defined in the subclass.

Menu items handled in this method are: "Add", "Remove...", "Modify...", "Markers...", "Next Page", "Previous Page", and "Properties...".

 o actionAdd
 private void actionAdd()
Adds new time slice(s) to the time grid (and to the visual grid component) according to the current selections in the visual grid.

 o actionRemove
 private void actionRemove()
Removes time slice(s) from the time grid (and from the visual grid component) according to the current selections in the visual grid and the selections made by the user in the remove dialog.

 o actionModify
 private void actionModify()
Modifies time slice(s) in the time grid (and int the visual grid component) according to the current selections in the visual grid and the selections made by the user in the modify dialog. The modifications are implemented by first making copies of the original time slices and removing the originals, then letting the user modify copies, and finally adding the modified copies.

 o actionMarkers
 private void actionMarkers()
Sets the current marker according to the selection made in the marker dialog.

 o actionNextPage
 private void actionNextPage()
Moves the visible part of the time grid forward (if the move will not go over grid edge). The number of columns is determined by the nextPageSize property.

 o actionPreviousPage
 private void actionPreviousPage()
Moves the visible part of the time grid backwards (if the move will not go over grid edge). The number of columns is determined by the nextPageSize property.

 o actionProperties
 private void actionProperties()
Shows the property dialog and (if the user confirms the selections made in the dialog) sets time grid and calendar panel properties according to the selections.

 o copyTimeSlices
 private void copyTimeSlices(Vector to,
                             Vector from)
Creates copies of time slices in a vector and puts them to another vector.

 o existingTimeSlices
 private Vector existingTimeSlices(MatrixLocation loc)
Returns a vector of those time slices that reside in the given matrix location (the location is given in visible window coordinates not in the time grid's internal grid coordinates).

 o getCurrentMarker
 private Marker getCurrentMarker()
Gets the current marker that can be used for adding new time slices.

 o getGrid
 private GridControl getGrid()
Gets the user interface widget for showing the time grid.

 o getModifyDialog
 private ModifyDialog getModifyDialog()
Gets the modify dialog.

 o getPropertyDialog
 public PropertyDialog getPropertyDialog()
Gets the property dialog.

 o getRemoveDialog
 private RemoveDialog getRemoveDialog()
Gets the remove dialog.

 o getStatusBar
 private StatusBar getStatusBar()
Gets the status bar.

 o jbInit
 private void jbInit() throws Exception
Initializes the user interface.

 o newTimeSlice
 private TimeSlice newTimeSlice(MatrixLocation start,
                                MatrixLocation end,
                                Marker m)
Creates and returns a new time slice from the given start matrix location to the given end location for the given marker.

 o selectionsToExistingTimeSlices
 private Vector selectionsToExistingTimeSlices(MatrixSelection ms)
Returns a vector of time slices that reside (partially or entirely) in the locations denoted by the given matrix selection.

 o selectionsToNewTimeSlices
 private Vector selectionsToNewTimeSlices(MatrixSelection ms)
Returns a vector of new time slices that correspond to the locations denoted by the given matrix selection. Because all rows are not always visible the selections that reside on several columns will produce a separate time slice for each column. Naturally all separate selections will produce separate time slices.

 o setAddedTimeSlices
 private void setAddedTimeSlices(Vector s)
Sets the time slices that have been added by the user. This information can be used, for example, to update an external data source, such as a database.

 o setCurrentMarker
 private void setCurrentMarker(Marker m)
Sets the current marker that can be used for adding new time slices.

 o setFrame
 private void setFrame(Frame f)
Sets the frame that owns this panel.

 o setMarkerDialog
 private void setMarkerDialog(MarkerDialog md)
Sets the marker dialog.

 o setModifyDialog
 private void setModifyDialog(ModifyDialog md)
Sets the modify dialog.

 o setPropertyDialog
 private void setPropertyDialog(PropertyDialog p)
Sets the property dialog.

 o setRemoveDialog
 private void setRemoveDialog(RemoveDialog rd)
Sets the remove dialog.

 o setRemovedTimeSlices
 private void setRemovedTimeSlices(Vector s)
Sets the time slices that have been removed by the user. This information can be used, for example, to update an external data source, such as a database.

 o setTimeGrid
 private void setTimeGrid(TimeGrid tg)
Sets the calendar information (the model) this calendar panel visualizes.


All Packages  Class Hierarchy  This Package  Previous  Next  Index