eu.beesoft.gantt
Class JGantt

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 eu.beesoft.gantt.JGantt
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class JGantt
extends javax.swing.JPanel

Swing component that displays a conventional gantt chart. JGantt consists of:

These components are built automatically when you create a JGantt. The communication between them is automated, too. You just need to set their properties:

Warning: This component is protected by BeeSoft Abeona license system. It is fully functional, but if you don't have purchased a license, the component displays 10 minutes after it was constructed a warning message and stops to paint itself. You need restart an application you use this component in.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JGantt()
          Creates a new instance of JGantt.
JGantt(GanttModel model)
          Creates a new instance of JGantt with a given model.
 
Method Summary
 void addColumn(GanttColumn column)
          Appends a column to the end of table columns.
 GanttColumn addColumn(java.lang.String key, java.lang.String binding)
          Appends a new column to the end of table columns.
 void addLayer(Layer layer)
          Adds given layer to the list of chart component layers.
 void addLayer(Layer layer, int index)
          Adds given layer to the list of chart component layers.
 void doubleClicked(GanttNode node)
          Invoked when user double clicked on the node.
 int getDividerLocation()
          Returns divider location of the split pane (between treetable and chart component).
 ChartComponent getChartComponent()
          Returns the instance of ChartComponent.
 ChartHeader getChartHeader()
          Returns the instance of ChartHeader.
 java.util.List<Layer> getLayers()
          Returns the list of chart component layers.
 License getLicense()
          Returns instance of valid License or null.
 GanttModel getModel()
          Returns GanttModel model instance for this JGantt object.
protected  java.util.List<javax.swing.Action> getPopupActions(java.util.List<GanttNode> selectedNodes)
          Returns a list of actions for selected nodes.
 java.lang.String getResourceBundleName()
          Returns the name of the resource bundle.
 GanttTreeTable getTreeTable()
          Returns the tree table object of this JGantt.
 javax.swing.undo.UndoManager getUndoManager()
          Returns the undo manager for JGantt operations.
 void removeColumn(GanttColumn column)
          Removes the column from the treetable.Redirects to JTable.removeColumn(javax.swing.table.TableColumn).
 void removeColumn(java.lang.String key)
          Removes a column with given key from the treetable.Redirects to GanttTreeTable.removeColumn(String).
 void removeLayer(Layer layer)
          Removes given layer from the list of chart component layers.
 void setDividerLocation(int location)
          Sets the divider location of the split pane (between treetable and chart component).
 License setLicense(java.io.InputStream licenseStream)
          Loads license from given licenseStream.
 void setModel(GanttModel model)
          Sets the new model for JGantt object.
 void setResourceBundleName(java.lang.String resourceBundleName)
          Sets the name of resource bundle.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintComponent, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printComponent, printChildren, 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
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, hide, checkImage, checkImage, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JGantt

public JGantt()
Creates a new instance of JGantt.


JGantt

public JGantt(GanttModel model)
Creates a new instance of JGantt with a given model.

Parameters:
model - - model to set
Method Detail

getModel

public GanttModel getModel()
Returns GanttModel model instance for this JGantt object.

Returns:
model for JGantt

setModel

public void setModel(GanttModel model)
Sets the new model for JGantt object.

Parameters:
model - - the model to set

getTreeTable

public GanttTreeTable getTreeTable()
Returns the tree table object of this JGantt.

Returns:
tree table

getDividerLocation

public int getDividerLocation()
Returns divider location of the split pane (between treetable and chart component).

Returns:
x-coordinate of the split pane divider location

setDividerLocation

public void setDividerLocation(int location)
Sets the divider location of the split pane (between treetable and chart component).

Parameters:
location - - x-coordinate of the split pane divider location

addColumn

public void addColumn(GanttColumn column)
Appends a column to the end of table columns. Redirects to GanttTreeTable.addColumn(javax.swing.table.TableColumn).

Parameters:
column - - the column to be added

addColumn

public GanttColumn addColumn(java.lang.String key,
                             java.lang.String binding)
Appends a new column to the end of table columns. Redirects to GanttTreeTable.addColumn(String, String).

Parameters:
key - - key to resource bundle key, where is stored column label under this key.
binding - - name of the property from model domain object, which value is displyed in this column
Returns:
newly created instance of GanttColumn

removeColumn

public void removeColumn(GanttColumn column)
Removes the column from the treetable.Redirects to JTable.removeColumn(javax.swing.table.TableColumn).

Parameters:
column - - column to be removed

removeColumn

public void removeColumn(java.lang.String key)
Removes a column with given key from the treetable.Redirects to GanttTreeTable.removeColumn(String).

Parameters:
key - - resource bundle key to identify column

getResourceBundleName

public java.lang.String getResourceBundleName()
Returns the name of the resource bundle.

Returns:
resource bundle name

setResourceBundleName

public void setResourceBundleName(java.lang.String resourceBundleName)
Sets the name of resource bundle. This name must according to ResourceBundle specification. Resource bundle is then used to construct treetable columns and gantt actions.

Parameters:
resourceBundleName - - resource bundle name to set

getUndoManager

public javax.swing.undo.UndoManager getUndoManager()
Returns the undo manager for JGantt operations.

Returns:
undo manager

getChartComponent

public ChartComponent getChartComponent()
Returns the instance of ChartComponent.

Returns:
instance of ChartComponent

getChartHeader

public ChartHeader getChartHeader()
Returns the instance of ChartHeader.

Returns:
instance of ChartHeader

addLayer

public void addLayer(Layer layer)
Adds given layer to the list of chart component layers. Simply redirects to ChartComponent.addLayer(Layer).

Parameters:
layer - - the layer to add

addLayer

public void addLayer(Layer layer,
                     int index)
Adds given layer to the list of chart component layers. Simply redirects to ChartComponent.addLayer(Layer, int).

Parameters:
layer - - the layer to add
index - - position in layers list where to insert

removeLayer

public void removeLayer(Layer layer)
Removes given layer from the list of chart component layers. Simply redirects to ChartComponent.removeLayer(Layer).

Parameters:
layer - - the layer to remove

getLayers

public java.util.List<Layer> getLayers()
Returns the list of chart component layers. Simply redirects to ChartComponent.getLayers().

Returns:
the list of the chart component layers

setLicense

public License setLicense(java.io.InputStream licenseStream)
Loads license from given licenseStream. This is a key method of library protection system.

Parameters:
licenseStream - - input stream from license properties file
Returns:
instance of valid License or null

getLicense

public License getLicense()
Returns instance of valid License or null.

Returns:
license or null.

doubleClicked

public void doubleClicked(GanttNode node)
Invoked when user double clicked on the node. In this implementation does nothing. Typically, you should display properties dialog for node's user object.

Parameters:
node - - double clicked node

getPopupActions

protected java.util.List<javax.swing.Action> getPopupActions(java.util.List<GanttNode> selectedNodes)
Returns a list of actions for selected nodes. Invoked when user right clicks on the node(s) in treetable. In this implementation does nothing and returns null, you must override it to give it some functionality.

Parameters:
selectedNodes - - list of selected GanttNode instances
Returns:
list of actions or null