/** * @see Content#draw(Graphics2D) */ @Override public void draw(Graphics2D graphics) { if(null!=color) { Color oldColor = graphics.getColor(); graphics.setColor(color); graphics.draw(getShape()); graphics.setColor(oldColor); } getContent().draw(graphics); }
public ContentBorder(ContentInsideShape contentShape, Color color) { contentShape.addParent(this); this.setBorderColor(color); this.setContent(contentShape); }
protected void createContentStructure() { setBorder(new ContentBorder(new ContentInsideRoundRectangle(new EmptyContent()), getBorderColor())); setBackground(new ContentBackground(getBorder(), getBackgroundColor())); setContent(getBackground()); }
@Override public void setBorderColor(Color borderColor) { this.borderColor = borderColor; if(null != border) { border.setBorderColor(borderColor); } }
/** * @see ContentInsideShape#getShape() */ protected Shape getShape() { return ((ContentInsideShape)getContent()).getShape(); }
@Override protected void createContentStructure() { TextContent textContent = new TextContent(text); textContent.setMinHeight(DEFAULT_HEIGHT); textContent.setMinWidth(DEFAULT_WIDTH); ContentInsideShape contentInsideShape = new ContentInsideCustomShape(textContent, new ContentInsideCustomShape.ShapeCreator() { @Override public Shape createShape(double contentWidth, double contentHeight) { GeneralPath path = new GeneralPath(); path.moveTo(0, 0); path.lineTo(contentWidth - FOLD_X, 0); path.lineTo(contentWidth, FOLD_Y); path.lineTo(contentWidth, contentHeight); path.lineTo(0, contentHeight); path.closePath(); return path; } }); setBorder(new ContentBorder(contentInsideShape, getBorderColor())); setBackground(new ContentBackground(getBorder(), getBackgroundColor())); setContent(getBackground()); setBackgroundColor(ColorToolsBarPanel.PASTEL_YELLOW_ORANCE.getBackgroundColor()); setBorderColor(ColorToolsBarPanel.PASTEL_YELLOW_ORANCE.getBorderColor()); setTextColor(ColorToolsBarPanel.PASTEL_YELLOW_ORANCE.getTextColor()); }