if (streamTokenizer.ttype == '=') {
streamTokenizer.nextToken();
if (streamTokenizer.ttype == StreamTokenizer.TT_WORD || streamTokenizer.ttype == '"') {
edge.setLabel(streamTokenizer.sval);
} else {
report.logIssue(new Issue(NbBundle.getMessage(ImporterDOT.class, "importerDOT_error_labelunreachable", streamTokenizer.lineno()), Issue.Level.WARNING));
streamTokenizer.pushBack();
}
} else {
report.logIssue(new Issue(NbBundle.getMessage(ImporterDOT.class, "importerDOT_error_labelunreachable", streamTokenizer.lineno()), Issue.Level.WARNING));
streamTokenizer.pushBack();
}
} else if (streamTokenizer.sval.equalsIgnoreCase("color")) {
streamTokenizer.nextToken();
if (streamTokenizer.ttype == '=') {
streamTokenizer.nextToken();
if (streamTokenizer.ttype == StreamTokenizer.TT_WORD || streamTokenizer.ttype == '"') {
if (colorTable.containsKey(streamTokenizer.sval)) {
edge.setColor(colorTable.get(streamTokenizer.sval));
} else {
try {
String[] colors = streamTokenizer.sval.split(" ");
edge.setColor(Float.parseFloat(colors[0]), Float.parseFloat(colors[1]), Float.parseFloat(colors[2]));
} catch (Exception e) {
}
}
} else {
report.logIssue(new Issue(NbBundle.getMessage(ImporterDOT.class, "importerDOT_color_labelunreachable", streamTokenizer.lineno()), Issue.Level.WARNING));
streamTokenizer.pushBack();
}
} else {
report.logIssue(new Issue(NbBundle.getMessage(ImporterDOT.class, "importerDOT_color_labelunreachable", streamTokenizer.lineno()), Issue.Level.WARNING));
streamTokenizer.pushBack();
}
} else if (streamTokenizer.sval.equalsIgnoreCase("style")) {
streamTokenizer.nextToken();
if (streamTokenizer.ttype == '=') {
streamTokenizer.nextToken();
if (streamTokenizer.ttype == StreamTokenizer.TT_WORD || streamTokenizer.ttype == '"'); else {
//System.err.println("couldn't find style at line " + streamTokenizer.lineno());
streamTokenizer.pushBack();
}
} else {
//System.err.println("couldn't find style at line " + streamTokenizer.lineno());
streamTokenizer.pushBack();
}
} else if (streamTokenizer.sval.equalsIgnoreCase("weight")) {
streamTokenizer.nextToken();
if (streamTokenizer.ttype == '=') {
streamTokenizer.nextToken();
if (streamTokenizer.ttype == StreamTokenizer.TT_WORD || streamTokenizer.ttype == '"') {
try {
Float weight = Float.parseFloat(streamTokenizer.sval);
edge.setWeight(weight);
} catch (Exception e) {
report.logIssue(new Issue(NbBundle.getMessage(ImporterDOT.class, "importerDOT_error_weightunreachable", streamTokenizer.lineno()), Issue.Level.WARNING));
}
} else {
report.logIssue(new Issue(NbBundle.getMessage(ImporterDOT.class, "importerDOT_error_weightunreachable", streamTokenizer.lineno()), Issue.Level.WARNING));
streamTokenizer.pushBack();
}
} else {
report.logIssue(new Issue(NbBundle.getMessage(ImporterDOT.class, "importerDOT_error_weightunreachable", streamTokenizer.lineno()), Issue.Level.WARNING));
streamTokenizer.pushBack();
}
}
}
edgeAttributes(streamTokenizer, edge);