return nodeTextColumns;
}
public void readXML(XMLStreamReader reader, Workspace workspace) throws XMLStreamException {
AttributeController attributeController = Lookup.getDefault().lookup(AttributeController.class);
AttributeModel attributeModel = attributeController != null ? attributeController.getModel(workspace) : null;
List<AttributeColumn> nodeCols = new ArrayList<AttributeColumn>();
List<AttributeColumn> edgeCols = new ArrayList<AttributeColumn>();
boolean nodeColumn = false;
boolean edgeColumn = false;
boolean nodeSizeFac = false;
boolean edgeSizeFac = false;
boolean end = false;
while (reader.hasNext() && !end) {
int type = reader.next();
switch (type) {
case XMLStreamReader.START_ELEMENT:
String name = reader.getLocalName();
if ("shownodelabels".equalsIgnoreCase(name)) {
showNodeLabels = Boolean.parseBoolean(reader.getAttributeValue(null, "enable"));
} else if ("showedgelabels".equalsIgnoreCase(name)) {
showEdgeLabels = Boolean.parseBoolean(reader.getAttributeValue(null, "enable"));
} else if ("selectedOnly".equalsIgnoreCase(name)) {
selectedOnly = Boolean.parseBoolean(reader.getAttributeValue(null, "value"));
} else if ("nodefont".equalsIgnoreCase(name)) {
String nodeFontName = reader.getAttributeValue(null, "name");
int nodeFontSize = Integer.parseInt(reader.getAttributeValue(null, "size"));
int nodeFontStyle = Integer.parseInt(reader.getAttributeValue(null, "style"));
nodeFont = new Font(nodeFontName, nodeFontStyle, nodeFontSize);
} else if ("edgefont".equalsIgnoreCase(name)) {
String edgeFontName = reader.getAttributeValue(null, "name");
int edgeFontSize = Integer.parseInt(reader.getAttributeValue(null, "size"));
int edgeFontStyle = Integer.parseInt(reader.getAttributeValue(null, "style"));
edgeFont = new Font(edgeFontName, edgeFontStyle, edgeFontSize);
} else if ("nodecolor".equalsIgnoreCase(name)) {
nodeColor = ColorUtils.decode(reader.getAttributeValue(null, "value")).getRGBComponents(null);
} else if ("edgecolor".equalsIgnoreCase(name)) {
edgeColor = ColorUtils.decode(reader.getAttributeValue(null, "value")).getRGBComponents(null);
} else if ("nodesizefactor".equalsIgnoreCase(name)) {
nodeSizeFac = true;
} else if ("edgesizefactor".equalsIgnoreCase(name)) {
edgeSizeFac = true;
} else if ("colormode".equalsIgnoreCase(name)) {
String colorModeClass = reader.getAttributeValue(null, "class");
if (colorModeClass.equals("UniqueColorMode")) {
colorMode = VizController.getInstance().getTextManager().getColorModes()[0];
} else if (colorModeClass.equals("ObjectColorMode")) {
colorMode = VizController.getInstance().getTextManager().getColorModes()[1];
}
} else if ("sizemode".equalsIgnoreCase(name)) {
String sizeModeClass = reader.getAttributeValue(null, "class");
if (sizeModeClass.equals("FixedSizeMode")) {
sizeMode = VizController.getInstance().getTextManager().getSizeModes()[0];
} else if (sizeModeClass.equals("ProportionalSizeMode")) {
sizeMode = VizController.getInstance().getTextManager().getSizeModes()[2];
} else if (sizeModeClass.equals("ScaledSizeMode")) {
sizeMode = VizController.getInstance().getTextManager().getSizeModes()[1];
}
} else if ("nodecolumns".equalsIgnoreCase(name)) {
nodeColumn = true;
} else if ("edgecolumns".equalsIgnoreCase(name)) {
edgeColumn = true;
} else if ("column".equalsIgnoreCase(name)) {
String id = reader.getAttributeValue(null, "id");
if (nodeColumn && attributeModel != null) {
AttributeColumn col = attributeModel.getNodeTable().getColumn(id);
if (col != null) {
nodeCols.add(col);
}
} else if (edgeColumn && attributeModel != null) {
AttributeColumn col = attributeModel.getEdgeTable().getColumn(id);
if (col != null) {
edgeCols.add(col);
}
}
}