1
15
16 package gate.annotation;
17
18 import java.awt.*;
19 import java.text.NumberFormat;
20 import java.util.*;
21
22 import javax.swing.*;
23 import javax.swing.table.*;
24
25 import gate.*;
26 import gate.creole.*;
27 import gate.swing.XJTable;
28 import gate.util.*;
29
30
37 public class AnnotationDiff extends AbstractVisualResource
38 implements Scrollable{
39
40 protected int maxUnitIncrement = 10;
42
43
44 private static final boolean DEBUG = false;
45
46
48 private Document keyDocument = null;
49
50
53 private String keyAnnotationSetName = null;
54
55
58 private Document responseDocument = null;
59
60
63 private String responseAnnotationSetName = null;
64
65
68 private String responseAnnotationSetNameFalsePoz = null;
69
70
71 private AnnotationSchema annotationSchema = null;
72
73
76 private Set keyFeatureNamesSet = null;
77
78
79 private double precisionStrict = 0.0;
80
81 private double precisionLenient = 0.0;
82
83 private double precisionAverage = 0.0;
84
85
86 private double recallStrict = 0.0;
87
88 private double recallLenient = 0.0;
89
90 private double recallAverage = 0.0;
91
92
93 private double falsePositiveStrict = 0.0;
94
95 private double falsePositiveLenient = 0.0;
96
97 private double falsePositiveAverage = 0.0;
98
99
100 private double fMeasureStrict = 0.0;
101
102 private double fMeasureLenient = 0.0;
103
104 private double fMeasureAverage = 0.0;
105
106 public static double weight = 0.5;
107
108
111 private String annotationTypeForFalsePositive = null;
112
113
114 protected static NumberFormat formatter = NumberFormat.getInstance();
115
116
117 private XJTable diffTable = null;
118
119
120 private Set diffSet = null;
121
122
124 private Set keyPartiallySet = null;
125
126 private Set responsePartiallySet = null;
127
128
129 private java.util.List keyAnnotList = null;
130
131 private java.util.List responseAnnotList = null;
132
133
135 private boolean textMode = false;
136
137
140 public static final int MAX_TYPES = 5;
141
142 public static final int DEFAULT_TYPE = 0;
143
144 public static final int CORRECT_TYPE = 1;
145
147 public static final int PARTIALLY_CORRECT_TYPE = 2;
148
150 public static final int SPURIOUS_TYPE = 3;
151
153 public static final int MISSING_TYPE = 4;
154
155
156 private final Color RED = new Color(255,173,181);
157
158 private final Color GREEN = new Color(173,255,214);
159
160 private final Color WHITE = new Color(255,255,255);
161
162 private final Color BLUE = new Color(173,215,255);
163
164 private final Color YELLOW = new Color(255,231,173);
165
166
167 private final int NULL_TYPE = -1;
168
169 private final Color BLACK = new Color(0,0,0);
170
171 private Color colors[] = new Color[MAX_TYPES];
172
173
174 private JScrollPane scrollPane = null;
175
176
179 private long typeCounter[] = new long[MAX_TYPES];
180
181
182 private gate.util.AnnotationDiffer annotDiffer;
183
184
185 public AnnotationDiff(){
186 annotDiffer = new AnnotationDiffer();
187 }
189
194 public void setAnnotationTypeForFalsePositive(String anAnnotType){
195 annotationTypeForFalsePositive = anAnnotType;
196 }
198
202 public String getAnnotationTypeForFalsePositive(){
203 return annotationTypeForFalsePositive;
204 }
206
209 public void setKeyDocument(Document aKeyDocument) {
210 keyDocument = aKeyDocument;
211 }
213
214 public Document getKeyDocument(){
215 return keyDocument;
216 }
218
223 public void setKeyAnnotationSetName(String aKeyAnnotationSetName){
224 keyAnnotationSetName = aKeyAnnotationSetName;
225 }
227
231 public String getKeyAnnotationSetName(){
232 return keyAnnotationSetName;
233 }
235
239 public void setKeyFeatureNamesSet(Set aKeyFeatureNamesSet){
240 keyFeatureNamesSet = aKeyFeatureNamesSet;
241 }
243
247 public Set getKeyFeatureNamesSet(){
248 return keyFeatureNamesSet;
249 }
251
256 public void setResponseAnnotationSetName(String aResponseAnnotationSetName){
257 responseAnnotationSetName = aResponseAnnotationSetName;
258 }
260
264 public String getResponseAnnotationSetName(){
265 return responseAnnotationSetName;
266 }
268
273 public void setResponseAnnotationSetNameFalsePoz(
274 String aResponseAnnotationSetNameFalsePoz){
275 responseAnnotationSetNameFalsePoz = aResponseAnnotationSetNameFalsePoz;
276 }
278
283 public String getResponseAnnotationSetNameFalsePoz(){
284 return responseAnnotationSetNameFalsePoz;
285 }
287
290 public void setTextMode(Boolean aTextMode){
291 textMode = aTextMode.booleanValue();
294 }
296
297 public boolean isTextMode(){
298 return textMode;
299 }
301
302 public Set getAnnotationsOfType(int annotType){
303 return annotDiffer.getAnnotationsOfType(annotType);
304 }
306
307
311
312 public double getPrecisionStrict(){
313 return annotDiffer.getPrecisionStrict();
314 }
316
317 public double getPrecisionLenient(){
318 return annotDiffer.getPrecisionLenient();
319 }
321
322 public double getPrecisionAverage(){
323 return annotDiffer.getPrecisionAverage();
324 }
326
327 public double getFMeasureStrict(){
328 return annotDiffer.getFMeasureStrict(1);
329 }
331
332 public double getFMeasureLenient(){
333 return annotDiffer.getFMeasureLenient(1);
334 }
336
337 public double getFMeasureAverage(){
338 return annotDiffer.getFMeasureAverage(1);
339 }
341
345
346 public double getRecallStrict(){
347 return annotDiffer.getRecallStrict();
348 }
350
351 public double getRecallLenient(){
352 return annotDiffer.getRecallLenient();
353 }
355
356 public double getRecallAverage(){
357 return annotDiffer.getRecallAverage();
358 }
360
364 public long getCorrectCount() {
365 return annotDiffer.getCorrectMatches();
366 }
367
368 public long getPartiallyCorrectCount() {
369 return annotDiffer.getPartiallyCorrectMatches();
370 }
371
372 public long getSpuriousCount() {
373 return annotDiffer.getSpurious();
374 }
375
376 public long getMissingCount() {
377 return annotDiffer.getMissing();
378 }
379
380
384
385 public double getFalsePositiveStrict(){
386 return annotDiffer.getFalsePositivesStrict();
387 }
389
390 public double getFalsePositiveLenient(){
391 return annotDiffer.getFalsePositivesLenient();
392 }
394
395 public double getFalsePositiveAverage(){
396 return (double)(((double)getFalsePositiveLenient() + getFalsePositiveStrict()) / (double)(2.0));
397 }
399
404 public void setResponseDocument(Document aResponseDocument) {
405 responseDocument = aResponseDocument;
406 }
408
414 public void setAnnotationSchema(AnnotationSchema anAnnotationSchema) {
415 annotationSchema = anAnnotationSchema;
416 }
418
419 public AnnotationSchema getAnnotationSchema(){
420 return annotationSchema;
421 }
423 public Dimension getPreferredScrollableViewportSize() {
424 return getPreferredSize();
425 }
427 public int getScrollableUnitIncrement(Rectangle visibleRect,
428 int orientation, int direction) {
429 return maxUnitIncrement;
430 }
432 public int getScrollableBlockIncrement(Rectangle visibleRect,
433 int orientation, int direction) {
434 if (orientation == SwingConstants.HORIZONTAL)
435 return visibleRect.width - maxUnitIncrement;
436 else
437 return visibleRect.height - maxUnitIncrement;
438 }
440 public boolean getScrollableTracksViewportWidth() {
441 return false;
442 }
444 public boolean getScrollableTracksViewportHeight() {
445 return false;
446 }
447
448
452 public Resource init() throws ResourceInstantiationException {
453 colors[DEFAULT_TYPE] = WHITE;
454 colors[CORRECT_TYPE] = GREEN;
455 colors[SPURIOUS_TYPE] = RED;
456 colors[PARTIALLY_CORRECT_TYPE] = BLUE;
457 colors[MISSING_TYPE] = YELLOW;
458
459 keyPartiallySet = new HashSet();
461 responsePartiallySet = new HashSet();
462
463 AnnotationSet keyAnnotSet = null;
465 AnnotationSet responseAnnotSet = null;
466
467 if(annotationSchema == null)
468 throw new ResourceInstantiationException("No annotation schema defined !");
469
470 if(keyDocument == null)
471 throw new ResourceInstantiationException("No key document defined !");
472
473 if(responseDocument == null)
474 throw new ResourceInstantiationException("No response document defined !");
475
476 if (keyAnnotationSetName == null)
477 keyAnnotSet = keyDocument.getAnnotations().get(
479 annotationSchema.getAnnotationName());
480 else
481 keyAnnotSet = keyDocument.getAnnotations(keyAnnotationSetName).
482 get(annotationSchema.getAnnotationName());
483
484
485 if (responseAnnotationSetName == null)
486 responseAnnotSet = responseDocument.getAnnotations().get(
488 annotationSchema.getAnnotationName());
489 else
490 responseAnnotSet = responseDocument.getAnnotations(responseAnnotationSetName).get(annotationSchema.getAnnotationName());
491
492
493
494 annotDiffer.setSignificantFeaturesSet(getKeyFeatureNamesSet());
497 ArrayList choices = (ArrayList) annotDiffer.calculateDiff(keyAnnotSet, responseAnnotSet);
498 diffSet = new HashSet();
499 for(int i=0;i<choices.size();i++) {
500 AnnotationDiffer.PairingImpl choice = (AnnotationDiffer.PairingImpl) choices.get(i);
501 int type = choice.getType();
502 int leftType = 0;
503 int rightType = 0;
504 if(type == AnnotationDiffer.CORRECT) {
505 leftType = CORRECT_TYPE;
506 rightType = CORRECT_TYPE;
507 } else if(type == AnnotationDiffer.PARTIALLY_CORRECT) {
508 leftType = PARTIALLY_CORRECT_TYPE;
509 rightType = PARTIALLY_CORRECT_TYPE;
510 } else {
511 if(choice.getKey() == null) { leftType = SPURIOUS_TYPE; rightType = SPURIOUS_TYPE; }
512 else { leftType = MISSING_TYPE; rightType = MISSING_TYPE; }
513 }
514 diffSet.add(new DiffSetElement(choice.getKey(),choice.getResponse(), leftType, rightType));
515 }
516
517 if (textMode) return this;
519
520 formatter.setMaximumIntegerDigits(1);
524 formatter.setMinimumFractionDigits(4);
525 formatter.setMinimumFractionDigits(4);
526
527 AnnotationDiffTableModel diffModel = new AnnotationDiffTableModel(diffSet);
529 diffTable = new XJTable(diffModel);
531 diffTable.setAlignmentX(Component.LEFT_ALIGNMENT);
532 AnnotationDiffCellRenderer cellRenderer = new AnnotationDiffCellRenderer();
534 diffTable.setDefaultRenderer(java.lang.String.class,cellRenderer);
535 diffTable.setDefaultRenderer(java.lang.Long.class,cellRenderer);
536
538 SwingUtilities.invokeLater(new Runnable(){
540 public void run(){
541 arangeAllComponents();
542 }
543 });
544
545 if (DEBUG)
546 printStructure(diffSet);
547
548 return this;
549 }
551
554 protected void arangeAllComponents(){
555 this.removeAll();
556 BoxLayout boxLayout = new BoxLayout(this,BoxLayout.Y_AXIS);
558 this.setLayout(boxLayout);
559
560 JTableHeader tableHeader = diffTable.getTableHeader();
561 tableHeader.setAlignmentX(Component.LEFT_ALIGNMENT);
562 this.add(tableHeader);
563 diffTable.setAlignmentX(Component.LEFT_ALIGNMENT);
564 this.add(diffTable);
566
567
568 JPanel infoBox = new JPanel();
572 infoBox.setLayout(new BoxLayout(infoBox,BoxLayout.X_AXIS));
573 infoBox.setAlignmentX(Component.LEFT_ALIGNMENT);
574
577 Box box = new Box(BoxLayout.Y_AXIS);
578 JLabel jLabel = new JLabel("LEGEND");
579 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
580 jLabel.setOpaque(true);
581 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
582 box.add(jLabel);
583
584 jLabel = new JLabel("Missing (present in Key but not in Response): " +
585 annotDiffer.getMissing());
586 jLabel.setForeground(BLACK);
587 jLabel.setBackground(colors[MISSING_TYPE]);
588 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
589 jLabel.setOpaque(true);
590 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
591 box.add(jLabel);
592
593 box.add(Box.createRigidArea(new Dimension(0,5)));
595
596 jLabel = new JLabel("Correct (total match): " + annotDiffer.getCorrectMatches());
597 jLabel.setForeground(BLACK);
598 jLabel.setBackground(colors[CORRECT_TYPE]);
599 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
600 jLabel.setOpaque(true);
601 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
602 box.add(jLabel);
603
604 box.add(Box.createRigidArea(new Dimension(0,5)));
606
607 jLabel =new JLabel("Partially correct (overlap in Key and Response): "+
608 annotDiffer.getPartiallyCorrectMatches());
609 jLabel.setForeground(BLACK);
610 jLabel.setBackground(colors[PARTIALLY_CORRECT_TYPE]);
611 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
612 jLabel.setOpaque(true);
613 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
614 box.add(jLabel);
615
616 box.add(Box.createRigidArea(new Dimension(0,5)));
618
619 jLabel = new JLabel("Spurious (present in Response but not in Key): " +
620 annotDiffer.getSpurious());
621 jLabel.setForeground(BLACK);
622 jLabel.setBackground(colors[SPURIOUS_TYPE]);
623 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
624 jLabel.setOpaque(true);
625 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
626 box.add(jLabel);
627
628 infoBox.add(box);
629 infoBox.add(Box.createRigidArea(new Dimension(40,0)));
631
632 box = new Box(BoxLayout.Y_AXIS);
635
636 jLabel = new JLabel("Precision strict: " +
637 formatter.format(getPrecisionStrict()));
638 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
639 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
640 box.add(jLabel);
641
642 jLabel = new JLabel("Precision average: " +
643 formatter.format(getPrecisionAverage()));
644 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
645 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
646 box.add(jLabel);
647
648 jLabel = new JLabel("Precision lenient: " +
649 formatter.format(getPrecisionLenient()));
650 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
651 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
652 box.add(jLabel);
653
654 infoBox.add(box);
655 infoBox.add(Box.createRigidArea(new Dimension(40,0)));
657
658 box = new Box(BoxLayout.Y_AXIS);
661
662 jLabel = new JLabel("Recall strict: " + formatter.format(getRecallStrict()));
663 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
664 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
665 box.add(jLabel);
666
667 jLabel = new JLabel("Recall average: " + formatter.format(getRecallAverage()));
668 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
669 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
670 box.add(jLabel);
671
672 jLabel = new JLabel("Recall lenient: " + formatter.format(getRecallLenient()));
673 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
674 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
675 box.add(jLabel);
676
677 infoBox.add(box);
678 infoBox.add(Box.createRigidArea(new Dimension(40,0)));
680
681 box = new Box(BoxLayout.Y_AXIS);
684
685 jLabel = new JLabel("F-Measure strict: " +
686 formatter.format(getFMeasureStrict()));
687 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
688 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
689 box.add(jLabel);
690
691 jLabel = new JLabel("F-Measure average: " +
692 formatter.format(getFMeasureAverage()));
693 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
694 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
695 box.add(jLabel);
696
697 jLabel = new JLabel("F-Measure lenient: " +
698 formatter.format(getFMeasureLenient()));
699 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
700 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
701 box.add(jLabel);
702 infoBox.add(box);
703
704 infoBox.add(Box.createRigidArea(new Dimension(40,0)));
706
707 box = new Box(BoxLayout.Y_AXIS);
710
711 jLabel = new JLabel("False positive strict: " +
712 formatter.format(getFalsePositiveStrict()));
713 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
714 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
715 box.add(jLabel);
716
717 jLabel = new JLabel("False positive average: " +
718 formatter.format(getFalsePositiveAverage()));
719 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
720 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
721 box.add(jLabel);
722
723 jLabel = new JLabel("False positive lenient: " +
724 formatter.format(getFalsePositiveLenient()));
725 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
726 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
727 box.add(jLabel);
728 infoBox.add(box);
729
730 infoBox.add(Box.createRigidArea(new Dimension(10,0)));
732
733 this.add(infoBox);
734 }
736
737 protected void printStructure(Set aDiffSet){
738 Iterator iterator = aDiffSet.iterator();
739 String leftAnnot = null;
740 String rightAnnot = null;
741 while(iterator.hasNext()){
742 DiffSetElement diffElem = (DiffSetElement) iterator.next();
743 if (diffElem.getLeftAnnotation() == null)
744 leftAnnot = "NULL ";
745 else
746 leftAnnot = diffElem.getLeftAnnotation().toString();
747 if (diffElem.getRightAnnotation() == null)
748 rightAnnot = " NULL";
749 else
750 rightAnnot = diffElem.getRightAnnotation().toString();
751 Out.prln( leftAnnot + "|" + rightAnnot);
752 } }
755
756
759
760
765 protected class AnnotationDiffTableModel extends AbstractTableModel{
766
767
768 public AnnotationDiffTableModel(Collection data){
769 modelData = new ArrayList();
770 modelData.addAll(data);
771 }
773
774 public AnnotationDiffTableModel(){
775 modelData = new ArrayList();
776 }
778
779 public int getRowCount(){
780 return modelData.size();
781 }
783
784 public int getColumnCount(){
785 return 9;
786 }
788
789 public String getColumnName(int column){
790 switch(column){
791 case 0: return "String - Key";
792 case 1: return "Start - Key";
793 case 2: return "End - Key";
794 case 3: return "Features - Key";
795 case 4: return " ";
796 case 5: return "String - Response";
797 case 6: return "Start - Response";
798 case 7: return "End -Response";
799 case 8: return "Features - Response";
800 default:return "?";
801 }
802 }
804
805 public Class getColumnClass(int column){
806 switch(column){
807 case 0: return String.class;
808 case 1: return Long.class;
809 case 2: return Long.class;
810 case 3: return String.class;
811 case 4: return String.class;
812 case 5: return String.class;
813 case 6: return Long.class;
814 case 7: return Long.class;
815 case 8: return String.class;
816 default:return Object.class;
817 }
818 }
820
821 public Object getValueAt(int row, int column){
822 DiffSetElement diffSetElement = (DiffSetElement) modelData.get(row);
823 if (diffSetElement == null) return null;
824 switch(column){
825 case 0:{
828 if (diffSetElement.getLeftAnnotation() == null) return null;
829 Annotation annot = diffSetElement.getLeftAnnotation();
830 String theString = "";
831 try {
832 theString = keyDocument.getContent().getContent(
833 annot.getStartNode().getOffset(),
834 annot.getEndNode().getOffset()).toString();
835 } catch (gate.util.InvalidOffsetException ex) {
836 Err.prln(ex.getMessage());
837 }
838 return theString;
839 }
840 case 1:{
842 if (diffSetElement.getLeftAnnotation() == null) return null;
843 return diffSetElement.getLeftAnnotation().getStartNode().getOffset();
844 }
845 case 2:{
847 if (diffSetElement.getLeftAnnotation() == null) return null;
848 return diffSetElement.getLeftAnnotation().getEndNode().getOffset();
849 }
850 case 3:{
852 if (diffSetElement.getLeftAnnotation() == null) return null;
853 if (diffSetElement.getLeftAnnotation().getFeatures() == null)
854 return null;
855 return diffSetElement.getLeftAnnotation().getFeatures().toString();
856 }
857 case 4:{
859 return " ";
860 }
861 case 5:{
864 if (diffSetElement.getRightAnnotation() == null) return null;
865 Annotation annot = diffSetElement.getRightAnnotation();
866 String theString = "";
867 try {
868 theString = responseDocument.getContent().getContent(
869 annot.getStartNode().getOffset(),
870 annot.getEndNode().getOffset()).toString();
871 } catch (gate.util.InvalidOffsetException ex) {
872 Err.prln(ex.getMessage());
873 }
874 return theString;
875 }
876 case 6:{
878 if (diffSetElement.getRightAnnotation() == null) return null;
879 return diffSetElement.getRightAnnotation().getStartNode().getOffset();
880 }
881 case 7:{
883 if (diffSetElement.getRightAnnotation() == null) return null;
884 return diffSetElement.getRightAnnotation().getEndNode().getOffset();
885 }
886 case 8:{
888 if (diffSetElement.getRightAnnotation() == null) return null;
889 return diffSetElement.getRightAnnotation().getFeatures().toString();
890 }
891 case 9:{
893 return diffSetElement;
894 }
895 default:{return null;}
896 } }
899 public Object getRawObject(int row){
900 return modelData.get(row);
901 }
903
904 private java.util.List modelData = null;
905
906 }
908
909
912
915 public class AnnotationDiffCellRenderer extends DefaultTableCellRenderer{
916
917
918 public AnnotationDiffCellRenderer() { }
920 private Color background = WHITE;
921
922 private Color foreground = BLACK;
923
924
925
926 public Component getTableCellRendererComponent(
927 JTable table, Object value, boolean isSelected, boolean hasFocus,
928 int row, int column
929 ) {
930 JComponent defaultComp = null;
931 defaultComp = (JComponent) super.getTableCellRendererComponent(
932 table, value, isSelected, hasFocus, row, column
933 );
934
935 if (column == 4 || value == null)
937 return new JPanel();
938
939 if (!(table.getModel().getValueAt(row,9) instanceof DiffSetElement))
940 return defaultComp;
941
942 DiffSetElement diffSetElement =
943 (DiffSetElement) table.getModel().getValueAt(row,9);
944
945 if (diffSetElement == null)
946 return defaultComp;
947
948 if (column < 4){
949 if (diffSetElement.getLeftAnnotation() != null) {
950 background = colors[diffSetElement.getLeftType()];
951 }
952 else return new JPanel();
953 }else{
954 if (diffSetElement.getRightAnnotation() != null)
955 background = colors[diffSetElement.getRightType()];
956 else return new JPanel();
957 }
958
959 defaultComp.setBackground(background);
960 defaultComp.setForeground(BLACK);
961 defaultComp.setOpaque(true);
962 return defaultComp;
963 }
965 }
967
968
971
972
976 protected class DiffSetElement {
977
978 private Annotation leftAnnotation = null;
979
980 private Annotation rightAnnotation = null;
981
982 private int leftType = DEFAULT_TYPE;
983
984 private int rightType = DEFAULT_TYPE;
985
986
987 public DiffSetElement() {}
988
989
990 public DiffSetElement( Annotation aLeftAnnotation,
991 Annotation aRightAnnotation,
992 int aLeftType,
993 int aRightType){
994 leftAnnotation = aLeftAnnotation;
995 rightAnnotation = aRightAnnotation;
996 leftType = aLeftType;
997 rightType = aRightType;
998 }
1000
1001 public void setLeftAnnotation(Annotation aLeftAnnotation){
1002 leftAnnotation = aLeftAnnotation;
1003 }
1005
1006 public Annotation getLeftAnnotation(){
1007 return leftAnnotation;
1008 }
1010
1011 public void setRightAnnotation(Annotation aRightAnnotation){
1012 rightAnnotation = aRightAnnotation;
1013 }
1015
1016 public Annotation getRightAnnotation(){
1017 return rightAnnotation;
1018 }
1020
1021 public void setLeftType(int aLeftType){
1022 leftType = aLeftType;
1023 }
1025
1026 public int getLeftType() {
1027 return leftType;
1028 }
1030
1031 public void setRightType(int aRightType) {
1032 rightType = aRightType;
1033 }
1035
1036 public int getRightType() {
1037 return rightType;
1038 } } }