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
35 public class AnnotationDiff extends AbstractVisualResource
36 implements Scrollable{
37
38 protected int maxUnitIncrement = 10;
40
41
42 private static final boolean DEBUG = false;
43
44
46 private Document keyDocument = null;
47
48
51 private String keyAnnotationSetName = null;
52
53
56 private Document responseDocument = null;
57
58
61 private String responseAnnotationSetName = null;
62
63
66 private String responseAnnotationSetNameFalsePoz = null;
67
68
69 private AnnotationSchema annotationSchema = null;
70
71
74 private Set keyFeatureNamesSet = null;
75
76
77 private double precisionStrict = 0.0;
78
79 private double precisionLenient = 0.0;
80
81 private double precisionAverage = 0.0;
82
83
84 private double recallStrict = 0.0;
85
86 private double recallLenient = 0.0;
87
88 private double recallAverage = 0.0;
89
90
91 private double falsePositiveStrict = 0.0;
92
93 private double falsePositiveLenient = 0.0;
94
95 private double falsePositiveAverage = 0.0;
96
97
98 private double fMeasureStrict = 0.0;
99
100 private double fMeasureLenient = 0.0;
101
102 private double fMeasureAverage = 0.0;
103
104 public static double weight = 0.5;
105
106
109 private String annotationTypeForFalsePositive = null;
110
111
112 protected static NumberFormat formatter = NumberFormat.getInstance();
113
114
115 private XJTable diffTable = null;
116
117
118 private Set diffSet = null;
119
120
122 private Set keyPartiallySet = null;
123
124 private Set responsePartiallySet = null;
125
126
127 private java.util.List keyAnnotList = null;
128
129 private java.util.List responseAnnotList = null;
130
131
133 private boolean textMode = false;
134
135
138 public static final int MAX_TYPES = 5;
139
140 public static final int DEFAULT_TYPE = 0;
141
142 public static final int CORRECT_TYPE = 1;
143
145 public static final int PARTIALLY_CORRECT_TYPE = 2;
146
148 public static final int SPURIOUS_TYPE = 3;
149
151 public static final int MISSING_TYPE = 4;
152
153
154 private final Color RED = new Color(255,173,181);
155
156 private final Color GREEN = new Color(173,255,214);
157
158 private final Color WHITE = new Color(255,255,255);
159
160 private final Color BLUE = new Color(173,215,255);
161
162 private final Color YELLOW = new Color(255,231,173);
163
164
165 private final int NULL_TYPE = -1;
166
167 private final Color BLACK = new Color(0,0,0);
168
169 private Color colors[] = new Color[MAX_TYPES];
170
171
172 private JScrollPane scrollPane = null;
173
174
177 private long typeCounter[] = new long[MAX_TYPES];
178
179
180 private gate.util.AnnotationDiffer annotDiffer;
181
182
183 public AnnotationDiff(){
184 annotDiffer = new AnnotationDiffer();
185 }
187
192 public void setAnnotationTypeForFalsePositive(String anAnnotType){
193 annotationTypeForFalsePositive = anAnnotType;
194 }
196
200 public String getAnnotationTypeForFalsePositive(){
201 return annotationTypeForFalsePositive;
202 }
204
207 public void setKeyDocument(Document aKeyDocument) {
208 keyDocument = aKeyDocument;
209 }
211
212 public Document getKeyDocument(){
213 return keyDocument;
214 }
216
221 public void setKeyAnnotationSetName(String aKeyAnnotationSetName){
222 keyAnnotationSetName = aKeyAnnotationSetName;
223 }
225
229 public String getKeyAnnotationSetName(){
230 return keyAnnotationSetName;
231 }
233
237 public void setKeyFeatureNamesSet(Set aKeyFeatureNamesSet){
238 keyFeatureNamesSet = aKeyFeatureNamesSet;
239 }
241
245 public Set getKeyFeatureNamesSet(){
246 return keyFeatureNamesSet;
247 }
249
254 public void setResponseAnnotationSetName(String aResponseAnnotationSetName){
255 responseAnnotationSetName = aResponseAnnotationSetName;
256 }
258
262 public String getResponseAnnotationSetName(){
263 return responseAnnotationSetName;
264 }
266
271 public void setResponseAnnotationSetNameFalsePoz(
272 String aResponseAnnotationSetNameFalsePoz){
273 responseAnnotationSetNameFalsePoz = aResponseAnnotationSetNameFalsePoz;
274 }
276
281 public String getResponseAnnotationSetNameFalsePoz(){
282 return responseAnnotationSetNameFalsePoz;
283 }
285
288 public void setTextMode(Boolean aTextMode){
289 textMode = aTextMode.booleanValue();
292 }
294
295 public boolean isTextMode(){
296 return textMode;
297 }
299
300 public Set getAnnotationsOfType(int annotType){
301 return annotDiffer.getAnnotationsOfType(annotType);
302 }
304
305
309
310 public double getPrecisionStrict(){
311 return annotDiffer.getPrecisionStrict();
312 }
314
315 public double getPrecisionLenient(){
316 return annotDiffer.getPrecisionLenient();
317 }
319
320 public double getPrecisionAverage(){
321 return annotDiffer.getPrecisionAverage();
322 }
324
325 public double getFMeasureStrict(){
326 return annotDiffer.getFMeasureStrict(1);
327 }
329
330 public double getFMeasureLenient(){
331 return annotDiffer.getFMeasureLenient(1);
332 }
334
335 public double getFMeasureAverage(){
336 return annotDiffer.getFMeasureAverage(1);
337 }
339
343
344 public double getRecallStrict(){
345 return annotDiffer.getRecallStrict();
346 }
348
349 public double getRecallLenient(){
350 return annotDiffer.getRecallLenient();
351 }
353
354 public double getRecallAverage(){
355 return annotDiffer.getRecallAverage();
356 }
358
362 public long getCorrectCount() {
363 return annotDiffer.getCorrectMatches();
364 }
365
366 public long getPartiallyCorrectCount() {
367 return annotDiffer.getPartiallyCorrectMatches();
368 }
369
370 public long getSpuriousCount() {
371 return annotDiffer.getSpurious();
372 }
373
374 public long getMissingCount() {
375 return annotDiffer.getMissing();
376 }
377
378
382
383 public double getFalsePositiveStrict(){
384 return annotDiffer.getFalsePositivesStrict();
385 }
387
388 public double getFalsePositiveLenient(){
389 return annotDiffer.getFalsePositivesLenient();
390 }
392
393 public double getFalsePositiveAverage(){
394 return (double)(((double)getFalsePositiveLenient() + getFalsePositiveStrict()) / (double)(2.0));
395 }
397
402 public void setResponseDocument(Document aResponseDocument) {
403 responseDocument = aResponseDocument;
404 }
406
412 public void setAnnotationSchema(AnnotationSchema anAnnotationSchema) {
413 annotationSchema = anAnnotationSchema;
414 }
416
417 public AnnotationSchema getAnnotationSchema(){
418 return annotationSchema;
419 }
421 public Dimension getPreferredScrollableViewportSize() {
422 return getPreferredSize();
423 }
425 public int getScrollableUnitIncrement(Rectangle visibleRect,
426 int orientation, int direction) {
427 return maxUnitIncrement;
428 }
430 public int getScrollableBlockIncrement(Rectangle visibleRect,
431 int orientation, int direction) {
432 if (orientation == SwingConstants.HORIZONTAL)
433 return visibleRect.width - maxUnitIncrement;
434 else
435 return visibleRect.height - maxUnitIncrement;
436 }
438 public boolean getScrollableTracksViewportWidth() {
439 return false;
440 }
442 public boolean getScrollableTracksViewportHeight() {
443 return false;
444 }
445
446
450 public Resource init() throws ResourceInstantiationException {
451 colors[DEFAULT_TYPE] = WHITE;
452 colors[CORRECT_TYPE] = GREEN;
453 colors[SPURIOUS_TYPE] = RED;
454 colors[PARTIALLY_CORRECT_TYPE] = BLUE;
455 colors[MISSING_TYPE] = YELLOW;
456
457 keyPartiallySet = new HashSet();
459 responsePartiallySet = new HashSet();
460
461 AnnotationSet keyAnnotSet = null;
463 AnnotationSet responseAnnotSet = null;
464
465 if(annotationSchema == null)
466 throw new ResourceInstantiationException("No annotation schema defined !");
467
468 if(keyDocument == null)
469 throw new ResourceInstantiationException("No key document defined !");
470
471 if(responseDocument == null)
472 throw new ResourceInstantiationException("No response document defined !");
473
474 if (keyAnnotationSetName == null)
475 keyAnnotSet = keyDocument.getAnnotations().get(
477 annotationSchema.getAnnotationName());
478 else
479 keyAnnotSet = keyDocument.getAnnotations(keyAnnotationSetName).
480 get(annotationSchema.getAnnotationName());
481
482
483 if (responseAnnotationSetName == null)
484 responseAnnotSet = responseDocument.getAnnotations().get(
486 annotationSchema.getAnnotationName());
487 else
488 responseAnnotSet = responseDocument.getAnnotations(responseAnnotationSetName).get(annotationSchema.getAnnotationName());
489
490
491
492 annotDiffer.setSignificantFeaturesSet(getKeyFeatureNamesSet());
495 ArrayList choices = (ArrayList) annotDiffer.calculateDiff(keyAnnotSet, responseAnnotSet);
496 diffSet = new HashSet();
497 for(int i=0;i<choices.size();i++) {
498 AnnotationDiffer.PairingImpl choice = (AnnotationDiffer.PairingImpl) choices.get(i);
499 int type = choice.getType();
500 int leftType = 0;
501 int rightType = 0;
502 if(type == AnnotationDiffer.CORRECT) {
503 leftType = CORRECT_TYPE;
504 rightType = CORRECT_TYPE;
505 } else if(type == AnnotationDiffer.PARTIALLY_CORRECT) {
506 leftType = PARTIALLY_CORRECT_TYPE;
507 rightType = PARTIALLY_CORRECT_TYPE;
508 } else {
509 if(choice.getKey() == null) { leftType = SPURIOUS_TYPE; rightType = SPURIOUS_TYPE; }
510 else { leftType = MISSING_TYPE; rightType = MISSING_TYPE; }
511 }
512 diffSet.add(new DiffSetElement(choice.getKey(),choice.getResponse(), leftType, rightType));
513 }
514
515 if (textMode) return this;
517
518 formatter.setMaximumIntegerDigits(1);
522 formatter.setMinimumFractionDigits(4);
523 formatter.setMinimumFractionDigits(4);
524
525 AnnotationDiffTableModel diffModel = new AnnotationDiffTableModel(diffSet);
527 diffTable = new XJTable(diffModel);
529 diffTable.setAlignmentX(Component.LEFT_ALIGNMENT);
530 AnnotationDiffCellRenderer cellRenderer = new AnnotationDiffCellRenderer();
532 diffTable.setDefaultRenderer(java.lang.String.class,cellRenderer);
533 diffTable.setDefaultRenderer(java.lang.Long.class,cellRenderer);
534
536 SwingUtilities.invokeLater(new Runnable(){
538 public void run(){
539 arangeAllComponents();
540 }
541 });
542
543 if (DEBUG)
544 printStructure(diffSet);
545
546 return this;
547 }
549
552 protected void arangeAllComponents(){
553 this.removeAll();
554 BoxLayout boxLayout = new BoxLayout(this,BoxLayout.Y_AXIS);
556 this.setLayout(boxLayout);
557
558 JTableHeader tableHeader = diffTable.getTableHeader();
559 tableHeader.setAlignmentX(Component.LEFT_ALIGNMENT);
560 this.add(tableHeader);
561 diffTable.setAlignmentX(Component.LEFT_ALIGNMENT);
562 this.add(diffTable);
564
565
566 JPanel infoBox = new JPanel();
570 infoBox.setLayout(new BoxLayout(infoBox,BoxLayout.X_AXIS));
571 infoBox.setAlignmentX(Component.LEFT_ALIGNMENT);
572
575 Box box = new Box(BoxLayout.Y_AXIS);
576 JLabel jLabel = new JLabel("LEGEND");
577 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
578 jLabel.setOpaque(true);
579 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
580 box.add(jLabel);
581
582 jLabel = new JLabel("Missing (present in Key but not in Response): " +
583 annotDiffer.getMissing());
584 jLabel.setForeground(BLACK);
585 jLabel.setBackground(colors[MISSING_TYPE]);
586 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
587 jLabel.setOpaque(true);
588 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
589 box.add(jLabel);
590
591 box.add(Box.createRigidArea(new Dimension(0,5)));
593
594 jLabel = new JLabel("Correct (total match): " + annotDiffer.getCorrectMatches());
595 jLabel.setForeground(BLACK);
596 jLabel.setBackground(colors[CORRECT_TYPE]);
597 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
598 jLabel.setOpaque(true);
599 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
600 box.add(jLabel);
601
602 box.add(Box.createRigidArea(new Dimension(0,5)));
604
605 jLabel =new JLabel("Partially correct (overlap in Key and Response): "+
606 annotDiffer.getPartiallyCorrectMatches());
607 jLabel.setForeground(BLACK);
608 jLabel.setBackground(colors[PARTIALLY_CORRECT_TYPE]);
609 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
610 jLabel.setOpaque(true);
611 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
612 box.add(jLabel);
613
614 box.add(Box.createRigidArea(new Dimension(0,5)));
616
617 jLabel = new JLabel("Spurious (present in Response but not in Key): " +
618 annotDiffer.getSpurious());
619 jLabel.setForeground(BLACK);
620 jLabel.setBackground(colors[SPURIOUS_TYPE]);
621 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
622 jLabel.setOpaque(true);
623 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
624 box.add(jLabel);
625
626 infoBox.add(box);
627 infoBox.add(Box.createRigidArea(new Dimension(40,0)));
629
630 box = new Box(BoxLayout.Y_AXIS);
633
634 jLabel = new JLabel("Precision strict: " +
635 formatter.format(getPrecisionStrict()));
636 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
637 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
638 box.add(jLabel);
639
640 jLabel = new JLabel("Precision average: " +
641 formatter.format(getPrecisionAverage()));
642 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
643 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
644 box.add(jLabel);
645
646 jLabel = new JLabel("Precision lenient: " +
647 formatter.format(getPrecisionLenient()));
648 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
649 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
650 box.add(jLabel);
651
652 infoBox.add(box);
653 infoBox.add(Box.createRigidArea(new Dimension(40,0)));
655
656 box = new Box(BoxLayout.Y_AXIS);
659
660 jLabel = new JLabel("Recall strict: " + formatter.format(getRecallStrict()));
661 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
662 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
663 box.add(jLabel);
664
665 jLabel = new JLabel("Recall average: " + formatter.format(getRecallAverage()));
666 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
667 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
668 box.add(jLabel);
669
670 jLabel = new JLabel("Recall lenient: " + formatter.format(getRecallLenient()));
671 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
672 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
673 box.add(jLabel);
674
675 infoBox.add(box);
676 infoBox.add(Box.createRigidArea(new Dimension(40,0)));
678
679 box = new Box(BoxLayout.Y_AXIS);
682
683 jLabel = new JLabel("F-Measure strict: " +
684 formatter.format(getFMeasureStrict()));
685 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
686 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
687 box.add(jLabel);
688
689 jLabel = new JLabel("F-Measure average: " +
690 formatter.format(getFMeasureAverage()));
691 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
692 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
693 box.add(jLabel);
694
695 jLabel = new JLabel("F-Measure lenient: " +
696 formatter.format(getFMeasureLenient()));
697 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
698 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
699 box.add(jLabel);
700 infoBox.add(box);
701
702 infoBox.add(Box.createRigidArea(new Dimension(40,0)));
704
705 box = new Box(BoxLayout.Y_AXIS);
708
709 jLabel = new JLabel("False positive strict: " +
710 formatter.format(getFalsePositiveStrict()));
711 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
712 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
713 box.add(jLabel);
714
715 jLabel = new JLabel("False positive average: " +
716 formatter.format(getFalsePositiveAverage()));
717 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
718 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
719 box.add(jLabel);
720
721 jLabel = new JLabel("False positive lenient: " +
722 formatter.format(getFalsePositiveLenient()));
723 jLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
724 jLabel.setFont(jLabel.getFont().deriveFont(Font.BOLD));
725 box.add(jLabel);
726 infoBox.add(box);
727
728 infoBox.add(Box.createRigidArea(new Dimension(10,0)));
730
731 this.add(infoBox);
732 }
734
735 protected void printStructure(Set aDiffSet){
736 Iterator iterator = aDiffSet.iterator();
737 String leftAnnot = null;
738 String rightAnnot = null;
739 while(iterator.hasNext()){
740 DiffSetElement diffElem = (DiffSetElement) iterator.next();
741 if (diffElem.getLeftAnnotation() == null)
742 leftAnnot = "NULL ";
743 else
744 leftAnnot = diffElem.getLeftAnnotation().toString();
745 if (diffElem.getRightAnnotation() == null)
746 rightAnnot = " NULL";
747 else
748 rightAnnot = diffElem.getRightAnnotation().toString();
749 Out.prln( leftAnnot + "|" + rightAnnot);
750 } }
753
754
757
758
763 protected class AnnotationDiffTableModel extends AbstractTableModel{
764
765
766 public AnnotationDiffTableModel(Collection data){
767 modelData = new ArrayList();
768 modelData.addAll(data);
769 }
771
772 public AnnotationDiffTableModel(){
773 modelData = new ArrayList();
774 }
776
777 public int getRowCount(){
778 return modelData.size();
779 }
781
782 public int getColumnCount(){
783 return 9;
784 }
786
787 public String getColumnName(int column){
788 switch(column){
789 case 0: return "String - Key";
790 case 1: return "Start - Key";
791 case 2: return "End - Key";
792 case 3: return "Features - Key";
793 case 4: return " ";
794 case 5: return "String - Response";
795 case 6: return "Start - Response";
796 case 7: return "End -Response";
797 case 8: return "Features - Response";
798 default:return "?";
799 }
800 }
802
803 public Class getColumnClass(int column){
804 switch(column){
805 case 0: return String.class;
806 case 1: return Long.class;
807 case 2: return Long.class;
808 case 3: return String.class;
809 case 4: return String.class;
810 case 5: return String.class;
811 case 6: return Long.class;
812 case 7: return Long.class;
813 case 8: return String.class;
814 default:return Object.class;
815 }
816 }
818
819 public Object getValueAt(int row, int column){
820 DiffSetElement diffSetElement = (DiffSetElement) modelData.get(row);
821 if (diffSetElement == null) return null;
822 switch(column){
823 case 0:{
826 if (diffSetElement.getLeftAnnotation() == null) return null;
827 Annotation annot = diffSetElement.getLeftAnnotation();
828 String theString = "";
829 try {
830 theString = keyDocument.getContent().getContent(
831 annot.getStartNode().getOffset(),
832 annot.getEndNode().getOffset()).toString();
833 } catch (gate.util.InvalidOffsetException ex) {
834 Err.prln(ex.getMessage());
835 }
836 return theString;
837 }
838 case 1:{
840 if (diffSetElement.getLeftAnnotation() == null) return null;
841 return diffSetElement.getLeftAnnotation().getStartNode().getOffset();
842 }
843 case 2:{
845 if (diffSetElement.getLeftAnnotation() == null) return null;
846 return diffSetElement.getLeftAnnotation().getEndNode().getOffset();
847 }
848 case 3:{
850 if (diffSetElement.getLeftAnnotation() == null) return null;
851 if (diffSetElement.getLeftAnnotation().getFeatures() == null)
852 return null;
853 return diffSetElement.getLeftAnnotation().getFeatures().toString();
854 }
855 case 4:{
857 return " ";
858 }
859 case 5:{
862 if (diffSetElement.getRightAnnotation() == null) return null;
863 Annotation annot = diffSetElement.getRightAnnotation();
864 String theString = "";
865 try {
866 theString = responseDocument.getContent().getContent(
867 annot.getStartNode().getOffset(),
868 annot.getEndNode().getOffset()).toString();
869 } catch (gate.util.InvalidOffsetException ex) {
870 Err.prln(ex.getMessage());
871 }
872 return theString;
873 }
874 case 6:{
876 if (diffSetElement.getRightAnnotation() == null) return null;
877 return diffSetElement.getRightAnnotation().getStartNode().getOffset();
878 }
879 case 7:{
881 if (diffSetElement.getRightAnnotation() == null) return null;
882 return diffSetElement.getRightAnnotation().getEndNode().getOffset();
883 }
884 case 8:{
886 if (diffSetElement.getRightAnnotation() == null) return null;
887 return diffSetElement.getRightAnnotation().getFeatures().toString();
888 }
889 case 9:{
891 return diffSetElement;
892 }
893 default:{return null;}
894 } }
897 public Object getRawObject(int row){
898 return modelData.get(row);
899 }
901
902 private java.util.List modelData = null;
903
904 }
906
907
910
913 public class AnnotationDiffCellRenderer extends DefaultTableCellRenderer{
914
915
916 public AnnotationDiffCellRenderer() { }
918 private Color background = WHITE;
919
920 private Color foreground = BLACK;
921
922
923
924 public Component getTableCellRendererComponent(
925 JTable table, Object value, boolean isSelected, boolean hasFocus,
926 int row, int column
927 ) {
928 JComponent defaultComp = null;
929 defaultComp = (JComponent) super.getTableCellRendererComponent(
930 table, value, isSelected, hasFocus, row, column
931 );
932
933 if (column == 4 || value == null)
935 return new JPanel();
936
937 if (!(table.getModel().getValueAt(row,9) instanceof DiffSetElement))
938 return defaultComp;
939
940 DiffSetElement diffSetElement =
941 (DiffSetElement) table.getModel().getValueAt(row,9);
942
943 if (diffSetElement == null)
944 return defaultComp;
945
946 if (column < 4){
947 if (diffSetElement.getLeftAnnotation() != null) {
948 background = colors[diffSetElement.getLeftType()];
949 }
950 else return new JPanel();
951 }else{
952 if (diffSetElement.getRightAnnotation() != null)
953 background = colors[diffSetElement.getRightType()];
954 else return new JPanel();
955 }
956
957 defaultComp.setBackground(background);
958 defaultComp.setForeground(BLACK);
959 defaultComp.setOpaque(true);
960 return defaultComp;
961 }
963 }
965
966
969
970
974 protected class DiffSetElement {
975
976 private Annotation leftAnnotation = null;
977
978 private Annotation rightAnnotation = null;
979
980 private int leftType = DEFAULT_TYPE;
981
982 private int rightType = DEFAULT_TYPE;
983
984
985 public DiffSetElement() {}
986
987
988 public DiffSetElement( Annotation aLeftAnnotation,
989 Annotation aRightAnnotation,
990 int aLeftType,
991 int aRightType){
992 leftAnnotation = aLeftAnnotation;
993 rightAnnotation = aRightAnnotation;
994 leftType = aLeftType;
995 rightType = aRightType;
996 }
998
999 public void setLeftAnnotation(Annotation aLeftAnnotation){
1000 leftAnnotation = aLeftAnnotation;
1001 }
1003
1004 public Annotation getLeftAnnotation(){
1005 return leftAnnotation;
1006 }
1008
1009 public void setRightAnnotation(Annotation aRightAnnotation){
1010 rightAnnotation = aRightAnnotation;
1011 }
1013
1014 public Annotation getRightAnnotation(){
1015 return rightAnnotation;
1016 }
1018
1019 public void setLeftType(int aLeftType){
1020 leftType = aLeftType;
1021 }
1023
1024 public int getLeftType() {
1025 return leftType;
1026 }
1028
1029 public void setRightType(int aRightType) {
1030 rightType = aRightType;
1031 }
1033
1034 public int getRightType() {
1035 return rightType;
1036 } } }