Policies
Visual appearance and editing capabilities are the two most common extension and customization points provided by basic user interface frameworks. More complex and advanced frameworks also add the ability to influence the behaviour of its components via policies. Policies are used to make decisions in various situations that can be very different in nature. It is important for policies to focus on a single aspect of an application, for example the drag & drop behaviour of timeline objects, otherwise they would easily become unmanageable.
Several components such as the tree table or the layer container own a policy provider object that can be used to retrieve policy implementations based on policy interfaces. Applications can register their own policy implementations with these providers in order to adjust the framework behaviour to their needs.
IStatusBarPolicy Gantt Chart
The status bar can display many information fields. Not all of them are needed by every application. The policy can be used to control which one of them will be shown. Some of the fields display time information such as the time located at the current mouse cursor postion or the time span of the timeline object over which the mouse cursor currently hovers. The text showing the time is application specific (especially dependent on the currently used dateline model) and will be returned by the policy.
ITimeGranularityZoomPolicy Dateline
If the dateline uses a model that is based on time granularities such as hours, minutes, seconds, then this policy can be used to control the dateline‘s zoom behaviour. It specifies which granularities are supported and which granularity will be shown next when the user decides to zoom in or out.
ISimpleGranularityZoomPolicy Dateline
If the dateline uses a model that is based on simple granularities such as one, hundred, thousand, ten thousand, then this policy can be used to control the dateline‘s zoom behaviour. It specifies which granularities are supported and which granularity will be shown next when the user decides to zoom in our out.
IDragAndDropPolicy Layer Container
In order to assign a timeline object to a new hierarchy node they need to be dragged by the user from one row to another row. The drag and drop policy controls which timeline objects can be dragged at all and where they can be dragged to. This behaviour is extremely dependent on the type of the application and often also dependent on the current state of the application.
IDragInfoPolicy Layer Container
A small window appears when timeline objects are being dragged from one time span to another or from one row to another. The content of this window is being rendered by a renderer. The input for the renderer is looked up from the drag info policy.
IEditTimelineObjectPolicy Layer Container
Several different editing operations can be performed on timeline objects. Which ones of these are available for a particular timeline object is being determined by the timeline object editing policy. Questions answered by the policy are: is the timeline object deletable, is its start time changeable, its duration, its node, etc. Additionally the policy returns the appropriate command objects that will perform the actual changes on the timeline object.
IEditActivityObjectPolicy Layer Container
Activity objects have a property called ‚percentage complete‘. The activity object policy determines whether this value can be changed by the user and which command will be used to perform the actual change.
IEditCapacityObjectPolicy Layer Container
Capacity objects have a property called ‚capacity‘. The capacity object policy determines whether this value can be changed by the user and which command will be used to perform the actual change.
IEditLayerPolicy Layer Container
Timeline object layers can be added and removed from the layer container. The commands for these operations are returned by the layer editing policy.
IGridLinePolicy Layer Container
The Gantt chart supports several different modes when it comes to drawing grid lines. It can display minor grid lines or major grid lines or both at the same time. However, depending on the dateline model used, the use of a combined grid (minor and major visible at the same time) does not always make sense. Even if the currently used grid mode requires it. The grid line policy can be used for fine-tuning the appearance of the grid lines. Example: when the dateline displays standard time granularities, the major time spans are months and the minor time spans are 14 days then the major and minor grid lines get out-of-sync and might get drawn more or less close to each other. This causes the grid to look erratic and simply not nice.
IGridPolicy Layer Container
Many applications want to assist the user when dragging timeline objects. For example to ensure that a dropped object always starts on the hour or at the beginning of a day. The grid policy can be used for this. It converts given time points to such time points that match certain criteria.
ILabelPolicy Layer Container
In a Gantt chart labels are used in various places. Timeline objects can have a name (but don‘t have to), a description drawn to their right, a tooltip, etc... The label policy is used for looking up labels for different types / situations.
IOverviewPolicy Layer Container
The overview feature renders a miniature Gantt chart where each row is one pixel high and timeline objects are drawn as a simple line. To add value to this overview panel it is neccessary to color these lines and also display icons depending on the status of a timeline object (e.g. violated scheduling constraints cause the lines to be drawn in red). The overview policy is used by the overview panel to lookup a status object for a given timeline object. The status object is then mapped to a color and / or icon, which are then drawn in the panel.
IPopupPolicy Layer Container
A popup window is a small window shown inside the layer container that is commonly used to display detailed information about a timeline object (one can think of it as an advanced tooltip). The popup gets drawn by popup renderers that are mapped to popup values. These values are looked up from the popup policy.
IRelationshipPolicy Layer Container
Timeline objects can have relationships with each other. These are often used to express constraints that exist between them (ends-before, starts-after, same-start, ...). The relationship policy is used to determine if an object can be used as the source of a relationship or as a target. If so then the user can interactively create a relationship. The policy also returns the appropriate command to create the relationship in the model.
ISelectionPolicy Layer Container
The user can select timeline object and time spans inside the Gantt chart. Whether a timeline object or a time span is selectable at all gets determined by querying the selection policy.
ICrosshairPolicy Layer Container
A crosshair can be shown by the Gantt chart at the location of the mouse cursor. Details about the location are shown in the four corners of the crosshair. The details are looked up from the crosshair policy.
ILinePolicy Layer Container
Many applications have the problem that their timeline objects can overlap each other. In order to make them all completely visible it is necessary to draw them on top of each other. This feature is supported by FlexGantt and expressed in the line policy. The policy returns an ‚inner line‘ count for a given row. The line count should be equal to the maximum number of timeline objects overlapping each other. The policy also returns the height and the location of any of these inner lines within their ‚parent‘ row.
IEditEventlineObjectPolicy Eventline
Eventline objects are similar to timeline objects, except that they are placed on the eventline. Object are placed on the eventline if they can not be directly assigned to a specific hierarchy node. Just like timeline objects they can also be edited. They can be deleted, their duration and their start time can be changed. These editing operations are supported by the eventline object edit policy.
IEventlineLabelPolicy Eventline
Eventline objects can be labeled in the same way that timeline objects can be labeled. The labels themselves are looked up from the label policy.
INodeDragAndDropPolicy Tree Table
Hierarchy / tree nodes can be dragged and dropped. The node drag and drop policy controls this operation. It determines which nodes are draggable and where they can be dropped. It also returns the command needed to perform the neccessary changes in the model.
INodeEditPolicy Tree Table
Hierarchy / tree nodes can be edited in many ways. Their key and their values can be changed, they can be deleted or created, they can be selected. The availability of each of these operations is determined by the node edit policy.
IRowPolicy Tree Table
The tree table supports different heights for each row. How high a row is, what its minimum and maximum height is, and whether the row can be resized all gets determined by the row policy. The policy also returns a command that will perform the actual row height change when a row gets resized.
