base.concatenate(unrotate); g2d.setTransform(base); rc.getRendererPane().paintComponent(g, component, rc.getScreenDevice(), (int)p.getX(), (int)p.getY(), d.width, d.height, true);
renderContext.getRendererPane(), x + h_offset, y + v_offset,
base.concatenate(unrotate); g2d.setTransform(base); rc.getRendererPane() .paintComponent( g,
/** * Labels the specified vertex with the specified label. * Uses the font specified by this instance's * <code>VertexFontFunction</code>. (If the font is unspecified, the existing * font for the graphics context is used.) If vertex label centering * is active, the label is centered on the position of the vertex; otherwise * the label is offset slightly. */ public void labelVertex(RenderContext<V,E> rc, Layout<V,E> layout, V v, String label) { Graph<V,E> graph = layout.getGraph(); if (rc.getVertexIncludePredicate().apply(Context.<Graph<V,E>,V>getInstance(graph,v)) == false) { return; } GraphicsDecorator g = rc.getGraphicsContext(); Component component = prepareRenderer(rc, rc.getVertexLabelRenderer(), label, rc.getPickedVertexState().isPicked(v), v); Dimension d = component.getPreferredSize(); int h_offset = -d.width / 2; int v_offset = -d.height / 2; Point2D p = layout.apply(v); p = rc.getMultiLayerTransformer().transform(Layer.LAYOUT, p); int x = (int)p.getX(); int y = (int)p.getY(); g.draw(component, rc.getRendererPane(), x+h_offset, y+v_offset, d.width, d.height, true); Dimension size = component.getPreferredSize(); Rectangle bounds = new Rectangle(-size.width/2 -2, -size.height/2 -2, size.width+4, size.height); shapes.put(v, bounds); }
g.draw(component, rc.getRendererPane(), 0, 0, d.width, d.height, true);
xform.translate(Math.min(layout.getSize().width - w, p / 2), (p1.getY() + p2.getY() - fm.getHeight()) / 2); g.setTransform(xform); g.draw(component, rc.getRendererPane(), 0, 0, d.width, d.height, true);
public void labelVertex(final RenderContext<ElementName, Dependency> rc, final Layout<ElementName, Dependency> layout, final ElementName v, final String label) { final Graph<ElementName, Dependency> graph = layout.getGraph(); if (rc.getVertexIncludePredicate().evaluate( Context.<Graph<ElementName, Dependency>, ElementName> getInstance( graph, v)) == false) { return; } final GraphicsDecorator g = rc.getGraphicsContext(); final Component component = prepareRenderer(rc, rc.getVertexLabelRenderer(), label, rc.getPickedVertexState().isPicked(v), v); final Dimension d = component.getPreferredSize(); final int h_offset = -d.width / 2; final int v_offset = -d.height / 2; Point2D p = layout.transform(v); p = rc.getMultiLayerTransformer().transform(Layer.LAYOUT, p); final int x = (int) p.getX(); final int y = (int) p.getY(); g.draw(component, rc.getRendererPane(), x + h_offset, y + v_offset, d.width, d.height, true); }
public void labelVertex(final RenderContext<ElementName, Dependency> rc, final Layout<ElementName, Dependency> layout, final ElementName v, final String label) { final Graph<ElementName, Dependency> graph = layout.getGraph(); if (rc.getVertexIncludePredicate().evaluate( Context.<Graph<ElementName, Dependency>, ElementName> getInstance( graph, v)) == false) { return; } final GraphicsDecorator g = rc.getGraphicsContext(); final Component component = prepareRenderer(rc, rc.getVertexLabelRenderer(), label, rc.getPickedVertexState().isPicked(v), v); final Dimension d = component.getPreferredSize(); final int h_offset = -d.width / 2; final int v_offset = -d.height / 2; Point2D p = layout.transform(v); p = rc.getMultiLayerTransformer().transform(Layer.LAYOUT, p); final int x = (int) p.getX(); final int y = (int) p.getY(); g.draw(component, rc.getRendererPane(), x + h_offset, y + v_offset, d.width, d.height, true); }
public void labelVertex(final RenderContext<ElementName, Dependency> rc, final Layout<ElementName, Dependency> layout, final ElementName v, final String label) { final Graph<ElementName, Dependency> graph = layout.getGraph(); if (rc.getVertexIncludePredicate().evaluate( Context.<Graph<ElementName, Dependency>, ElementName> getInstance( graph, v)) == false) { return; } final GraphicsDecorator g = rc.getGraphicsContext(); final Component component = prepareRenderer(rc, rc.getVertexLabelRenderer(), label, rc.getPickedVertexState().isPicked(v), v); final Dimension d = component.getPreferredSize(); final int h_offset = -d.width / 2; final int v_offset = -d.height / 2; Point2D p = layout.transform(v); p = rc.getMultiLayerTransformer().transform(Layer.LAYOUT, p); final int x = (int) p.getX(); final int y = (int) p.getY(); g.draw(component, rc.getRendererPane(), x + h_offset, y + v_offset, d.width, d.height, true); }
final Rectangle2D boundsVertex = new Rectangle2D.Double(vertexPositionInPixels.getX() - vertexIcon.getIconWidth() / 2, vertexPositionInPixels.getY() - vertexIcon.getIconHeight() / 2, vertexIcon.getIconWidth(), vertexIcon.getIconHeight()); final Point anchorPointInPixels = getAnchorPoint(boundsVertex, dimensionMessage, Renderer.VertexLabel.Position.NE); g.draw(component, rc.getRendererPane(), anchorPointInPixels.x, anchorPointInPixels.y, dimensionMessage.width, dimensionMessage.height, true); final Rectangle2D boundsVertex = new Rectangle2D.Double(vertexPositionInPixels.getX() - vertexIcon.getIconWidth() / 2, vertexPositionInPixels.getY() - vertexIcon.getIconHeight() / 2, vertexIcon.getIconWidth(), vertexIcon.getIconHeight()); final Point anchorPointInPixels = getAnchorPoint(boundsVertex, dimensionMessage, Renderer.VertexLabel.Position.NE); g.draw(component, rc.getRendererPane(), anchorPointInPixels.x, anchorPointInPixels.y, dimensionMessage.width, dimensionMessage.height, true); final Rectangle2D boundsVertex = new Rectangle2D.Double(vertexPositionInPixels.getX() - vertexIcon.getIconWidth() / 2, vertexPositionInPixels.getY() - vertexIcon.getIconHeight() / 2, vertexIcon.getIconWidth(), vertexIcon.getIconHeight()); final Point anchorPointInPixels = getAnchorPoint(boundsVertex, dimensionMessage, Renderer.VertexLabel.Position.NE); g.draw(component, rc.getRendererPane(), anchorPointInPixels.x, anchorPointInPixels.y, dimensionMessage.width, dimensionMessage.height, true);
g.draw( component, renderContext.getRendererPane(), (int) p.x, (int) p.y, g.draw( component, renderContext.getRendererPane(), (int) p.x, (int) p.y,
p = getAnchorPoint(bounds, d, position); g.draw(component, rc.getRendererPane(), p.x, p.y, d.width, d.height, true);
g.draw(component, renderContext.getRendererPane(), 0, 0, d.width, d.height, true);
g.setBackground(bgColor); g.clearRect(0, 0, d.width, d.height); g.draw(component, rc.getRendererPane(), 0, 0, d.width, d.height, true);