JIDE 3.5.15

com.jidesoft.diff
Class DiffTableStyleProvider

java.lang.Object
  extended by com.jidesoft.diff.DiffTableStyleProvider
All Implemented Interfaces:
GridColorProvider, TableStyleProvider

public class DiffTableStyleProvider
extends Object
implements TableStyleProvider, GridColorProvider

The style provider class to display table difference.


Field Summary
protected  CellStyle CELL_STYLE
          The shared CELL_STYLE instance in use.
 
Constructor Summary
DiffTableStyleProvider()
           
DiffTableStyleProvider(TableDiffPane diffPane, int index)
          Constructor with a diff pane.
 
Method Summary
 void addChangedCellHighlight(int row, int column)
          Adds a changed cell highlight.
 void addChangedHighlight(int start, int end)
          Adds changed rows highlight.
 void addConflictedCellHighlight(int row, int column)
          Adds a conflicted cell highlight.
 void addConflictHighlight(int start, int end)
          Adds conflicted rows highlight.
 void addDeletedCellHighlight(int row, int column)
          Adds a deleted cell highlight.
 void addDeletedHighlight(int start, int end)
          Adds deleted rows highlight.
 void addInsertedCellHighlight(int row, int column)
          Adds an inserted cell highlight.
 void addInsertedHighlight(int start, int end)
          Adds inserted rows highlight.
 void addPositionHighlight(int row)
          Adds a position highlight.
 void clearAllHighlights()
          Clears all highlights.
protected  int getCellStyle(int row, int column)
          Gets the cell's style.
 CellStyle getCellStyleAt(JTable table, int rowIndex, int columnIndex)
          Gets the cell style at the specified cell.
 Color getChangedColor()
          Gets the changed color.
 Color getConflictedColor()
          Gets the conflicted color.
 Color getDeletedColor()
          Gets the deleted color.
 Color getGridColor(int row)
          Gets the horizontal grid line color.
 Color getInsertedColor()
          Gets the inserted color.
 Color getVerticalGridColor(int column)
          Gets the vertical grid line color.
 void setChangedColor(Color changedColor)
          Sets the changed color.
 void setConflictedColor(Color conflictedColor)
          Sets the deleted color.
 void setDeletedColor(Color deletedColor)
          Sets the deleted color.
 void setInsertedColor(Color insertedColor)
          Sets the inserted color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CELL_STYLE

protected final CellStyle CELL_STYLE
The shared CELL_STYLE instance in use.

Constructor Detail

DiffTableStyleProvider

public DiffTableStyleProvider()

DiffTableStyleProvider

public DiffTableStyleProvider(TableDiffPane diffPane,
                              int index)
Constructor with a diff pane.

Parameters:
diffPane - the table diff pane it works for.
Method Detail

getInsertedColor

public Color getInsertedColor()
Gets the inserted color.

Returns:
the inserted color.
See Also:
setInsertedColor(java.awt.Color)

setInsertedColor

public void setInsertedColor(Color insertedColor)
Sets the inserted color.

By default, it gets color from UIDefaults with the key "DiffMerge.inserted".

Parameters:
insertedColor - the inserted color

getChangedColor

public Color getChangedColor()
Gets the changed color.

Returns:
the changed color.
See Also:
setChangedColor(java.awt.Color)

setChangedColor

public void setChangedColor(Color changedColor)
Sets the changed color.

By default, it gets color from UIDefaults with the key "DiffMerge.changed".

Parameters:
changedColor - the changed color

getDeletedColor

public Color getDeletedColor()
Gets the deleted color.

Returns:
the deleted color.
See Also:
setDeletedColor(java.awt.Color)

setDeletedColor

public void setDeletedColor(Color deletedColor)
Sets the deleted color.

By default, it gets color from UIDefaults with the key "DiffMerge.deleted".

Parameters:
deletedColor - the deleted color

getConflictedColor

public Color getConflictedColor()
Gets the conflicted color.

Returns:
the conflicted color.
See Also:
setConflictedColor(java.awt.Color)

setConflictedColor

public void setConflictedColor(Color conflictedColor)
Sets the deleted color.

By default, it gets color from UIDefaults with the key "DiffMerge.conflicted".

Parameters:
conflictedColor - the deleted color

getCellStyleAt

public CellStyle getCellStyleAt(JTable table,
                                int rowIndex,
                                int columnIndex)
Description copied from interface: TableStyleProvider
Gets the cell style at the specified cell.

Specified by:
getCellStyleAt in interface TableStyleProvider
Parameters:
table - the table.
rowIndex - the row index as in the table
columnIndex - the column index as in the table
Returns:
the cell style at the specified cell.

getCellStyle

protected int getCellStyle(int row,
                           int column)
Gets the cell's style. It should be DiffMarkerArea.TYPE_INSERTED, DiffMarkerArea.TYPE_DELETED, DiffMarkerArea.TYPE_CHANGED or DiffMarkerArea.TYPE_CONFLICTED.

Parameters:
row - the row index
column - the column index
Returns:
the cell style of the cell.

getGridColor

public Color getGridColor(int row)
Description copied from interface: GridColorProvider
Gets the horizontal grid line color.

Specified by:
getGridColor in interface GridColorProvider
Parameters:
row - the row index. Note the grid line corresponding to a row is the one below the row.
Returns:
the horizontal grid line color.

getVerticalGridColor

public Color getVerticalGridColor(int column)
Description copied from interface: GridColorProvider
Gets the vertical grid line color.

Specified by:
getVerticalGridColor in interface GridColorProvider
Parameters:
column - the column index. The vertical grid line corresponding to a column is the one on the right side of the column (in left to right orientation).
Returns:
the vertical grid line color.

clearAllHighlights

public void clearAllHighlights()
Clears all highlights.


addChangedCellHighlight

public void addChangedCellHighlight(int row,
                                    int column)
Adds a changed cell highlight.

Parameters:
row - the row index
column - the column index
Since:
3.4.0

addDeletedCellHighlight

public void addDeletedCellHighlight(int row,
                                    int column)
Adds a deleted cell highlight.

Parameters:
row - the row index
column - the column index
Since:
3.4.0

addInsertedCellHighlight

public void addInsertedCellHighlight(int row,
                                     int column)
Adds an inserted cell highlight.

Parameters:
row - the row index
column - the column index
Since:
3.4.0

addConflictedCellHighlight

public void addConflictedCellHighlight(int row,
                                       int column)
Adds a conflicted cell highlight.

Parameters:
row - the row index
column - the column index
Since:
3.4.0

addChangedHighlight

public void addChangedHighlight(int start,
                                int end)
Adds changed rows highlight.

Parameters:
start - the start row index
end - the end row index

addDeletedHighlight

public void addDeletedHighlight(int start,
                                int end)
Adds deleted rows highlight.

Parameters:
start - the start row index
end - the end row index

addInsertedHighlight

public void addInsertedHighlight(int start,
                                 int end)
Adds inserted rows highlight.

Parameters:
start - the start row index
end - the end row index

addConflictHighlight

public void addConflictHighlight(int start,
                                 int end)
Adds conflicted rows highlight.

Parameters:
start - the start row index
end - the end row index

addPositionHighlight

public void addPositionHighlight(int row)
Adds a position highlight.

Parameters:
row - the row index

JIDE 3.5.15