@Override public <T> T getHandleAttribute(AttributeKey<T> key) { return target.getHandleAttribute(key); }
protected int getHandlesize() { return (Integer) getEditor().getHandleAttribute(HandleAttributeKeys.HANDLE_SIZE); }
/** * Draws this handle. */ @Override public void draw(Graphics2D g) { drawCircle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.HANDLE_STROKE_COLOR)); }
@Override public void draw(Graphics2D g) { drawDiamond(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_STROKE_COLOR) ); }
/** * Draws this handle. */ @Override public void draw(Graphics2D g) { drawDiamond(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_STROKE_COLOR)); }
/** * Draws this handle. * Null Handles are drawn as unfilled rectangles. */ @Override public void draw(Graphics2D g) { drawRectangle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.NULL_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.NULL_HANDLE_STROKE_COLOR) ); }
/** * Draws this handle. */ @Override public void draw(Graphics2D g) { drawCircle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.SCALE_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.SCALE_HANDLE_STROKE_COLOR) ); }
/** * Draws this handle. */ @Override public void draw(Graphics2D g) { Figure o = getOwner(); if (o.get(LINK)!=null&&o.get(LINK).trim().length()>0) { g.setColor((Color) getEditor().getHandleAttribute(HandleAttributeKeys.OVERFLOW_HANDLE_STROKE_COLOR)); Rectangle r = basicGetBounds(); g.drawLine(r.x+(r.width/2)-1, r.y, r.x, r.y); g.drawLine(r.x, r.y, r.x, r.y+r.height-1); g.drawLine(r.x, r.y+r.height-1, r.x+(r.width/2)-1, r.y+r.height-1); g.drawLine(r.x+(r.width/3), r.y+r.height/2, r.x+r.width-1, r.y+r.height/2); g.drawLine(r.x+r.width-1, r.y+r.height/2, (int)(r.x+r.width*.75-1), (int)(r.y+r.height*.25)); g.drawLine(r.x+r.width-1, r.y+r.height/2, (int)(r.x+r.width*.75-1), (int)(r.y+r.height*.75)); } }
/** * Draws this handle. */ @Override public void draw(Graphics2D g) { if (getOwner().isTextOverflow()) { drawRectangle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.OVERFLOW_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.OVERFLOW_HANDLE_STROKE_COLOR) ); g.setColor((Color) getEditor().getHandleAttribute(HandleAttributeKeys.OVERFLOW_HANDLE_STROKE_COLOR)); Rectangle r = basicGetBounds(); g.drawLine(r.x+1, r.y+1, r.x+r.width-2, r.y+r.height-2); g.drawLine(r.x+r.width-2, r.y+1, r.x+1, r.y+r.height-2); } }
/** * Draws this handle. */ @Override public void draw(Graphics2D g) { if (getEditor().getTool().supportsHandleInteraction()) { drawDiamond(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_STROKE_COLOR)); } else { drawDiamond(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_FILL_COLOR_DISABLED), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_STROKE_COLOR_DISABLED)); } }
/** * Draws this handle. */ @Override public void draw(Graphics2D g) { if (getEditor().getTool().supportsHandleInteraction()) { drawDiamond(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_STROKE_COLOR)); } else { drawDiamond(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_FILL_COLOR_DISABLED), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ATTRIBUTE_HANDLE_STROKE_COLOR_DISABLED)); } }
/** * Draws this handle. */ @Override public void draw(Graphics2D g) { if (getEditor().getTool().supportsHandleInteraction()) { drawCircle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ROTATE_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ROTATE_HANDLE_STROKE_COLOR)); } else { drawCircle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ROTATE_HANDLE_FILL_COLOR_DISABLED), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.ROTATE_HANDLE_STROKE_COLOR_DISABLED)); } }
/** * Draws this handle. */ @Override public void draw(Graphics2D g) { if (getEditor().getTool().supportsHandleInteraction()) { //drawArc(g); drawDiamond(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.TRANSFORM_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.TRANSFORM_HANDLE_STROKE_COLOR)); } else { drawDiamond(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.TRANSFORM_HANDLE_FILL_COLOR_DISABLED), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.TRANSFORM_HANDLE_STROKE_COLOR_DISABLED)); } }
/** * Draws this handle. * <p> * If the figure is transformable, the handle is drawn as a filled rectangle. * If the figure is not transformable, the handle is drawn as an unfilled * rectangle. */ @Override public void draw(Graphics2D g) { if (getOwner().isTransformable()) { drawRectangle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.MOVE_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.MOVE_HANDLE_STROKE_COLOR)); } else { drawRectangle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.NULL_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.NULL_HANDLE_STROKE_COLOR)); } }
@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); } }
stroke1 = (Stroke) getEditor().getHandleAttribute(stroke1Enabled); strokeColor1 = (Color) getEditor().getHandleAttribute(strokeColor1Enabled); stroke2 = (Stroke) getEditor().getHandleAttribute(stroke2Enabled); strokeColor2 = (Color) getEditor().getHandleAttribute(strokeColor2Enabled); } else { stroke1 = (Stroke) getEditor().getHandleAttribute(stroke1Disabled); strokeColor1 = (Color) getEditor().getHandleAttribute(strokeColor1Disabled); stroke2 = (Stroke) getEditor().getHandleAttribute(stroke2Disabled); strokeColor2 = (Color) getEditor().getHandleAttribute(strokeColor2Disabled);
/** * Draws this handle. * <p> * If the figure is transformable, the handle is drawn as a filled rectangle. * If the figure is not transformable, the handle is drawn as an unfilled * rectangle. */ @Override public void draw(Graphics2D g) { if (getEditor().getTool().supportsHandleInteraction()) { if (getOwner().isTransformable()) { drawRectangle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.RESIZE_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.RESIZE_HANDLE_STROKE_COLOR)); } else { drawRectangle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.NULL_HANDLE_FILL_COLOR), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.NULL_HANDLE_STROKE_COLOR)); } } else { drawRectangle(g, (Color) getEditor().getHandleAttribute(HandleAttributeKeys.HANDLE_FILL_COLOR_DISABLED), (Color) getEditor().getHandleAttribute(HandleAttributeKeys.HANDLE_STROKE_COLOR_DISABLED)); } }
stroke1 = (Stroke) getEditor().getHandleAttribute(stroke1Enabled); strokeColor1 = (Color) getEditor().getHandleAttribute(strokeColor1Enabled); stroke2 = (Stroke) getEditor().getHandleAttribute(stroke2Enabled); strokeColor2 = (Color) getEditor().getHandleAttribute(strokeColor2Enabled); } else { stroke1 = (Stroke) getEditor().getHandleAttribute(stroke1Disabled); strokeColor1 = (Color) getEditor().getHandleAttribute(strokeColor1Disabled); stroke2 = (Stroke) getEditor().getHandleAttribute(stroke2Disabled); strokeColor2 = (Color) getEditor().getHandleAttribute(strokeColor2Disabled);
/** * 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)); } }
Color strokeColor; if (getEditor().getTool().supportsHandleInteraction()) { fillColor = (Color) getEditor().getHandleAttribute(HandleAttributeKeys.BEZIER_NODE_HANDLE_FILL_COLOR); strokeColor = (Color) getEditor().getHandleAttribute(HandleAttributeKeys.BEZIER_NODE_HANDLE_STROKE_COLOR); } else { fillColor = (Color) getEditor().getHandleAttribute(HandleAttributeKeys.BEZIER_NODE_HANDLE_FILL_COLOR_DISABLED); strokeColor = (Color) getEditor().getHandleAttribute(HandleAttributeKeys.BEZIER_NODE_HANDLE_STROKE_COLOR_DISABLED);