|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
scheduler.view.view_ui.CalendarViewUI
public class CalendarViewUI
Displaying a schedule in a calendar mode
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JScrollPane |
---|
javax.swing.JScrollPane.AccessibleJScrollPane, javax.swing.JScrollPane.ScrollBar |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected java.util.ArrayList<CalColumn> |
calColumnList
List of CalColumn for selected days in AF |
protected CalendarView |
calView
The companion model object |
protected int |
cellHeight
|
protected int |
cellWidth
|
protected java.util.ArrayList<javax.swing.Box> |
colBox
list of box for each column in the schedule. |
protected java.util.ArrayList<javax.swing.Box> |
dayBox
list of box each day column in the schedule |
protected java.util.ArrayList<javax.swing.JPanel> |
dayGrid
list of grid each day column in the schedule |
protected int[] |
dayNumCol
the number indicate number of col needed for that day more than 1 col means there is an overlapping calendar cell for that day |
(package private) static java.lang.String[] |
daysList
|
protected javax.swing.JPanel |
emptyheadingGrid
panels inside each box |
protected java.awt.Dimension |
emptyheadingGridDim
dimensions for each panel |
protected int |
endTime
Time obj representing the time range in calendar view |
protected javax.swing.Box |
headingBox
Box to layout the Calendar View |
protected javax.swing.JPanel |
headingGrid
panels inside each box |
protected int |
i
|
protected javax.swing.Box |
innerBox
Box to layout the Calendar View |
protected java.util.ArrayList<ScheduleItemLabel> |
labelList
ArrayList of ScheduleItemLabel for each label in Calendar View |
protected int |
minCellHeight
Default constant for the height of calendar cell. |
protected int |
minCellWidth
Default constant for the width of calendar cell. |
protected int |
minWindowHeight
Default constant for the height of calendar panel. |
protected int |
minWindowWidth
Default constant for the width of calendar panel. |
protected java.util.ArrayList<javax.swing.JButton> |
moreButton
List of "More..." button in the view |
protected int |
numDaysInWeek
number of days in a weekly view or 1 for a daily view, indicate number of cols |
protected int |
numHour
number of hours in a day, indicate number of rows |
protected javax.swing.Box |
outerBox
Box to layout the Calendar View |
protected java.awt.Dimension |
outerGridDim
dimensions for each panel |
protected javax.swing.JPanel |
outerPanel
panels inside each box |
protected javax.swing.Box |
outerScrollBox
Box to layout the Calendar View |
protected java.util.ArrayList<javax.swing.JPanel> |
popup
List of JPanel for Popup dialog in calendar view |
protected int |
popupInd
|
protected javax.swing.Box |
scheduleBox
Box to layout the Calendar View |
protected javax.swing.JPanel |
scheduleGrid
panels inside each box |
protected java.awt.Dimension |
scheduleGridDim
dimensions for each panel |
protected java.awt.GridLayout |
scheduleLayout
gridLayout for each panel |
protected javax.swing.Box |
scheduleScrollBox
Box to layout the Calendar View |
protected int |
startTime
Time obj representing the time range in calendar view |
protected javax.swing.Box |
timeBox
Box to layout the Calendar View |
protected javax.swing.JPanel |
timeGrid
panels inside each box |
protected java.awt.Dimension |
timeGridDim
dimensions for each panel |
protected java.awt.Dimension |
timeGridDimMax
dimensions for each panel |
protected java.awt.GridLayout |
timeLayout
gridLayout for each panel |
(package private) static java.lang.String[] |
timeList
|
protected int |
timeWidth
Default constant for the width of time cell. |
protected javax.swing.Box |
titleBox
Box to layout the Calendar View |
protected int |
totalNumCol
Number of Column needed |
protected int |
windowHeight
|
protected int |
windowWidth
|
Fields inherited from class javax.swing.JScrollPane |
---|
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.ScrollPaneConstants |
---|
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
CalendarViewUI(CalendarView calView)
|
Method Summary | |
---|---|
void |
calcDimension()
Calculate the dimension of the Calendar view and Calendar Cell |
private void |
createCalColumn()
Go through each calColumn in CalColumnList in order to go through each CalCell in the current CalColumn in order to add ScheduleItem's label to the CalCell |
private javax.swing.JPanel |
createCellBox(java.util.ArrayList<ScheduleItem> siList,
int numH)
Create a panel for each cell on the calendar view Each panel contains a list of scheduleitem from the first param If there are more than 3 scheduleItem in 1 panel, this method will create "more" button to display the whole list of scheduleItem in a new dialog |
private javax.swing.JPanel |
createEmptyCellBox(int numH)
Create empty JPanel when there are gaps b/w each cell |
protected javax.swing.JPanel |
createHeadingCol(java.lang.String str,
int w)
Create heading cell with the given text |
private void |
createInnerOuterBox()
Combine each boxes together |
private void |
createScheduleBox()
Create the main calendar view containing scheduleItems |
private void |
createTimeBox()
Create Time Column |
private void |
createTitleBox()
Create the heading/Title row |
java.util.ArrayList<ScheduleItemLabel> |
getLabelList()
return labelList of the calendar view |
void |
printCalendarView()
Print the calendar inforamtion |
protected javax.swing.JPanel |
setTimeCol(java.lang.String str)
Create JLabel for the given text with gray background |
void |
update()
update the data and repaint the panel for calendar view when View receive notification from AF or checkboxes |
void |
updateData()
Update calendar information for painting |
private void |
updateHeadingGrid()
Add Day's name or "Daily" to the heading box |
private void |
updateInnerOuterBox()
Recombine the boxes when the setting changes |
void |
updateLabel()
Update the JLabel for each Calendar Cell |
private void |
updateScheduleBox()
Update the main schedule view when the setting changes |
private void |
updateTimeBox()
Update the Time column when the setting changes |
private void |
updateTitleBox()
Update the Title row when the setting changes |
Methods inherited from class javax.swing.JScrollPane |
---|
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList<ScheduleItemLabel> labelList
protected final int minCellHeight
protected final int minCellWidth
protected final int timeWidth
protected final int minWindowHeight
protected final int minWindowWidth
protected int cellHeight
protected int cellWidth
protected int windowHeight
protected int windowWidth
protected int numDaysInWeek
protected int startTime
protected int endTime
protected int numHour
protected javax.swing.Box titleBox
protected javax.swing.Box headingBox
protected javax.swing.Box timeBox
protected javax.swing.Box scheduleBox
protected javax.swing.Box scheduleScrollBox
protected javax.swing.Box innerBox
protected javax.swing.Box outerScrollBox
protected javax.swing.Box outerBox
protected javax.swing.JPanel headingGrid
protected javax.swing.JPanel emptyheadingGrid
protected javax.swing.JPanel timeGrid
protected javax.swing.JPanel scheduleGrid
protected javax.swing.JPanel outerPanel
protected java.awt.Dimension emptyheadingGridDim
protected java.awt.Dimension timeGridDim
protected java.awt.Dimension outerGridDim
protected java.awt.Dimension timeGridDimMax
protected java.awt.Dimension scheduleGridDim
protected java.awt.GridLayout timeLayout
protected java.awt.GridLayout scheduleLayout
protected java.util.ArrayList<javax.swing.Box> colBox
protected java.util.ArrayList<javax.swing.Box> dayBox
protected java.util.ArrayList<javax.swing.JPanel> dayGrid
protected CalendarView calView
protected java.util.ArrayList<CalColumn> calColumnList
protected java.util.ArrayList<javax.swing.JPanel> popup
protected java.util.ArrayList<javax.swing.JButton> moreButton
protected int popupInd
protected int[] dayNumCol
protected int totalNumCol
protected int i
static final java.lang.String[] daysList
static final java.lang.String[] timeList
Constructor Detail |
---|
public CalendarViewUI(CalendarView calView)
Method Detail |
---|
public void printCalendarView()
public void update()
public void updateLabel()
public void updateData()
public void calcDimension()
private void createTitleBox()
private void updateTitleBox()
private void updateHeadingGrid()
private void createTimeBox()
private void updateTimeBox()
private void createScheduleBox()
private void updateScheduleBox()
private void createCalColumn()
private javax.swing.JPanel createCellBox(java.util.ArrayList<ScheduleItem> siList, int numH)
siList
- - list of ScheduleItem in the panelnumHour
- - determine the height of the panel cell
private javax.swing.JPanel createEmptyCellBox(int numH)
numH
- - the width of the empty cell
private void createInnerOuterBox()
private void updateInnerOuterBox()
protected javax.swing.JPanel setTimeCol(java.lang.String str)
str
- - text to display in the JPanel
protected javax.swing.JPanel createHeadingCol(java.lang.String str, int w)
str
- - the text to be displayedw
- - the width unit of the cell
public java.util.ArrayList<ScheduleItemLabel> getLabelList()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |