org.sourcejammer.client.gui.merge
Class MergeViewVisitor

java.lang.Object
  |
  +--org.sourcejammer.client.gui.merge.MergeViewVisitor
All Implemented Interfaces:
JLibDiff.Hunk3Visitor

public class MergeViewVisitor
extends java.lang.Object
implements JLibDiff.Hunk3Visitor

Version:
$VerNum: 2$ $KeyWordsOff: $
Author:
$AuthorName: Rob MacGrogan$

Field Summary
static java.awt.Color ADDED_COLOR
           
static java.awt.Color ANCESTOR_HIGHLIGHT_COLOR
           
private  javax.swing.JTextArea ancestorArea
           
private  javax.swing.plaf.basic.BasicTextUI.BasicHighlighter ancestorHighLighter
           
static java.awt.Color CHANGED_COLOR
           
private  java.util.ArrayList changePoints
           
private  javax.swing.JTextArea checkingInArea
           
private  javax.swing.plaf.basic.BasicTextUI.BasicHighlighter checkingInHighLighter
           
private  boolean continueVisit
           
private  javax.swing.JTextArea currVerArea
           
private  javax.swing.plaf.basic.BasicTextUI.BasicHighlighter currVerHighLighter
           
static java.awt.Color DELETED_COLOR
           
private static java.lang.String EOL
           
private  int linesAddedToAncestor
           
private  int linesAddedToCheckingIn
           
private  int linesAddedToCurrVer
           
static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painterAdded
           
static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painterAncestor
           
static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painterDeleted
           
static javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painterModified
           
 
Constructor Summary
MergeViewVisitor(javax.swing.JTextArea ancestorArea, javax.swing.JTextArea currVerArea, javax.swing.JTextArea checkingInArea)
           
 
Method Summary
private  void addHighLighter(int start, int end, javax.swing.text.DefaultHighlighter.DefaultHighlightPainter painter, javax.swing.plaf.basic.BasicTextUI.BasicHighlighter highlighter)
           
private  void balanceViews(JLibDiff.Hunk3 hunk)
          Add lines to the text areas as necessary so that they balance.
 boolean continueVisit()
           
private  int getAncestorEndLineNum(JLibDiff.Hunk3 hunk)
          Returns adjusted end line of ancestor version of this hunk.
private  int getAncestorStartLineNum(JLibDiff.Hunk3 hunk)
           
private  int getCheckingInEndLineNum(JLibDiff.Hunk3 hunk)
          Returns adjusted end line of checking in version of this hunk.
private  int getCheckingInStartLineNum(JLibDiff.Hunk3 hunk)
           
private  int getCurrVersionEndLineNum(JLibDiff.Hunk3 hunk)
          Returns adjusted end line of current version of this hunk.
private  int getCurrVersionStartLineNum(JLibDiff.Hunk3 hunk)
           
private  int getOffsetEOL(int linenumber, javax.swing.JTextArea area)
          Return character index of end of specified line in buffer.
private  int getOffsetSOL(int linenumber, javax.swing.JTextArea area)
           
private  void highlightAncestor(JLibDiff.Hunk3 hunk)
           
private  void highlightCheckingIn(JLibDiff.Hunk3 hunk)
           
private  void highlightCurrentVersion(JLibDiff.Hunk3 hunk)
           
 void setContinueVisit(boolean b)
           
 void visitHunk3(JLibDiff.Hunk3 hunk3)
          Ancestor is 0.
Current Version is 1.
Checking In Version is 2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANCESTOR_HIGHLIGHT_COLOR

public static java.awt.Color ANCESTOR_HIGHLIGHT_COLOR

ADDED_COLOR

public static java.awt.Color ADDED_COLOR

CHANGED_COLOR

public static java.awt.Color CHANGED_COLOR

DELETED_COLOR

public static java.awt.Color DELETED_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

painterAncestor

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

continueVisit

private boolean continueVisit

ancestorArea

private javax.swing.JTextArea ancestorArea

currVerArea

private javax.swing.JTextArea currVerArea

checkingInArea

private javax.swing.JTextArea checkingInArea

ancestorHighLighter

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

currVerHighLighter

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

checkingInHighLighter

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

changePoints

private java.util.ArrayList changePoints

EOL

private static final java.lang.String EOL

linesAddedToAncestor

private int linesAddedToAncestor

linesAddedToCurrVer

private int linesAddedToCurrVer

linesAddedToCheckingIn

private int linesAddedToCheckingIn
Constructor Detail

MergeViewVisitor

public MergeViewVisitor(javax.swing.JTextArea ancestorArea,
                        javax.swing.JTextArea currVerArea,
                        javax.swing.JTextArea checkingInArea)
Method Detail

visitHunk3

public void visitHunk3(JLibDiff.Hunk3 hunk3)
Ancestor is 0.
Current Version is 1.
Checking In Version is 2.

Specified by:
visitHunk3 in interface JLibDiff.Hunk3Visitor

highlightAncestor

private void highlightAncestor(JLibDiff.Hunk3 hunk)

highlightCurrentVersion

private void highlightCurrentVersion(JLibDiff.Hunk3 hunk)

highlightCheckingIn

private void highlightCheckingIn(JLibDiff.Hunk3 hunk)

continueVisit

public boolean continueVisit()
Specified by:
continueVisit in interface JLibDiff.Hunk3Visitor
See Also:
Hunk3Visitor.continueVisit()

setContinueVisit

public void setContinueVisit(boolean b)
Specified by:
setContinueVisit in interface JLibDiff.Hunk3Visitor
See Also:
Hunk3Visitor.setContinueVisit(boolean)

balanceViews

private void balanceViews(JLibDiff.Hunk3 hunk)
Add lines to the text areas as necessary so that they balance.


getAncestorStartLineNum

private int getAncestorStartLineNum(JLibDiff.Hunk3 hunk)

getAncestorEndLineNum

private int getAncestorEndLineNum(JLibDiff.Hunk3 hunk)
Returns adjusted end line of ancestor version of this hunk.


getCurrVersionStartLineNum

private int getCurrVersionStartLineNum(JLibDiff.Hunk3 hunk)

getCurrVersionEndLineNum

private int getCurrVersionEndLineNum(JLibDiff.Hunk3 hunk)
Returns adjusted end line of current version of this hunk.


getCheckingInStartLineNum

private int getCheckingInStartLineNum(JLibDiff.Hunk3 hunk)

getCheckingInEndLineNum

private int getCheckingInEndLineNum(JLibDiff.Hunk3 hunk)
Returns adjusted end line of checking in version of this hunk.


getOffsetSOL

private int getOffsetSOL(int linenumber,
                         javax.swing.JTextArea area)

getOffsetEOL

private int getOffsetEOL(int linenumber,
                         javax.swing.JTextArea area)
Return character index of end of specified line in buffer.


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.