/** * The color used to fill this shape. */ public Color getFillColor(){ return getFill().getForegroundColor(); }
/** * Fill properties of this shape * * @return fill properties of this shape */ public Fill getFill(){ if(_fill == null) _fill = new Fill(this); return _fill; }
/** * Event which fires when a shape is inserted in the sheet. * In some cases we need to propagate changes to upper level containers. * <br> * Default implementation does nothing. * * @param sh - owning shape */ protected void afterInsert(Sheet sh){ if(_fill != null) { _fill.afterInsert(sh); } }
Dimension pg = getSheet().getSlideShow().getPageSize(); Rectangle anchor = new Rectangle(0, 0, pg.width, pg.height); switch (f.getFillType()) { case Fill.FILL_SOLID: Color color = f.getForegroundColor(); graphics.setPaint(color); graphics.fill(anchor); break; case Fill.FILL_PICTURE: PictureData data = f.getPictureData(); if (data instanceof Bitmap) { BufferedImage img = null; logger.log(POILogger.WARN, "unsuported fill type: " + f.getFillType()); break;
/** * The color used to fill this shape. * * @param color the background color */ public void setFillColor(Color color){ getFill().setForegroundColor(color); }
/** */ protected void afterInsert(Sheet sh){ EscherOptRecord opt = (EscherOptRecord)Shape.getEscherChild(shape.getSpContainer(), EscherOptRecord.RECORD_ID); EscherSimpleProperty p = (EscherSimpleProperty)Shape.getEscherProperty(opt, EscherProperties.FILL__PATTERNTEXTURE); if(p != null) { int idx = p.getPropertyValue(); EscherBSERecord bse = getEscherBSERecord(idx); bse.setRef(bse.getRef() + 1); } }
protected void applyPaint(SimpleShape shape) { if (_paint instanceof Color) { shape.getFill().setForegroundColor((Color)_paint); } } }
/** * Assign picture used to fill the underlying shape. * * @param idx 0-based index of the picture added to this ppt by <code>SlideShow.addPicture</code> method. */ public void setPictureData(int idx){ EscherOptRecord opt = (EscherOptRecord)Shape.getEscherChild(shape.getSpContainer(), EscherOptRecord.RECORD_ID); Shape.setEscherProperty(opt, (short)(EscherProperties.FILL__PATTERNTEXTURE + 0x4000), idx); if( idx != 0 ) { if( shape.getSheet() != null ) { EscherBSERecord bse = getEscherBSERecord(idx); bse.setRef(bse.getRef() + 1); } } }
@Override protected Color getSlideBGColor(int index){ return slides[index].getBackground().getFill().getForegroundColor(); }
/** * Strokes the outline of a <code>Shape</code> using the settings of the * current <code>Graphics2D</code> context. The rendering attributes * applied include the <code>Clip</code>, <code>Transform</code>, * <code>Paint</code>, <code>Composite</code> and * <code>Stroke</code> attributes. * @param shape the <code>Shape</code> to be rendered * @see #setStroke * @see #setPaint * @see java.awt.Graphics#setColor * @see #_transform * @see #setTransform * @see #clip * @see #setClip * @see #setComposite */ public void draw(Shape shape){ GeneralPath path = new GeneralPath(_transform.createTransformedShape(shape)); Freeform p = new Freeform(_group); p.setPath(path); p.getFill().setForegroundColor(null); applyStroke(p); _group.addShape(p); }
Color fillColor = shape.getFill().getForegroundColor(); if (fillColor != null) {