public Map getStyledTextAttributes(JRPrintText printText) { Map attributes = new HashMap(); JRFontUtil.getAttributes(attributes, printText, getTextLocale(printText)); attributes.put(TextAttribute.FOREGROUND, printText.getForecolor()); return attributes; } };
public Map getStyledTextAttributes(JRPrintText printText) { Map attributes = new HashMap(); JRFontUtil.getAttributes(attributes, printText, getTextLocale(printText)); attributes.put(TextAttribute.FOREGROUND, printText.getForecolor()); if (printText.getMode() == JRElement.MODE_OPAQUE) { attributes.put(TextAttribute.BACKGROUND, printText.getBackcolor()); } return attributes; } };
/** * */ private Map getAttributes(JRStyle style) throws IOException//FIXMEDOCX put this in util? { JRPrintText text = new JRBasePrintText(null); text.setStyle(style); Map styledTextAttributes = new HashMap(); JRFontUtil.getAttributes(styledTextAttributes, text, (Locale)null);//FIXMEDOCX getLocale()); styledTextAttributes.put(TextAttribute.FOREGROUND, text.getForecolor()); if (text.getMode() == JRElement.MODE_OPAQUE) { styledTextAttributes.put(TextAttribute.BACKGROUND, text.getBackcolor()); } return styledTextAttributes; }
/** * */ public void exportProps(JRStyle style) throws IOException { JRPrintText text = new JRBasePrintText(null); text.setStyle(style); Map styledTextAttributes = new HashMap(); JRFontUtil.getAttributes(styledTextAttributes, text, (Locale)null);//FIXMEDOCX getLocale()); styledTextAttributes.put(TextAttribute.FOREGROUND, text.getForecolor()); if (style.getMode() == null || style.getMode().byteValue() == JRElement.MODE_OPAQUE) { styledTextAttributes.put(TextAttribute.BACKGROUND, style.getBackcolor()); } exportProps(getAttributes(style.getStyle()), getAttributes(style)); }
grx.setColor(text.getForecolor());
short forecolor = getNearestColor(textElement.getForecolor()).getIndex();
Colour forecolor = getWorkbookColour(text.getForecolor()); WritableFont cellFont = this.getLoadedFont(text, forecolor.getValue());