public class IlvHourlyActivitySheet extends JComponent implements Scrollable
IlvHourlyActivitySheet
displays a single day of activities arranged in
columns along the vertical axis, which represents the hours of the day.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 |
---|
IlvHourlyActivitySheet()
Creates a new hourly activity sheet.
|
Modifier and Type | Method and Description |
---|---|
List |
getActivities()
Returns the activities that are displayed on the sheet.
|
IlvActivity |
getActivity(Point point)
Returns the activity or milestone that is displayed at the specified
point . |
int |
getActivityColumnCount()
Returns the number of activity columns being displayed.
|
IlvActivityCalendarRenderer |
getActivityRenderer()
Returns the renderer that is used to draw the graphic presentation of activities
within the activity sheet.
|
int |
getActivitySpacing()
Returns the horizontal spacing between activity bars and milestones.
|
Calendar |
getCalendar()
Returns the calendar displayed by the sheet.
|
Calendar |
getCalendar(int y)
Returns the calendar that corresponds to the specified Y position.
|
Paint |
getHalfHourPaint()
Returns the paint object used to stroke the half hour grid lines.
|
Stroke |
getHalfHourStroke()
Returns the style used to stroke the half hour grid lines.
|
int |
getHourHeight()
Returns the height of each hour interval.
|
float |
getHourOfDay(int y)
Returns the hour of the day that corresponds to the specified Y position.
|
Paint |
getHourPaint()
Returns the paint object used to stroke the hour grid lines.
|
Stroke |
getHourStroke()
Returns the style used to stroke the hour grid lines.
|
Dimension |
getMaximumSize()
Returns the maximum size of the sheet.
|
IlvMilestoneCalendarRenderer |
getMilestoneRenderer()
Returns the renderer that is used to draw the graphic presentation of milestones
within the activity sheet.
|
Dimension |
getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this activity sheet.
|
Dimension |
getPreferredSize()
Returns the preferred size of the sheet.
|
int |
getPreferredVisibleHours()
Returns the preferred number of hours that will be displayed when the activity sheet is
placed in a scrollpane.
|
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
Returns the distance to scroll to expose the next or previous block of hour rows
for vertical scrolling, or the value of 10 pixels for horizontal scrolling.
|
boolean |
getScrollableTracksViewportHeight()
Returns
false to indicate that a viewport should not force the
height of the activity sheet to match the height of the viewport. |
boolean |
getScrollableTracksViewportWidth()
Returns
true to indicate that a viewport should always force the
width of the activity sheet to match the width of the viewport. |
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Returns the distance to scroll to expose the next or previous
hour row for vertical scrolling, or the value of 1 pixel for horizontal scrolling.
|
Collection |
getSelectedActivities()
Returns a collection of the currently selected activities.
|
String |
getToolTipText(MouseEvent event)
Returns the string to be used as the tooltip for the specified mouse
event.
|
float |
getY(Calendar calendar)
Returns the vertical Y position within the sheet that corresponds to the hour of the
day of the specified calendar.
|
float |
getY(float hourOfDay)
Returns the vertical Y position within the sheet that corresponds to the specified
hour of the day.
|
void |
paintComponent(Graphics g)
Paints the activity sheet.
|
void |
setActivities(List activities,
IlvGanttModel ganttModel)
Sets the activities that are displayed on the sheet.
|
void |
setActivityRenderer(IlvActivityCalendarRenderer activityRenderer)
Sets the renderer that will be used to draw the graphic presentation of activities
within the activity sheet.
|
void |
setActivitySpacing(int spacing)
Sets the horizontal spacing between activity bars and milestones.
|
void |
setCalendar(Calendar calendar)
Sets the calendar representing the day that is displayed by the sheet.
|
void |
setHalfHourPaint(Paint paint)
Sets the paint object used to stroke the half hour grid lines.
|
void |
setHalfHourStroke(Stroke stroke)
Sets the style used to stroke the half hour grid lines.
|
void |
setHourHeight(int height)
Sets the height of each hour interval.
|
void |
setHourPaint(Paint paint)
Sets the paint object used to stroke the hour grid lines.
|
void |
setHourStroke(Stroke stroke)
Sets the style used to stroke the hour grid lines.
|
void |
setMilestoneRenderer(IlvMilestoneCalendarRenderer milestoneRenderer)
Sets the renderer that will be used to draw the graphic presentation of milestones
within the activity sheet.
|
void |
setPreferredVisibleHours(int visibleHours)
Sets the preferred number of hours that will be displayed when the activity sheet is
placed in a scrollpane.
|
void |
setSelectedActivities(Collection activities)
Sets the collection of activities that are currently selected.
|
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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, updateUI
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, getAccessibleContext, 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, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public IlvHourlyActivitySheet()
public Calendar getCalendar()
Calendar
objects are mutable, this method returns a copy of the sheet's internal calendar
value.setCalendar(java.util.Calendar)
public Calendar getCalendar(int y)
y
- The vertical Y position.public void setCalendar(Calendar calendar)
calendar
- The calendar to set.getCalendar()
public List getActivities()
public void setActivities(List activities, IlvGanttModel ganttModel)
activities
- The activities.ganttModel
- The Gantt data model that contains the activities.public Collection getSelectedActivities()
setSelectedActivities(java.util.Collection)
public void setSelectedActivities(Collection activities)
activities
- The selected activities.getSelectedActivities()
public int getHourHeight()
setHourHeight(int)
public void setHourHeight(int height)
height
- The interval height.getHourHeight()
public int getActivityColumnCount()
public int getActivitySpacing()
setActivitySpacing(int)
public void setActivitySpacing(int spacing)
spacing
- The activity spacing.getActivitySpacing()
public float getHourOfDay(int y)
y
- The vertical Y position.public float getY(float hourOfDay)
hourOfDay
- The hour of the day, which should be a value from 0 to 24.public float getY(Calendar calendar)
calendar
- The calendar.public IlvActivity getActivity(Point point)
point
. This method returns null
if the location does
not lie in an activity or a milestone.point
- The location of interest.null
.public Dimension getPreferredSize()
getPreferredSize
in class JComponent
Dimension
.public Dimension getMaximumSize()
getMaximumSize
in class JComponent
Dimension
.public String getToolTipText(MouseEvent event)
setToolTipText
method is returned.getToolTipText
in class JComponent
event
- The mouse event that caused the ToolTipManager
to show
the tooltip.public int getPreferredVisibleHours()
setPreferredVisibleHours(int)
public void setPreferredVisibleHours(int visibleHours)
getPreferredScrollableViewportSize()
property.visibleHours
- The preferred number of visible hours.getPreferredVisibleHours()
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
JViewport
whose view
is this activity sheet.getPreferredVisibleHours()
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface Scrollable
visibleRect
- The visible rectangleorientation
- The scroll orientation, which must be either
SwingConstants.VERTICAL
or SwingConstants.HORIZONTAL
.direction
- The scroll direction, which will be less than zero to scroll
up/left or greater than zero for down/right.public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface Scrollable
visibleRect
- The visible rectangleorientation
- The scroll orientation, which must be either
SwingConstants.VERTICAL
or SwingConstants.HORIZONTAL
.direction
- The scroll direction, which will be less than zero to scroll
up/left or greater than zero for down/right.public boolean getScrollableTracksViewportWidth()
true
to indicate that a viewport should always force the
width of the activity sheet to match the width of the viewport. Note, that this
effectively disables horizontal scrolling when the activity sheet is placed in a
JScrollPane
.getScrollableTracksViewportWidth
in interface Scrollable
true
, which indicates that a viewport should force the
activity sheet's width to match its own.public boolean getScrollableTracksViewportHeight()
false
to indicate that a viewport should not force the
height of the activity sheet to match the height of the viewport. Note, that this
effectively enables vertical scrolling when the activity sheet is placed in a
JScrollPane
.getScrollableTracksViewportHeight
in interface Scrollable
false
, which indicates that a viewport should not force the
activity sheet's height to match its own.public Paint getHourPaint()
null
if the hour grid lines will
not be stroked.setHourPaint(java.awt.Paint)
public void setHourPaint(Paint paint)
paint
- The hour grid line paint, or null
to indicate that the
hour grid lines will not be stroked.getHourPaint()
public Stroke getHourStroke()
BasicStroke
.null
if the hour grid lines will not
be stroked.setHourStroke(java.awt.Stroke)
public void setHourStroke(Stroke stroke)
stroke
- The stroke style, or null
to indicate that the hour grid
lines will not be stroked.getHourStroke()
public Paint getHalfHourPaint()
null
if the half hour grid lines will
not be stroked.setHalfHourPaint(java.awt.Paint)
public void setHalfHourPaint(Paint paint)
paint
- The half hour grid line paint, or null
to indicate that the
half hour grid lines will not be stroked.getHalfHourPaint()
public Stroke getHalfHourStroke()
BasicStroke
.null
if the half hour grid lines will not
be stroked.setHalfHourStroke(java.awt.Stroke)
public void setHalfHourStroke(Stroke stroke)
stroke
- The stroke style, or null
to indicate that the half hour grid
lines will not be stroked.getHalfHourStroke()
public IlvActivityCalendarRenderer getActivityRenderer()
setActivityRenderer(ilog.views.gantt.swing.calendarview.IlvActivityCalendarRenderer)
public void setActivityRenderer(IlvActivityCalendarRenderer activityRenderer)
activityRenderer
- The activity renderer.getActivityRenderer()
public IlvMilestoneCalendarRenderer getMilestoneRenderer()
setMilestoneRenderer(ilog.views.gantt.swing.calendarview.IlvMilestoneCalendarRenderer)
public void setMilestoneRenderer(IlvMilestoneCalendarRenderer milestoneRenderer)
milestoneRenderer
- The milestone renderer.getMilestoneRenderer()
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- The graphics context.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.