public class IlvDayView extends JPanel
IlvDayView
is a Swing component that displays a single day
of activities from a Gantt data model.
Leaf activities that are less than 1 day duration and milestones of the
data model are displayed within an IlvHourlyActivitySheet
.
The activities are tiled in vertical columns, where the vertical axis
represents the hours of the day. Leaf activities that are greater
than or equal to 1 day duration are displayed in rows at the top of the
view.
The views 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 view. Leaf activities from the holiday model are displayed using the holiday renderer in rows at the top of the view. Note, that the day 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
Modifier and Type | Field and Description |
---|---|
static String |
CALENDAR_CHANGED_PROPERTY
Identifies that the view's calendar has changed.
|
static String |
CALENDAR_MODEL_CHANGED_PROPERTY
Identifies that the view's calendar model has changed.
|
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 |
---|
IlvDayView()
Creates a new day view.
|
IlvDayView(IlvGanttModel ganttModel)
Creates a new day 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.
|
protected IlvCalendarModel |
createDefaultCalendarModel()
Returns the default calendar model object for this view, which is
an instance of
IlvDefaultCalendarModel . |
void |
decrementDay()
Decrements the view to display the preceding day.
|
void |
deselectAllActivities()
Deselects all of the currently selected activities.
|
void |
doLayout()
Performs the view layout.
|
IlvActivity |
getActivity(Point point)
Returns the activity, milestone, or holiday that is displayed at the
specified
point . |
int |
getActivityColumnCount()
Returns the number of activity columns displayed within the hourly grid
portion of the view.
|
int |
getActivityColumnSpacing()
Returns the horizontal spacing between the columns of activity bars and
milestones displayed within the hourly grid portion of the view.
|
IlvActivityCalendarRenderer |
getActivityRenderer()
Returns the renderer that is used to draw the graphic presentation of
activities within the day view.
|
int |
getActivityRowCount()
Returns the number of activity rows displayed at the top of the view.
|
int |
getActivityRowHeight()
Returns the height of the activity and holiday bars displayed at the
top of the view.
|
int |
getActivityRowSpacing()
Returns the vertical spacing between the rows of activity and holiday
bars displayed at the top of the view.
|
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.
|
Paint |
getHalfHourGridPaint()
Returns the paint object used to stroke the half hour grid lines.
|
Stroke |
getHalfHourGridStroke()
Returns the style used to stroke the half hour grid lines.
|
Font |
getHeaderFont()
Returns the font of the day header.
|
Color |
getHeaderForeground()
Returns the foreground color of the day header.
|
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 day view.
|
Font |
getHourFont()
Returns the font of the hour labels.
|
Color |
getHourGridBackground()
Returns the background color of the hourly grid portion of the view.
|
Paint |
getHourGridPaint()
Returns the paint object used to stroke the hour grid lines.
|
Stroke |
getHourGridStroke()
Returns the style used to stroke the hour grid lines.
|
int |
getHourHeight()
Returns the height of each hour interval within the hourly grid portion
of the view.
|
IlvHourlyActivitySheet |
getHourlyActivitySheet()
Returns the hourly activity sheet.
|
Color |
getHourScaleBackground()
Returns the background color of the vertical hour scale.
|
Color |
getHourScaleForeground()
Returns the foreground color of the vertical hour scale.
|
Color |
getHourTickColor()
Returns the color of the hourly tick marks.
|
int |
getHourTickMargin()
Returns the margin of the hourly tick marks.
|
IlvMilestoneCalendarRenderer |
getMilestoneRenderer()
Returns the renderer that is used to draw the graphic presentation of
milestones within the day view.
|
Font |
getMinuteFont()
Returns the font of the minute labels.
|
Dimension |
getPreferredSize()
Returns the preferred size of the day view.
|
List |
getSelectedActivities()
Returns a list of the currently selected activities.
|
ULocale |
getULocale()
Returns the locale of this component.
|
void |
incrementDay()
Increments the view to display the next day.
|
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 |
setActivityColumnSpacing(int spacing)
Sets the horizontal spacing between the columns of activity bars and
milestones displayed within the hourly grid portion of the view.
|
void |
setActivityRenderer(IlvActivityCalendarRenderer activityRenderer)
Sets the renderer that will be used to draw the graphic presentation of
activities within the day view.
|
void |
setActivityRowHeight(int height)
Sets the height of the activity and holiday bars displayed at the top
of the view.
|
void |
setActivityRowSpacing(int spacing)
Sets the vertical spacing between the rows of activity and holiday bars
displayed at the top of the view.
|
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 |
setHalfHourGridPaint(Paint paint)
Sets the paint object used to stroke the half hour grid lines.
|
void |
setHalfHourGridStroke(Stroke stroke)
Sets the style used to stroke the half hour grid lines.
|
void |
setHeaderFont(Font font)
Sets the font of the day header.
|
void |
setHeaderForeground(Color color)
Sets the foreground color of the day header.
|
void |
setHolidayModel(IlvGanttModel holiday)
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 day view.
|
void |
setHourFont(Font font)
Sets the font of the hour labels.
|
void |
setHourGridBackground(Color color)
Sets the background color of the hourly grid portion of the view.
|
void |
setHourGridPaint(Paint paint)
Sets the paint object used to stroke the hour grid lines.
|
void |
setHourGridStroke(Stroke stroke)
Sets the style used to stroke the hour grid lines.
|
void |
setHourHeight(int height)
Sets the height of each hour interval within the hourly grid portion
of the view.
|
void |
setHourScaleBackground(Color color)
Sets the background color of the vertical hour scale.
|
void |
setHourScaleForeground(Color color)
Sets the foreground color of the vertical hour scale.
|
void |
setHourTickColor(Color color)
Sets the color of the hourly tick marks.
|
void |
setHourTickMargin(int margin)
Sets the margin of the hourly tick marks.
|
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 day view.
|
void |
setMinuteFont(Font font)
Sets the font of the minute labels.
|
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, 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, 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 static final String CALENDAR_MODEL_CHANGED_PROPERTY
public static final String CALENDAR_CHANGED_PROPERTY
public IlvDayView(IlvGanttModel ganttModel)
ganttModel
- The Gantt data model.public IlvDayView()
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)
protected IlvCalendarModel createDefaultCalendarModel()
IlvDefaultCalendarModel
.
A subclass can override this method to return a different calendar
model object.getCalendarModel()
,
setCalendarModel(ilog.views.util.swing.calendar.IlvCalendarModel)
public IlvCalendarModel getCalendarModel()
setCalendarModel(ilog.views.util.swing.calendar.IlvCalendarModel)
,
createDefaultCalendarModel()
public void setCalendarModel(IlvCalendarModel calendarModel)
calendarModel
- The calendar model.getCalendarModel()
,
createDefaultCalendarModel()
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 incrementDay()
public void decrementDay()
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 holiday)
holiday
- The holiday model.getHolidayModel()
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()
public IlvHourlyActivitySheet getHourlyActivitySheet()
public int getHourHeight()
setHourHeight(int)
public void setHourHeight(int height)
height
- The interval height.getHourHeight()
public int getActivityColumnCount()
public int getActivityColumnSpacing()
setActivityColumnSpacing(int)
public void setActivityColumnSpacing(int spacing)
spacing
- The activity column spacing.getActivityColumnSpacing()
public int getActivityRowCount()
public int getActivityRowHeight()
setActivityRowHeight(int)
public void setActivityRowHeight(int height)
height
- The activity row height.getActivityRowHeight()
public int getActivityRowSpacing()
setActivityRowSpacing(int)
public void setActivityRowSpacing(int spacing)
spacing
- The activity row spacing.getActivityRowSpacing()
public IlvActivity getActivity(Point point)
point
. This method returns null
if
the location does not lie in an activity, a milestone, or a holiday.point
- The location of interest.null
.public Dimension getPreferredSize()
getPreferredSize
in class JComponent
Dimension
.public Color getHourGridBackground()
setHourGridBackground(java.awt.Color)
public void setHourGridBackground(Color color)
color
- The hour grid background color.getHourGridBackground()
public Color getHourScaleBackground()
setHourScaleBackground(java.awt.Color)
public void setHourScaleBackground(Color color)
color
- The hour scale background color.getHourScaleBackground()
public Color getHourScaleForeground()
setHourScaleForeground(java.awt.Color)
public void setHourScaleForeground(Color color)
color
- The hour scale foreground color.getHourScaleForeground()
public Paint getHourGridPaint()
null
if the hour grid
lines will not be stroked.setHourGridPaint(java.awt.Paint)
public void setHourGridPaint(Paint paint)
paint
- The hour grid line paint, or null
to indicate
that the hour grid lines will not be stroked.getHourGridPaint()
public Stroke getHourGridStroke()
BasicStroke
.null
if the hour grid lines
will not be stroked.setHourGridStroke(java.awt.Stroke)
public void setHourGridStroke(Stroke stroke)
stroke
- The stroke style, or null
to indicate that
the hour grid lines will not be stroked.getHourGridStroke()
public Paint getHalfHourGridPaint()
null
if the half
hour grid lines will not be stroked.setHalfHourGridPaint(java.awt.Paint)
public void setHalfHourGridPaint(Paint paint)
paint
- The half hour grid line paint, or null
to
indicate that the half hour grid lines will not be stroked.getHalfHourGridPaint()
public Stroke getHalfHourGridStroke()
BasicStroke
.null
if the half hour grid
lines will not be stroked.setHalfHourGridStroke(java.awt.Stroke)
public void setHalfHourGridStroke(Stroke stroke)
stroke
- The stroke style, or null
to indicate that
the half hour grid lines will not be stroked.getHalfHourGridStroke()
public Font getHourFont()
setHourFont(java.awt.Font)
public void setHourFont(Font font)
font
- The hour label font.getHourFont()
public Font getMinuteFont()
setMinuteFont(java.awt.Font)
public void setMinuteFont(Font font)
font
- The minute label font.getMinuteFont()
public Color getHourTickColor()
setHourTickColor(java.awt.Color)
public void setHourTickColor(Color color)
color
- The tick color.getHourTickColor()
public int getHourTickMargin()
setHourTickMargin(int)
public void setHourTickMargin(int margin)
margin
- The tick margin.getHourTickMargin()
public Font getHeaderFont()
setHeaderFont(java.awt.Font)
public void setHeaderFont(Font font)
font
- The header font.getHeaderFont()
public Color getHeaderForeground()
setHeaderForeground(java.awt.Color)
public void setHeaderForeground(Color color)
color
- The header foreground color.getHeaderForeground()
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()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.