* @see JGraphpadGraphConstants#setVertexShape(Map, int)
* @see JGraphpadVertexTool
*/
protected JGraphpadVertexTool createVertexTool(String name, Object defaultValue,
int shape, ImageIcon icon, boolean postEdit) {
JGraphpadVertexTool vertextTool = null;
Object userObject = createVertexUserObject(defaultValue);
GraphCell vertex = createVertex(userObject);
if (shape >= 0) {
JGraphpadGraphConstants.setVertexShape(vertex.getAttributes(),
shape);
} else {
vertex.getAttributes().remove(GraphConstants.BORDERCOLOR);
vertex.getAttributes().remove(GraphConstants.BORDER);
}
if (icon != null) {
GraphConstants.setIcon(vertex.getAttributes(), icon);
}
if (postEdit) {
vertextTool = new JGraphpadVertexTool(name, vertex) {
protected void execute(JGraph graph, Object cell) {
super.execute(graph, cell);
graph.startEditingAtCell(cell);
}
};
} else {
vertextTool = new JGraphpadVertexTool(name, vertex);
}
Dimension dimension =
new Dimension(WorkflowProperties.cellHeight, WorkflowProperties.cellWidth);
vertextTool.setSingleClickSize(dimension);
return vertextTool;
}