eu.beesoft.gantt.chart
Class HeaderModel

java.lang.Object
  extended by javax.swing.table.DefaultTableColumnModel
      extended by eu.beesoft.gantt.chart.HeaderModel
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.swing.event.ListSelectionListener, javax.swing.table.TableColumnModel

public final class HeaderModel
extends javax.swing.table.DefaultTableColumnModel

Model used to paint major or minor header for ChartComponent. Instances of this class are used by ChartHeader.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableColumnModel
columnMargin, columnSelectionAllowed, changeEvent, listenerList, selectionModel, tableColumns, totalColumnWidth
 
Constructor Summary
HeaderModel(ChartHeader header, boolean isMajor)
          Creates a new instance of HeaderModel.
 
Method Summary
 ChartHeader getHeader()
          Returns instance of ChartHeader to which this model belongs.
 ChartComponent getChartComponent()
          Returns instance of ChartComponent which is used in JGantt.
 TimeUnit getTimeUnit()
          Returns TimeUnit for this model.
 boolean update()
          Updates the model according to the last changes.
 
Methods inherited from class javax.swing.table.DefaultTableColumnModel
addColumn, addColumnModelListener, createSelectionModel, fireColumnAdded, fireColumnMarginChanged, fireColumnMoved, fireColumnRemoved, fireColumnSelectionChanged, getColumn, getColumnCount, getColumnIndex, getColumnIndexAtX, getColumnMargin, getColumnModelListeners, getColumns, getColumnSelectionAllowed, getListeners, getSelectedColumnCount, getSelectedColumns, getSelectionModel, getTotalColumnWidth, moveColumn, propertyChange, recalcWidthCache, removeColumn, removeColumnModelListener, setColumnMargin, setColumnSelectionAllowed, setSelectionModel, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderModel

public HeaderModel(ChartHeader header,
                   boolean isMajor)
Creates a new instance of HeaderModel.

Parameters:
header - - Swing component to which this model belongs
isMajor - - true, if this instance is model for major header, false otherwise
Method Detail

getHeader

public ChartHeader getHeader()
Returns instance of ChartHeader to which this model belongs.

Returns:
instance of ChartHeader to which this model belongs

getChartComponent

public ChartComponent getChartComponent()
Returns instance of ChartComponent which is used in JGantt.

Returns:
instance of ChartComponent

getTimeUnit

public TimeUnit getTimeUnit()
Returns TimeUnit for this model. It obtains it from ZoomPolicy.

Returns:
TimeUnit constant for this model

update

public boolean update()
Updates the model according to the last changes. Called from ChartHeader.update() method.

Returns:
true if model was changed