ilog.views.gantt
Class IlvHierarchyChart

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by ilog.views.gantt.IlvHierarchyChart
All Implemented Interfaces:
IlvTimeScrollable, IlvVerticalScrollable, IlvAcceptFunctions, IlvStylable, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
IlvGanttChart, IlvScheduleChart

public class IlvHierarchyChart
extends JPanel
implements IlvTimeScrollable, IlvVerticalScrollable, IlvStylable, IlvAcceptFunctions

The IlvHierarchyChart class is the base class for IlvGanttChart and IlvScheduleChart. The left part of the chart is an IlvJTable that displays the activities or resources of a given IlvGanttModel as a tree structure. The right part of the chart is an IlvGanttSheet showing activities or reservations.

The Hierarchy chart supports alternate locales by utilizing resource files. The resource files are documented here.

Two horizontal time scrolling modes are supported by the chart:

The following default keyboard actions are installed on the chart and its sub-components by default:

Action KeyStroke Component Condition
Zoom In Control-Z Chart WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
Zoom Out Control-U Chart WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
Scroll Up Up Arrow Right Gantt Panel WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
Scroll Down Down Arrow Right Gantt Panel WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
Scroll Time Left Left Arrow Right Gantt Panel WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
Scroll Time Right Right Arrow Right Gantt Panel WHEN_ANCESTOR_OF_FOCUSED_COMPONENT

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int HORIZONTAL
          Horizontal orientation.
static int ROW_VERTICAL_SCROLL
          The scrolling mode that indicates that vertical scrolling will occur by rows.
static KeyStroke SCROLL_TIME_LEFT_KEYSTROKE
          The default left-arrow KeyStroke that is used to register the scroll-time-left action with the right Gantt panel when the chart is created.
static KeyStroke SCROLL_TIME_RIGHT_KEYSTROKE
          The default right-arrow KeyStroke that is used to register the scroll-time-right action with the right Gantt panel when the chart is created.
static KeyStroke SCROLL_VERTICAL_DOWN_KEYSTROKE
          The default down-arrow KeyStroke that is used to register the scroll-down action with the right Gantt panel when the chart is created.
static KeyStroke SCROLL_VERTICAL_UP_KEYSTROKE
          The default up-arrow KeyStroke that is used to register the scroll-up action with the right Gantt panel when the chart is created.
static int SMOOTH_VERTICAL_SCROLL
          The scrolling mode that indicates that vertical scrolling will occur smoothly by pixels.
static String TIME_CONVERTER_PROPERTY
          Identifies a change to the time converter of the chart.
static int VERTICAL
          Vertical orientation.
static int VERTICAL_SCROLLBAR_ALWAYS
          The vertical scroll bar will always be displayed.
static int VERTICAL_SCROLLBAR_AS_NEEDED
          The vertical scroll bar will be displayed as needed.
static int VERTICAL_SCROLLBAR_NEVER
          The vertical scroll bar will never be displayed.
static KeyStroke ZOOM_IN_KEYSTROKE
          The default Control-Z KeyStroke that is used to register the zoom-in action with the chart when the chart is created.
static KeyStroke ZOOM_OUT_KEYSTROKE
          The default Control-U KeyStroke that is used to register the zoom-out action with the chart when the chart is created.
 
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 ilog.views.util.styling.IlvStylable
APPLIED_RULE_MASK, BAD_CLASS_MASK, BAD_PROP_MASK, BAD_PROP_WITH_STACK_MASK, CREATED_MASK, DECL_MASK, DECL_VALUE_MASK, FAILED_CONVERSIONS_MASK, TIME_REPORT_MASK, WARNING_PROP_MASK
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlvHierarchyChart(int rowType)
          Creates a new IlvHierarchyChart.
 
Method Summary
 void addChartDividerListener(ChartDividerListener aListener)
          Adds the specified listener to receive divider events from this chart.
 void addGanttModelListener(GanttModelListener listener)
          Adds the specified listener to receive notifications when this chart's Gantt model has been changed.
 void addHeaderListener(HeaderListener listener)
          Adds the specified listener for receiving header change events from this chart.
 void addSelectionListener(SelectionListener listener)
          Adds the specified listener to receive selection events from this chart.
 void addTimeScrollListener(TimeScrollListener listener)
          Adds the specified listener to receive time scroll events from this chart.
 void addVerticalExpansionListener(VerticalExpansionListener listener)
          Adds the specified listener to receive vertical expansion events from this chart.
 void addVerticalScrollListener(VerticalScrollListener listener)
          Adds the specified listener to receive vertical scroll events from this chart.
 void collapseRow(IlvHierarchyNode row)
          Ensures that the specified row is collapsed.
 int computeVerticalScrollPosition(int rowDelta)
          Returns the position that will cause the chart to scroll by the specified number of rows up or down.
protected  IlvJTableColumn[] createDefaultTableColumns()
          Creates the default table columns for the chart.
 void deSelectAllRows()
          Deselects all of the currently selected rows.
 void expandAllRows()
          Ensures that all rows in the chart are expanded and visible.
 void expandAllRows(IlvHierarchyNode row)
          Ensures that the specified row and all of its children are expanded and visible.
 void expandRow(IlvHierarchyNode row)
          Ensures that the specified row is expanded and visible.
 ActionListener getActionForGanttPanelKeyStroke(KeyStroke aKeyStroke)
          Returns the object that will perform the action registered with the right Gantt panel.
 ActionListener getActionForTablePanelKeyStroke(KeyStroke aKeyStroke)
          Returns the object that will perform the action registered with the left table panel.
 IlvActivityFactory getActivityFactory()
          Returns the activity factory used for creating activities.
 IlvActivityRendererFactory getActivityRendererFactory()
          Returns the activity-renderer factory used to create activity graphics.
 IlvGanttComponentManager getComponentManager()
          Returns the component manager that is coordinating the scrolling, row expand/collapse, and selection behaviors for the chart's UI components.
 int getConditionForGanttPanelKeyStroke(KeyStroke aKeyStroke)
          Returns the condition code for the action that is registered with the right Gantt panel for the specified keystroke.
 int getConditionForTablePanelKeyStroke(KeyStroke aKeyStroke)
          Returns the condition code for the action that is registered with the left table panel for the specified keystroke.
 IlvConstraintFactory getConstraintFactory()
          Returns the constraint factory used for creating constraints.
 IlvConstraintGraphicFactory getConstraintGraphicFactory()
          Returns the constraint-graphics factory used to create constraint graphics.
 IlvHierarchyNode getDisplayedRowAtPosition(int position)
          Returns the row at the specified vertical position relative to the display area.
 int getDisplayedRowIndexAtPosition(int position)
          Returns the row index at the specified vertical position relative to the display area.
 Border getDividerBorder()
          Deprecated. Beginning with ILOG JViews 6.0 you should use the getInsideBorder() method instead.
 int getDividerLocation()
          Returns the location of the divider as the number of pixels from the left side of the chart.
 int getDividerSize()
          Returns the size of the divider in pixels.
 IlvGanttModel getGanttModel()
          Returns the Gantt data model for the hierarchy chart.
 IlvGanttSheet getGanttSheet()
          Returns the Gantt sheet displaying the activities or the reservations.
 Color getGanttSheetBackground()
          Returns the background color of the Gantt sheet.
 int getHeaderHeight()
          Returns the header height of the time scale for synchronization.
 Border getInsideBorder()
          Returns the inside border of the chart.
 int getMaxVerticalPosition()
          Returns the maximum vertical position that the chart can display.
 Date getMaxVisibleTime()
          Returns the maximum time that the chart can show in bounded scrolling mode.
 int getMinimumGanttSheetWidth()
          Returns the minimum width of the Gantt sheet.
 int getMinimumTableWidth()
          Returns the minimum width of the table.
 Date getMinVisibleTime()
          Returns the minimum time that the chart can show in bounded scrolling mode.
 int getMouseWheelPreferredOrientation()
          Returns the preferred orientation of scrolling by the mouse wheel, either VERTICAL or HORIZONTAL.
 URL getProject()
          Returns the project file URL loaded by this chart.
 KeyStroke[] getRegisteredGanttPanelKeyStrokes()
          Returns the KeyStroke s that are registered with the right Gantt panel to initiate actions.
 KeyStroke[] getRegisteredTablePanelKeyStrokes()
          Returns the KeyStroke s that are registered with the left table panel to initiate actions.
 IlvReservationFactory getReservationFactory()
          Returns the reservation factory used for creating reservations.
 IlvResourceFactory getResourceFactory()
          Returns the resource factory used for creating resources.
 IlvHierarchyNode getRootRow()
          Returns the root row of the displayed hierarchy chart or null if the hierarchy chart has no rows.
 int getRowHeight()
          Returns the row height used when all rows in the chart are set to have the same height.
 int getRowHeight(IlvHierarchyNode row)
          Returns the height of the specified row.
 int getRowType()
          Returns an int representing the type of the rows in the hierarchy chart.
 IlvTimeScrollAction getScrollTimeLeftAction()
          Returns the scroll-time-left action that is registered by default on the right Gantt panel with the left-arrow keystroke.
 IlvTimeScrollAction getScrollTimeRightAction()
          Returns the scroll-time-right action that is registered by default on the right Gantt panel with the right-arrow keystroke.
 IlvVerticalScrollAction getScrollVerticalDownAction()
          Returns the vertical-scroll-down action that is registered by default on the right Gantt panel with the down-arrow keystroke.
 IlvVerticalScrollAction getScrollVerticalUpAction()
          Returns the vertical-scroll-up action that is registered by default on the right Gantt panel with the up-arrow keystroke.
 IlvConstraint[] getSelectedConstraints()
          Returns the constraints that are selected in the chart.
 IlvGraphic[] getSelectedGraphics()
          Returns the selected graphics in the Gantt sheet.
 IlvHierarchyNode[] getSelectedRows()
          Returns the rows that are selected in the chart.
 String getStyleSheet()
          Returns the first of the Cascading Style Sheets for the chart.
 int getStyleSheetDebugMask()
          Returns the current debug level, expressed as an OR combination of the predefined flags: IlvStylable.APPLIED_RULE_MASK IlvStylable.BAD_CLASS_MASK IlvStylable.BAD_PROP_MASK IlvStylable.CREATED_MASK IlvStylable.DECL_MASK IlvStylable.DECL_VALUE_MASK IlvStylable.FAILED_CONVERSIONS_MASK IlvStylable.TIME_REPORT_MASK IlvStylable.WARNING_PROP_MASK
 String[] getStyleSheets()
          Returns the chart's Cascading Style Sheets.
 String getStyleSheets(int index)
          Returns one of the chart's Cascading Style Sheets.
 ilog.views.gantt.styling.IlvGanttCSSManager getStylingManager()
          Returns the styling manager for this chart.
 IlvJTable getTable()
          Retrieves the IlvJTable used to display the activity or resource hierarchy in a Gantt model.
 Color getTableBackground()
          Returns the background color of the table.
 Font getTableFont()
          Returns the font used in the table.
 Color getTableForeground()
          Returns the foreground color of the table.
 Color getTableGridColor()
          Returns the color of the table grid.
 Color getTableHeaderBackground()
          Returns the background color of the table header.
 Font getTableHeaderFont()
          Returns the font of the table header.
 Color getTableHeaderForeground()
          Returns the foreground color of the table header.
 IlvTimeConverter getTimeConverter()
          Returns the time converter used by the Gantt sheet and the time scale.
 IlvTimeScale getTimeScale()
          Returns the time scale.
 Color getTimeScaleBackground()
          Returns the background color of the time scale.
 Font getTimeScaleFont()
          Returns the font of the time scale.
 Color getTimeScaleForeground()
          Returns the foreground color of the time scale.
 IlvTimeScrollBar getTimeScrollBar()
          Returns the horizontal time scroll bar.
 int getVerticalExtent()
          Returns the extent of the vertical range displayed by the chart.
 int getVerticalPosition()
          Returns the beginning of the vertical range displayed by the chart.
 int getVerticalScrollBarPolicy()
          Returns the vertical scroll bar policy.
 int getVerticalScrollMode()
          Returns the interactive vertical scrolling mode.
 IlvDuration getVisibleDuration()
          Returns the duration of the time interval displayed by the chart.
 IlvTimeInterval getVisibleInterval()
          Returns the time interval displayed by the chart.
 int getVisibleIntervalAnimationSteps()
          Returns the number of steps in the animation of changes to the visible interval of the chart.
 IlvHierarchyNode getVisibleRow(int rowIndex)
          Returns the row that is visible on the specified row index.
 IlvHierarchyNode getVisibleRowAtPosition(int position)
          Returns the row at the specified vertical position , relative to the first visible row at position = 0.
 Rectangle getVisibleRowBounds(IlvHierarchyNode row)
          Returns the vertical bounds of the specified row as the y and height fields of a rectangle.
 Rectangle getVisibleRowBounds(int row)
          Returns the vertical bounds of the specified row as the y and height fields of a rectangle.
 int getVisibleRowCount()
          Returns the number of rows that are currently visible.
 int getVisibleRowIndex(IlvHierarchyNode row)
          Returns the row index that the specified row is displayed on.
 int getVisibleRowIndexAtPosition(int position)
          Returns the row index at the specified vertical position , relative to the first visible row at position = 0.
 Date getVisibleTime()
          Returns the beginning of the time interval displayed by the chart.
 IlvZoomInAction getZoomInAction()
          Returns the zoom-in action that is registered by default on the chart with the Control-Z keystroke.
 IlvZoomOutAction getZoomOutAction()
          Returns the zoom-out action that is registered by default on the chart with the Control-U keystroke.
 boolean isConstantZoomFactorOnWidthChange()
          Returns whether the visible duration of the chart will be modified when its width changes in order to maintain a constant zoom factor.
 boolean isConstraintLayerVisible()
          Returns whether the constraint graphic layer is visible in the Gantt sheet.
 boolean isDisplayingConstraints()
          Returns whether the Gantt sheet is displaying constraints.
 boolean isDividerOneTouchExpandable()
          Returns whether the divider should provide a UI widget to expand or collapse the divider quickly.
 boolean isDividerOpaqueMove()
          Returns whether the divider is in Opaque Move mode or not.
 boolean isFixedRowHeight()
          Returns whether all rows in the chart are set to have the same fixed height.
 boolean isGanttSheetToolTipsEnabled()
          Returns true if tooltips are enabled for the Gantt sheet.
 boolean isGanttSheetVisible()
          Specifies whether the Gantt sheet is visible.
 boolean isGraphicSelected(IlvGraphic graphic)
          Returns whether the specified graphic is currently selected in the Gantt sheet.
 boolean isHorizontalScrollBarVisible()
          Returns the visibility status of the horizontal scroll bar.
 boolean isMouseWheelEnabled()
          Indicates whether or not scrolling and zooming will take place in response to movement of the mouse wheel.
 boolean isMultipleRowActivityGraphicsEnabled()
          Returns whether activity graphics are allowed to be drawn over multiple rows.
 boolean isRowExpanded(IlvHierarchyNode row)
          Returns whether the specified row is currently expanded.
 boolean isRowSelected(IlvHierarchyNode row)
          Returns whether the specified row is selected.
 boolean isRowVisible(IlvHierarchyNode row)
          Returns whether the specified row is visible.
 boolean isSelectionAdjusting()
          Returns whether we are currently selecting or deselecting a series of objects.
 boolean isTableVisible()
          Specifies whether the hierarchy table is visible.
 void makeRowDisplayed(IlvHierarchyNode row)
          Ensures that the specified row is displayed.
 void makeRowVisible(IlvHierarchyNode row)
          Ensures that the specified row is visible.
 void registerFunction(IlvCSSFunction function)
          Registers another function in the Cascading Style Sheets engine.
 void registerGanttPanelKeyboardAction(ActionListener anAction, KeyStroke aKeyStroke, int aCondition)
          Registers a new keyboard action with the right panel of the chart.
 void registerTablePanelKeyboardAction(ActionListener anAction, KeyStroke aKeyStroke, int aCondition)
          Registers a new keyboard action with the left panel of the chart.
 void removeChartDividerListener(ChartDividerListener aListener)
          Removes the specified listener so that it no longer receives divider events from this chart.
 void removeGanttModelListener(GanttModelListener listener)
          Removes the specified listener so that it will no longer receive notifications when this chart's Gantt model has been changed.
 void removeHeaderListener(HeaderListener listener)
          Removes the specified listener so that it no longer receives header change events from this chart.
 void removeSelectionListener(SelectionListener listener)
          Removes the specified listener so that it will no longer receive selection events from this chart.
 void removeTimeScrollListener(TimeScrollListener listener)
          Removes the specified listener so that it will no longer receive time scroll events from this chart.
 void removeVerticalExpansionListener(VerticalExpansionListener listener)
          Removes the specified listener so that it will no longer receive vertical expansion events from this chart.
 void removeVerticalScrollListener(VerticalScrollListener listener)
          Removes the specified listener so that it will no longer receive vertical scroll events from this chart.
 void select(IlvConstraint constraint, boolean selected)
          Selects or deselects a constraint.
 Iterator selectedGraphicsIterator()
          Returns an iterator over the currently selected graphics in the Gantt sheet.
 Iterator selectedRowsIterator()
          Returns an iterator over the rows that are selected in the chart.
 void selectRow(IlvHierarchyNode row, boolean selected)
          Selects or deselects the specified row.
 void selectRow(int index, boolean selected)
          Selects or deselects the row having the specified index.
 void setActivityFactory(IlvActivityFactory factory)
          Sets the activity factory for creating activities.
 void setActivityRendererFactory(IlvActivityRendererFactory factory)
          Sets the activity-renderer factory used to create activity graphics.
 void setConstantZoomFactorOnWidthChange(boolean enabled)
          Sets whether the visible duration of the chart will be modified when its width changes in order to maintain a constant zoom factor.
 void setConstraintFactory(IlvConstraintFactory factory)
          Sets the constraint factory for creating constraints.
 void setConstraintGraphicFactory(IlvConstraintGraphicFactory factory)
          Sets the constraint-graphics factory used to create constraint graphics.
 void setConstraintLayerVisible(boolean visible)
          Specifies whether the constraint graphic layer should be visible in the Gantt sheet.
 void setDisplayingConstraints(boolean enable)
          Sets whether the Gantt sheet is displaying constraints.
 void setDividerBorder(Border border)
          Deprecated. Beginning with ILOG JViews 6.0 you should use the setInsideBorder(javax.swing.border.Border) method instead.
 void setDividerLocation(int location)
          Sets the location of the divider as the number of pixels from the left side of the chart.
 void setDividerOneTouchExpandable(boolean newValue)
          Sets whether the divider should provide a UI widget to expand or collapse the divider quickly.
 void setDividerOpaqueMove(boolean opaqueMove)
          Sets whether the divider is in Opaque Move mode.
 void setDividerSize(int size)
          Sets the size of the divider.
 void setGanttModel(IlvGanttModel ganttModel)
          Sets the data model for the hierarchy chart.
 void setGanttSheetBackground(Color color)
          Sets the background color of the Gantt sheet.
 void setGanttSheetToolTipsEnabled(boolean enable)
          Sets whether tooltips are enabled for the Gantt sheet.
 void setGanttSheetVisible(boolean visible)
          Sets the visibility of the Gantt sheet.
 void setHorizontalScrollBarVisible(boolean visible)
          Sets the visibility status of the horizontal scroll bar.
 void setInsideBorder(Border border)
          Sets the inside border of the chart.
 void setMaxVerticalPosition(int max)
          Sets the maximum vertical position that the chart can display.
 void setMaxVisibleTime(Date max)
          Sets the maximum time that the chart can show in bounded scrolling mode.
 void setMinimumGanttSheetWidth(int minimumWidth)
          Sets the minimum width of the Gantt sheet to a constant value.
 void setMinimumTableWidth(int minimumWidth)
          Sets the minimum width of the table to a constant value.
 void setMinVisibleTime(Date min)
          Sets the minimum time that the chart can show in bounded scrolling mode.
 void setMouseWheelEnabled(boolean handleWheel)
          Enables/disables scrolling and zooming in response to movement of the mouse wheel.
 void setMouseWheelPreferredOrientation(int orientation)
          Sets the preferred orientation of scrolling by the mouse wheel, either VERTICAL or HORIZONTAL.
 void setMultipleRowActivityGraphicsEnabled(boolean enable)
          Enables or disables the capability of activity graphics drawing over multiple rows.
 void setProject(URL project)
          Sets the project file URL of this chart.
 void setReservationFactory(IlvReservationFactory factory)
          Sets the reservation factory for creating reservations.
 void setResourceFactory(IlvResourceFactory factory)
          Sets the resource factory for creating resources.
 void setRowHeight(IlvHierarchyNode row, int rowHeight)
          Sets the height of the specified row.
 void setRowHeight(int rowHeight)
          Sets all rows in the chart to have the same height.
 void setSelectionAdjusting(boolean selectionAdjusting)
          Starts a series of selection events.
 void setStyleSheet(String styleSheet)
          Sets the first style sheet for the chart.
 void setStyleSheetDebugMask(int mask)
          Sets the debug level while parsing the style sheets.
 void setStyleSheets(int index, String css)
          Changes one of the Cascading Style Sheets for the chart.
 void setStyleSheets(String[] css)
          Sets the Cascading Style Sheets for the chart.
 void setTableBackground(Color color)
          Sets the background color of the table.
 void setTableFont(Font font)
          Sets the font used in the table.
 void setTableForeground(Color color)
          Sets the foreground color of the table.
 void setTableGridColor(Color color)
          Sets the color of the table grid.
 void setTableHeaderBackground(Color color)
          Sets the background color of the table header.
 void setTableHeaderFont(Font font)
          Sets the font of the table header.
 void setTableHeaderForeground(Color color)
          Sets the foreground color of the table header.
 void setTableVisible(boolean visible)
          Sets the visibility of the hierarchy table.
 void setTimeConverter(IlvTimeConverter timeConverter)
          Sets the time converter used by the Gantt sheet and the time scale.
 void setTimeScale(IlvTimeScale timeScale)
          Sets the time scale.
 void setTimeScaleBackground(Color color)
          Sets the background color of the time scale.
 void setTimeScaleFont(Font font)
          Sets the font of the time scale.