fi.helsinki.cs.gist.schedule
Class GCalendarEventBox

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--fi.helsinki.cs.gist.schedule.GAbstractCalendarEventBox
                          |
                          +--fi.helsinki.cs.gist.schedule.GCalendarEventBox

public class GCalendarEventBox
extends GAbstractCalendarEventBox
implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.dnd.DragSourceListener, java.awt.dnd.DragGestureListener, java.awt.event.ComponentListener, GCalendarEventSelectionModelListener

GCalendarEventBox is a basic event box for calendar events in GSchedule environment.

See Also:
Serialized Form

Inner Class Summary
 class GCalendarEventBox.BorderMouseHandler
           
 class GCalendarEventBox.MouseHandler
           
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
protected  java.awt.Color bgColor
           
protected  java.awt.Color borderColor
           
protected  javax.swing.event.MouseInputListener borderMouseHandler
           
static int LOW
          Constant for Low priority events.
protected  javax.swing.event.MouseInputListener mouseHandler
           
static int NORMAL
          Constant for Low priority events.
protected  java.awt.Color selectionColor
           
protected  GCalendarEventSelectionModel selectionModel
           
static int TOP
          Constant for Low priority
 
Fields inherited from class fi.helsinki.cs.gist.schedule.GAbstractCalendarEventBox
column, LOWER_EDGE, PARTIAL_VISIBILITY_AT_BOTTOM, PARTIAL_VISIBILITY_AT_TOP, UPPER_EDGE
 
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
GCalendarEventBox(GCalendarEvent calEvent, GCalendarEventSelectionModel selectionModel)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
 void calendarEventSelectionModelChanged(GCalendarEventSelectionModelEvent e)
           
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
           
 void componentShown(java.awt.event.ComponentEvent e)
           
 void copy()
          Copies the event.
protected  void createContextMenu()
           
 void cut()
          Cuts the event.
 void delete()
          Delete this event.
 void dragDropEnd(java.awt.dnd.DragSourceDropEvent e)
          this message goes to DragSourceListener, informing it that the dragging has ended
 void dragEnter(java.awt.dnd.DragSourceDragEvent event)
          this message goes to DragSourceListener, informing it that the dragging has entered the DropSite
 void dragExit(java.awt.dnd.DragSourceEvent event)
          this message goes to DragSourceListener, informing it that the dragging has exited the DropSite
 void dragGestureRecognized(java.awt.dnd.DragGestureEvent dge)
          a drag gesture has been initiated
 void dragOver(java.awt.dnd.DragSourceDragEvent event)
          this message goes to DragSourceListener, informing it that the dragging is currently ocurring over the DropSite
 void dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
          is invoked when the user changes the dropAction
 void edit()
          Displays the event editor.
 void finalize()
           
 java.awt.Color getBackgroundColor()
           
 java.awt.Color getBorderColor()
           
 GCalendarEvent getCalendarEvent()
           
 GCalendarEvent getDraggedCalendarEvent(java.awt.dnd.DragGestureEvent dge)
           
 java.util.Date getEndTime()
          Required by GAbstractCalendarEventBox.
 int getEventTipDelay()
          Gets the eventTip delay time.
 java.awt.Color getSelectionColor()
          Gets the color eventBox background is when it is selected.
 java.util.Date getStartTime()
          Required by GAbstractCalendarEventBox.
 void killEventTipTimer()
           
 void properties()
          Displays the properties context menu.
 void setBackgroundColor(java.awt.Color c)
           
 void setBorderColor(java.awt.Color c)
           
 void setContextMenu(javax.swing.JPopupMenu popup)
          Sets the context menu of this CalendarEventBox
 void setEventEditor(GAbstractCalendarEventEditor editBox)
          Sets the editor of this CalendarEventBox
 void setEventTip(GAbstractCalendarEventTip eventTip)
          Sets the eventtip of this CalendarEventBox
 void setEventTipDelay(int delay)
          Sets the delay how long it takes before eventTip is shown after mouse enters this EventBox.
 void setSelectionColor(java.awt.Color c)
          Sets the color eventBox background is when it is selected.
 void setVisibility(int visibility)
          Required by GAbstractCalendarEventBox.
protected  void updateColors()
           
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class fi.helsinki.cs.gist.schedule.GAbstractCalendarEventBox
getColumn, setColumn
 
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, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOW

public static final int LOW
Constant for Low priority events.

NORMAL

public static final int NORMAL
Constant for Low priority events.

TOP

public static final int TOP
Constant for Low priority

mouseHandler

protected javax.swing.event.MouseInputListener mouseHandler

borderMouseHandler

protected javax.swing.event.MouseInputListener borderMouseHandler

selectionModel

protected GCalendarEventSelectionModel selectionModel

bgColor

protected java.awt.Color bgColor

selectionColor

protected java.awt.Color selectionColor

borderColor

protected java.awt.Color borderColor
Constructor Detail

GCalendarEventBox

public GCalendarEventBox(GCalendarEvent calEvent,
                         GCalendarEventSelectionModel selectionModel)
Method Detail

getStartTime

public java.util.Date getStartTime()
Required by GAbstractCalendarEventBox.
Overrides:
getStartTime in class GAbstractCalendarEventBox

getEndTime

public java.util.Date getEndTime()
Required by GAbstractCalendarEventBox.
Overrides:
getEndTime in class GAbstractCalendarEventBox

getCalendarEvent

public GCalendarEvent getCalendarEvent()

setVisibility

public void setVisibility(int visibility)
Required by GAbstractCalendarEventBox.
Overrides:
setVisibility in class GAbstractCalendarEventBox

getBackgroundColor

public java.awt.Color getBackgroundColor()

setBackgroundColor

public void setBackgroundColor(java.awt.Color c)

getBorderColor

public java.awt.Color getBorderColor()

setBorderColor

public void setBorderColor(java.awt.Color c)

getSelectionColor

public java.awt.Color getSelectionColor()
Gets the color eventBox background is when it is selected.
Returns:
selection color

setSelectionColor

public void setSelectionColor(java.awt.Color c)
Sets the color eventBox background is when it is selected.
Parameters:
c - selection color

setEventTipDelay

public void setEventTipDelay(int delay)
Sets the delay how long it takes before eventTip is shown after mouse enters this EventBox.
Parameters:
delay - delay

getEventTipDelay

public int getEventTipDelay()
Gets the eventTip delay time.
Returns:
delay

setContextMenu

public void setContextMenu(javax.swing.JPopupMenu popup)
Sets the context menu of this CalendarEventBox

setEventTip

public void setEventTip(GAbstractCalendarEventTip eventTip)
Sets the eventtip of this CalendarEventBox

setEventEditor

public void setEventEditor(GAbstractCalendarEventEditor editBox)
Sets the editor of this CalendarEventBox

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object

edit

public void edit()
Displays the event editor.

delete

public void delete()
Delete this event. (not implemented yet)

cut

public void cut()
Cuts the event. (not implemented yet)

copy

public void copy()
Copies the event. (not implemented yet)

properties

public void properties()
Displays the properties context menu. (not implemented yet)

killEventTipTimer

public void killEventTipTimer()

calendarEventSelectionModelChanged

public void calendarEventSelectionModelChanged(GCalendarEventSelectionModelEvent e)
Specified by:
calendarEventSelectionModelChanged in interface GCalendarEventSelectionModelListener

updateColors

protected void updateColors()

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Specified by:
componentResized in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

getDraggedCalendarEvent

public GCalendarEvent getDraggedCalendarEvent(java.awt.dnd.DragGestureEvent dge)

dragGestureRecognized

public void dragGestureRecognized(java.awt.dnd.DragGestureEvent dge)
a drag gesture has been initiated
Specified by:
dragGestureRecognized in interface java.awt.dnd.DragGestureListener

dragDropEnd

public void dragDropEnd(java.awt.dnd.DragSourceDropEvent e)
this message goes to DragSourceListener, informing it that the dragging has ended
Specified by:
dragDropEnd in interface java.awt.dnd.DragSourceListener

dragEnter

public void dragEnter(java.awt.dnd.DragSourceDragEvent event)
this message goes to DragSourceListener, informing it that the dragging has entered the DropSite
Specified by:
dragEnter in interface java.awt.dnd.DragSourceListener

dragExit

public void dragExit(java.awt.dnd.DragSourceEvent event)
this message goes to DragSourceListener, informing it that the dragging has exited the DropSite
Specified by:
dragExit in interface java.awt.dnd.DragSourceListener

dragOver

public void dragOver(java.awt.dnd.DragSourceDragEvent event)
this message goes to DragSourceListener, informing it that the dragging is currently ocurring over the DropSite
Specified by:
dragOver in interface java.awt.dnd.DragSourceListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
is invoked when the user changes the dropAction
Specified by:
dropActionChanged in interface java.awt.dnd.DragSourceListener

createContextMenu

protected void createContextMenu()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Specified by:
actionPerformed in interface java.awt.event.ActionListener