public class IlvMonthView extends JPanel
IlvMonthView
is a Swing component that displays activities from
a Gantt data model overlaid on a monthly calendar grid.
It groups an IlvMonthPanel
with a vertical scroll bar that allows you to
increment or decrement the month.
The month view displays the leaf activities and milestones of the Gantt data model set on it. The view also listens for changes to the data model and updates itself dynamically. Leaf activities from the data model are displayed using the currently set activity renderer and milestones are displayed using the current milestone renderer. You can also set a static holiday data model on the month view. Leaf activities from the holiday model are displayed using the holiday renderer. Note, that the month view does not listen for dynamic updates to the holiday data model.
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvMonthView()
Creates a new month view.
|
IlvMonthView(IlvGanttModel ganttModel)
Creates a new month view that displays the activities in the specified Gantt
data model.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionListener(SelectionListener listener)
Adds the specified selection listener to receive selection events from
this panel.
|
void |
decrementMonth()
Decrements the view to display the preceding month.
|
void |
deselectAllActivities()
Deselects all of the currently selected activities.
|
IlvActivityCalendarRenderer |
getActivityRenderer()
Returns the renderer that is used to draw the graphic presentation of activities
within the month panel.
|
Calendar |
getCalendar()
Returns the calendar displayed by the view.
|
IlvCalendarModel |
getCalendarModel()
Returns the model that holds the calendar displayed by the view.
|
Date |
getDate()
Returns the date displayed by the view.
|
IlvGanttModel |
getGanttModel()
Returns the Gantt data model that is being displayed.
|
IlvGanttModel |
getHolidayModel()
Returns the holiday model that is being displayed.
|
IlvActivityCalendarRenderer |
getHolidayRenderer()
Returns the renderer that is used to draw the graphic presentation of holidays
within the month panel.
|
IlvMilestoneCalendarRenderer |
getMilestoneRenderer()
Returns the renderer that is used to draw the graphic presentation of milestones
within the month panel.
|
IlvMonthPanel |
getMonthPanel()
Returns the view's month panel component.
|
int |
getMonthScrollRange()
Returns the range of the vertical scroll bar, in months.
|
List |
getSelectedActivities()
Returns a list of the currently selected activities.
|
ULocale |
getULocale()
Returns the locale of this component.
|
void |
incrementMonth()
Increments the view to display the next month.
|
boolean |
isMouseSelectionEnabled()
Returns whether mouse selection of activities is enabled.
|
boolean |
isSelected(IlvActivity activity)
Returns whether the specified activity is currently selected.
|
void |
removeSelectionListener(SelectionListener listener)
Remove the specified selection listener so that it no longer receives
selection events from this panel.
|
void |
setActivityRenderer(IlvActivityCalendarRenderer activityRenderer)
Sets the renderer that will be used to draw the graphic presentation of activities
within the month panel.
|
void |
setCalendar(Calendar calendar)
Sets the calendar displayed by the view.
|
void |
setCalendarModel(IlvCalendarModel calendarModel)
Sets the model that holds the calendar displayed by the view.
|
void |
setDate(Date date)
Sets the date displayed by the view.
|
void |
setGanttModel(IlvGanttModel ganttModel)
Sets the Gantt data model that will be displayed.
|
void |
setHolidayModel(IlvGanttModel holidays)
Sets the holiday model that will be displayed.
|
void |
setHolidayRenderer(IlvActivityCalendarRenderer holidayRenderer)
Sets the renderer that will be used to draw the graphic presentation of holidays
within the month panel.
|
void |
setLocale(Locale locale)
Sets the locale of this component.
|
void |
setMilestoneRenderer(IlvMilestoneCalendarRenderer milestoneRenderer)
Sets the renderer that will be used to draw the graphic presentation of milestones
within the month panel.
|
void |
setMonthScrollRange(int months)
Sets the range of the vertical scroll bar, in months.
|
void |
setMouseSelectionEnabled(boolean enabled)
Sets whether mouse selection of activities is enabled.
|
void |
setSelected(IlvActivity activity,
boolean selected)
Selects or deselects the specified activity.
|
void |
setULocale(ULocale locale)
Sets the locale of this component.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
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, 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, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public IlvMonthView()
public IlvMonthView(IlvGanttModel ganttModel)
ganttModel
- The Gantt data model.public ULocale getULocale()
ULocale
.IllegalStateException
- if this component's locale has been removed
through setLocale(null)
and none of the ancestors has
a Locale
set eithersetULocale(ULocale)
public void setULocale(ULocale locale)
locale
- An ICU ULocale
, or null
if this
component shall inherit its locale from the parent component.getULocale()
,
setLocale(Locale)
public void setLocale(Locale locale)
setLocale
in class Component
locale
- An Locale
, or null
if this
component shall inherit its locale from the parent component.setULocale(ULocale)
public IlvMonthPanel getMonthPanel()
public int getMonthScrollRange()
setMonthScrollRange(int)
public void setMonthScrollRange(int months)
months
- The scroll range.getMonthScrollRange()
public IlvCalendarModel getCalendarModel()
setCalendarModel(ilog.views.util.swing.calendar.IlvCalendarModel)
public void setCalendarModel(IlvCalendarModel calendarModel)
calendarModel
- The calendar model.getCalendarModel()
public Calendar getCalendar()
Calendar
objects are mutable, this method returns a copy of the view's internal calendar
value.setCalendar(java.util.Calendar)
public void setCalendar(Calendar calendar)
calendar
- The calendar to set.getCalendar()
public Date getDate()
setDate(java.util.Date)
public void setDate(Date date)
date
- The date to set.getDate()
public void incrementMonth()
public void decrementMonth()
public IlvGanttModel getGanttModel()
setGanttModel(ilog.views.gantt.IlvGanttModel)
public void setGanttModel(IlvGanttModel ganttModel)
ganttModel
- The Gantt data model.getGanttModel()
public IlvGanttModel getHolidayModel()
setHolidayModel(ilog.views.gantt.IlvGanttModel)
public void setHolidayModel(IlvGanttModel holidays)
holidays
- The holiday model.getHolidayModel()
public IlvActivityCalendarRenderer getActivityRenderer()
setActivityRenderer(ilog.views.gantt.swing.calendarview.IlvActivityCalendarRenderer)
public void setActivityRenderer(IlvActivityCalendarRenderer activityRenderer)
activityRenderer
- The activity renderer.getActivityRenderer()
public IlvActivityCalendarRenderer getHolidayRenderer()
setHolidayRenderer(ilog.views.gantt.swing.calendarview.IlvActivityCalendarRenderer)
public void setHolidayRenderer(IlvActivityCalendarRenderer holidayRenderer)
holidayRenderer
- The holiday renderer.getHolidayRenderer()
public IlvMilestoneCalendarRenderer getMilestoneRenderer()
setMilestoneRenderer(ilog.views.gantt.swing.calendarview.IlvMilestoneCalendarRenderer)
public void setMilestoneRenderer(IlvMilestoneCalendarRenderer milestoneRenderer)
milestoneRenderer
- The milestone renderer.getMilestoneRenderer()
public void setSelected(IlvActivity activity, boolean selected)
activity
- The activity to select or deselect.selected
- true
to select the activity or
false
to deselect it.isSelected(ilog.views.gantt.IlvActivity)
,
deselectAllActivities()
,
getSelectedActivities()
public void deselectAllActivities()
public List getSelectedActivities()
isSelected(ilog.views.gantt.IlvActivity)
,
setSelected(ilog.views.gantt.IlvActivity, boolean)
,
deselectAllActivities()
public boolean isSelected(IlvActivity activity)
activity
- The activity.true
if the activity is selected, or false
otherwise.setSelected(ilog.views.gantt.IlvActivity, boolean)
,
deselectAllActivities()
,
getSelectedActivities()
public void addSelectionListener(SelectionListener listener)
listener
- The selection listener.removeSelectionListener(ilog.views.gantt.event.SelectionListener)
public void removeSelectionListener(SelectionListener listener)
listener
- The selection listener.addSelectionListener(ilog.views.gantt.event.SelectionListener)
public boolean isMouseSelectionEnabled()
true
true
if mouse selection is enabled, false
otherwise.setMouseSelectionEnabled(boolean)
public void setMouseSelectionEnabled(boolean enabled)
enabled
- true
to enable mouse selection or false
to disable mouse selection.isMouseSelectionEnabled()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.