Top Description Inners Fields Constructors Methods
org.eclipse.jgit.awtui

public Class CommitGraphPane

extends JTable
Class Inheritance
Imports
java.awt.BasicStroke, .Component, .Graphics, .Stroke, java.text.DateFormat, .SimpleDateFormat, javax.swing.JTable, .ListSelectionModel, javax.swing.table.AbstractTableModel, .DefaultTableCellRenderer, .JTableHeader, .TableCellRenderer, .TableColumn, .TableColumnModel, .TableModel, org.eclipse.jgit.awtui.SwingCommitList.SwingLane, org.eclipse.jgit.lib.PersonIdent, org.eclipse.jgit.revplot.PlotCommit, .PlotCommitList, org.eclipse.jgit.util.References

Draws a commit graph in a JTable.

This class is currently a very primitive commit visualization tool. It shows a table of 3 columns:

  1. Commit graph and short message
  2. Author name and email address
  3. Author date and time

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final SwingCommitList
private static final long
pack-priv static final Stroke[]
Inherited from javax.swing.JTable:
AUTO_RESIZE_ALL_COLUMNSAUTO_RESIZE_LAST_COLUMNAUTO_RESIZE_NEXT_COLUMNAUTO_RESIZE_OFFAUTO_RESIZE_SUBSEQUENT_COLUMNSautoCreateColumnsFromModelautoResizeModecellEditorcellSelectionEnabledcolumnModeldataModeldefaultEditorsByColumnClassdefaultRenderersByColumnClasseditingColumneditingRoweditorCompgridColorpreferredViewportSizerowHeightrowMarginrowSelectionAllowedselectionBackgroundselectionForegroundselectionModelshowHorizontalLinesshowVerticalLinestableHeader

Constructor Summary

AccessConstructor and Description
public
CommitGraphPane()

Create a new empty panel.

Method Summary

Modifier and TypeMethod and Description
private void
private void
protected TableModel
createDefaultDataModel()

Overrides javax.swing.JTable.createDefaultDataModel.

Returns the default table model object, which is a DefaultTableModel.

public PlotCommitList<L extends PlotLane>

Returns:

the list the caller must populate.
getCommitList
()

Get the commit list this pane renders from.

public void
setModel(TableModel
the new data source for this table
dataModel
)

Overrides javax.swing.JTable.setModel.

Sets the data model for this table to dataModel and registers with it for listener notifications from the new data model.

pack-priv static Stroke
stroke(int width)

Inherited from javax.swing.JTable:
addColumnaddColumnSelectionIntervaladdNotifyaddRowSelectionIntervalchangeSelectionclearSelectioncolumnAddedcolumnAtPointcolumnMarginChangedcolumnMovedcolumnRemovedcolumnSelectionChangedconfigureEnclosingScrollPaneconvertColumnIndexToModelconvertColumnIndexToViewconvertRowIndexToModelconvertRowIndexToViewcreateDefaultColumnModelcreateDefaultColumnsFromModelcreateDefaultEditorscreateDefaultRendererscreateDefaultSelectionModelcreateDefaultTableHeadercreateScrollPaneForTabledoLayouteditCellAteditCellAteditingCancelededitingStoppedgetAccessibleContextgetAutoCreateColumnsFromModelgetAutoCreateRowSortergetAutoResizeModegetCellEditorgetCellEditorgetCellRectgetCellRenderergetCellSelectionEnabledgetColumngetColumnClassgetColumnCountgetColumnModelgetColumnNamegetColumnSelectionAllowedgetDefaultEditorgetDefaultRenderergetDragEnabledgetDropLocationgetDropModegetEditingColumngetEditingRowgetEditorComponentgetFillsViewportHeightgetGridColorgetIntercellSpacinggetModelgetPreferredScrollableViewportSizegetPrintablegetRowCountgetRowHeightgetRowHeightgetRowMargingetRowSelectionAllowedgetRowSortergetScrollableBlockIncrementgetScrollableTracksViewportHeightgetScrollableTracksViewportWidthgetScrollableUnitIncrementgetSelectedColumngetSelectedColumnCountgetSelectedColumnsgetSelectedRowgetSelectedRowCountgetSelectedRowsgetSelectionBackgroundgetSelectionForegroundgetSelectionModelgetShowHorizontalLinesgetShowVerticalLinesgetSurrendersFocusOnKeystrokegetTableHeadergetToolTipTextgetUIgetUIClassIDgetUpdateSelectionOnSortgetValueAtinitializeLocalVarsisCellEditableisCellSelectedisColumnSelectedisEditingisRowSelectedmoveColumnparamStringprepareEditorprepareRendererprintprintprintprintprintprocessKeyBindingremoveColumnremoveColumnSelectionIntervalremoveEditorremoveNotifyremoveRowSelectionIntervalresizeAndRepaintrowAtPointselectAllsetAutoCreateColumnsFromModelsetAutoCreateRowSortersetAutoResizeModesetCellEditorsetCellSelectionEnabledsetColumnModelsetColumnSelectionAllowedsetColumnSelectionIntervalsetDefaultEditorsetDefaultRenderersetDragEnabledsetDropModesetEditingColumnsetEditingRowsetFillsViewportHeightsetGridColorsetIntercellSpacingsetPreferredScrollableViewportSizesetRowHeightsetRowHeightsetRowMarginsetRowSelectionAllowedsetRowSelectionIntervalsetRowSortersetSelectionBackgroundsetSelectionForegroundsetSelectionModesetSelectionModelsetShowGridsetShowHorizontalLinessetShowVerticalLinessetSurrendersFocusOnKeystrokesetTableHeadersetUIsetUpdateSelectionOnSortsetValueAtsizeColumnsToFitsizeColumnsToFitsorterChangedtableChangedunconfigureEnclosingScrollPaneupdateUIvalueChanged

Field Detail

allCommitsback to summary
private final SwingCommitList allCommits
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.Container.serialVersionUID.

strokeCacheback to summary
pack-priv static final Stroke[] strokeCache

Constructor Detail

CommitGraphPaneback to summary
public CommitGraphPane()

Create a new empty panel.

Method Detail

configureHeaderback to summary
private void configureHeader()
configureRowHeightback to summary
private void configureRowHeight()
createDefaultDataModelback to summary
protected TableModel createDefaultDataModel()

Overrides javax.swing.JTable.createDefaultDataModel.

Doc from javax.swing.JTable.createDefaultDataModel.

Returns the default table model object, which is a DefaultTableModel. A subclass can override this method to return a different table model object.

Returns:TableModel

the default table model object

Annotations
@Override
getCommitListback to summary
public PlotCommitList<L extends PlotLane> getCommitList()

Get the commit list this pane renders from.

Returns:PlotCommitList<L extends PlotLane>

the list the caller must populate.

setModelback to summary
public void setModel(TableModel dataModel)

Overrides javax.swing.JTable.setModel.

Doc from javax.swing.JTable.setModel.

Sets the data model for this table to dataModel and registers with it for listener notifications from the new data model.

Parameters
dataModel:TableModel

the new data source for this table

Annotations
@Override
strokeback to summary
pack-priv static Stroke stroke(int width)
org.eclipse.jgit.awtui back to summary

pack-priv Class CommitGraphPane.CommitTableModel

extends AbstractTableModel
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv PersonIdent
pack-priv PlotCommit<SwingCommitList.SwingLane>
private static final long
Inherited from javax.swing.table.AbstractTableModel:
listenerList

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv PersonIdent
public int
getColumnCount()

Implements javax.swing.table.TableModel.getColumnCount.

Returns the number of columns in the model.

public int
getRowCount()

Implements javax.swing.table.TableModel.getRowCount.

Returns the number of rows in the model.

public Object
getValueAt(int
the row whose value is to be queried
rowIndex
,
int
the column whose value is to be queried
columnIndex
)

Implements javax.swing.table.TableModel.getValueAt.

Returns the value for the cell at columnIndex and rowIndex.

Inherited from javax.swing.table.AbstractTableModel:
addTableModelListenerfindColumnfireTableCellUpdatedfireTableChangedfireTableDataChangedfireTableRowsDeletedfireTableRowsInsertedfireTableRowsUpdatedfireTableStructureChangedgetColumnClassgetColumnNamegetListenersgetTableModelListenersisCellEditableremoveTableModelListenersetValueAt

Field Detail

lastAuthorback to summary
pack-priv PersonIdent lastAuthor
lastCommitback to summary
pack-priv PlotCommit<SwingCommitList.SwingLane> lastCommit
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

CommitTableModelback to summary
pack-priv CommitTableModel()

Method Detail

authorForback to summary
pack-priv PersonIdent authorFor(PlotCommit<SwingCommitList.SwingLane> c)
getColumnCountback to summary
public int getColumnCount()

Implements javax.swing.table.TableModel.getColumnCount.

Doc from javax.swing.table.TableModel.getColumnCount.

Returns the number of columns in the model. A JTable uses this method to determine how many columns it should create and display by default.

Returns:int

the number of columns in the model

Annotations
@Override
getRowCountback to summary
public int getRowCount()

Implements javax.swing.table.TableModel.getRowCount.

Doc from javax.swing.table.TableModel.getRowCount.

Returns the number of rows in the model. A JTable uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.

Returns:int

the number of rows in the model

Annotations
@Override
getValueAtback to summary
public Object getValueAt(int rowIndex, int columnIndex)

Implements javax.swing.table.TableModel.getValueAt.

Doc from javax.swing.table.TableModel.getValueAt.

Returns the value for the cell at columnIndex and rowIndex.

Parameters
rowIndex:int

the row whose value is to be queried

columnIndex:int

the column whose value is to be queried

Returns:Object

the value Object at the specified cell

Annotations
@Override
org.eclipse.jgit.awtui back to summary

pack-priv Class CommitGraphPane.DateCellRender

extends DefaultTableCellRenderer
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final DateFormat
private static final long
Inherited from javax.swing.table.DefaultTableCellRenderer:
noFocusBorder

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Component
getTableCellRendererComponent(final JTable
the JTable
table
,
final Object
the value to assign to the cell at [row, column]
value
,
final boolean
true if cell is selected
isSelected
,
final boolean
true if cell has focus
hasFocus
,
final int
the row of the cell to render
row
,
final int
the column of the cell to render
column
)

Overrides javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Implements javax.swing.table.TableCellRenderer.getTableCellRendererComponent.

Returns the default table cell renderer.

Inherited from javax.swing.table.DefaultTableCellRenderer:
firePropertyChangefirePropertyChangeinvalidateisOpaquerepaintrepaintrepaintrevalidatesetBackgroundsetForegroundsetValueupdateUIvalidate

Field Detail

fmtback to summary
private final DateFormat fmt
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.Container.serialVersionUID.

Constructor Detail

DateCellRenderback to summary
pack-priv DateCellRender()

Method Detail

getTableCellRendererComponentback to summary
public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column)

Overrides javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Implements javax.swing.table.TableCellRenderer.getTableCellRendererComponent.

Doc from javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Returns the default table cell renderer.

During a printing operation, this method will be called with isSelected and hasFocus values of false to prevent selection and focus from appearing in the printed output. To do other customization based on whether or not the table is being printed, check the return value from javax.swing.JComponent#isPaintingForPrint().

Parameters
table:JTable

the JTable

value:Object

the value to assign to the cell at [row, column]

isSelected:boolean

true if cell is selected

hasFocus:boolean

true if cell has focus

row:int

the row of the cell to render

column:int

the column of the cell to render

Returns:Component

the default table cell renderer

Annotations
@Override
org.eclipse.jgit.awtui back to summary

pack-priv Class CommitGraphPane.GraphCellRender

extends DefaultTableCellRenderer
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv PlotCommit<SwingCommitList.SwingLane>
private final AWTPlotRenderer
private static final long
Inherited from javax.swing.table.DefaultTableCellRenderer:
noFocusBorder

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Component
getTableCellRendererComponent(final JTable
the JTable
table
,
final Object
the value to assign to the cell at [row, column]
value
,
final boolean
true if cell is selected
isSelected
,
final boolean
true if cell has focus
hasFocus
,
final int
the row of the cell to render
row
,
final int
the column of the cell to render
column
)

Overrides javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Implements javax.swing.table.TableCellRenderer.getTableCellRendererComponent.

Returns the default table cell renderer.

protected void
paintComponent(Graphics
the Graphics object to protect
inputGraphics
)

Overrides javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null.

Inherited from javax.swing.table.DefaultTableCellRenderer:
firePropertyChangefirePropertyChangeinvalidateisOpaquerepaintrepaintrepaintrevalidatesetBackgroundsetForegroundsetValueupdateUIvalidate

Field Detail

commitback to summary
pack-priv PlotCommit<SwingCommitList.SwingLane> commit
rendererback to summary
private final AWTPlotRenderer renderer
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.Container.serialVersionUID.

Constructor Detail

GraphCellRenderback to summary
pack-priv GraphCellRender()

Method Detail

getTableCellRendererComponentback to summary
public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column)

Overrides javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Implements javax.swing.table.TableCellRenderer.getTableCellRendererComponent.

Doc from javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Returns the default table cell renderer.

During a printing operation, this method will be called with isSelected and hasFocus values of false to prevent selection and focus from appearing in the printed output. To do other customization based on whether or not the table is being printed, check the return value from javax.swing.JComponent#isPaintingForPrint().

Parameters
table:JTable

the JTable

value:Object

the value to assign to the cell at [row, column]

isSelected:boolean

true if cell is selected

hasFocus:boolean

true if cell has focus

row:int

the row of the cell to render

column:int

the column of the cell to render

Returns:Component

the default table cell renderer

Annotations
@Override
@SuppressWarnings:unchecked
paintComponentback to summary
protected void paintComponent(Graphics inputGraphics)

Overrides javax.swing.JComponent.paintComponent.

Doc from javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null. We pass the delegate a copy of the Graphics object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate).

If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it. Further, if you do not invoke super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in an opaque color. If you do not honor the opaque property you will likely see visual artifacts.

The passed in Graphics object might have a transform other than the identify transform installed on it. In this case, you might get unexpected results if you cumulatively apply another transform.

Parameters
inputGraphics:Graphics

the Graphics object to protect

Annotations
@Override
org.eclipse.jgit.awtui back to summary

pack-priv Class CommitGraphPane.NameCellRender

extends DefaultTableCellRenderer
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from javax.swing.table.DefaultTableCellRenderer:
noFocusBorder

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Component
getTableCellRendererComponent(final JTable
the JTable
table
,
final Object
the value to assign to the cell at [row, column]
value
,
final boolean
true if cell is selected
isSelected
,
final boolean
true if cell has focus
hasFocus
,
final int
the row of the cell to render
row
,
final int
the column of the cell to render
column
)

Overrides javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Implements javax.swing.table.TableCellRenderer.getTableCellRendererComponent.

Returns the default table cell renderer.

Inherited from javax.swing.table.DefaultTableCellRenderer:
firePropertyChangefirePropertyChangeinvalidateisOpaquerepaintrepaintrepaintrevalidatesetBackgroundsetForegroundsetValueupdateUIvalidate

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.Container.serialVersionUID.

Constructor Detail

NameCellRenderback to summary
pack-priv NameCellRender()

Method Detail

getTableCellRendererComponentback to summary
public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column)

Overrides javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Implements javax.swing.table.TableCellRenderer.getTableCellRendererComponent.

Doc from javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Returns the default table cell renderer.

During a printing operation, this method will be called with isSelected and hasFocus values of false to prevent selection and focus from appearing in the printed output. To do other customization based on whether or not the table is being printed, check the return value from javax.swing.JComponent#isPaintingForPrint().

Parameters
table:JTable

the JTable

value:Object

the value to assign to the cell at [row, column]

isSelected:boolean

true if cell is selected

hasFocus:boolean

true if cell has focus

row:int

the row of the cell to render

column:int

the column of the cell to render

Returns:Component

the default table cell renderer

Annotations
@Override