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
-
addedTimeSlices
- The time slices that have been added by the user.
-
addItem
- A menu item.
-
borderLayout
- Layout for the calendar panel.
-
currentMarker
- The current marker that can be used for adding new time slices.
-
frame
- The frame that owns this panel.
-
grid
- The user interface widget for showing the time grid.
-
markerDialog
- The marker dialog.
-
markersItem
- A menu item.
-
modifyDialog
- The modify dialog.
-
modifyItem
- A menu item.
-
nextPageItem
- A menu item.
-
nextPageSize
- The number of columns to move forwards (or backwards) when the user
selects "Next Page" (or "Previous Page") in the popup menu.
-
popupMenu
- The popup menu.
-
popupmenuActionAdapter
- The action adapter for the popup menu.
-
prevPageItem
- A menu item.
-
propertiesItem
- A menu item.
-
propertyDialog
- The property dialog.
-
removeDialog
- The remove dialog.
-
removedTimeSlices
- The time slices that have been removed by the user.
-
removeItem
- A menu item.
-
statusBar
- The status bar of the CalendarPanel.
-
timeGrid
- The calendar information (the model) this calendar panel visualizes.
-
CalendarPanel(Frame, TimeGrid)
- Initializes the calendar panel with the given owner frame and time grid.
-
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.
-
actionMarkers()
- Sets the current marker according to the selection made in the marker
dialog.
-
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.
-
actionNextPage()
- Moves the visible part of the time grid forward (if the move will not go
over grid edge).
-
actionPreviousPage()
- Moves the visible part of the time grid backwards (if the move will not go
over grid edge).
-
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.
-
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.
-
addPopupMenuItem(String)
- Adds a new item into the popup menu of this calendar panel.
-
copyTimeSlices(Vector, Vector)
- Creates copies of time slices in a vector and puts them to another vector.
-
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).
-
getAddedTimeSlices()
- Gets the time slices that have been added by the user.
-
getCurrentMarker()
- Gets the current marker that can be used for adding new time slices.
-
getFrame()
- Gets the frame that owns this panel.
-
getGrid()
- Gets the user interface widget for showing the time grid.
-
getMarkerDialog()
- Gets the marker dialog.
-
getModifyDialog()
- Gets the modify dialog.
-
getNextPageSize()
- Gets the number of columns to move forwards (or backwards) when the user
selects "Next Page" (or "Previous Page") in the popup menu.
-
getPropertyDialog()
- Gets the property dialog.
-
getRemoveDialog()
- Gets the remove dialog.
-
getRemovedTimeSlices()
- Gets the time slices that have been removed by the user.
-
getStatus()
- Gets the status text from the status bar.
-
getStatusBar()
- Gets the status bar.
-
getTimeGrid()
- Gets the calendar information (the model) this calendar panel visualizes.
-
handlePopupMenuEvent(ActionEvent)
- Handles selections from the popup menu.
-
jbInit()
- Initializes the user interface.
-
mousePressed(MouseEvent)
- Called when the mouse is pressed.
-
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.
-
popupmenuActionPerformed(ActionEvent)
- Called when the user selects an item from the popup menu.
-
refresh()
- Refreshes the calendar's grid component.
-
selectionsToExistingTimeSlices(MatrixSelection)
- Returns a vector of time slices that reside (partially or entirely)
in the locations denoted by the given matrix selection.
-
selectionsToNewTimeSlices(MatrixSelection)
- Returns a vector of new time slices that correspond to the locations
denoted by the given matrix selection.
-
setAddedTimeSlices(Vector)
- Sets the time slices that have been added by the user.
-
setCurrentMarker(Marker)
- Sets the current marker that can be used for adding new time slices.
-
setFrame(Frame)
- Sets the frame that owns this panel.
-
setMarkerDialog(MarkerDialog)
- Sets the marker dialog.
-
setModifyDialog(ModifyDialog)
- Sets the modify dialog.
-
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.
-
setPropertyDialog(PropertyDialog)
- Sets the property dialog.
-
setRemoveDialog(RemoveDialog)
- Sets the remove dialog.
-
setRemovedTimeSlices(Vector)
- Sets the time slices that have been removed by the user.
-
setStatus(String)
- Sets the status text (of the status bar) to the given string.
-
setTimeGrid(TimeGrid)
- Sets the calendar information (the model) this calendar panel visualizes.
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.
addItem
private MenuItem addItem
- A menu item.
borderLayout
private BorderLayout borderLayout
- Layout for the calendar panel.
currentMarker
private Marker currentMarker
- The current marker that can be used for adding new time slices.
frame
private Frame frame
- The frame that owns this panel.
grid
private GridControl grid
- The user interface widget for showing the time grid.
markerDialog
private MarkerDialog markerDialog
- The marker dialog.
markersItem
private MenuItem markersItem
- A menu item.
modifyDialog
private ModifyDialog modifyDialog
- The modify dialog.
modifyItem
private MenuItem modifyItem
- A menu item.
nextPageItem
private MenuItem nextPageItem
- A menu item.
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.
popupMenu
private PopupMenu popupMenu
- The popup menu.
popupmenuActionAdapter
private CalendarPanelPopupmenuActionAdapter popupmenuActionAdapter
- The action adapter for the popup menu.
prevPageItem
private MenuItem prevPageItem
- A menu item.
propertiesItem
private MenuItem propertiesItem
- A menu item.
propertyDialog
private PropertyDialog propertyDialog
- The property dialog.
removeDialog
private RemoveDialog removeDialog
- The remove dialog.
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.
removeItem
private MenuItem removeItem
- A menu item.
statusBar
private StatusBar statusBar
- The status bar of the CalendarPanel.
timeGrid
private TimeGrid timeGrid
- The calendar information (the model) this calendar panel visualizes.
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.
getMarkerDialog
public MarkerDialog getMarkerDialog()
- Gets the marker dialog.
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.
getStatus
public String getStatus()
- Gets the status text from the status bar.
- Returns:
- The status string.
getTimeGrid
public TimeGrid getTimeGrid()
- Gets the calendar information (the model) this calendar panel visualizes.
refresh
public void refresh()
- Refreshes the calendar's grid component.
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.
setStatus
public void setStatus(String status)
- Sets the status text (of the status bar) to the given string.
- Parameters:
- status - The new status string.
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.
popupmenuActionPerformed
void popupmenuActionPerformed(ActionEvent event)
- Called when the user selects an item from the popup menu. Calls
handlePopupMenuEvent(ActionEvent event).
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.
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.
getFrame
protected Frame getFrame()
- Gets the frame that owns this panel.
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.
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...".
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.
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.
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.
actionMarkers
private void actionMarkers()
- Sets the current marker according to the selection made in the marker
dialog.
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.
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.
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.
copyTimeSlices
private void copyTimeSlices(Vector to,
Vector from)
- Creates copies of time slices in a vector and puts them to another vector.
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).
getCurrentMarker
private Marker getCurrentMarker()
- Gets the current marker that can be used for adding new time slices.
getGrid
private GridControl getGrid()
- Gets the user interface widget for showing the time grid.
getModifyDialog
private ModifyDialog getModifyDialog()
- Gets the modify dialog.
getPropertyDialog
public PropertyDialog getPropertyDialog()
- Gets the property dialog.
getRemoveDialog
private RemoveDialog getRemoveDialog()
- Gets the remove dialog.
getStatusBar
private StatusBar getStatusBar()
- Gets the status bar.
jbInit
private void jbInit() throws Exception
- Initializes the user interface.
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.
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.
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.
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.
setCurrentMarker
private void setCurrentMarker(Marker m)
- Sets the current marker that can be used for adding new time slices.
setFrame
private void setFrame(Frame f)
- Sets the frame that owns this panel.
setMarkerDialog
private void setMarkerDialog(MarkerDialog md)
- Sets the marker dialog.
setModifyDialog
private void setModifyDialog(ModifyDialog md)
- Sets the modify dialog.
setPropertyDialog
private void setPropertyDialog(PropertyDialog p)
- Sets the property dialog.
setRemoveDialog
private void setRemoveDialog(RemoveDialog rd)
- Sets the remove dialog.
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.
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