private static Hashtable edgesAttributes(DefaultEdge[] edges, String[] roleAssignation) { Hashtable edgesAttributes = new Hashtable(); for (int i = 0; i < roleAssignation.length; i++) { // Create a Map that holds the attributes for the edge RoleEntity re = (RoleEntity) edges[i].getUserObject(); Map attr = re.getAttributes(); // Source /*if (selectedAssignation[i].indexOf("source") >= 0) // Add a Line Begin Attribute GraphConstants.setLineBegin(attr, GraphConstants.SIMPLE);*/ // Target if (roleAssignation[i].toUpperCase().indexOf("TARGET") >= 0 || roleAssignation[i].endsWith("T")) { // Add a Line End Attribute GraphConstants.setLineEnd(attr, GraphConstants.ARROW_SIMPLE); // Associate the Edge with its Attributes } GraphConstants.setDisconnectable(attr,false); GraphConstants.setLineWidth(attr, 1); GraphConstants.setEndSize(attr, 7); GraphConstants.setBendable(attr,false); edgesAttributes.put(edges[i], attr); } return edgesAttributes; }
private Hashtable edgesAttributes(DefaultEdge[] edges, String[] roleAssignation) { Hashtable edgesAttributes = new Hashtable(); for (int i = 0; i < roleAssignation.length; i++) { // Create a Map that holds the attributes for the edge RoleEntity re = (RoleEntity) edges[i].getUserObject(); Map attr = re.getAttributes(); // Source /*if (selectedAssignation[i].indexOf("source") >= 0) // Add a Line Begin Attribute GraphConstants.setLineBegin(attr, GraphConstants.SIMPLE);*/ // Target if (roleAssignation[i].toUpperCase().indexOf("TARGET") >= 0 || roleAssignation[i].endsWith("T")) { // Add a Line End Attribute GraphConstants.setLineEnd(attr, GraphConstants.ARROW_SIMPLE); // Associate the Edge with its Attributes } GraphConstants.setDisconnectable(attr,false); GraphConstants.setLineWidth(attr, 1); GraphConstants.setEndSize(attr, 7); GraphConstants.setBendable(attr,false); edgesAttributes.put(edges[i], attr); } return edgesAttributes; }
GraphConstants.setLineEnd(attrMap, Integer.parseInt(lineEnd));
GraphConstants.setLineEnd(attrMap, Integer.parseInt(lineEnd));
private void createArrow(K source, K target) { if (!arrowAlreadyExist(source, target)) { DefaultGraphCell[] arrowCell = new DefaultGraphCell[1]; DefaultEdge edge = new DefaultEdge(); edge.setSource(stateCells.get(source).getChildAt(0)); edge.setTarget(stateCells.get(target).getChildAt(0)); arrowCell[0] = edge; int arrow = GraphConstants.ARROW_TECHNICAL; GraphConstants.setLineEnd(edge.getAttributes(), arrow); GraphConstants.setEndFill(edge.getAttributes(), true); graph.getGraphLayoutCache().insert(arrowCell); Set<K> targetSet = arrows.get(source); if (targetSet == null) { targetSet = EnumSet.noneOf(keyType); arrows.put(source, targetSet); } targetSet.add(target); } }
DefaultEdge createInheritanceEdge(ObjEntity entity) { if (!inheritanceEdges.containsKey(entity)) { ObjEntity superEntity = entity.getSuperEntity(); if (superEntity != null) { DefaultGraphCell sourceCell = entityCells.get(entity.getName()); DefaultGraphCell targetCell = entityCells.get(superEntity.getName()); DefaultEdge edge = new DefaultEdge(); edge.setSource(sourceCell.getChildAt(0)); edge.setTarget(targetCell.getChildAt(0)); GraphConstants.setDashPattern(edge.getAttributes(), new float[] { 5, 5 }); GraphConstants.setLineEnd( edge.getAttributes(), GraphConstants.ARROW_TECHNICAL); GraphConstants.setSelectable(edge.getAttributes(), false); inheritanceEdges.put(entity, edge); return edge; } } return null; }
private void createArrow(int source, int target) { if (!arrowAlreadyExist(source, target)) { DefaultGraphCell[] arrowCell = new DefaultGraphCell[1]; DefaultEdge edge = new DefaultEdge(); edge.setSource(stateCells[source].getChildAt(0)); edge.setTarget(stateCells[target].getChildAt(0)); arrowCell[0] = edge; int arrow = GraphConstants.ARROW_TECHNICAL; GraphConstants.setLineEnd(edge.getAttributes(), arrow); GraphConstants.setEndFill(edge.getAttributes(), true); graph.getGraphLayoutCache().insert(arrowCell); sourceArrows[sourceArrowIndex] = source; sourceArrowIndex++; targetArrows[targetArrowIndex] = target; targetArrowIndex++; } }
private void createArrow(int source, int target) { if (!arrowAlreadyExist(source, target)) { DefaultGraphCell[] arrowCell = new DefaultGraphCell[1]; DefaultEdge edge = new DefaultEdge(); edge.setSource(stateCells[source].getChildAt(0)); edge.setTarget(stateCells[target].getChildAt(0)); arrowCell[0] = edge; int arrow = GraphConstants.ARROW_TECHNICAL; GraphConstants.setLineEnd(edge.getAttributes(), arrow); GraphConstants.setEndFill(edge.getAttributes(), true); graph.getGraphLayoutCache().insert(arrowCell); sourceArrows[sourceArrowIndex] = source; sourceArrowIndex++; targetArrows[targetArrowIndex] = target; targetArrowIndex++; } }
selectedAssignation[i].endsWith("T")) { GraphConstants.setLineEnd(attr, GraphConstants.ARROW_CLASSIC);
GraphConstants.setLineEnd(attr, GraphConstants.ARROW_SIMPLE);
GraphConstants.setBeginFill(aggregateStyle, true); GraphConstants.setBeginSize(aggregateStyle, 6); GraphConstants.setLineEnd(aggregateStyle, GraphConstants.ARROW_SIMPLE); GraphConstants.setEndSize(aggregateStyle, 8); GraphConstants.setLabelPosition(aggregateStyle, new Point2D.Double(500,
GraphConstants.setLineEnd(map, GraphConstants.ARROW_CLASSIC); GraphConstants.setEndFill(map, true); GraphConstants.setLineStyle(map, GraphConstants.STYLE_SPLINE); GraphConstants.setLineEnd(map, GraphConstants.ARROW_CIRCLE); GraphConstants.setEndFill(map, false); GraphConstants.setEndSize(map, 6);