highlighting refactored

This commit is contained in:
2014-11-16 14:49:31 +01:00
parent 0e128e2ef7
commit cb052143f5
48 changed files with 469 additions and 880 deletions
@@ -19,15 +19,14 @@ package com.jpexs.decompiler.graph;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.flash.helpers.HilightedTextWriter;
import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightData;
import com.jpexs.decompiler.graph.model.BinaryOp;
import com.jpexs.decompiler.graph.model.LocalData;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
@@ -59,7 +58,7 @@ public abstract class GraphTargetItem implements Serializable {
public List<GraphSourceItemPos> moreSrc = new ArrayList<>();
public GraphPart firstPart;
public GraphTargetItem value;
protected Map<String, String> srcData = new HashMap<>();
protected HighlightData srcData = new HighlightData();
public GraphPart getFirstPart() {
if (value == null) {
@@ -120,7 +119,7 @@ public abstract class GraphTargetItem implements Serializable {
public abstract GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException;
public String toString(LocalData localData) throws InterruptedException {
HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false);
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false);
toString(writer, localData);
return writer.toString();
}
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.graph;
import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
import com.jpexs.decompiler.graph.model.LocalData;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.ArrayList;
@@ -72,13 +73,13 @@ public class TypeItem extends GraphTargetItem {
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
if (localData.fullyQualifiedNames.contains(fullTypeName)) {
writer.hilightSpecial(IdentifiersDeobfuscation.printNamespace(localData.constantsAvm2 != null, fullTypeName), "typename", fullTypeName);
writer.hilightSpecial(IdentifiersDeobfuscation.printNamespace(localData.constantsAvm2 != null, fullTypeName), HighlightSpecialType.TYPE_NAME, fullTypeName);
} else {
String simpleName = fullTypeName;
if (simpleName.contains(".")) {
simpleName = simpleName.substring(simpleName.lastIndexOf('.') + 1);
}
writer.hilightSpecial(IdentifiersDeobfuscation.printNamespace(localData.constantsAvm2 != null, simpleName), "typename", fullTypeName);
writer.hilightSpecial(IdentifiersDeobfuscation.printNamespace(localData.constantsAvm2 != null, simpleName), HighlightSpecialType.TYPE_NAME, fullTypeName);
}
return writer;