MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / update

Method update

src/main/java/core/packetproxy/gui/GUIDiffRaw.java:56–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 }
55
56 @Override
57 public void update() throws Exception {
58 DiffSet ds;
59 if (jc.isSelected()) {
60
61 ds = sortUniq(Diff.getInstance().getSet());
62 } else {
63
64 ds = Diff.getInstance().getSet();
65 }
66 textOrig.setData(ds.getOriginal(), false);
67 textTarg.setData(ds.getTarget(), false);
68
69 docOrig = textOrig.getStyledDocument();
70 docTarg = textTarg.getStyledDocument();
71
72 docOrig.setCharacterAttributes(0, docOrig.getLength(), defaultAttr, false);
73 docTarg.setCharacterAttributes(0, docTarg.getLength(), defaultAttr, false);
74
75 DiffEventAdapter eventFordocOrig = new DiffEventAdapter() {
76
77 public void foundDelDelta(int pos, int length) throws Exception {
78 docOrig.setCharacterAttributes(pos, length, delAttr, false);
79 }
80
81 public void foundChgDelta(int pos, int length) throws Exception {
82 docOrig.setCharacterAttributes(pos, length, chgAttr, false);
83 }
84 };
85
86 DiffEventAdapter eventForTarget = new DiffEventAdapter() {
87
88 public void foundInsDelta(int pos, int length) throws Exception {
89 docTarg.setCharacterAttributes(pos, length, insAttr, false);
90 }
91
92 public void foundChgDelta(int pos, int length) throws Exception {
93 docTarg.setCharacterAttributes(pos, length, chgAttr, false);
94 }
95 };
96 if (jcCh.isSelected()) { // Character based
97
98 Diff.diffPerCharacter(ds, eventFordocOrig, eventForTarget);
99 } else { // Line based
100
101 Diff.diffPerLine(ds, eventFordocOrig, eventForTarget);
102 }
103 }
104}

Callers 1

actionPerformedMethod · 0.95

Calls 9

sortUniqMethod · 0.95
getInstanceMethod · 0.95
getOriginalMethod · 0.95
getTargetMethod · 0.95
diffPerCharacterMethod · 0.95
diffPerLineMethod · 0.95
getSetMethod · 0.80
setDataMethod · 0.45
getLengthMethod · 0.45

Tested by

no test coverage detected