Software
EPL LICENSE
|
|||||||||||||
External SiteThis widget is under the Eclipse Nebula project, which is a group of custom written widgets that are not part of the standard SWT api but perhaps aim to be so in the future. This site contains more information and also example snippets that are very useful to understanding how to use the widget. Please visit the Nebula homepage for more information. | |||||||||||||
LicenseThe Calendar Combo is released under the EPL (Eclipse Public License). It is imperetive that you understand what this license allows you to do. If you do not know what this license entails, please read the full license here: | |||||||||||||
DownloadNightly builds for JAR's, source and API.
| |||||||||||||
ScreenshotsThe following screenshots show a glimpse of the many different possible ways to create a GANTT chart.
| |||||||||||||
UsageSnippetsPlease view this page for example snippets that are ready to run and will help get you going:
DocumentationUsing the widget is very easy as it is a normal composite at the root level - that is then wrapped inside two more composites for providing scrollbars and optional extra features. But in the root, it's a control that can exist anywhere any other SWT control can exist.
Normal Creation
GanttChart ganttChart = new GanttChart(parent, SWT.NONE)
Adding Gantt Chart Events
All events are GanttEvents regardless of type (normal, checkpoint, scopes, etc). There are a few different constructors for GanttEvents, depending on what type you are creating (types may be changed on the fly as well). To create your typical normal event that can be resized, moved, etc, here is how it's done:
// make a 10 day long event
Revised dates are simply an indication that an event didn't start and/or end on the initially set start and/or end dates. You may set revised dates when creating a GanttEvent if you already know what they are, and you may also set them later on. By default, the widget will draw lines (when the user requests to do so) showing what the revised start and end dates are. The start date is drawn in a different color than the end date. Please see screenshot #4 above for a reference. To set the revised dates when the GanttEvent is created, here is an example:
// make a 10 day long event
// set revised dates
Setting an event to be a checkpoint is simply a flag. Even checkpoints can span over more than one day (despite by nature having a definition as existing only on one day, which you can control should you not like it).
ganttEvent.setCheckpoint(true);
Then voila, the event is now a checkpoint. Note: A checkpoint - by definition - is a point in time on which you check something (a project, a task or similar). There is nothing in the code preventing you from treating checkpoints in any way you prefer (in fact, the code supports it). But ideally they should be 1 day long.
Scopes are slighly more complex than checkpoints, however, not overly so. The idea behind a scope is that it is linked to n number of events and its visibility, size, percentage complete, etc - is dependent on the events that it is linked to.
GanttEvent scope = new GanttEvent(ganttChart, null, "Scope for events: ge, ge2, ge3");
Should you wish to change an event on the fly to become a scope, or you wish to use a different constructor than above, you can change the type by using the following code:
ganttEvent.setScope(true);
It's also possible to add events that are simply image representations. You may change an event on the fly to become an image representation via two methods, or you can do it when constructing the GanttEvent. Here's an example of both:
GanttEvent iEvent = new GanttEvent(null, "Image", ImageCache.getImage("/picture.gif"));
iEvent.setImage(true);
A dependency is one event that is linked to another. There are a few features built-in for dependent events, but they are only as linked as you want them to be. The only thing the Gantt Widget will do for you is the following: » Draw lines and arrows (depending on possible customized settings) will be drawn between events. » Linked events will be moved together (assuming DND is enabled) if the shift key is held down when moving an event with dependencies. » If A depends on B, and B depends on C, and C depends on A (infinite loop), this is OK! Such links are fully supported (even if they are illogical). Creating the links themselves is very easy. Here is some example code that will be very self-explanatory. Assume we have events "ge" and "ge2". "ge2" is dependent on "ge".
// create dependency
That is truly everything you have to do. Dependencies may be modified on the fly.
Changing Event Colors
To change the color of an event, there are two methods (you may also control other properties via overriding the default color settings). One controls the foreground, and one controls the background. Both are used for drawing events in a gradient way, or only one if the gradient feature is turned off.
// set plain color and gradient color.
| |||||||||||||
Listening to EventsListening to events is very easy. The IGanttEventListener lets you listen to everything that happens to an event.IGanttEventListener
There is also an adapter if you don't want to implement all the methods for each listener you are introducing. The adapter is called | |||||||||||||
AdvancedThere are many things that can be customized. Almost everything can be changed if you're willing to do some dirty work. 3 main interfaces control most of the visual aspects of the GANTT Widget. They are:
» IColorManager » IPaintManager » ILanguageManager Legend
» The name inside the [brackets] is the name of the default class implementing the interface. » The name inside the (parenthesis) is the name of the abstract class. ISettings [DefaultSettings] (AbstractSettings) This interface is probably the most likely that you will be implementing on your own. Each method has a JavaDoc entry. Mainly this interface controls pixel values (widths, heights, multipliers) and various boolean flags (if events can be moved, resized, etc). All in all there are about 30-40 methods.
This interface controls all colors used for drawing everything on the chart. By overriding any methods here, you can control everything from line colors to text colors.
This interface is one you want to use if you want to dig really deep into how things are drawn. This class by default controls exactly how an event is represented visually, pixel by pixel. If you don't like the look of a certain object on the chart, this is the interface you will want to implement. ILanguageManager [DefaultLanguageManager] (AbstractLanguageManager) This interface is for changing the default "English" language strings used throughout the application, to internationalize or simply to change the defaults.
| |||||||||||||


















