org.sourcejammer.client.gui.vdiff
Class HunkColorVisitor

java.lang.Object
  |
  +--JLibDiff.HunkVisitor
        |
        +--org.sourcejammer.client.gui.vdiff.HunkColorVisitor

public class HunkColorVisitor
extends JLibDiff.HunkVisitor


Field Summary
static java.awt.Color ADDED_COLOR
           
static java.awt.Color DELETED_COLOR
           
private  int linesAddedToNew
           
private  int linesAddedToOld
           
static java.awt.Color MODIFIED_COLOR
           
private  javax.swing.plaf.basic.BasicTextUI.BasicHighlighter newHighLighter
           
private  javax.swing.JTextArea newTextArea
           
private  javax.swing.plaf.basic.BasicTextUI.BasicHighlighter oldHighLighter
           
private  javax.swing.JTextArea oldTextArea
           
static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painterAdded
           
static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painterDeleted
           
static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painterModified
           
private  java.util.Vector vecNewPositions
           
private  java.util.Vector vecOldPositions
           
 
Constructor Summary
HunkColorVisitor(javax.swing.JTextArea oldTextArea, javax.swing.JTextArea newTextArea)
           
 
Method Summary
private  void addHighLighter(int start, int end, javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painter, javax.swing.plaf.basic.BasicTextUI.BasicHighlighter highlighter)
           
private  void addPositionToVector(int iStartPosition, int iEndPosition, java.util.Vector vec)
           
private  void addtoNewHighLighter(int start, int end, javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painter)
           
private  void addtoOldHighLighter(int start, int end, javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painter)
           
private  void balanceViews(JLibDiff.Hunk hunk)
           
private  int getNewEndLineNum(JLibDiff.Hunk hunk)
           
 java.util.Vector getNewPositions()
           
private  int getNewStartLineNum(JLibDiff.Hunk hunk)
           
private  int getOffsetEOL(int linenumber, java.lang.String buffer)
           
private  int getOffsetSOL(int linenumber, java.lang.String buffer)
           
private  int getOldEndLineNum(JLibDiff.Hunk hunk)
           
 java.util.Vector getOldPositions()
           
private  int getOldStartLineNum(JLibDiff.Hunk hunk)
           
 void visitHunkAdd(JLibDiff.HunkAdd hunk)
           
 void visitHunkChange(JLibDiff.HunkChange hunk)
           
 void visitHunkDel(JLibDiff.HunkDel hunk)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADDED_COLOR

public static java.awt.Color ADDED_COLOR

DELETED_COLOR

public static java.awt.Color DELETED_COLOR

MODIFIED_COLOR

public static java.awt.Color MODIFIED_COLOR

painterAdded

public static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painterAdded

painterDeleted

public static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painterDeleted

painterModified

public static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painterModified

oldHighLighter

private javax.swing.plaf.basic.BasicTextUI.BasicHighlighter oldHighLighter

newHighLighter

private javax.swing.plaf.basic.BasicTextUI.BasicHighlighter newHighLighter

vecOldPositions

private java.util.Vector vecOldPositions

vecNewPositions

private java.util.Vector vecNewPositions

oldTextArea

private javax.swing.JTextArea oldTextArea

newTextArea

private javax.swing.JTextArea newTextArea

linesAddedToNew

private int linesAddedToNew

linesAddedToOld

private int linesAddedToOld
Constructor Detail

HunkColorVisitor

public HunkColorVisitor(javax.swing.JTextArea oldTextArea,
                        javax.swing.JTextArea newTextArea)
Method Detail

getOldPositions

public java.util.Vector getOldPositions()

getNewPositions

public java.util.Vector getNewPositions()

balanceViews

private void balanceViews(JLibDiff.Hunk hunk)

getOldStartLineNum

private int getOldStartLineNum(JLibDiff.Hunk hunk)

getOldEndLineNum

private int getOldEndLineNum(JLibDiff.Hunk hunk)

getNewEndLineNum

private int getNewEndLineNum(JLibDiff.Hunk hunk)

getNewStartLineNum

private int getNewStartLineNum(JLibDiff.Hunk hunk)

visitHunkAdd

public void visitHunkAdd(JLibDiff.HunkAdd hunk)
Overrides:
visitHunkAdd in class JLibDiff.HunkVisitor

visitHunkChange

public void visitHunkChange(JLibDiff.HunkChange hunk)
Overrides:
visitHunkChange in class JLibDiff.HunkVisitor

visitHunkDel

public void visitHunkDel(JLibDiff.HunkDel hunk)
Overrides:
visitHunkDel in class JLibDiff.HunkVisitor

getOffsetSOL

private int getOffsetSOL(int linenumber,
                         java.lang.String buffer)

getOffsetEOL

private int getOffsetEOL(int linenumber,
                         java.lang.String buffer)

addPositionToVector

private void addPositionToVector(int iStartPosition,
                                 int iEndPosition,
                                 java.util.Vector vec)

addtoNewHighLighter

private void addtoNewHighLighter(int start,
                                 int end,
                                 javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painter)

addtoOldHighLighter

private void addtoOldHighLighter(int start,
                                 int end,
                                 javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painter)

addHighLighter

private void addHighLighter(int start,
                            int end,
                            javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painter,
                            javax.swing.plaf.basic.BasicTextUI.BasicHighlighter highlighter)


Copyright 2003 Soucejammer project.