/** * Hook for subclassers to avoid default label positions. */ protected void checkDefaultLabelPosition() { labelPosition = GraphConstants.getLabelPosition(allAttributes); String label = String.valueOf(getCell()); if (labelPosition == null && label != null && label.length() > 0) { int center = GraphConstants.PERMILLE / 2; labelPosition = new Point(center, 0); GraphConstants.setLabelPosition(allAttributes, labelPosition); } }
public void actionPerformed(ActionEvent e) { re.hide(); AttributeMap am = graph.getModel().getAttributes(defaultEdge); GraphConstants.setLabelEnabled(am,false); GraphConstants.setLabelPosition(am, new Point2D.Double(GraphConstants.PERMILLE/2, -20)); Hashtable attributes=new Hashtable(); attributes.put(defaultEdge,am); graph.getModel().edit(attributes,null,null,null); // hack to prevent duplicating attributes /*attributes=new Hashtable(); attributes.put(defaultEdge,am); graph.getModel().edit(attributes,null,null,null);*/ SwingUtilities.invokeLater(new Runnable(){ public void run(){ graph.invalidate(); graph.repaint(); resources.getMainFrame().invalidate(); resources.getMainFrame().repaint(); } }); } });
GraphConstants.setLabelPosition(am, new Point2D.Double(GraphConstants.PERMILLE/2, -20));
|| lineStyle == GraphConstants.STYLE_SPLINE) { GraphConstants.setLabelPosition(allAttributes, new Point2D.Double(x, r * edgeMiddleDeparture / 79));
/** * Clones special object entried in the given map. */ public AttributeMap cloneEntries(AttributeMap newMap) { // Clone Bounds Rectangle2D bounds = GraphConstants.getBounds(newMap); if (bounds != null) GraphConstants.setBounds(newMap, (Rectangle2D) (bounds.clone())); // Clone List Of Points List points = GraphConstants.getPoints(newMap); if (points != null) GraphConstants.setPoints(newMap, clonePoints(points)); // Clone extra label positions Point2D[] positions = GraphConstants.getExtraLabelPositions(newMap); if (positions != null) GraphConstants.setExtraLabelPositions(newMap, clonePoints(positions)); // Clone Edge Label Point2D label = GraphConstants.getLabelPosition(newMap); if (label != null) GraphConstants.setLabelPosition(newMap, (Point2D) label.clone()); return newMap; }
GraphConstants.setLabelPosition(attr, GraphConstants.setLabelPosition(attr,
GraphConstants.setLineEnd(aggregateStyle, GraphConstants.ARROW_SIMPLE); GraphConstants.setEndSize(aggregateStyle, 8); GraphConstants.setLabelPosition(aggregateStyle, new Point2D.Double(500, 0)); if (GraphConstants.DEFAULTFONT != null) {