@Override public void draw(Graphics2D g) { Shape bounds = getOwner().getPath(); if (getOwner().get(TRANSFORM) != null) { bounds = getOwner().get(TRANSFORM).createTransformedShape(bounds); } bounds = view.getDrawingToViewTransform().createTransformedShape(bounds); g.setColor(HANDLE_FILL_COLOR); g.draw(bounds); } }
@Override protected Rectangle basicGetBounds() { Shape bounds = getOwner().getBounds(); if (getOwner().get(TRANSFORM) != null) { bounds = getOwner().get(TRANSFORM).createTransformedShape(bounds); } bounds = view.getDrawingToViewTransform().createTransformedShape(bounds); Rectangle r = bounds.getBounds(); r.grow(2, 2); return r; }
@Override protected Rectangle basicGetBounds() { Shape bounds = getOwner().getBounds(); if (getOwner().get(TRANSFORM) != null) { bounds = getOwner().get(TRANSFORM).createTransformedShape(bounds); } bounds = view.getDrawingToViewTransform().createTransformedShape(bounds); Rectangle r = bounds.getBounds(); r.grow(2, 2); return r; }
@Override public void draw(Graphics2D g, DrawingView view) { if (isVisible) { AffineTransform t = view.getDrawingToViewTransform(); Rectangle viewBounds = g.getClipBounds(); Rectangle2D.Double bounds = view.viewToDrawing(viewBounds);
@Override public void draw(Graphics2D g) { Graphics2D gg = (Graphics2D) g.create(); gg.transform(getView().getDrawingToViewTransform()); if (targetFigure != null) { for (Connector c : targetFigure.getConnectors(getPrototype())) { c.draw(gg); } } if (createdFigure != null) { createdFigure.draw(gg); Point p = getView().drawingToView(createdFigure.getStartPoint()); Ellipse2D.Double e = new Ellipse2D.Double( p.x - ANCHOR_WIDTH / 2, p.y - ANCHOR_WIDTH / 2, ANCHOR_WIDTH, ANCHOR_WIDTH); g.setColor(Color.GREEN); g.fill(e); g.setColor(Color.BLACK); g.draw(e); p = getView().drawingToView(createdFigure.getEndPoint()); e = new Ellipse2D.Double( p.x - ANCHOR_WIDTH / 2, p.y - ANCHOR_WIDTH / 2, ANCHOR_WIDTH, ANCHOR_WIDTH); g.setColor(Color.GREEN); g.fill(e); g.setColor(Color.BLACK); g.draw(e); } gg.dispose(); }
bounds = o.get(TRANSFORM).createTransformedShape(bounds); bounds = view.getDrawingToViewTransform().createTransformedShape(bounds); Stroke stroke1; Color strokeColor1;
bounds = getOwner().get(TRANSFORM).createTransformedShape(bounds); bounds = view.getDrawingToViewTransform().createTransformedShape(bounds); Stroke stroke1; Color strokeColor1;
bounds = getOwner().get(TRANSFORM).createTransformedShape(bounds); bounds = view.getDrawingToViewTransform().createTransformedShape(bounds); outline = ConvexHull.getConvexHullPath2D(bounds);
@Override public void draw(Graphics2D g) { Graphics2D gg = (Graphics2D) g.create(); gg.transform(view.getDrawingToViewTransform()); for (Connector c : connectors) { c.draw(gg); } if (createdConnection == null) { drawCircle(g, getEditor().getHandleAttribute(HandleAttributeKeys.DISCONNECTED_CONNECTOR_HANDLE_FILL_COLOR), getEditor().getHandleAttribute(HandleAttributeKeys.DISCONNECTED_CONNECTOR_HANDLE_STROKE_COLOR)); } else { drawCircle(g, getEditor().getHandleAttribute(HandleAttributeKeys.CONNECTED_CONNECTOR_HANDLE_FILL_COLOR), getEditor().getHandleAttribute(HandleAttributeKeys.CONNECTED_CONNECTOR_HANDLE_STROKE_COLOR)); Point p = view.drawingToView(createdConnection.getEndPoint()); g.setColor((Color) getEditor().getHandleAttribute(HandleAttributeKeys.CONNECTED_CONNECTOR_HANDLE_FILL_COLOR)); int width = getHandlesize(); g.fillOval(p.x - width / 2, p.y - width / 2, width, width); g.setColor((Color) getEditor().getHandleAttribute(HandleAttributeKeys.CONNECTED_CONNECTOR_HANDLE_STROKE_COLOR)); g.drawOval(p.x - width / 2, p.y - width / 2, width, width); } }
bounds = owner.get(TRANSFORM).createTransformedShape(bounds); bounds = view.getDrawingToViewTransform().createTransformedShape(bounds); Stroke stroke1; Color strokeColor1;
/** * Draws this handle. */ @Override public void draw(Graphics2D g) { Graphics2D gg = (Graphics2D) g.create(); gg.transform(view.getDrawingToViewTransform()); for (Connector c : connectors) { c.draw(gg); } gg.dispose(); if (getTarget() == null) { drawCircle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.DISCONNECTED_CONNECTION_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.DISCONNECTED_CONNECTION_HANDLE_STROKE_COLOR)); } else { drawCircle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.CONNECTED_CONNECTION_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.CONNECTED_CONNECTION_HANDLE_STROKE_COLOR)); } }