|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--fi.helsinki.cs.gist.timeline.GCalendarScrollbar
GCalendarScrollbar shows a specified time range from calendar. It allows
user to modify visible time range and select some part of visible calendar
to more detailed views. It itself doesn't show this detailed view, but tells * through GVisibleDaysModel user's selection. In case of GTimeline, GTimeline
listens this GVisibleDaysModel and updates it view accordingly.
GCalendarScrollbar offers several different ways to select visible days,
and offer possibilities for developers to add extra functionality to it.
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
protected static java.lang.String |
BUTTON_DOWN_ACTION
Constant, which can be used to differentiate actions send by scrollbar buttons. |
protected static java.lang.String |
BUTTON_UP_ACTION
Constant, which can be used to differentiate actions send by scrollbar buttons. |
protected java.util.Calendar |
calendar
|
protected int[] |
colsOfDaysOfWeek
|
protected int |
columns
|
protected int |
colW
|
protected int |
colWRemainder
|
protected javax.swing.JButton |
downButtonBottom
|
protected javax.swing.JButton |
downButtonTop
|
protected java.util.Date[][] |
grid
Grid of calendar days. |
protected int |
headerH
|
protected java.util.Vector |
monthChangeCells
|
protected GMonthRange |
monthRange
|
protected static int |
NOT_VISIBLE
Constant that indicates that some day or day of week is not visible. |
protected int |
rowH
|
protected int |
rowHRemainder
|
protected int |
rows
|
protected javax.swing.JLayeredPane |
scrollArea
|
protected java.util.Vector |
scrollAreaLayers
|
protected static int |
UNDEFINED
|
protected javax.swing.JButton |
upButtonBottom
|
protected javax.swing.JButton |
upButtonTop
|
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 |
Constructor Summary | |
GCalendarScrollbar(GCalendarModel calendarM,
GVisibleDaysModel visibleDaysM,
GCalendarEventSelectionModel selectionM)
Constructs CalendarScrollbar with the given models. |
|
GCalendarScrollbar(GCalendarModel calendarM,
GVisibleDaysModel visibleDaysM,
GCalendarEventSelectionModel selectionM,
GDayNumberRenderer dayNumberRenderer,
java.util.Date firstDay,
java.util.Date lastDay,
int firstVisibleWeekday,
int lastVisibleWeekday)
Constructs CalendarScrollbar with the given initial values. |
Method Summary | |
protected void |
calculateCellSizes()
Calculates widths and heights for day cells. |
protected void |
commonConstructor(GCalendarModel calendarM,
GVisibleDaysModel visibleDaysM,
GCalendarEventSelectionModel selectionM,
GDayNumberRenderer dayNumberRenderer,
java.util.Date firstDay,
java.util.Date lastDay,
int firstVisibleWeekday,
int lastVisibleWeekday)
An implementation of constructor code common to all constructors. |
void |
componentHidden(java.awt.event.ComponentEvent e)
|
void |
componentMoved(java.awt.event.ComponentEvent e)
|
void |
componentResized(java.awt.event.ComponentEvent e)
Kun ScrollAreaa muutetaan, niin lasketaan gridin solujen koot uusiksi |
void |
componentShown(java.awt.event.ComponentEvent e)
|
protected int |
countWeeks(java.util.Date first,
java.util.Date last)
Counts weeks between and including given days. |
protected void |
fillGrid(java.util.Date first,
java.util.Date last)
Maps dates to grid, stores grid points for months changes. |
java.util.Calendar |
getCalendar()
Returns the calendar, that CalendarScrollbar uses. |
java.awt.Point |
getCellAtPoint(java.awt.Point p)
Returns cell of given graphical point in day grid. |
java.awt.Point |
getCellOfDay(java.util.Date day)
Returns cell of given day in day grid. |
int |
getColumnCount()
Returns number of columns in day grid. |
int |
getColumnOfDayOfWeek(int DOW)
Returns column number for given day of week. |
java.util.Date |
getDayAtCell(int col,
int row)
Returns day at given cell of day grid. |
java.util.Date |
getDayAtCell(java.awt.Point cell)
Returns day at given cell of day grid. |
java.util.Date |
getDayAtPoint(java.awt.Point p)
Returns day at given graphical point in day grid. |
int |
getDayOfWeekOfColumn(int col)
Returns constant of day of week , which given column represents. |
javax.swing.JComponent |
getLayerBelow(javax.swing.JComponent layer)
Returns layer below given layer. |
java.util.Vector |
getMonthChangeCells()
Returns those cells of day grid, which represents 1st days of month. |
int |
getMonthCount()
Returns number of months visible currently in CalendarScrollbar. |
java.util.Vector |
getMonthLinePointsOnLeft(javax.swing.JComponent c)
Returns month lines (on left edge of scrollArea) in given component's coordinates. |
java.util.Vector |
getMonths()
Returns months a calendar scrollbar is currently showing. |
java.awt.Rectangle |
getRectOfCell(int col,
int row)
Returns graphical area of certain cell in day grid. |
java.awt.Rectangle |
getRectOfCell(java.awt.Point cell)
Returns graphical area of certain cell in day grid. |
java.awt.Rectangle |
getRectOfColumnHeader(int col)
|
java.awt.Rectangle |
getRectOfDay(java.util.Date day)
Returns graphical area of certain day in day grid. |
int |
getRowCount()
Returns number of rows in day grid. |
java.util.Vector |
getScrollAreaLayers()
Returns currently used scroll area layers. |
java.util.Vector |
getScrollDownButtons()
Returns referernces to all buttons that acts as scroll down -buttons. |
java.util.Vector |
getScrollUpButtons()
Returns referernces to all buttons that acts as scroll up -buttons. |
javax.swing.JComponent |
getTopMostLayer()
Returns top layer in scroll area. |
protected void |
initColumns(int firstWeekday,
int lastWeekday)
Counts columns between and including first and last visible weekday |
protected void |
initScrollArea(GVisibleDaysModel visibleDaysM,
GDayNumberRenderer dayNumberRenderer,
GCalendarEventSelectionModel selectionM)
Sets initial layout and creates layers for scrollarea. |
boolean |
isFirstMonthFull()
Returns true, if first day of first visible month of day grid is in grid also. |
boolean |
isLastMonthFull()
Returns true, if last day of last visible month of day grid is in grid also. |
static void |
main(java.lang.String[] args)
|
void |
propertyChange(java.beans.PropertyChangeEvent e)
|
void |
setScrollAreaLayers(java.util.Vector layers)
Sets and layouts new layers for scroll area. |
void |
setVisibleRange(java.util.Date firstDay,
java.util.Date lastDay,
boolean fillWeeks)
Sets CalendarLayerl to show days between given range. |
java.lang.String |
toString()
Returns internal state of CalendarScrollbar as text output. |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getAccessibleContext,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getUIClassID,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
paramString,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update,
updateUI |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setCursor,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected static final int NOT_VISIBLE
protected static final int UNDEFINED
protected static final java.lang.String BUTTON_UP_ACTION
protected static final java.lang.String BUTTON_DOWN_ACTION
protected GMonthRange monthRange
protected javax.swing.JButton upButtonTop
protected javax.swing.JButton downButtonTop
protected javax.swing.JButton upButtonBottom
protected javax.swing.JButton downButtonBottom
protected javax.swing.JLayeredPane scrollArea
protected java.util.Vector scrollAreaLayers
protected java.util.Calendar calendar
protected int columns
protected int rows
protected java.util.Date[][] grid
protected java.util.Vector monthChangeCells
protected int colW
protected int colWRemainder
protected int rowH
protected int rowHRemainder
protected int headerH
protected int[] colsOfDaysOfWeek
Constructor Detail |
public GCalendarScrollbar(GCalendarModel calendarM, GVisibleDaysModel visibleDaysM, GCalendarEventSelectionModel selectionM)
calendarM
- the calendar modelvisibleDaysM
- the visible days modelselectionM
- the calendar event selection modelpublic GCalendarScrollbar(GCalendarModel calendarM, GVisibleDaysModel visibleDaysM, GCalendarEventSelectionModel selectionM, GDayNumberRenderer dayNumberRenderer, java.util.Date firstDay, java.util.Date lastDay, int firstVisibleWeekday, int lastVisibleWeekday)
calendarM
- the calendar modelvisibleDaysM
- the visible days modelselectionM
- the calendar event selection modeldayNumberRenderer
- the DayNumberRenderer to draw day numbersfirstDay
- first visible day in scrollbarlastDay
- last visible day in scrollbarfirstVisibleWeekday
- the first weekday shownlastVisibleWeekday
- the last weekday shownMethod Detail |
protected void commonConstructor(GCalendarModel calendarM, GVisibleDaysModel visibleDaysM, GCalendarEventSelectionModel selectionM, GDayNumberRenderer dayNumberRenderer, java.util.Date firstDay, java.util.Date lastDay, int firstVisibleWeekday, int lastVisibleWeekday)
protected void initScrollArea(GVisibleDaysModel visibleDaysM, GDayNumberRenderer dayNumberRenderer, GCalendarEventSelectionModel selectionM)
public java.util.Vector getScrollUpButtons()
public java.util.Vector getScrollDownButtons()
public int getColumnCount()
public int getRowCount()
public java.awt.Rectangle getRectOfDay(java.util.Date day)
public java.awt.Rectangle getRectOfCell(java.awt.Point cell)
public java.awt.Rectangle getRectOfCell(int col, int row)
public java.awt.Rectangle getRectOfColumnHeader(int col)
public java.awt.Point getCellOfDay(java.util.Date day)
java.awt.Point
where x is for columns, and y for rows.public java.awt.Point getCellAtPoint(java.awt.Point p)
java.awt.Point
where x is for columns, and y for rows.public java.util.Date getDayAtPoint(java.awt.Point p)
java.awt.Point
where x is for columns, and y for rows.public java.util.Date getDayAtCell(java.awt.Point cell)
public java.util.Date getDayAtCell(int col, int row)
public int getColumnOfDayOfWeek(int DOW)
public int getDayOfWeekOfColumn(int col)
public java.util.Vector getMonthChangeCells()
public boolean isFirstMonthFull()
public boolean isLastMonthFull()
public java.util.Vector getMonths()
public int getMonthCount()
public java.util.Vector getMonthLinePointsOnLeft(javax.swing.JComponent c)
GMonthRange
public void setScrollAreaLayers(java.util.Vector layers)
public java.util.Vector getScrollAreaLayers()
public java.util.Calendar getCalendar()
public void setVisibleRange(java.util.Date firstDay, java.util.Date lastDay, boolean fillWeeks)
firstDay
- the first day of range to be shown.lastDay
- the last day of range to be shown.fillWeeks
- true, if days outside of given range, but in same weeks
with firstDay or lastDay, has to be shown.
false, otherwise.public javax.swing.JComponent getLayerBelow(javax.swing.JComponent layer)
public javax.swing.JComponent getTopMostLayer()
public void propertyChange(java.beans.PropertyChangeEvent e)
public void componentHidden(java.awt.event.ComponentEvent e)
public void componentMoved(java.awt.event.ComponentEvent e)
public void componentShown(java.awt.event.ComponentEvent e)
public void componentResized(java.awt.event.ComponentEvent e)
protected void initColumns(int firstWeekday, int lastWeekday)
protected int countWeeks(java.util.Date first, java.util.Date last)
protected void fillGrid(java.util.Date first, java.util.Date last)
protected void calculateCellSizes()
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |