@Override public Object createObject(Attributes atts) { JRBasePrintGraphicElement graphicElement = (JRBasePrintGraphicElement)digester.peek(); PenEnum pen = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_pen)); if (pen != null) { if (log.isWarnEnabled()) { log.warn("The 'pen' attribute is deprecated. Use the <pen> tag instead."); } JRPenUtil.setLinePenFromPen(pen, graphicElement.getLinePen()); } FillEnum fill = FillEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_fill)); if (fill != null) { graphicElement.setFill(fill); } return graphicElement; }
/** * */ public FillEnum getFillValue(JRCommonGraphicElement element) { FillEnum ownFill = element.getOwnFillValue(); if (ownFill != null) { return ownFill; } JRStyle baseStyle = getBaseStyle(element); if (baseStyle != null) { FillEnum fill = baseStyle.getFillValue(); if (fill != null) { return fill; } } return FillEnum.SOLID; }
/** * Creates the property descriptors. * * @param desc * the desc */ @Override public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { super.createPropertyDescriptors(desc, defaultsMap); fillD = new JSSEnumPropertyDescriptor(JRBaseStyle.PROPERTY_FILL, Messages.common_fill, FillEnum.class, NullEnum.INHERITED); fillD.setDescription(Messages.MRectangle_fill_description); desc.add(fillD); setHelpPrefix(desc, "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#graphicElement"); IntegerPropertyDescriptor rD = new IntegerPropertyDescriptor(JRBaseStyle.PROPERTY_RADIUS, Messages.common_radius); rD.setCategory(Messages.MRectangle_rectangle_properties_category); rD.setDescription(Messages.MRectangle_radius_description); desc.add(rD); defaultsMap.put(JRBaseStyle.PROPERTY_FILL, null); setHelpPrefix(desc, "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#rectangle"); }
@Override public void setFill(FillEnum fillValue) { FillEnum old = this.fillValue; this.fillValue = fillValue; getEventSupport().firePropertyChange(JRBaseStyle.PROPERTY_FILL, old, this.fillValue); }
@SuppressWarnings("deprecation") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) { fillValue = FillEnum.getByValue(fill); fill = null; } }
@Override public void setFill(FillEnum fillValue) { Object old = this.fillValue; this.fillValue = fillValue; getEventSupport().firePropertyChange(PROPERTY_FILL, old, this.fillValue); }
@Override public Object createObject(Attributes atts) { JRDesignGraphicElement graphicElement = (JRDesignGraphicElement)digester.peek(); StretchTypeEnum stretchType = StretchTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_stretchType)); if (stretchType != null) { if (log.isWarnEnabled()) { log.warn("The 'stretchType' attribute in <graphicElement> tag is deprecated. Use the same attribut in <reportElement> tag instead."); } graphicElement.setStretchType(stretchType); } PenEnum pen = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_pen)); if (pen != null) { if (log.isWarnEnabled()) { log.warn("The 'pen' attribute is deprecated. Use the <pen> tag instead."); } JRPenUtil.setLinePenFromPen(pen, graphicElement.getLinePen()); } FillEnum fill = FillEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_fill)); if (fill != null) { graphicElement.setFill(fill); } return graphicElement; }
/** * */ public FillEnum getFillValue(JRStyle style) { FillEnum ownFill = style.getOwnFillValue(); if (ownFill != null) { return ownFill; } JRStyle baseStyle = getBaseStyle(style); if (baseStyle != null) { return baseStyle.getFillValue(); } return null; }
/** * */ protected void setSubreport(JRSubreport subreport) { super.setElement(subreport); // don't want to inherit mode because of different defaults for rectangles and subreports setMode(subreport.getModeValue()); linePen = new JRBasePen(this); getLinePen().setLineWidth(0f); setFill(FillEnum.SOLID); }
/** * */ protected void setChart(JRChart chart) { super.setElement(chart); linePen = new JRBasePen(this); getLinePen().setLineWidth(0f); setFill(FillEnum.SOLID); copyLineBox(chart.getLineBox()); setLinkType(chart.getLinkType()); setLinkTarget(chart.getLinkTarget()); }
@Override public void setPropertyValue(Object id, Object value) { JRDesignLine jrElement = (JRDesignLine) getValue(); if (id.equals(JRBaseLine.PROPERTY_DIRECTION)) jrElement.setDirection((LineDirectionEnum) directionD.getEnumValue(value)); if (id.equals(JRBaseStyle.PROPERTY_FILL)) jrElement.setFill((FillEnum) fillD.getEnumValue(value)); else super.setPropertyValue(id, value); }
@Override public void setPropertyValue(Object id, Object value) { JRDesignRectangle jrElement = (JRDesignRectangle) getValue(); if (id.equals(JRBaseStyle.PROPERTY_FILL)) jrElement.setFill((FillEnum) fillD.getEnumValue(value)); else if (id.equals(JRBaseStyle.PROPERTY_RADIUS)) { jrElement.setRadius(value != null ? ((Integer) value).intValue() : 0); } else super.setPropertyValue(id, value); }
/** * Creates the property descriptors. * * @param desc * the desc */ @Override public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { super.createPropertyDescriptors(desc, defaultsMap); ComboBoxPropertyDescriptor fillD = new ComboBoxPropertyDescriptor(JRBaseStyle.PROPERTY_FILL, Messages.common_fill, EnumHelper.getEnumNames(FillEnum.values(), NullEnum.INHERITED)); fillD.setDescription(Messages.MEllipse_fill_description); desc.add(fillD); setHelpPrefix(desc, "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#graphicElement"); }
@Override public void setPropertyValue(Object id, Object value) { JRDesignEllipse jrElement = (JRDesignEllipse) getValue(); if (id.equals(JRBaseStyle.PROPERTY_FILL)) jrElement.setFill((FillEnum) EnumHelper.getSetValue(FillEnum.values(), value, 1, true)); else super.setPropertyValue(id, value); }
@Override public List getTagList() { List tags = new java.util.ArrayList(); tags.add(new Tag(FillEnum.SOLID, I18n.getString("Global.Property.Solid"))); return tags; }
@Override @SuppressWarnings(value = "unchecked") public PropertyEditor getPropertyEditor() { if (editor == null) { ArrayList l = new ArrayList(); l.add(new Tag(FillEnum.SOLID, I18n.getString("AbstractStyleNode.Property.Solid"))); editor = new ComboBoxPropertyEditor(false, l); } return editor; }
private void setPropertyValue(Object val) { if (val == null || val instanceof FillEnum) { FillEnum oldValue = style.getOwnFillValue() == null ? null : style.getOwnFillValue(); FillEnum newValue = (FillEnum) val; style.setFill(newValue); ObjectPropertyUndoableEdit urob = new ObjectPropertyUndoableEdit(style, "Fill", Byte.class, oldValue, newValue); IReportManager.getInstance().addUndoableEdit(urob); } }
@Override public FillEnum getFillValue() { return getStyleResolver().getFillValue(this); }
@Override public FillEnum getOwnFillValue() { return this.fillValue; }
@Override public FillEnum getOwnFillValue() { return fillValue; }
@SuppressWarnings("deprecation") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) { modeValue = ModeEnum.getByValue(mode); horizontalAlignmentValue = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getByValue(horizontalAlignment); verticalAlignmentValue = net.sf.jasperreports.engine.type.VerticalAlignEnum.getByValue(verticalAlignment); rotationValue = RotationEnum.getByValue(rotation); lineSpacingValue = LineSpacingEnum.getByValue(lineSpacing); scaleImageValue = ScaleImageEnum.getByValue(scaleImage); fillValue = FillEnum.getByValue(fill); mode = null; horizontalAlignment = null; verticalAlignment = null; rotation = null; lineSpacing = null; scaleImage = null; fill = null; } if (isStyledText != null) { markup = isStyledText.booleanValue() ? JRCommonText.MARKUP_STYLED_TEXT : JRCommonText.MARKUP_NONE; isStyledText = null; } if (paragraph == null) { paragraph = new JRBaseParagraph(this); paragraph.setLineSpacing(lineSpacingValue); lineSpacingValue = null; } if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_5_5_2) { fontsize = fontSize == null ? null : fontSize.floatValue(); fontSize = null; } if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2) { horizontalTextAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalTextAlignEnum(horizontalAlignmentValue); verticalTextAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalTextAlignEnum(verticalAlignmentValue); horizontalImageAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalImageAlignEnum(horizontalAlignmentValue); verticalImageAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalImageAlignEnum(verticalAlignmentValue); horizontalAlignmentValue = null; verticalAlignmentValue = null; } }
@Override public void setFill(FillEnum fillValue) { this.fillValue = fillValue; }
/** * */ public static FillEnum getFillValue(JRCommonGraphicElement element) { return styleResolver.getFillValue(element); }
/** * */ public static FillEnum getFillValue(JRStyle style) { return styleResolver.getFillValue(style); }
@Override public FillEnum getOwnFillValue() { return providerStyle == null || providerStyle.getOwnFillValue() == null ? ((JRGraphicElement)this.parent).getOwnFillValue() : providerStyle.getOwnFillValue(); }
@Override public void setFill(FillEnum fill) { throw new UnsupportedOperationException(); }
@Override public FillEnum getFillValue() { return ((JRTemplateGraphicElement)this.template).getFillValue(); }