Skip to main content
Wikispaces Classroom is now free, social, and easier than ever.
Try it today.
Pages and Files
Creating a table
Creating a toolbar
Creating a timeline
Using a TableModel
Todo List - Please Help
To keep this simple only terminology that has perticular relevance to the library is included; this assumes the reader has familiarity with Java, AWT and Swing.
This page unfortunately is still a work-in progress
The Cell Editor provides an abstraction layer around the JTableCellEditor specification this allows for E-Gantt in future to not be dependent on the Swing JTable.
E-Gantt provides a wrapper class
for this purpose.
The Cell Renderer interface provides an abstract layout from the JTableCellRedender implementation see
E-Gantt provides a wrapper class
The CellState is a transient data class which contains all the values passed in from the JTable during cell rendering this data includes the JTable component, Value or DrawingState, rowNumber, column number and is this row selected.
The base component for all things "Swing", legacy AWT wigits extend the Component
This is the Swing implementation of a table, the swing table conforms to the Model View Controller pattern for components.
It consists of:
JTableModel - A Table Model - the data behind the table this contains the actual values stored as rows / columns
JTable - The Actual Component
JTableColumnModel - A view to which columns the table will renderer this must match with the JTableModel
CellRenderer - A component for rendering the contents of column
CellEditor - A Component for editing the contents of the column, "these are not present by default"
This is E-GANTT's version of the JTable "actually it is a wrapper for the table(s)". The wrapper is used to make using the library a lot easier by taking away the need for the user to strap E-GANTT to a table we have done this for you.
The Gantt Table implements the most needed methods of the JTable component and provides accesing to the underlying tables themselves for methods that we have not yet dealt with.
The Drawing Axis is a model it represents a graph axis it is comprised of an
Orientation - either horizontal or vertical
AxisInterval - The furtherest limits the axis can reach i.e the start and end poing
The Interval for the axis is not fixed in fact it can be changed dynamically the DrawingAxis provides listeners for the purpose so that the diagram will know you have increased or reduced these and so will any parts of your application which are registered.
Drawing Component Painter
The Component painter is delegated all responsibility for drawing from the
these have a 1-1 relationship.
It's role is to find out which
(layers) are required to be drawn and which
(renderer) is used to draw it.
The mechanism uses the following information:
to return the list of drawing parts available
DrawingPart.getPainter() to return the identifier of the Painter to be used
to get the painter
The painter will iterate through each part in the
for each part:
Get the identifier to the part painter
Retrieve the part painter from context
Invoke the part-painter with the part and as much information as available
Drawing Component 2D
The Drawing Component is the Java2D implementation of the DrawingComponent interface see
The drawing component is the actual component which appears inside the table cell renderer / editor it is therefore responsible for all of the Drawing with-in E-Gantt.
The Drawing Component largely delegates all responsibility for Drawing to the
however it does maintain the remaining responsiblities of being a component.
Support for Tooltips
Managing the off-screen graphics support
Drag 'n' Drop to be done
A Granularity is a drawable view on a series of data it uses a transform to help calculate the best level of the series to draw.
This is a configuration of settings that can be loaded in to the E-Gantt application these modules control the instanatiation of the Painters and Graphics Contexts.
A Drawing module will typically only load settings into the DrawingContext which your application can choose to link to by specifying the appropriate keys in the DrawingState / DrawingPart
Drawing Part (E-GANTT)
The drawing part is the data layer with-in egantt, you can have multiple Drawing Parts with-in a drawing state.
The concept is to specify the values and data-types with-in the model but leaving the rendering to the table.
It contains the following information:
String : Which Axises it should be rendered against
Map [Object, Interval] A unique map of Key to Interval
Object 1 - 1] An identifier for the PartPainter to use for this Drawing Part.
Painter for the Interval with-in the DrawingPart
PainterState for the Interval with-in the DrawingPart
DrawingContext for the Interview with-in the DrawingPart
The Drawing State is the model for the entire drawing, when E-GANTT is used with-in a table this is typically a per cell basis.
The contents of a DrawingState is an ordered list of Drawing Parts, the ordering indicates which is drawn first or "Z-Level". The DrawingState provides listeners which can be used to notify when the Drawing changes.
This should notify when either the state changes or any underlying parts that it refers to .
The Drawing Context is the settings for the actual drawing, if you were to compare E-GANTT with swing it would be the equivilant of the UIManager to use (but hopefully a bit more freindlier).
The DrawingContext will contain:
All of the painters
All of the paints
All of the axises
Effectively any static data which will infrequently change unlike the model
The Drawing Transform is the Coordinate Converter, this is used for converting between real values and screen coordinates and vice-versa.
The Drawing Transforms role is to make it easier to convert between these it is possible to get a DrawingTransform from either an Axis or an AxisInterval.
The Graphics Manager has two purposes to simplify the off-screen drawing process and to reduce the overhead of this.
The View Manager is used to manage the current visable extent of the Gantt Component. This is required for using the zooming and scrolling mechanism of the chart.
help on how to format text
Turn off "Getting Started"