com.miginfocom.calendar.datearea
Class DefaultDateArea

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.miginfocom.calendar.datearea.DefaultDateArea
All Implemented Interfaces:
InteractionListener, DateArea, DateGridContainer, DateGridProvider, GridContainer, GridLayoutProvider, GridLineSpecProvider, SubRowCreator, ActivityLayoutBroker, DateChangeListener, TimeSpanListListener, java.awt.event.HierarchyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener
Direct Known Subclasses:
ThemeDateArea

public class DefaultDateArea
extends javax.swing.JComponent
implements DateArea, java.awt.event.MouseMotionListener, java.awt.event.MouseListener, java.beans.PropertyChangeListener, InteractionListener, DateChangeListener, java.awt.event.HierarchyListener, ActivityLayoutBroker, GridLayoutProvider, GridLineSpecProvider, TimeSpanListListener, DateGridProvider, SubRowCreator

The "heart" in the calendaring system. It is a component that binds together all the different technologies. Basically shows a DateGrid and all the extras to decorate that grid. It is also the focal point for a lot of other parts.

This calss does not handle headers, that is added around this component by a DateAreaContainer.

This class is not Theme aware, generally sub classes to the implmentation classes add com.miginfocom.theme support.

Does not handle key traveral between the ActivityView, but that is very simple to add. The reason that it's not is that it should be done differently for different purposes. Here is one solution:


dateArea.addKeyListener(new KeyAdapter() {
  public void keyPressed(KeyEvent e)
  {
    final int keyCode = e.getKeyCode();
    if (keyCode == KeyEvent.VK_TAB) {

      dateArea.cycleActivityViewSelection(e.isShiftDown() ? -1 : 1, true);

    } else if (keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN) {

      TimeSpanList actViews = getActivityViews();
      for (int i = 0, iSz = actViews.size(); i < iSz; i++) {
        ActivityView actView = (ActivityView) actViews.get(i);

        if(actView.getModel().getStates().isStateSet(GenericStates.SELECTED_BIT))
          actView.getViewDateRange().add(Calendar.MINUTE, (keyCode == KeyEvent.VK_UP ? -5 : 5), true, false);
      }
    }
  }
});

The size of the rows (and columns) will be adjustable in a very flexible way through the settable GridLayoutProvider. There is also the possibility to set the size statically for all rows (so they all have the same min/preferred/max size) with setPrimaryDimensionRowSizesStatic(com.miginfocom.util.gfx.geometry.SizeSpec) and setSecondaryDimensionRowSizesStatic(com.miginfocom.util.gfx.geometry.SizeSpec).

If you have set up a number of sub grid rows (with CategoryFilter) and using them to show different categories (as in the TVSchedule demo) you can add a listener that can move them between the categories. This is for instance if you are moveing a booking between rooms or a task between developers. This is how the code could look like without any error checking and with a few assumptions:

addActivityMoveListener(new ActivityMoveListener()
{
        public void activityMove(ActivityMoveEvent e)
        {
                DefaultDateArea da = (DefaultDateArea) e.getSource();
                Point p = ((MouseEvent) e.getEvent()).getPoint();
                GridRow row = da.getDateGrid().getRowAt(Grid.SECONDARY_DIMENSION, p, 1000, true);

                CategoryFilter catFilter = (CategoryFilter) row.getFilter();
                Category c1 = CategoryDepository.getCategory(e.getActivity().getCategoryIDs()[0]);
                Category c2 = catFilter.getCategories()[0];

                if (c1 != c2) {
                        e.getActivity().setCategoryIDs(new Object[] {c2.getId()});
                        layoutActivityViews(null);
                }
        }
});

See Also:
and ThemeDateAreaContainer, ActivityLayoutBroker, StateHandler, CategoryFilter, ActivityViewRenderer, ActivityDepository, DateAreaContainer, Serialized Form

Nested Class Summary
 class DefaultDateArea.ActivityViewDecorator
          A class that draws the activities that this date area holds.
 class DefaultDateArea.MultiSelectRectangleDecorator
          A class that draws the rectangle that is shown when the user is trying to select many activities.
static class DefaultDateArea.StateOrderComparator
          A class that compares ActivityViews and sorts the accoring to states (mouse over, selected).
 
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
static java.lang.String AE_CLICKED
          An action event for when a shape has been single clicked in the date area.
static java.lang.String AE_DOUBLE_CLICKED
          An action event for when a shape has been double clicked in the date area.
static java.lang.String AE_DRAG_PRESSED
          An action event for when the area that is used to drag an activity view has been pressed.
static java.lang.String AE_MOUSE_ENTERED
          An action event for when a shape has the mouse entered into it if it's the top most one.
static java.lang.String AE_MOUSE_EXITED
          An action event for when a shape has the mouse exited after it previously had an mouse entered.
static java.lang.String AE_MOUSE_RELEASED
          An action event for when a the mosue button is released over a AShape.
static java.lang.String AE_POPUP_TRIGGER
          An action event for when a shape has been clicked and the action is interpreted by the platform to be a popup trigger.
static java.lang.String AE_RESIZE_END_PRESSED
          An action event for when the resize end area has been pressed.
static java.lang.String AE_RESIZE_START_PRESSED
          An action event for when the resize start area has been pressed.
static java.lang.String AE_SELECTED_PRESSED
          An action event for when the area that is used to select an activity view has been pressed.
protected  DecoratorSupport decoratorSupport
          A number of decorators, normally only one or two.
static int DEFAULT_ACTIVITY_VIEW_LAYER_INDEX
          Default index for the activity view decorator when creating new DefaultDateAress.
static int DEFAULT_MULTI_SELECT_RECTANGLE_LAYER_INDEX
          Default index for the multi select rectangle decorator when creating new DefaultDateAress.
static java.lang.String NO_FIT_EVENT_PROPERTY
           
 
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 com.miginfocom.calendar.datearea.DateArea
SELECTION_TYPE_NONE, SELECTION_TYPE_NORMAL
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DefaultDateArea()
          Constructor.
 
Method Summary
 void addActivityDragResizeListener(ActivityDragResizeListener l)
          Adds the listener as a strong reference.
 void addActivityDragResizeListener(ActivityDragResizeListener l, boolean asWeakRef)
          Adds the listener.
 void addActivityLayout(ActivityLayout layout)
          Installs a layout that will be queried to layout ActivityViews.
 void addActivityMoveListener(ActivityMoveListener l)
          Adds the listener as a strong reference.
 void addActivityMoveListener(ActivityMoveListener l, boolean asWeakRef)
          Adds the listener.
 void addDateChangeListener(DateChangeListener l)
          Adds the listener as a strong reference.
 void addDateChangeListener(DateChangeListener l, boolean asWeakRef)
          Adds a listener that gets notified when any date range (mouseOver, pressed, selected, selectable) changes.
 void addDecorator(Decorator decorator)
          Adds a decorator to the current contained grid and to any recreated grids in the tracked dateArea.
A manual repaint has to be issued to paint the decorator.
 void addDecorators(java.util.Collection decorators)
          Calls addDecorator(com.miginfocom.calendar.decorators.Decorator) for every element in the collection.
 void addGridListener(java.beans.PropertyChangeListener l)
          Adds a listener that gets notified when the grid is changed or any other "major" change occurs.
 void addGridListener(java.beans.PropertyChangeListener l, boolean asWeakRef)
          Adds a listener that gets notified when the grid is changed or any other "major" change occurs.
 void addInteractionListener(InteractionListener l)
          Adds a listener that listens to InteractionEvents.
 void addInteractionListener(InteractionListener l, boolean asWeakRef)
          Adds a listener that listens to InteractionEvents.
 void clearSelectableRange()
          Clears the selected date range.
 void clearSelectedRange()
          Clears the selected date range.
 DateGrid createDateGrid(DateArea dateArea)
          Create a DateGrid that is suitable for the DateArea.
 GridDimensionLayout createLayout(Grid grid, int dimIx)
          Creates a new GridDimensionLayout.
 javax.swing.JScrollPane createScrollPane()
          Creates a JScrollPane with this DateArea as view and no border.
 GridLineSpecification createSpecification(DateArea dateArea)
          Creates a new GridLineProvider.
 void createSubRows(GridRow row, GridLineProvider glProvider)
          Creates one sub row for every row Filter.
 void cycleActivityViewSelection(int delta, boolean wrap)
          Moves the selection relative to the current selection.
 void dateRangeChanged(DateChangeEvent e)
          Called when a date range changed.
 void doLayout()
           
protected  void drawMultiSelectRectangle(java.awt.Graphics2D g)
          Draws an XOR rectangle directly.
protected  boolean fireActivityDragResizeChange(ActivityList acts, int modifiers)
          Fires an event to the listeners.
protected  void fireActivityPreMoveEvent(Activity act, MutableDateRange dateRange, java.awt.event.MouseEvent e)
           
protected  boolean fireDateChange(DateRangeI oldRange, DateRangeI newRange, int type)
          Fires a date change event to the listeners
protected  boolean fireGridChanged(java.lang.String propName, java.lang.Object oldValue, java.lang.Object newValue)
          Fires a structurat change event to the listeners
protected  void fireInteractionOccured(InteractionEvent e)
          Notifies all listeners of the the event but stops as soon as the event get's consumed.
 java.lang.String getActivityDepositoryContext()
          Property: The depository context used to get the activities from the ActivityDepository.
 ActivityLayoutBroker getActivityLayoutBroker()
          Returns the current broker used to divide which activity views that should be laid out by when activity layouts.
 int getActivityLayoutDelay()
          Property: The time in milliseconds to wait before laying out activities again.
 java.util.List getActivityLayouts()
          Returns the layouts currently installed as a new list.
 int getActivityRecreateDelay()
          Deprecated. This is handleded in a better way from 5.7.1 (internal) and now has no meaning
 ActivityView getActivityViewAt(int x, int y)
          Returns the top most ActivityView that is hit by this point.
 Filter getActivityViewFilter()
          Returns the filter currently filtering all shown ActivityViews in the date area.
 int getActivityViewLayerIndex()
          Returns the index for the activity view decorator.
 ActivityViewRenderer getActivityViewRenderer()
          Returns the activity renderer used for painting the activities.
 TimeSpanList getActivityViews()
          Returns a new list with all activity views that should be shown in this date area.
 java.util.Comparator getActViewEventOrderComparator()
          Returns the comparator used for sorting the activity views before checking them for mouse/key events.
 java.util.Comparator getActViewLayoutOrderComparator()
          Returns the comparator used for sorting the activity views before laying out them.
 java.util.Comparator getActViewPaintOrderComparator()
          Returns the comparator used for sorting the activity views before painting.
 java.awt.Paint getBackgroundPaint()
          Sets the background paint.
 boolean getBackgroundPaintViewport()
          If the background paint should only paint the view port.
 java.awt.Rectangle getBoundingRect(long millis, java.util.TimeZone timeZone, int cellSizeMode, boolean forDraw)
          Returns the bounding box for a date in the contained grid.
 javax.swing.JComponent getComponent()
          Returns the component that show the date area.
 DateGrid getDateGrid()
          Returns the current DateGrid object in use in this DateArea.
 DateGridProvider getDateGridProvider()
          Returns the DateGridProvider or this (which implements DateGridProvider) if none is explicitly set.
 MutableDateRange getDateRangeForPoint(java.awt.Point p, boolean onlySelectableDates, boolean singlePIT, boolean lenient)
          Returns the currect range for the point 'p'.
 DateRangeI getDateRangeSelection(int type)
          Returns the selection date range indicated.
 java.util.List getDecorators()
          Returns a cloned list with the decorators currently installed in this date area.
 java.awt.Cursor getDefaultCursor()
          Returns the cursor to show when the cursor is over the date area itself.
 RootAShape getDefaultNoFitShape()
          Sets the default shape used to paint the indication when some activity view doesn't fit.
 KeySequence getExpandDateRangeKeySequence()
          Returns the key sequence to be held down to expand date range selection or null if it shouldn't be possible.
 int[] getExpectedCellCount()
          Returns the cell counts that is to be expected for creating a new DateGrid given the current settings.
 long getFallbackSnapToMillis()
          Returns what even millisecond to snap to when resizing and moving activities that should be used as fallback if snap is temporary turned off because the user is pressing the key sequence outlined in getNoSnapKeySequence() .
 java.awt.GraphicsConfiguration getGraphicsConfigurationForPoint(java.awt.Point p)
          Returns the GraphicsConfiguration for a point.
 Grid getGrid()
          Returns the grid.
 GridLayoutProvider getGridLayoutProvider()
          Returns the GridLayoutProvider or this (which implements GridLayoutProvider) if none is explicitly set.
 GridLineSpecProvider getGridLineSpecProvider()
          Returns the GridLineSpecProvider or this (which implements GridLineSpecProvider) if none is explicitly set.
 int getLayoutDelayFromOther()
          Deprecated. Use getActivityLayoutDelay()
 java.lang.Integer getLayoutOptimizeBoundary()
          Property: When an activity is changed the activites that overlaps it will be layed out again.
 java.awt.Dimension getMaximumSize()
           
 java.awt.Dimension getMinimumSize()
           
 KeySequence getMultiRectSelectKeySequence()
          Returns the key sequence to be held down to select multiple activities (using a "rubberband" rectangle) or null if it shouldn't be possible.
 KeySequence getMultiSelectKeySequence()
          Returns the key sequence to be held down to select multiple activities (using mouse click) or null if it shouldn't be possible.
 int getMultiSelectRectangleLayerIndex()
          Returns the index for the multi select rectangle decorator.
 TimeSpanList getNoFitDateRanges()
          Returns the live list of DateRangeIs that didn't fit the layout bounds during the last layout cycle.
 KeySequence getNoSnapKeySequence()
          Return key to disregard snap when moving/resizing activities.
 javax.swing.border.Border getOuterBorder()
          Property: The outer border around the date area.
 java.awt.Dimension getPreferredSize()
           
 int getPrimaryDimension()
          What dimension time progresses if there was no wrapping.
 int getPrimaryDimensionCellType()
          Returns the type of primDimCellSpanCount.
 int getPrimaryDimensionCellTypeCount()
          Returns how may cells in the primary dimension.
 java.awt.Insets getRepaintCellExpand()
          Returns the repaint padding.
 Filter[] getRowFilters()
          Returns the filters currently in the date area.
 javax.swing.JScrollPane getScrollPane()
          Returns the scroll pane that host the date area if one was created.
 int getSecondaryDimension()
          What dimension that increase it's size when time wraps.
 ImmutableDateRange getSelectableRange()
          Returns the selectable range.
 KeySequence getSelectDateRangeKeySequence()
          returns the key sequence to be held down to make a date range selection or null if it shouldn't be possible.
 DateRangeI getSelectedRange()
          Returns the currently selected date range or null if none.
 DateRangeRounder getSelectionRounder()
          Returns the rounder used to round the selection date ranges.
 int getSelectionType()
          Returns the type of selection that can be made when the mouse is clicked / dragged on the date area surface.
 long getSnapToMillis()
          Return what even millisecond to snap to when resizing and moving activities.
 StateHandler getStateHandler()
          Returns the handler that handles the states of the activites.
 SubRowCreator getSubGridRowCreator()
          Deprecated. Renamed. Use getSubRowCreator() instead.
 GridRowLayout getSubGridRowLayout()
          Returns the sub grid row layout used if this class is the set as the GridDimensionLayout.
 SubRowCreator getSubRowCreator()
          Returns the sub grid row creator.
 ToolTipProvider getToolTipProvider()
          Returns the current tool tip provider.
 boolean getUseVisibilityOptimizations()
          Property: If the component should cut some curners such as not laying out or activities or recreating activity views when the component is not visible.
 ImmutableDateRange getVisibleDateRange()
          Returns the current visible range has been set.
 ImmutableDateRange getVisibleDateRangeCorrected()
          Returns the visible date range corrected for the fact that the date grid has to have its range even up to the cells.
 java.lang.String getVisibleDateRangeString()
          Returns a string representing the visual date range.
 java.lang.Integer getWrapBoundary()
          At what date range boundary the date area will wrap.
 int getWrapBoundaryCount()
          The number of wrapBoundary before wrapping.
 void hideTooltip()
           
 void hierarchyChanged(java.awt.event.HierarchyEvent e)
           
 void interactionOccured(InteractionEvent e)
          Called when an interaction has occurred-
 void invalidateGrid()
          Forces the grid to be discarded and triggers a invalidate() to create a new one.
 boolean isActivitiesSupported()
          Returns whether this date area should support activities.
 boolean isMultiSelectLive()
          Return if the selection of activities should be updated in real-time.
 boolean isSelectable(DateRangeI dateRange)
          Returns if the whole of 'dateRange' is within the selectable range.
protected  void layoutActivityViews(ImmutableDateRange optRange)
          Lays out all activity views.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
protected  void multiSelectActivities()
          Selects all activities that touches the area that msPoint1 and msPoint2 spans.
protected  void paintActivities(java.awt.Graphics2D g2)
          Paints the activities
protected  void paintBackground(java.awt.Graphics2D g2)
          Paints the background of the DateArea into the specified graphics object if this is opaque.
protected  void paintComponent(java.awt.Graphics g)
           
 void print(java.awt.Graphics g)
           
protected  void processEvent(java.awt.AWTEvent e)
          Overridden to let all activity views have fist chance to interact with the events and if they are consumed disregard them for further processing.
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void recreateActivityViews()
          Recreates the views for the activities.
 void removeActivityDragResizeListener(ActivityDragResizeListener l)
          Removes the listener, if it is in the list.
 void removeActivityLayout(ActivityLayout layout)
          Removes a layout for a date area, if it exists.
 void removeActivityMoveListener(ActivityMoveListener l)
          Removes the listener if it is registered.
 void removeDateChangeListener(DateChangeListener l)
          Removes the listener, if it is in the list.
 boolean removeDecorator(java.lang.Class type, boolean inclSubClasses)
          Removes the first decorator found with the class type type, including sub types id inclSubClasses == true.
 void removeDecorator(Decorator decorator)
          Removes a decorator from the current contained grid and to any recreated grids in the tracked dateArea.
A manual repaint has to be issued to paint the decorator.
 void removeDecorators()
          Removes all decorators.
 void removeDecorators(java.util.Collection decorators)
          Removes all decorators
 void removeGridListener(java.beans.PropertyChangeListener l)
          Removes the listener, if it is in the list.
 void removeInteractionListener(InteractionListener l)
          Removes the listener.
 void repaint(long t, int x, int y, int w, int h)
          Overridden to enable a possible expansion of the repainted area.
 void revalidateGridDimensionLayout()
          Re-reads the GridDimensionLayout from the GridLayoutProvider (which is normaly this).
 void setActivitiesSupported(boolean b)
          Set whether this date area should support activities.
 void setActivityDepositoryContext(java.lang.String context)
          Property: The depository context used to get the activities from the ActivityDepository.
 void setActivityLayoutBroker(ActivityLayoutBroker broker)
          Sets the current broker used to divide which activity views that should be laid out by when activity layouts.
 void setActivityLayoutDelay(int millis)
          Property: The time in milliseconds to wait before laying out activities again.
 void setActivityLayouts(java.util.List aList)
          Remove all prior layouts and adds the ones in layouts.
 void setActivityRecreateDelay(int millis)
          Deprecated. This is handleded in a better way from 5.7.1 (internal) and now has no meaning
 void setActivityViewFilter(Filter filter)
          Set the filter currently filtering all shown ActivityViews in the date area.
 void setActivityViewLayerIndex(int i)
          Sets the index for the activity view decorator.
 void setActivityViewRenderer(ActivityViewRenderer renderer)
          Sets the activity renderer used for painting the activities
 void setActViewEventOrderComparator(java.util.Comparator c)
          Sets the comparator used for sorting the activity views before checking them for mouse/key events.
 void setActViewLayoutOrderComparator(java.util.Comparator c)
          Sets the comparator used for sorting the activity views before laying out them.
 void setActViewPaintOrderComparator(java.util.Comparator c)
          Sets the comparator used for sorting the activity views before painting.
 void setBackgroundPaint(java.awt.Paint p)
          Sets the background paint.
 void setBackgroundPaintViewport(boolean b)
          If the background paint should only paint the view port.
 void setDateGridProvider(DateGridProvider provider)
          Sets a new DateGridProvider.
 void setDateRangeSelection(DateRangeI dateRange, int type, boolean fireUpdateEvent)
          Selects a new range in the area and possibly fires an event to tell every listener about it.
 void setDebugMessage(java.lang.String s)
          Do not use!!
 void setDecorators(java.util.Collection decorators)
          Sets the decorators to use.
 void setDefaultCursor(java.awt.Cursor defaultCursor)
          Sets the cursor to show when the cursor is over the date area itself.
 void setDefaultNoFitShape(RootAShape shape)
          Sets or resets the shape used for showing when an ativity void couldn't fit.
 void setExpandDateRangeKeySequence(KeySequence ks)
          The key sequence to be held down to expand date range selection or null if it shouldn't be possible.
 void setFallbackSnapToMillis(long millis)
          Sets what even millisecond to snap to when resizing and moving activities that should be used as fallback if snap is temporary turned off because the user is pressing the key sequence outlined in getNoSnapKeySequence() .
 void setGridLayoutProvider(GridLayoutProvider provider)
          Sets a new GridLayoutProvider.
 void setGridLineSpecProvider(GridLineSpecProvider provider)
          Sets a new GridLineSpecProvider.
protected  void setGridSize()
          Sets the bounds of the grid to the the bounds of this.
 void setLayoutDelayFromOther(int millis)
          Deprecated. Use setActivityLayoutDelay(int)
 void setLayoutOptimizeBoundary(java.lang.Integer boundary)
          Property: When an activity is changed the activites that overlaps it will be layed out again.
 void setMultiRectSelectKeySequence(KeySequence ks)
          Sets the key sequence to be held down to select multiple activities (using a "rubberband" rectangle) or null if it shouldn't be possible.
protected  void setMultiSelectCorners(java.awt.Point p1, java.awt.Point p2)
          Sets the corner points and repoint the dirty region.
 void setMultiSelectKeySequence(KeySequence ks)
          Sets the key sequence to be held down to select multiple activities (using mouse click) or null if it shouldn't be possible.
 void setMultiSelectLive(boolean b)
          If the selection of activities should be updated in real-time.
 void setMultiSelectRectangleLayerIndex(int i)
          Sets the index for the multi select rectangle decorator.
 void setNoSnapKeySequence(KeySequence ks)
          Sets key to disregard snap when moving/resizing activities.
 void setOuterBorder(javax.swing.border.Border b)
          Property: The outer border around the date area.
 void setPrimaryDimension(int dim)
          Sets the dimension time progresses if there was no wrapping.
 void setPrimaryDimensionCellType(int rangeType)
          Sets the type of primDimCellSpanCount.
 void setPrimaryDimensionCellTypeCount(int count)
          Sets how many primDimCellSpanType a cell spanns in the primary dimension.
 void setPrimaryDimensionRowSizesStatic(SizeSpec sizeSpec)
          Sets the row size in the primary dimension to a specific value.
 void setRepaintCellExpand(java.awt.Insets insets)
          Sets the repaint padding.
 void setRowFilters(Filter[] rowFilters)
          If non null every row in the grid will be divided into subrows that each is specified by one Filter.
 void setSecondaryDimensionRowSizesStatic(SizeSpec sizeSpec)
          Sets the row size in the secondary dimension to a specific value.
 void setSelectableRange(DateRangeI dateRange)
          Sets the range of dates that can be selected.
 void setSelectDateRangeKeySequence(KeySequence ks)
          The key sequence to be held down to make a date range selection or null if it shouldn't be possible.
 void setSelectedRange(DateRangeI dateRange)
          Sets the date range that is considered to be selected in the grid.
 void setSelectionRounder(DateRangeRounder rounder)
          Sets the rounder used to round the selection date ranges.
 void setSelectionType(int selectionType)
          Sets the type of selection that can be made when the mouse is clicked / dragged on the date area surface.
 void setSnapToMillis(long millis)
          Sets what even millisecond to snap to when resizing and moving activities.
 void setStateHandler(StateHandler handler)
          Sets the handler that handles the states of the activites.
 void setSubGridRowCreator(SubRowCreator creator)
          Deprecated. Renamed. Use setSubRowCreator(com.miginfocom.calendar.grid.SubRowCreator) instead
 void setSubGridRowLayout(GridRowLayout layout)
          Sets the sub grid row layout used if this class is the set as the GridDimensionLayout.
 void setSubRowCreator(SubRowCreator creator)
          Sets the sub grid row creator.
 void setToolTipProvider(ToolTipProvider ttp)
          Set the tool tip provider used when creating tool tips for this date area.
 void setUseVisibilityOptimizations(boolean b)
          Property: If the component should cut some curners such as not laying out or activities or recreating activity views when the component is not visible.
 void setVisibleDateRange(DateRangeI dateRange)
          Sets the dateArea's visible dates.
 void setVisibleDateRangeString(java.lang.String dateStrings)
          Parses the string to set the visual date range.
 void setWrapBoundary(java.lang.Integer rangeType)
          At what date range boundary the date area will wrap.
 void setWrapBoundaryCount(int count)
          The number of wrapBoundary before wrapping.
 void sortDecorators()
          Resort the decorators that this date area handles.
 TimeSpanList[] splitByLayout(TimeSpanList actViews, java.util.List layouts)
          ActivityLayoutBroker: Divides the activity views into list depending on which layout they will have.
 void timeSpanListChanged(TimeSpanListEvent e)
          Called when the time span list itesf changes (add/remove).
 void updateUI()
           
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, 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, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, setComponentOrientation, 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

AE_RESIZE_START_PRESSED

public static final java.lang.String AE_RESIZE_START_PRESSED
An action event for when the resize start area has been pressed. Can be sent in an InteractionEvent with command DefaultInteractionBroker.CMD_FIRE_INTERACTION_EVENT.

Note that this is interactions installed in the default shape created if not anotherone are provided. Other AShapes might have a totally different set of interaction event command strings.

See Also:
interactionOccured(com.miginfocom.ashape.interaction.InteractionEvent), addInteractionListener(com.miginfocom.ashape.interaction.InteractionListener, boolean), Constant Field Values

AE_RESIZE_END_PRESSED

public static final java.lang.String AE_RESIZE_END_PRESSED
An action event for when the resize end area has been pressed. Can be sent in an InteractionEvent with command DefaultInteractionBroker.CMD_FIRE_INTERACTION_EVENT.

Note that this is interactions installed in the default shape created if not anotherone are provided. Other AShapes might have a totally different set of interaction event command strings.

See Also:
interactionOccured(com.miginfocom.ashape.interaction.InteractionEvent), addInteractionListener(com.miginfocom.ashape.interaction.InteractionListener, boolean), Constant Field Values

AE_DRAG_PRESSED

public static final java.lang.String AE_DRAG_PRESSED
An action event for when the area that is used to drag an activity view has been pressed. Can be sent in an InteractionEvent with command DefaultInteractionBroker.CMD_FIRE_INTERACTION_EVENT.

Note that this is interactions installed in the default shape created if not another one are provided. Other AShapes might have a totally different set of interaction event command strings.

See Also:
interactionOccured(com.miginfocom.ashape.interaction.InteractionEvent), addInteractionListener(com.miginfocom.ashape.interaction.InteractionListener, boolean), Constant Field Values

AE_SELECTED_PRESSED

public static final java.lang.String AE_SELECTED_PRESSED
An action event for when the area that is used to select an activity view has been pressed. Can be sent in an InteractionEvent with command DefaultInteractionBroker.CMD_FIRE_INTERACTION_EVENT.

Note that this is interactions installed in the default shape created if not another one are provided. Other AShapes might have a totally different set of interaction event command strings.

See Also:
interactionOccured(com.miginfocom.ashape.interaction.InteractionEvent), addInteractionListener(com.miginfocom.ashape.interaction.InteractionListener, boolean), Constant Field Values

AE_DOUBLE_CLICKED

public static final java.lang.String AE_DOUBLE_CLICKED
An action event for when a shape has been double clicked in the date area. Can be sent in an InteractionEvent with command DefaultInteractionBroker.CMD_FIRE_INTERACTION_EVENT.

Note that this is interactions installed in the default shape created if not another one are provided. Other AShapes might have a totally different set of interaction event command strings.

See Also:
interactionOccured(com.miginfocom.ashape.interaction.InteractionEvent), addInteractionListener(com.miginfocom.ashape.interaction.InteractionListener, boolean), Constant Field Values

AE_CLICKED

public static final java.lang.String AE_CLICKED
An action event for when a shape has been single clicked in the date area. Can be sent in an InteractionEvent with command DefaultInteractionBroker.CMD_FIRE_INTERACTION_EVENT.

Note that this is interactions installed in the default shape created if not another one are provided. Other AShapes might have a totally different set of interaction event command strings.

See Also:
interactionOccured(com.miginfocom.ashape.interaction.InteractionEvent), addInteractionListener(com.miginfocom.ashape.interaction.InteractionListener, boolean), Constant Field Values

AE_POPUP_TRIGGER

public static final java.lang.String AE_POPUP_TRIGGER
An action event for when a shape has been clicked and the action is interpreted by the platform to be a popup trigger. Can be sent in an InteractionEvent with command DefaultInteractionBroker.CMD_FIRE_INTERACTION_EVENT.

Note that this is interactions installed in the default shape created if not another one are provided. Other AShapes might have a totally different set of interaction event command strings.

See Also:
interactionOccured(com.miginfocom.ashape.interaction.InteractionEvent), addInteractionListener(com.miginfocom.ashape.interaction.InteractionListener, boolean), Constant Field Values

AE_MOUSE_ENTERED

public static final java.lang.String AE_MOUSE_ENTERED
An action event for when a shape has the mouse entered into it if it's the top most one.

Can be sent in an InteractionEvent with command DefaultInteractionBroker.CMD_FIRE_INTERACTION_EVENT.

Note that this is interactions installed in the default shape created if not another one are provided. Other AShapes might have a totally different set of interaction event command strings.

See Also:
interactionOccured(com.miginfocom.ashape.interaction.InteractionEvent), addInteractionListener(com.miginfocom.ashape.interaction.InteractionListener, boolean), Constant Field Values

AE_MOUSE_EXITED

public static final java.lang.String AE_MOUSE_EXITED
An action event for when a shape has the mouse exited after it previously had an mouse entered.

Can be sent in an InteractionEvent with command DefaultInteractionBroker.CMD_FIRE_INTERACTION_EVENT.

Note that this is interactions installed in the default shape created if not anotherone are provided. Other AShapes might have a totally different set of interaction event command strings.

See Also:
interactionOccured(com.miginfocom.ashape.interaction.InteractionEvent), addInteractionListener(com.miginfocom.ashape.interaction.InteractionListener, boolean), Constant Field Values

AE_MOUSE_RELEASED

public static final java.lang.String AE_MOUSE_RELEASED
An action event for when a the mosue button is released over a AShape.

Can be sent in an InteractionEvent with command DefaultInteractionBroker.CMD_FIRE_INTERACTION_EVENT.

Note that this is interactions installed in the default shape created if not anotherone are provided. Other AShapes might have a totally different set of interaction event command strings.

See Also:
interactionOccured(com.miginfocom.ashape.interaction.InteractionEvent), addInteractionListener(com.miginfocom.ashape.interaction.InteractionListener, boolean), Constant Field Values

NO_FIT_EVENT_PROPERTY

public static final java.lang.String NO_FIT_EVENT_PROPERTY
See Also:
Constant Field Values

DEFAULT_ACTIVITY_VIEW_LAYER_INDEX

public static int DEFAULT_ACTIVITY_VIEW_LAYER_INDEX
Default index for the activity view decorator when creating new DefaultDateAress.


DEFAULT_MULTI_SELECT_RECTANGLE_LAYER_INDEX

public static int DEFAULT_MULTI_SELECT_RECTANGLE_LAYER_INDEX
Default index for the multi select rectangle decorator when creating new DefaultDateAress.


decoratorSupport

protected final DecoratorSupport decoratorSupport
A number of decorators, normally only one or two. Maintains insertion order.

Constructor Detail

DefaultDateArea

public DefaultDateArea()
Constructor.

Method Detail

setActivitiesSupported

public void setActivitiesSupported(boolean b)
Set whether this date area should support activities.

NOTE! If you don't use a ThemeDateArea you will have to install the decorator that shall draw the activities, if that is desired. Also the multi select rectangle decorator should normally be installed.

DefaultDateArea.ActivityViewDecorator
DefaultDateArea.MultiSelectRectangleDecorator

Since it's a inner class, the syntax is a bit strange:
(E.g. addDecorator(dateAreaInstance.new ActivityViewDecorator()); recreateActivityViews() will be called.

Specified by:
setActivitiesSupported in interface DateArea
Parameters:
b - true turns on. false is defalt.

isActivitiesSupported

public boolean isActivitiesSupported()
Description copied from interface: DateArea
Returns whether this date area should support activities.

Specified by:
isActivitiesSupported in interface DateArea
Returns:
Whether this date area should support activities. false is default.

getLayoutOptimizeBoundary

public java.lang.Integer getLayoutOptimizeBoundary()
Property: When an activity is changed the activites that overlaps it will be layed out again. If the visual bounds of the activity extends layout-wise outside the base date range of the activity more activities needs to be re-layed out. Normally this is not done but by changing this property to a boundary type (e.g. DateRangeI.RANGE_TYPE_DAY the affected layout date range is rounded upwards to this boundary. null means exact and no rounding.

Returns:
The current value. Default is null.
Since:
6.5

setLayoutOptimizeBoundary

public void setLayoutOptimizeBoundary(java.lang.Integer boundary)
Property: When an activity is changed the activites that overlaps it will be layed out again. If the visual bounds of the activity extends layout-wise outside the base date range of the activity more activities needs to be re-layed out. Normally this is not done but by changing this property to a boundary type (e.g. DateRangeI.RANGE_TYPE_DAY the affected layout date range is rounded upwards to this boundary. null means exact and no rounding.

Parameters:
boundary - The current value. Default is null.
Since:
6.5

getUseVisibilityOptimizations

public boolean getUseVisibilityOptimizations()
Property: If the component should cut some curners such as not laying out or activities or recreating activity views when the component is not visible.

Returns:
If the optimization is turned on (default is on).

setUseVisibilityOptimizations

public void setUseVisibilityOptimizations(boolean b)
Property: If the component should cut some curners such as not laying out or activities or recreating activity views when the component is not visible.

Parameters:
b - If the optimization should be turned on (default is on).

getActivityDepositoryContext

public java.lang.String getActivityDepositoryContext()
Property: The depository context used to get the activities from the ActivityDepository. You can get different "sets" of activities using more than one context for the depository.

Returns:
The current context. Default is null.
See Also:
ActivityDepository.getInstance(String context).

setActivityDepositoryContext

public void setActivityDepositoryContext(java.lang.String context)
Property: The depository context used to get the activities from the ActivityDepository. You can get different "sets" of activities using more than one context for the depository.

Parameters:
context - The new current context. Default is null.
See Also:
ActivityDepository.getInstance(String context).

setActivityLayoutDelay

public void setActivityLayoutDelay(int millis)
Property: The time in milliseconds to wait before laying out activities again. This value is only used if it is not this date area that has initiated the layout.

Parameters:
millis - The number of millis. Default is 500.

getActivityLayoutDelay

public int getActivityLayoutDelay()
Property: The time in milliseconds to wait before laying out activities again. This value is only used if it is not this date area that has initiated the layout.

Returns:
The number of millis. Default is 500.

setActivityRecreateDelay

public void setActivityRecreateDelay(int millis)
Deprecated. This is handleded in a better way from 5.7.1 (internal) and now has no meaning

Property: The time in milliseconds to wait before recreating activity views if for instance the ActivityDepository count changes. This value is only used if it is not this date area that has initiated the layout.

Parameters:
millis - The number of millis. Default is 200.

getActivityRecreateDelay

public int getActivityRecreateDelay()
Deprecated. This is handleded in a better way from 5.7.1 (internal) and now has no meaning

Property: The time in milliseconds to wait before recreating activity views if for instance the ActivityDepository count changes. This value is only used if it is not this date area that has initiated the layout.

Returns:
The number of millis. Default is 200.

getSelectionType

public int getSelectionType()
Description copied from interface: DateArea
Returns the type of selection that can be made when the mouse is clicked / dragged on the date area surface.

Specified by:
getSelectionType in interface DateArea
Returns:
The selection type. E.g. DateArea.SELECTION_TYPE_NORMAL (DateArea.SELECTION_TYPE_NONE is default)

setSelectionType

public void setSelectionType(int selectionType)
Description copied from interface: DateArea
Sets the type of selection that can be made when the mouse is clicked / dragged on the date area surface.

Specified by:
setSelectionType in interface DateArea
Parameters:
selectionType - The selection type. E.g. DateArea.SELECTION_TYPE_NORMAL (default)

getDefaultCursor

public java.awt.Cursor getDefaultCursor()
Returns the cursor to show when the cursor is over the date area itself. This cursor will be set for mouse enter events.

Returns:
The cursor. Can be null.

setDefaultCursor

public void setDefaultCursor(java.awt.Cursor defaultCursor)
Sets the cursor to show when the cursor is over the date area itself. This cursor will be set for mouse enter events.

Parameters:
defaultCursor - The cursor. Can be null.

getComponent

public javax.swing.JComponent getComponent()
Description copied from interface: DateArea
Returns the component that show the date area.

Specified by:
getComponent in interface DateArea
Returns:
The component that show the date area.

getScrollPane

public javax.swing.JScrollPane getScrollPane()
Description copied from interface: DateArea
Returns the scroll pane that host the date area if one was created.

Specified by:
getScrollPane in interface DateArea
Returns:
he scroll pane that host the date area. Might be null.

createScrollPane

public javax.swing.JScrollPane createScrollPane()
Creates a JScrollPane with this DateArea as view and no border. Also makes sure that changing the UI don't installs borders, since DateArea don't use them. No row or column header added.

The scrollpane can after a call to this be retrieved with getScrollPane()

Returns:
A JScrollPane with this DateArea as view and no border.

updateUI

public void updateUI()
Overrides:
updateUI in class javax.swing.JComponent

getStateHandler

public StateHandler getStateHandler()
Returns the handler that handles the states of the activites.

Returns:
The handler that handles the states of the activites.
Since:
6.0

setStateHandler

public void setStateHandler(StateHandler handler)
Sets the handler that handles the states of the activites.

Parameters:
handler - The handler that handles the states of the activites.
Since:
6.0

print

public void print(java.awt.Graphics g)
Overrides:
print in class javax.swing.JComponent

paintComponent

protected void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

repaint

public void repaint(long t,
                    int x,
                    int y,
                    int w,
                    int h)
Overridden to enable a possible expansion of the repainted area.

Overrides:
repaint in class javax.swing.JComponent
Parameters:
t - Time sent to super method unchanged.
x - The x position rectangle that is about to be painted.
y - The y position rectangle that is about to be painted.
w - The width of the rectangle that is about to be painted.
h - The height of the rectangle that is about to be painted.

paintBackground

protected void paintBackground(java.awt.Graphics2D g2)
Paints the background of the DateArea into the specified graphics object if this is opaque.

Parameters:
g2 - The graphics object to draw in
See Also:
JComponent.isOpaque()

layoutActivityViews

protected void layoutActivityViews(ImmutableDateRange optRange)
Lays out all activity views. May lead to repaints.

Parameters:
optRange - If not null the activity layout is told to optimize for this range.
See Also:
ActivityLayout.layout(com.miginfocom.calendar.grid.DateGrid, com.miginfocom.util.dates.TimeSpanList, java.util.ArrayList, com.miginfocom.util.dates.ImmutableDateRange)

paintActivities

protected void paintActivities(java.awt.Graphics2D g2)
Paints the activities

Parameters:
g2 - The object to paint in

drawMultiSelectRectangle

protected void drawMultiSelectRectangle(java.awt.Graphics2D g)
Draws an XOR rectangle directly.


setMultiSelectCorners

protected void setMultiSelectCorners(java.awt.Point p1,
                                     java.awt.Point p2)
Sets the corner points and repoint the dirty region.

Parameters:
p1 - The corner point or null to clear it.
p2 - The corner point or null to clear it.

multiSelectActivities

protected void multiSelectActivities()
Selects all activities that touches the area that msPoint1 and msPoint2 spans.


getActivityViewAt

public ActivityView getActivityViewAt(int x,
                                      int y)
Returns the top most ActivityView that is hit by this point. Not that it is the reference bound that is checked. The graphical representation might be smaller or bigger depending on the ActivityRenderer used.

Parameters:
x - The x pixel
y - The y pixel
Returns:
The ActivityView or null if none was hit.

cycleActivityViewSelection

public void cycleActivityViewSelection(int delta,
                                       boolean wrap)
Moves the selection relative to the current selection. Selects the first activity view if currently no selection.

Parameters:
delta - Negative to select activity views before the currently selected one and vice versa. E.g. -1 selects the activity view just before the currently selected one.
wrap - If true selection will wrap around and for instance select the last if the first was selected and delta is -1.

getActivityViews

public TimeSpanList getActivityViews()
Returns a new list with all activity views that should be shown in this date area. If there are no activity views created yet they will be created. Note that if there is a view filer installed those activity views will not be in the returned list.

If activity support is turned off this method always returns null.

Returns:
A new list with all activity view that should be shown in the date area. null only if activity support is turned off.

setDebugMessage

public void setDebugMessage(java.lang.String s)
Do not use!!

Parameters:
s - null is ok and default.
Since:
6.0

getOuterBorder

public javax.swing.border.Border getOuterBorder()
Property: The outer border around the date area. The border will be installed on the scroll pane so that it will normally always be shown fully even if the view is partly scrolled away (invisible).

Returns:
The current border. May be null.

setOuterBorder

public void setOuterBorder(javax.swing.border.Border b)
Property: The outer border around the date area. The border will be installed on the scroll pane so that it will normally always be shown fully even if the view is partly scrolled away (invisible).

Parameters:
b - The new border. May be null.

getLayoutDelayFromOther

public int getLayoutDelayFromOther()
Deprecated. Use getActivityLayoutDelay()

Returns the number of milliseconds to wait befor performing a layout if it was initiated from another source than this.

Returns:
The number of milliseconds to wait befor performing a layout if it was initiated from another source than this.

setLayoutDelayFromOther

public void setLayoutDelayFromOther(int millis)
Deprecated. Use setActivityLayoutDelay(int)

Sets the number of milliseconds to wait befor performing a layout if it was initiated from another source than this.

Parameters:
millis - The number of milliseconds to wait befor performing a layout if it was initiated from another source that this. 500 is default.

getActViewEventOrderComparator

public java.util.Comparator getActViewEventOrderComparator()
Returns the comparator used for sorting the activity views before checking them for mouse/key events. The first activity view will be the one notified LAST, this is so that the same Comarator can be used for the sorting the paint list as well. It would be illogical to do otherwise.

The object type sent to the comparator is ActivityView.

Returns:
The comparator used for sorting the activity views before lhecking them for mouse/key events. May be null in which case they are sorted in their natural order according the the ActivityView.

setActViewEventOrderComparator

public void setActViewEventOrderComparator(java.util.Comparator c)
Sets the comparator used for sorting the activity views before checking them for mouse/key events. The first activity view will be the one notified LAST, this is so that the same Comarator can be used for the sorting the paint list as well. It would be illogical to do otherwise.

The object type sent to the comparator is ActivityView.

Parameters:
c - The comparator used for sorting the activity views before lhecking them for mouse/key events. May be null in which case they are sorted in their natural order according the the ActivityView.

getActViewLayoutOrderComparator

public java.util.Comparator getActViewLayoutOrderComparator()
Returns the comparator used for sorting the activity views before laying out them. The first activity view will be the one laid out first and it thus gets free space before latter ones. Note that the paint order might be different.

The object type sent to the comparator is ActivityView.

Returns:
The comparator used for sorting the activity views before laying out them. May be null in which case they are sorted in their natural order according the the ActivityView.

setActViewLayoutOrderComparator

public void setActViewLayoutOrderComparator(java.util.Comparator c)
Sets the comparator used for sorting the activity views before laying out them. The first activity view will be the one laid out first and it thus gets free space before latter ones. Note that the paint order might be different.

The object type sent to the comparator is ActivityView.

Parameters:
c - The new comparator used for sorting the activity views before laying out them. May be null in which case they are sorted in their natural order according the the ActivityView.

getActViewPaintOrderComparator

public java.util.Comparator getActViewPaintOrderComparator()
Returns the comparator used for sorting the activity views before painting. The first activity view will be the one painted first and it thus ends up under overlapping activity views.

The object type sent to the comparator is ActivityView.

Returns:
The comparator used for sorting the activity views before painting. May be null in which case they are sorted in their natural order according the the ActivityView.

setActViewPaintOrderComparator

public void setActViewPaintOrderComparator(java.util.Comparator c)
Sets the comparator used for sorting the activity views before painting. The first activity view will be the one painted first and it thus ends up under overlapping activity views.
The object type sent to the comparator is ActivityView.

Parameters:
c - The new comparator used for sorting the activity views before painting. May be null in which case they are sorted in their natural order according the the ActivityView.

getNoFitDateRanges

public TimeSpanList getNoFitDateRanges()
Returns the live list of DateRangeIs that didn't fit the layout bounds during the last layout cycle. This method should therefore only be called after the layout cycle. During the paint cycle is fine since the layout cycle is always before the paint cycle. Don't change the returned list.

Returns:
The live list of DateRangeIs that didn't fit the layout bounds during the last layout cycle. Never null.

getRepaintCellExpand

public java.awt.Insets getRepaintCellExpand()
Returns the repaint padding. If not null all repaint requests are expanded to cell bounds plus these insets. If null the repaint requests goes through unchanged.

Returns:
The padding, positive values incrases. Can be null.

setRepaintCellExpand

public void setRepaintCellExpand(java.awt.Insets insets)
Sets the repaint padding. If not null all repaint requests are expanded to cell bounds plus these insets. If null the repaint requests goes through unchanged.

Parameters:
insets - The padding, positive values incrases. Can be null.

getSnapToMillis

public long getSnapToMillis()
Return what even millisecond to snap to when resizing and moving activities.

Returns:
The millisecond to snap to in milliseconds or 0 if snap is disabled.

setSnapToMillis

public void setSnapToMillis(long millis)
Sets what even millisecond to snap to when resizing and moving activities.

Parameters:
millis - The millisecond to snap to in milliseconds. 0 disables snap.

getFallbackSnapToMillis

public long getFallbackSnapToMillis()
Returns what even millisecond to snap to when resizing and moving activities that should be used as fallback if snap is temporary turned off because the user is pressing the key sequence outlined in getNoSnapKeySequence() .

Returns:
The fallback millisecond to snap to in milliseconds.

setFallbackSnapToMillis

public void setFallbackSnapToMillis(long millis)
Sets what even millisecond to snap to when resizing and moving activities that should be used as fallback if snap is temporary turned off because the user is pressing the key sequence outlined in getNoSnapKeySequence() .

Parameters:
millis - The fallback millisecond to snap to in milliseconds.

getNoSnapKeySequence

public KeySequence getNoSnapKeySequence()
Return key to disregard snap when moving/resizing activities.

Returns:
The key sequence or null if disabled.

setNoSnapKeySequence

public void setNoSnapKeySequence(KeySequence ks)
Sets key to disregard snap when moving/resizing activities.

Parameters:
ks - The key sequence or null to disable.

getActivityViewRenderer

public ActivityViewRenderer getActivityViewRenderer()
Returns the activity renderer used for painting the activities. Default is a AShapeRenderer.

Returns:
The activity renderer used for painting the activities. never null.
See Also:
setActivityViewRenderer(com.miginfocom.calendar.activity.renderer.ActivityViewRenderer)

setActivityViewRenderer

public void setActivityViewRenderer(ActivityViewRenderer renderer)
Sets the activity renderer used for painting the activities

Parameters:
renderer - The activity renderer used for painting the activities. Not null.

getDecorators

public java.util.List getDecorators()
Returns a cloned list with the decorators currently installed in this date area.

Returns:
The decorators. Not null.

setDecorators

public void setDecorators(java.util.Collection decorators)
Sets the decorators to use.

Parameters:
decorators - The decorators. Not null. List is cloned shallow for storage.
See Also:
DecoratorSupport.setDecorators(java.util.Collection)

addDecorators

public void addDecorators(java.util.Collection decorators)
Calls addDecorator(com.miginfocom.calendar.decorators.Decorator) for every element in the collection.

Parameters:
decorators - The decorators. Not null.
See Also:
DecoratorSupport.addDecorators(java.util.Collection)

sortDecorators

public void sortDecorators()
Resort the decorators that this date area handles. This is normally only needed if any of the decorators has changed its layer outside the control of this date area.


addDecorator

public void addDecorator(Decorator decorator)
Adds a decorator to the current contained grid and to any recreated grids in the tracked dateArea.
A manual repaint has to be issued to paint the decorator.

Parameters:
decorator - The decorator. Insertion order is maintained and decorations will be painted in this order.
See Also:
DecoratorSupport.addDecorator(com.miginfocom.calendar.decorators.Decorator)

removeDecorator

public void removeDecorator(Decorator decorator)
Removes a decorator from the current contained grid and to any recreated grids in the tracked dateArea.
A manual repaint has to be issued to paint the decorator.

Parameters:
decorator - The decorator to be removed.
See Also:
DecoratorSupport.removeDecorator(com.miginfocom.calendar.decorators.Decorator)

removeDecorator

public boolean removeDecorator(java.lang.Class type,
                               boolean inclSubClasses)
Removes the first decorator found with the class type type, including sub types id inclSubClasses == true.

Parameters:
type - The type. Not null.
inclSubClasses - If sub classes of type should be removed as well.
Returns:
If a decorator was removed.

removeDecorators

public void removeDecorators()
Removes all decorators. NOte that this also removes the self decorating decorators. You should probably add DefaultDateArea.MultiSelectRectangleDecorator and DefaultDateArea.ActivityViewDecorator again. Add an instance by: dateArea.addDecorator(dateArea.new ActivityViewDecorator(110));

See Also:
DecoratorSupport.removeDecorators(java.util.Collection)

removeDecorators

public void removeDecorators(java.util.Collection decorators)
Removes all decorators


getExpandDateRangeKeySequence

public KeySequence getExpandDateRangeKeySequence()
Returns the key sequence to be held down to expand date range selection or null if it shouldn't be possible. Could be an empty key sequence in which case it's the default behavior when dragging the mouse on a free area. Default is empty.

Returns:
The key sequence to be held down to expand date range selection

setExpandDateRangeKeySequence

public void setExpandDateRangeKeySequence(KeySequence ks)
The key sequence to be held down to expand date range selection or null if it shouldn't be possible. Could be an empty key sequence in which case it's the default behavior when dragging the mouse on a free area. Default is empty.

Parameters:
ks - The key sequence to be held down to expand date range selection.

getSelectDateRangeKeySequence

public KeySequence getSelectDateRangeKeySequence()
returns the key sequence to be held down to make a date range selection or null if it shouldn't be possible. Could be an empty key sequence in which case it's the default behavior when dragging the mouse on a free area. Default is empty.

Returns:
The key sequence to be held down to make a date range selection

setSelectDateRangeKeySequence

public void setSelectDateRangeKeySequence(KeySequence ks)
The key sequence to be held down to make a date range selection or null if it shouldn't be possible. Could be an empty key sequence in which case it's the default behavior when dragging the mouse on a free area. Default is empty.

Parameters:
ks - The key sequence to be held down to make a date range selection.

getMultiRectSelectKeySequence

public KeySequence getMultiRectSelectKeySequence()
Returns the key sequence to be held down to select multiple activities (using a "rubberband" rectangle) or null if it shouldn't be possible. Could be an empty key sequence in which case it's the default behavior when dragging the mouse on a free area. Default is SHIFT.

Returns:
The key sequence to be held down to select multiple activities.

setMultiRectSelectKeySequence

public void setMultiRectSelectKeySequence(KeySequence ks)
Sets the key sequence to be held down to select multiple activities (using a "rubberband" rectangle) or null if it shouldn't be possible. Could be an empty key sequence in which case it's the default behavior when dragging the mouse on a free area. Default is SHIFT.

Parameters:
ks - The key sequence to be held down to select multiple activities.

getMultiSelectKeySequence

public KeySequence getMultiSelectKeySequence()
Returns the key sequence to be held down to select multiple activities (using mouse click) or null if it shouldn't be possible. Could be an empty key sequence in which case it's the default behavior when dragging the mouse on a free area. Default is SHIFT.

Returns:
The key sequence to be held down to select multiple activities.

setMultiSelectKeySequence

public void setMultiSelectKeySequence(KeySequence ks)
Sets the key sequence to be held down to select multiple activities (using mouse click) or null if it shouldn't be possible. Could be an empty key sequence in which case it's the default behavior when dragging the mouse on a free area. Default is SHIFT.

Parameters:
ks - The key sequence to be held down to select multiple activities.

isMultiSelectLive

public boolean isMultiSelectLive()
Return if the selection of activities should be updated in real-time.

Returns:
If the selection of activities should be updated in real-time.

setMultiSelectLive

public void setMultiSelectLive(boolean b)
If the selection of activities should be updated in real-time.

Parameters:
b - If the selection of activities should be updated in real-time.

getBackgroundPaint

public java.awt.Paint getBackgroundPaint()
Sets the background paint. If != null this paint is drawn in the background (if opaque) rather than the normal background color. If this is null the normal color retrieved from Component.getBackground() is painted instead. If not opaque none of the colors will be painted.

Returns:
The background paint. May be null.

setBackgroundPaint

public void setBackgroundPaint(java.awt.Paint p)
Sets the background paint. If != null this paint is drawn in the background (if opaque) rather than the normal background color. If this is null the normal color retrieved from Component.getBackground() is painted instead. If not opaque none of the colors will be painted.

Parameters:
p - The background paint. May be null.

getBackgroundPaintViewport

public boolean getBackgroundPaintViewport()
If the background paint should only paint the view port. This means that for instance a gradient will span the viewport (the visible part in a scroll pane) and not the whole component.

Note that if the background is a Paint (and not a Color) the scrolling may be slower since the viewport needs to be repainted in full when scrolling.

Returns:
The current value. Default is true.

setBackgroundPaintViewport

public void setBackgroundPaintViewport(boolean b)
If the background paint should only paint the view port. This means that for instance a gradient will span the viewport (the visible part in a scroll pane) and not the whole component.

Note that if the background is a Paint (and not a Color) the scrolling may be slower since the viewport needs to be repainted in full when scrolling.

Parameters:
b - The new value. Default is true.

getActivityViewLayerIndex

public int getActivityViewLayerIndex()
Returns the index for the activity view decorator.

Returns:
The index for the activity view decorator.

setActivityViewLayerIndex

public void setActivityViewLayerIndex(int i)
Sets the index for the activity view decorator.

Parameters:
i - The new index for the activity view decorator.

getMultiSelectRectangleLayerIndex

public int getMultiSelectRectangleLayerIndex()
Returns the index for the multi select rectangle decorator.

Returns:
The index for the multi select rectangle decorator.

setMultiSelectRectangleLayerIndex

public void setMultiSelectRectangleLayerIndex(int i)
Sets the index for the multi select rectangle decorator.

Parameters:
i - The new index for the multi select rectangle decorator.

setSelectionRounder

public void setSelectionRounder(DateRangeRounder rounder)
Sets the rounder used to round the selection date ranges. Can be used for instance to make a selected range 1 to 3 weeks or so that exactly two days must be selected.

Parameters:
rounder - The roudner to use or null to not use any rounder (default)

getSelectionRounder

public DateRangeRounder getSelectionRounder()
Returns the rounder used to round the selection date ranges.

Returns:
The rounder. May be null.

getWrapBoundary

public java.lang.Integer getWrapBoundary()
Description copied from interface: DateArea
At what date range boundary the date area will wrap. E.g. DateRangeI.RANGE_TYPE_WEEK

Specified by:
getWrapBoundary in interface DateArea
Returns:
The date range type or null for no wrap.

setWrapBoundary

public void setWrapBoundary(java.lang.Integer rangeType)
Description copied from interface: DateArea
At what date range boundary the date area will wrap. E.g. DateRangeI.RANGE_TYPE_WEEK

Invalidates the date grid so that it will be recreated next validation.

Specified by:
setWrapBoundary in interface DateArea
Parameters:
rangeType - The date range type. Only minute, hour, day or week. Can be null which means no wrap.

getWrapBoundaryCount

public int getWrapBoundaryCount()
Description copied from interface: DateArea
The number of wrapBoundary before wrapping.

Specified by:
getWrapBoundaryCount in interface DateArea
Returns:
The number of wrapBoundary before wrapping. Default is 1. Always > 0.

setWrapBoundaryCount

public void setWrapBoundaryCount(int count)
Description copied from interface: DateArea
The number of wrapBoundary before wrapping.

Invalidates the date grid so that it will be recreated next validation.

Specified by:
setWrapBoundaryCount in interface DateArea
Parameters:
count - The count. Default is 1.If < 1 then 1 will be set silently.

getPrimaryDimensionCellType

public int getPrimaryDimensionCellType()
Description copied from interface: DateArea
Returns the type of primDimCellSpanCount. E.g DateRangeI.RANGE_TYPE_MINUTE

Specified by:
getPrimaryDimensionCellType in interface DateArea
Returns:
The type of primDimCellSpanCount. E.g DateRangeI.RANGE_TYPE_MINUTE

setPrimaryDimensionCellType

public void setPrimaryDimensionCellType(int rangeType)
Description copied from interface: DateArea
Sets the type of primDimCellSpanCount. E.g DateRangeI.RANGE_TYPE_MINUTE

Specified by:
setPrimaryDimensionCellType in interface DateArea
Parameters:
rangeType - The type of primDimCellSpanCount. E.g DateRangeI.RANGE_TYPE_MINUTE

getPrimaryDimensionCellTypeCount

public int getPrimaryDimensionCellTypeCount()
Description copied from interface: DateArea
Returns how may cells in the primary dimension. Unly used if wrapBoundary is set.

Specified by:
getPrimaryDimensionCellTypeCount in interface DateArea
Returns:
How may cells in the primary dimension. Unly used if wrapBoundary is set.

setPrimaryDimensionCellTypeCount

public void setPrimaryDimensionCellTypeCount(int count)
Description copied from interface: DateArea
Sets how many primDimCellSpanType a cell spanns in the primary dimension. E.g. 30 (if primDimCellSpanType is minutes).

Specified by:
setPrimaryDimensionCellTypeCount in interface DateArea
Parameters:
count - how many primDimCellSpanType a cell spanns in the primary dimension.

getPrimaryDimension

public int getPrimaryDimension()
Description copied from interface: DateArea
What dimension time progresses if there was no wrapping. SwingConstants.HORIZONTAL or SwingConstants.VERTICAL.

Specified by:
getPrimaryDimension in interface DateArea
Returns:
What dimension time progresses if there was no wrapping.

setPrimaryDimension

public void setPrimaryDimension(int dim)
Description copied from interface: DateArea
Sets the dimension time progresses if there was no wrapping. SwingConstants.HORIZONTAL or SwingConstants.VERTICAL.

Specified by:
setPrimaryDimension in interface DateArea
Parameters:
dim - What dimension time progresses if there was no wrapping.

getSecondaryDimension

public int getSecondaryDimension()
Description copied from interface: DateArea
What dimension that increase it's size when time wraps. This is just the other dimension from DateArea.getPrimaryDimension(). SwingConstants.HORIZONTAL or SwingConstants.VERTICAL.

Specified by:
getSecondaryDimension in interface DateArea
Returns:
What dimension that increase it's size when time wraps.

setSelectableRange

public void setSelectableRange(DateRangeI dateRange)
Description copied from interface: DateArea
Sets the range of dates that can be selected. Dates outside this range may be visible but not selectable.

Specified by:
setSelectableRange in interface DateArea
Parameters:
dateRange - The new range. null means that all dates are selectable. Cloned locally

getSelectableRange

public ImmutableDateRange getSelectableRange()
Description copied from interface: DateArea
Returns the selectable range.

Specified by:
getSelectableRange in interface DateArea
Returns:
The selectable range. Can be null which means everything is selectable.

clearSelectableRange

public void clearSelectableRange()
Description copied from interface: DateArea
Clears the selected date range. Exactly the same as setDateRangeSelection(null, DateChangeEvent.SELECTABLE, true);.

Specified by:
clearSelectableRange in interface DateArea

isSelectable

public boolean isSelectable(DateRangeI dateRange)
Description copied from interface: DateArea
Returns if the whole of 'dateRange' is within the selectable range.

Specified by:
isSelectable in interface DateArea
Parameters:
dateRange - The range to check. Not null.
Returns:
If the whole of 'dateRange' is within the selectable range.

setSelectedRange

public void setSelectedRange(DateRangeI dateRange)
Description copied from interface: DateArea
Sets the date range that is considered to be selected in the grid. This is exactly the same as:
setDateRangeSelection(dateRange, DateChangeEvent.SELECTED, true);.

Specified by:
setSelectedRange in interface DateArea
Parameters:
dateRange - The new date range. null clears the selection.

getSelectedRange

public DateRangeI getSelectedRange()
Description copied from interface: DateArea
Returns the currently selected date range or null if none. This is exactly the same as:
getDateRangeSelection(DateChangeEvent.SELECTED);.

Specified by:
getSelectedRange in interface DateArea
Returns:
The currently selected date range or null if none.

clearSelectedRange

public void clearSelectedRange()
Description copied from interface: DateArea
Clears the selected date range. Exactly the same as setDateRangeSelection(null, DateChangeEvent.SELECTED, true);.

Specified by:
clearSelectedRange in interface DateArea

setVisibleDateRangeString

public void setVisibleDateRangeString(java.lang.String dateStrings)
Parses the string to set the visual date range. Note that this is a convenience that should only be used for tests since there is no time zone or locale information.

Parameters:
dateStrings - Of the exact form: "yyyyMMdd'T'HHmmssSSS'-'yyyyMMdd'T'HHmmssSSS" without the ' of course. Example 20061030T164500000.

getVisibleDateRangeString

public java.lang.String getVisibleDateRangeString()
Returns a string representing the visual date range. Note that this is a convenience that should only be used for tests since there is no time zone or locale information.

Returns:
The visual date range of the exact form: "yyyyMMdd'T'HHmmssSSS'-'yyyyMMdd'T'HHmmssSSS" without the & of course. Example 20061030T164500000.

setVisibleDateRange

public void setVisibleDateRange(DateRangeI dateRange)
Description copied from interface: DateArea
Sets the dateArea's visible dates.

Specified by:
setVisibleDateRange in interface DateArea
Parameters:
dateRange - The range that should be shown. Not changed, cloned locally.
See Also:
DateArea.getVisibleDateRangeCorrected()

getVisibleDateRange

public ImmutableDateRange getVisibleDateRange()
Description copied from interface: DateArea
Returns the current visible range has been set. Not that this might not be the exact date range that is shown since the DateGrid must have a date range that evens up to its cells. To get that aske the date grid for the date range instead.

Specified by:
getVisibleDateRange in interface DateArea
Returns:
The visible range as has been set with DateArea.setVisibleDateRange(com.miginfocom.util.dates.DateRangeI)

getVisibleDateRangeCorrected

public ImmutableDateRange getVisibleDateRangeCorrected()
Returns the visible date range corrected for the fact that the date grid has to have its range even up to the cells.

Specified by:
getVisibleDateRangeCorrected in interface DateArea
Returns:
The corrected visible range.

getActivityViewFilter

public Filter getActivityViewFilter()
Description copied from interface: DateArea
Returns the filter currently filtering all shown ActivityViews in the date area.

Specified by:
getActivityViewFilter in interface DateArea
Returns:
The filter currently filtering all shown ActivityViews in the date area. May be null.

setActivityViewFilter

public void setActivityViewFilter(Filter filter)
Description copied from interface: DateArea
Set the filter currently filtering all shown ActivityViews in the date area.

Specified by:
setActivityViewFilter in interface DateArea
Parameters:
filter - The filter currently filtering all shown ActivityViews in the date area. If null no filtering will be done and all activity views will be accepted.

setDateRangeSelection

public void setDateRangeSelection(DateRangeI dateRange,
                                  int type,
                                  boolean fireUpdateEvent)
Description copied from interface: DateArea
Selects a new range in the area and possibly fires an event to tell every listener about it.

Specified by:
setDateRangeSelection in interface DateArea
Parameters:
dateRange - The new selection range or null for no selection. The order is not sorted here, if only sorted ranges should be possible that should be done beforehand. Clones the reference for storing locally.
type - The type of selection that changed. E.g. DateChangeEvent.SELECTED
fireUpdateEvent - Om true fires ett event if the selected range changed.

getDateRangeSelection

public DateRangeI getDateRangeSelection(int type)
Description copied from interface: DateArea
Returns the selection date range indicated.

Specified by:
getDateRangeSelection in interface DateArea
Parameters:
type - The type of selection. E.g. DateChangeEvent.MOUSE_OVER
Returns:
A clone of the selection date range indicated or null if that kind of selection is not active. Will always be sorted.
See Also:
DateRangeI.isSorted()

getBoundingRect

public java.awt.Rectangle getBoundingRect(long millis,
                                          java.util.TimeZone timeZone,
                                          int cellSizeMode,
                                          boolean forDraw)
Description copied from interface: DateArea
Returns the bounding box for a date in the contained grid.

Specified by:
getBoundingRect in interface DateArea
Parameters:
millis - The date/time.
timeZone - The time zone to use. null uses the zone for the grid.
cellSizeMode - The size and placement of the returned rectangle. Eg. Grid.SIZE_MODE_INSIDE
forDraw - If true the returned size is for draw-commands. If false it's sized for fill-commands (one pixel bigger).
Returns:
A rectangle of the bounds of the cell

getDateRangeForPoint

public MutableDateRange getDateRangeForPoint(java.awt.Point p,
                                             boolean onlySelectableDates,
                                             boolean singlePIT,
                                             boolean lenient)
Description copied from interface: DateArea
Returns the currect range for the point 'p'.

Does NOT take into acount if the dates in the range actually are selectable and of not returns null.

Specified by:
getDateRangeForPoint in interface DateArea
Parameters:
p - The point in the to be translated to a range (see SelectableDates).
onlySelectableDates - If true only date ranges that are enirely within the selectable range are returnen. null will be returned otherwise.
singlePIT - Only Single Point In Time. If true a date range that has the start and end dates set to the exact time the mouse is over, not rounded to cell boundary. Returns null if not over a valid point.
lenient - If true a the date range that makes most sense will be returned if p isn't hitting the dateable area.
Returns:
The date range corresponding to a possition Could be null if invalid.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

getMaximumSize

public java.awt.Dimension getMaximumSize()
Overrides:
getMaximumSize in class javax.swing.JComponent

recreateActivityViews

public void recreateActivityViews()
Recreates the views for the activities. Only does this if setActivitiesSupported(boolean) is set to true. Does nothing if the component is not showing depending on setUseVisibilityOptimizations(boolean).


splitByLayout

public TimeSpanList[] splitByLayout(TimeSpanList actViews,
                                    java.util.List layouts)
ActivityLayoutBroker: Divides the activity views into list depending on which layout they will have. The returned array will be as long as there are layouts in layouts. Every activity view vill only exist in one of the returned lists.

Specified by:
splitByLayout in interface ActivityLayoutBroker
Parameters:
actViews - The views to divide
layouts - A number of (at least one) ActivityLayouts.
Returns:
One list per layout where all views in that list is accepted by the corresponding layout.

getActivityLayoutBroker

public ActivityLayoutBroker getActivityLayoutBroker()
Returns the current broker used to divide which activity views that should be laid out by when activity layouts. If not set or set to null this is returned. this implements ActivityLayoutBroker

Returns:
The current broker, never null.

setActivityLayoutBroker

public void setActivityLayoutBroker(ActivityLayoutBroker broker)
Sets the current broker used to divide which activity views that should be laid out by when activity layouts. If set to null this is used (default). this implements ActivityLayoutBroker

Parameters:
broker -

setActivityLayouts

public void setActivityLayouts(java.util.List aList)
Description copied from interface: DateArea
Remove all prior layouts and adds the ones in layouts.

Specified by:
setActivityLayouts in interface DateArea
Parameters:
aList - The layouts to add. Not null.
See Also:
DateArea.addActivityLayout(com.miginfocom.calendar.layout.ActivityLayout)

addActivityLayout

public void addActivityLayout(ActivityLayout layout)
Description copied from interface: DateArea
Installs a layout that will be queried to layout ActivityViews. The layouts will be interrogated to know which one should be used to layout every ActivityView. The layout is responsible for setting the bounds of the view and then it is up to the renderer of the view to render in those bounds.

Specified by:
addActivityLayout in interface DateArea
Parameters:
layout - The layout to added. Not null.

removeActivityLayout

public void removeActivityLayout(ActivityLayout layout)
Description copied from interface: DateArea
Removes a layout for a date area, if it exists. Resorts the list.

Specified by:
removeActivityLayout in interface DateArea
Parameters:
layout - The layout to remove.
See Also:
DateArea.addActivityLayout(com.miginfocom.calendar.layout.ActivityLayout)

getActivityLayouts

public java.util.List getActivityLayouts()
Description copied from interface: DateArea
Returns the layouts currently installed as a new list.

Specified by:
getActivityLayouts in interface DateArea
Returns:
The layouts currently installed as a new list. Never null.
See Also:
DateArea.addActivityLayout(com.miginfocom.calendar.layout.ActivityLayout)

doLayout

public void doLayout()
Overrides:
doLayout in class java.awt.Container

getGrid

public Grid getGrid()
Description copied from interface: GridContainer
Returns the grid. Should generally not return null.

Specified by:
getGrid in interface GridContainer
Returns:
The grid.

getDateGrid

public DateGrid getDateGrid()
Description copied from interface: DateArea
Returns the current DateGrid object in use in this DateArea.

Specified by:
getDateGrid in interface DateArea
Specified by:
getDateGrid in interface DateGridContainer
Returns:
The current DateGrid object in use in this DateArea. Never null.

invalidateGrid

public void invalidateGrid()
Forces the grid to be discarded and triggers a invalidate() to create a new one. Will be recreated when needed next time.


createDateGrid

public DateGrid createDateGrid(DateArea dateArea)
Create a DateGrid that is suitable for the DateArea.

This is the implementation of DateGridProvider. It will use the GridLayoutProvider and the GridLineSpecProvider to build the grid.

Specified by:
createDateGrid in interface DateGridProvider
Parameters:
dateArea - Contains information about how the grid should be stucturally set up. This include visual range, primary dimension, cell counts in both dimensions and such.
Returns:
The newly created grid.
See Also:
getVisibleDateRangeCorrected(), getWrapBoundary(), getPrimaryDimensionCellType(), getPrimaryDimensionCellTypeCount(), getRowFilters(), getExpectedCellCount(), DateGridProvider, GridLayoutProvider, GridLineSpecProvider

revalidateGridDimensionLayout

public void revalidateGridDimensionLayout()
Re-reads the GridDimensionLayout from the GridLayoutProvider (which is normaly this). A Swing layout needs to happen before the sizes get updated.


getDateGridProvider

public DateGridProvider getDateGridProvider()
Returns the DateGridProvider or this (which implements DateGridProvider) if none is explicitly set.

The provider will be asked to create the date grid when needed.

Returns:
The date grid provider. Never null

setDateGridProvider

public void setDateGridProvider(DateGridProvider provider)
Sets a new DateGridProvider. If null then this will be used as a default provider.

The provider will be asked to create the date grid when they change.

Parameters:
provider - The new provider or null to use this as the provider.

createSubRows

public void createSubRows(GridRow row,
                          GridLineProvider glProvider)
Creates one sub row for every row Filter.

Specified by:
createSubRows in interface SubRowCreator
Parameters:
row - The row to lay out the dub grid lines and grid rows for
glProvider - The provider of the grid lines.

getSubGridRowCreator

public SubRowCreator getSubGridRowCreator()
Deprecated. Renamed. Use getSubRowCreator() instead.


setSubGridRowCreator

public void setSubGridRowCreator(SubRowCreator creator)
Deprecated. Renamed. Use setSubRowCreator(com.miginfocom.calendar.grid.SubRowCreator) instead


getSubRowCreator

public SubRowCreator getSubRowCreator()
Returns the sub grid row creator. It will be called upon to create the sub grid rows for a main row. This normally means the fitered rows that each show on or more Categorys.

Returns:
The sub grid row creator. Never null but may return this since we implement SubRowCreator

setSubRowCreator

public void setSubRowCreator(SubRowCreator creator)
Sets the sub grid row creator. It will be called upon to create the sub grid rows for a main row. This normally means the fitered rows that each show on or more Categorys.

Parameters:
creator - The sub grid row creator. If null then this will be used to create the sub grid rows, one for every filter sent into the constructor. This class implements SubRowCreator.

setRowFilters

public void setRowFilters(Filter[] rowFilters)
Description copied from interface: DateArea
If non null every row in the grid will be divided into subrows that each is specified by one Filter.

Specified by:
setRowFilters in interface DateArea
Parameters:
rowFilters - The filters to apply to the sub rows. null turns of filtered sub rows. Object is overtaken.

getRowFilters

public Filter[] getRowFilters()
Description copied from interface: DateArea
Returns the filters currently in the date area.

Specified by:
getRowFilters in interface DateArea
Returns:
The filters currently in the date area. The live array, so do not change it.

createLayout

public GridDimensionLayout createLayout(Grid grid,
                                        int dimIx)
Description copied from interface: GridLayoutProvider
Creates a new GridDimensionLayout.

Specified by:
createLayout in interface GridLayoutProvider
Parameters:
grid - The grid used to get information.
dimIx - The dimension. Either Grid.PRIMARY_DIMENSION or Grid.SECONDARY_DIMENSION
Returns:
The layout that will be used to layout a Grid.

setPrimaryDimensionRowSizesStatic

public void setPrimaryDimensionRowSizesStatic(SizeSpec sizeSpec)
Sets the row size in the primary dimension to a specific value. The min, preferres and max values will, if they are not null, constrain the row size. If the preferred size is null the rows will be streched to the size of the date area container.

If the rows can't fit the date area container will show scroll bars and if the size of the rows is less than the available space in the date area container there will be empty space.

This is a convenence method istead of providing a GridLayoutProvider with setGridLayoutProvider(com.miginfocom.calendar.grid.GridLayoutProvider), which is more flexible and can for instance be used to create segments of rows that have different sizes. Thus this value is only used if GridLayoutProvider is set to null with that method.

You may need to revalidate and repaint the date area after this method is called.

Also note that if a Theme is used in a sub class this method will have no effect since it has it's own GridLayoutProvider implementation.

Parameters:
sizeSpec - The minimum, preferred and/or maximum row size in pixels. May be null for no size constaint.
See Also:
DefaultGridDimensionLayout, GridLayoutProvider

setSecondaryDimensionRowSizesStatic

public void setSecondaryDimensionRowSizesStatic(SizeSpec sizeSpec)
Sets the row size in the secondary dimension to a specific value. The min, preferres and max values will, if they are not null, constrain the row size. If the preferred size is null the rows will be strached to the size of the date area container.

If the rows can't fit the date area container will show scroll bars and if the size of the rows is less than the available space in the date area container there will be empty space.

This is a convenence method istead of providing a GridLayoutProvider with setGridLayoutProvider(com.miginfocom.calendar.grid.GridLayoutProvider), which is more flexible and can for instance be used to create segments of rows that have different sizes. Thus this value is only used if GridLayoutProvider is set to null with that method.

You may need to revalidate and repaint the date area after this method is called.

Also note that if a Theme is used in a sub class this method will have no effect since it has it's own GridLayoutProvider implementation.

Parameters:
sizeSpec - The minimum, preferred and/or maximum row size in pixels. May be null for no size constaint.
See Also:
DefaultGridDimensionLayout, GridLayoutProvider

getGridLayoutProvider

public GridLayoutProvider getGridLayoutProvider()
Returns the GridLayoutProvider or this (which implements GridLayoutProvider) if none is explicitly set.

The provider will be asked to create the layouts to create the grid with.

Returns:
The layout provider. Never null

setGridLayoutProvider

public void setGridLayoutProvider(GridLayoutProvider provider)
Sets a new GridLayoutProvider. If null then this will be used as a default provider. The provider will be asked to create the layouts to create the grid with.

Note! This provider will only be used if this is used as the DateGridProvider. Other DateGridProviders might not honor this provider.

This provider is used to layout the rows, and as such is responsible for the sizes of the rows both in the horizontal and vertical dimensions.

Parameters:
provider - The new GridLayoutProvider or null to use this as the provider.

getSubGridRowLayout

public GridRowLayout getSubGridRowLayout()
Returns the sub grid row layout used if this class is the set as the GridDimensionLayout.

Returns:
The sub grid row layout. Might be null.
See Also:
setGridLayoutProvider(com.miginfocom.calendar.grid.GridLayoutProvider)

setSubGridRowLayout

public void setSubGridRowLayout(GridRowLayout layout)
Sets the sub grid row layout used if this class is the set as the GridDimensionLayout.

Parameters:
layout - The sub grid row layout. May be null.
See Also:
setGridLayoutProvider(com.miginfocom.calendar.grid.GridLayoutProvider)

getGridLineSpecProvider

public GridLineSpecProvider getGridLineSpecProvider()
Returns the GridLineSpecProvider or this (which implements GridLineSpecProvider) if none is explicitly set.

The provider will be asked to create the grid line specification to create the grid with.

Returns:
The grid line specification provider. Never null

setGridLineSpecProvider

public void setGridLineSpecProvider(GridLineSpecProvider provider)
Sets a new GridLineSpecProvider. If null then this will be used as a default provider. The specProvider will be asked to create the grid line specification to create the grid with.

Note! This provider will only be used if this is used as the DateGridProvider. Other DateGridProviders might not honor this grid line specProvider

Parameters:
provider - The new specProviderider or null to use this as the specProviderider.
See Also:
setDateGridProvider(com.miginfocom.calendar.grid.DateGridProvider)

createSpecification

public GridLineSpecification createSpecification(DateArea dateArea)
Description copied from interface: GridLineSpecProvider
Creates a new GridLineProvider.

Specified by:
createSpecification in interface GridLineSpecProvider
Parameters:
dateArea - The date area to get information from.
Returns:
The spec that hold the grid lines to be used for creating a Grid.

getExpectedCellCount

public int[] getExpectedCellCount()
Returns the cell counts that is to be expected for creating a new DateGrid given the current settings.

Returns:
The cell counts for the primary and secondary dimension, respectively.
See Also:
getPrimaryDimensionCellType(), getPrimaryDimensionCellTypeCount(), getWrapBoundary(), getVisibleDateRangeCorrected()

setGridSize

protected void setGridSize()
Sets the bounds of the grid to the the bounds of this.


getDefaultNoFitShape

public RootAShape getDefaultNoFitShape()
Sets the default shape used to paint the indication when some activity view doesn't fit.

Returns:
The default shape used to paint the indication when some activity view doesn't fit.

setDefaultNoFitShape

public void setDefaultNoFitShape(RootAShape shape)
Sets or resets the shape used for showing when an ativity void couldn't fit. A call to this will also check the current registered decorators for a NoFitShapeDecorator (or subclasses). If a decorator of that class is found the shape will be changed to shape otherwise it will only be stored and then returned by getDefaultNoFitShape().
At least a call to repaint() is needed to see the change.

Parameters:
shape - The new shape to use or null to reset it to the value returned by AShapeUtil.createDefaultNoFitShape(String).
See Also:
NoFitShapeDecorator

addInteractionListener

public void addInteractionListener(InteractionListener l)
Adds a listener that listens to InteractionEvents. Interaction events are normally fired by the Interaction/Interactor/AbstractInteractionBroker framework, used for instance by the AShape framework.

The default AShape created has events fired for clicking, double-clicking and right-clicking an AvtivityView. See for static fields starting with AE_ in this class. E.g. AE_DOUBLE_CLICKED.

To for instance listen for mouse clicks on the little [...] shapes that sometimes, depending on configuration, shows when an activity does not fit you can do something like this:

        dateArea.addInteractionListener(new InteractionListener() {
                        public void interactionOccured(InteractionEvent e)
                        {
                                if (e.getCommand().getValue().equals("NoFitShape"))
                                        System.out.println("No Fit hit!");
                        }
                });
 

This class is actually a re-dispatcher of these events. It is itself an InteractionListener and registers itself on the interaction observable objects it creates. For instance ActivityViews.

Parameters:
l - The listener to add

addInteractionListener

public void addInteractionListener(InteractionListener l,
                                   boolean asWeakRef)
Adds a listener that listens to InteractionEvents. Interaction events are normally fired by the Interaction/Interactor/AbstractInteractionBroker framework, used for instance by the AShape framework.

The default AShape created has events fired for clicking, double-clicking and right-clicking an AvtivityView. See for static fields starting with AE_ in this class. E.g. AE_DOUBLE_CLICKED.

This class is actually a re-dispatcher of these events. It is itself an InteractionListener and registers itself on the interaction observable objects it creates. For instance ActivityViews.

Parameters:
l - The listener to add
asWeakRef - If the listener should be added wrapped in a WeakReference. This defers memory leak problems since the garbage collector can collect the listener if it is only referenced from this list.

Note! This (weak reference) can not be used with listeners that doesn't have another real (a.k.a Strong) reference to it, as for instance an annonymous inner class. If one such listener is added it will be removed almost immediately by the garbage collector.


removeInteractionListener

public void removeInteractionListener(InteractionListener l)
Removes the listener.

Parameters:
l - The listener to remove.

fireInteractionOccured

protected void fireInteractionOccured(InteractionEvent e)
Notifies all listeners of the the event but stops as soon as the event get's consumed.


addActivityMoveListener

public void addActivityMoveListener(ActivityMoveListener l)
Adds the listener as a strong reference. The listener will be notified before the actual setting of the new date range in the activity as a result of a move. It is therefore possible to change the date range (for example to the same as the activity currently has to make NO move) to something else for instance to keep it within some bounds.

It is also possible to accomodate for moving beween sub rows (normally categories). Here is the simplest possible code to get the sub GridRow that the mouse is over:
((DefaultDateArea) e.getSource()).getDateGrid().getRowAt(Grid.SECONDARY_DIMENSION, ((MouseEvent) e.getEvent()).getPoint(), 1000, true);

Since the grid rows can be filtered in many ways, not just by category, there is no automatic way to change category by drag and drop. This has to be coded manually by checking the filter type and get the categories of the filter.

Parameters:
l - The listener. Not null.
See Also:
CategoryFilter

addActivityMoveListener

public void addActivityMoveListener(ActivityMoveListener l,
                                    boolean asWeakRef)
Adds the listener. The listener will be notified before the actual setting of the new date range in the activity as a result of a move. It is therefore possible to change the date range (for example to the same as the activity currently has to make NO move) to something else for instance to keep it within some bounds.

It is also possible to accomodate for moving beween sub rows (normally categories). Here is the simplest possible code to get the sub GridRow that the mouse is over:
((DefaultDateArea) e.getSource()).getDateGrid().getRowAt(Grid.SECONDARY_DIMENSION, ((MouseEvent) e.getEvent()).getPoint(), 1000, true);

Since the grid rows can be filtered in many ways, not just by category, there is no automatic way to change category by drag and drop. This has to be coded manyally by checking the filter type and get the categories of the filter.

Parameters:
l - The listener. Not null.
asWeakRef - If the listener should be added wrapped in a WeakReference. This defers memory leak problems since the garbage collector can collect the listener if it is only referenced from this list.
Note! This (weak reference) can not be used with listeners that doesn't have another real (a.k.a Strong) reference to it, as for instance an annonymous inner class. If one such listener is added it will be removed almost immediately by the garbage collector.
See Also:
CategoryFilter

removeActivityMoveListener

public void removeActivityMoveListener(ActivityMoveListener l)
Removes the listener if it is registered.

Parameters:
l - The listener.

fireActivityPreMoveEvent

protected void fireActivityPreMoveEvent(Activity act,
                                        MutableDateRange dateRange,
                                        java.awt.event.MouseEvent e)

addGridListener

public void addGridListener(java.beans.PropertyChangeListener l)
Description copied from interface: GridContainer
Adds a listener that gets notified when the grid is changed or any other "major" change occurs.

Specified by:
addGridListener in interface GridContainer
Parameters:
l - The listener. Not null

addGridListener

public void addGridListener(java.beans.PropertyChangeListener l,
                            boolean asWeakRef)
Description copied from interface: GridContainer
Adds a listener that gets notified when the grid is changed or any other "major" change occurs.

Specified by:
addGridListener in interface GridContainer
Parameters:
l - The listener. Not null
asWeakRef - If the listener should be added wrapped in a WeakReference. This defers memory leak problems since the garbage collector can collect the listener if it is only referenced from this list.
Note! This (weak reference) can not be used with listeners that doesn't have another real (a.k.a Strong) reference to it, as for instance an annonymous inner class. If one such listener is added it will be removed almost immediately by the garbage collector.

removeGridListener

public void removeGridListener(java.beans.PropertyChangeListener l)
Description copied from interface: GridContainer
Removes the listener, if it is in the list.

Specified by:
removeGridListener in interface GridContainer
Parameters:
l - The listener to remove, not null.

fireGridChanged

protected boolean fireGridChanged(java.lang.String propName,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)
Fires a structurat change event to the listeners

Returns:
If there was any listeners registered.

addDateChangeListener

public void addDateChangeListener(DateChangeListener l)
Adds the listener as a strong reference. The listener gets notified when a date range (e.g. selected, selectable, pressed (temporary) gets changed.

Specified by:
addDateChangeListener in interface DateArea
Parameters:
l - The listener. Not null.

addDateChangeListener

public void addDateChangeListener(DateChangeListener l,
                                  boolean asWeakRef)
Description copied from interface: DateArea
Adds a listener that gets notified when any date range (mouseOver, pressed, selected, selectable) changes.

Specified by:
addDateChangeListener in interface DateArea
Parameters:
l - The listener. Not null
asWeakRef - If the listener should be added wrapped in a WeakReference. This defers memory leak problems since the garbage collector can collect the listener if it is only referenced from this list.
Note! This (weak reference) can not be used with listeners that doesn't have another real (a.k.a Strong) reference to it, as for instance an annonymous inner class. If one such listener is added it will be removed almost immediately by the garbage collector.

removeDateChangeListener

public void removeDateChangeListener(DateChangeListener l)
Description copied from interface: DateArea
Removes the listener, if it is in the list.

Specified by:
removeDateChangeListener in interface DateArea
Parameters:
l - The listener to remove.

fireDateChange

protected boolean fireDateChange(DateRangeI oldRange,
                                 DateRangeI newRange,
                                 int type)
Fires a date change event to the listeners

Parameters:
oldRange - The old range or null if not applicable. Will be cloned locally if not already immutable. The old range doesn't need to be provided.
newRange - The new range or null if there was no new range. Will be cloned locally if not already immutable.
type - The type, E.g. DateChangeEvent.SELECTED. As a contract between the producer and reciever of the event and can assume any value.
Returns:
If there was any listeners registered.

addActivityDragResizeListener

public void addActivityDragResizeListener(ActivityDragResizeListener l)
Adds the listener as a strong reference. The listener gets notified when one or more Activity objects's date ranges gets changed by this date area. This is normally sent when the user releases the mouse button. Listening on the activities themself can't provide this information since the activity doesn't know if the user is done dragging/resizing it.

The ActionEvent has the change ActivityViews as the source. Id and command are not used. Modifiers are taken from the MouseEvent for the mouse release.

Parameters:
l - The listener. Not null.

addActivityDragResizeListener

public void addActivityDragResizeListener(ActivityDragResizeListener l,
                                          boolean asWeakRef)
Adds the listener. The listener gets notified when one or more Activity objects's date ranges gets changed by this date area. This is normally sent when the user releases the mouse button. Listening on the activities themself can't provide this information since the activity doesn't know if the user is done dragging/resizing it.

The ActionEvent has the change ActivityViews as the source. Id and command are not used. Modifiers are taken from the MouseEvent for the mouse release.

Parameters:
l - The listener. Not null.
asWeakRef - If the listener should be added wrapped in a WeakReference. This defers memory leak problems since the garbage collector can collect the listener if it is only referenced from this list.
Note! This (weak reference) can not be used with listeners that doesn't have another real (a.k.a Strong) reference to it, as for instance an annonymous inner class. If one such listener is added it will be removed almost immediately by the garbage collector.

removeActivityDragResizeListener

public void removeActivityDragResizeListener(ActivityDragResizeListener l)
Removes the listener, if it is in the list.

Parameters:
l - The listener to remove.

fireActivityDragResizeChange

protected boolean fireActivityDragResizeChange(ActivityList acts,
                                               int modifiers)
Fires an event to the listeners.

Parameters:
acts - The Activitys. Not null.
modifiers - Modifiers.
Returns:
If there was any listeners registered.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

timeSpanListChanged

public void timeSpanListChanged(TimeSpanListEvent e)
Description copied from interface: TimeSpanListListener
Called when the time span list itesf changes (add/remove).

Specified by:
timeSpanListChanged in interface TimeSpanListListener
Parameters:
e - The event that explains what happened.

interactionOccured

public void interactionOccured(InteractionEvent e)
Description copied from interface: InteractionListener
Called when an interaction has occurred-

Yes, embarrassing as it is, we are aware that occurred it is spelled wrong.

Specified by:
interactionOccured in interface InteractionListener
Parameters:
e - The event

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

dateRangeChanged

public void dateRangeChanged(DateChangeEvent e)
Description copied from interface: DateChangeListener
Called when a date range changed.

Specified by:
dateRangeChanged in interface DateChangeListener
Parameters:
e - The event that explains what happened

hierarchyChanged

public void hierarchyChanged(java.awt.event.HierarchyEvent e)
Specified by:
hierarchyChanged in interface java.awt.event.HierarchyListener

processEvent

protected void processEvent(java.awt.AWTEvent e)
Overridden to let all activity views have fist chance to interact with the events and if they are consumed disregard them for further processing.

Overrides:
processEvent in class java.awt.Container
Parameters:
e - The event.

getToolTipProvider

public ToolTipProvider getToolTipProvider()
Returns the current tool tip provider.

Returns:
the current provider. May be null.

setToolTipProvider

public void setToolTipProvider(ToolTipProvider ttp)
Set the tool tip provider used when creating tool tips for this date area. Not that this is a more flexible way to do tool tips that the Swing build in one. You can have dynamic tool tips that follows the mouse. It is easy to show tool tips for mouse overs of Activities.

It is also very simple to customize fonts, border colors and such.

Some sample code:

         setToolTipProvider(new ToolTipProvider()
         {
                 public int configureToolTip(JToolTip toolTip, MouseEvent e, Object source)
                 {
                         if (e.getID() == MouseEvent.MOUSE_MOVED && source instanceof ActivityView) {
                                 toolTip.setForeground(Color.BLACK);
                                 toolTip.setTipText(((ActivityView) source).getModel().getSummary());
                                 return ToolTipProvider.SHOW_TOOLTIP;
                         } else {
                                 return ToolTipProvider.HIDE_TOOLTIP;
                         }
                 }
         });

Parameters:
ttp - The tool tip provider or null to turn it off.
See Also:
ToolTipProvider

getGraphicsConfigurationForPoint

public java.awt.GraphicsConfiguration getGraphicsConfigurationForPoint(java.awt.Point p)
Returns the GraphicsConfiguration for a point.

Parameters:
p - The point. Not null. If the point isn't in bounds of any screen the default GraphicsConfiguration is returned.
Returns:
The GraphicsConfiguration. Never null.

hideTooltip

public void hideTooltip()


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.