/** * Returns an attributeMap for the specified position and color. */ public static Map createBounds(AttributeMap map, int x, int y, Color c) { GraphConstants.setBounds(map, map.createRect(x, y, 90, 30)); GraphConstants.setBorder(map, BorderFactory.createRaisedBevelBorder()); GraphConstants.setBackground(map, c.darker().darker()); GraphConstants .setGradientColor(map, c.brighter().brighter().brighter()); GraphConstants.setForeground(map, Color.white); if (GraphConstants.DEFAULTFONT != null) { GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont( Font.BOLD, 12)); } GraphConstants.setOpaque(map, true); return map; }
private DefaultGraphCell createCell(K stateKey, Point2D placement) { // System.out.println(name + " " + placement + " " + index); String cellName = stateKey.toString(); DefaultGraphCell stateCell = new DefaultGraphCell(new String(cellName)); Font font = new Font("Arial", Font.PLAIN, 12); GraphConstants.setFont(stateCell.getAttributes(), font); GraphConstants.setAutoSize(stateCell.getAttributes(), true); GraphConstants.setOpaque(stateCell.getAttributes(), true); Color color = colorStateCell(stateKey); GraphConstants.setBackground(stateCell.getAttributes(), color); GraphConstants.setBounds(stateCell.getAttributes(), new Rectangle2D.Double(placement.getX(), placement.getY(), 0, 0)); stateCell.addPort(); return stateCell; }
private DefaultGraphCell createCell(String name, Point2d placement, int index) { // System.out.println(name + " " + placement + " " + index); stateCells[index] = new DefaultGraphCell(new String(name)); Font f = new Font("Arial", Font.PLAIN, 12); GraphConstants.setFont(stateCells[index].getAttributes(), f); GraphConstants.setAutoSize(stateCells[index].getAttributes(), true); GraphConstants.setOpaque(stateCells[index].getAttributes(), true); Color color = colorStateCell(stateMachine.states.get(indexOfStateinStateMachine(name))); GraphConstants.setBackground(stateCells[index].getAttributes(), color); GraphConstants.setBounds(stateCells[index].getAttributes(), new Rectangle2D.Double(placement.getX(), placement.getY(), 0, 0)); stateCells[index].addPort(); return stateCells[index]; }
private DefaultGraphCell createCell(String name, Point2D placement, int index) { // System.out.println(name + " " + placement + " " + index); stateCells[index] = new DefaultGraphCell(new String(name)); Font f = new Font("Arial", Font.PLAIN, 12); GraphConstants.setFont(stateCells[index].getAttributes(), f); GraphConstants.setAutoSize(stateCells[index].getAttributes(), true); GraphConstants.setOpaque(stateCells[index].getAttributes(), true); Color color = colorStateCell(stateMachine.states.get(indexOfStateinStateMachine(name))); GraphConstants.setBackground(stateCells[index].getAttributes(), color); GraphConstants.setBounds(stateCells[index].getAttributes(), new Rectangle2D.Double(placement.getX(), placement.getY(), 0, 0)); stateCells[index].addPort(); return stateCells[index]; }
protected DefaultEdge createRelationshipCell(Relationship rel) { if (!relCells.containsKey(getQualifiedName(rel))) { Relationship reverse = rel.getReverseRelationship(); DefaultEdge edge = new DefaultEdge(); // GraphConstants.setLineStyle(edge.getAttributes(), // GraphConstants.STYLE_ORTHOGONAL); // GraphConstants.setRouting(edge.getAttributes(), // GraphConstants.ROUTING_SIMPLE); GraphConstants.setEditable(edge.getAttributes(), false); GraphConstants.setLabelAlongEdge(edge.getAttributes(), true); GraphConstants.setSelectable(edge.getAttributes(), false); GraphConstants.setFont(edge.getAttributes(), EDGE_FONT); updateRelationshipLabels(edge, rel, reverse); relCells.put(getQualifiedName(rel), edge); if (reverse != null) { relCells.put(getQualifiedName(reverse), edge); } return edge; } return null; }
GraphConstants.setDashPattern(implementStyle, new float[] { 3, 3 }); if (GraphConstants.DEFAULTFONT != null) { GraphConstants.setFont(implementStyle, GraphConstants.DEFAULTFONT .deriveFont(10)); GraphConstants.setBeginSize(extendStyle, 10); if (GraphConstants.DEFAULTFONT != null) { GraphConstants.setFont(extendStyle, GraphConstants.DEFAULTFONT .deriveFont(10)); 0)); if (GraphConstants.DEFAULTFONT != null) { GraphConstants.setFont(aggregateStyle, GraphConstants.DEFAULTFONT .deriveFont(10));