@Override protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException { if (pieSeries != null && pieSeries.length > 0) { for(int i = 0; i < pieSeries.length; i++) { pieSeries[i].evaluate(calculator); } } otherKey = (String)calculator.evaluate(getOtherKeyExpression()); otherLabel = (String)calculator.evaluate(getOtherLabelExpression()); if (!JRHyperlinkHelper.isEmpty(getOtherSectionHyperlink())) { evaluateOtherSectionHyperlink(calculator); } }
@SuppressWarnings("deprecation") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if (linkType == null) { linkType = JRHyperlinkHelper.getLinkType(HyperlinkTypeEnum.getByValue(hyperlinkType)); } if (linkTarget == null) { linkTarget = JRHyperlinkHelper.getLinkTarget(HyperlinkTargetEnum.getByValue(hyperlinkTarget)); } if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) { evaluationTimeValue = EvaluationTimeEnum.getByValue(evaluationTime); } }
@SuppressWarnings("deprecation") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if (linkType == null) { linkType = JRHyperlinkHelper.getLinkType(HyperlinkTypeEnum.getByValue(hyperlinkType)); } if (linkTarget == null) { linkTarget = JRHyperlinkHelper.getLinkTarget(HyperlinkTargetEnum.getByValue(hyperlinkTarget)); } if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2) { evaluationTimeValue = EvaluationTimeEnum.getByValue(evaluationTime); if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_1_3) { legendPositionValue = EdgeEnum.getByValue(legendPosition); titlePositionValue = EdgeEnum.getByValue(titlePosition); showLegend = Boolean.valueOf(isShowLegend); } else { legendPositionValue = EdgeEnum.getByValue(legendPositionByte); titlePositionValue = EdgeEnum.getByValue(titlePositionByte); legendPositionByte = null; titlePositionByte = null; } } }
@SuppressWarnings("deprecation") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if (linkTarget == null) { linkTarget = JRHyperlinkHelper.getLinkTarget(HyperlinkTargetEnum.getByValue(hyperlinkTarget)); } }
@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) { horizontalAlignmentValue = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getByValue(horizontalAlignment); verticalAlignmentValue = net.sf.jasperreports.engine.type.VerticalAlignEnum.getByValue(verticalAlignment); scaleImageValue = ScaleImageEnum.getByValue(scaleImage); onErrorTypeValue = OnErrorTypeEnum.getByValue(onErrorType); evaluationTimeValue = EvaluationTimeEnum.getByValue(evaluationTime); horizontalAlignment = null; verticalAlignment = null; scaleImage = null; } if (linkType == null) { linkType = JRHyperlinkHelper.getLinkType(HyperlinkTypeEnum.getByValue(hyperlinkType)); } if (linkTarget == null) { linkTarget = JRHyperlinkHelper.getLinkTarget(HyperlinkTargetEnum.getByValue(hyperlinkTarget)); } if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2) { horizontalImageAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalImageAlignEnum(horizontalAlignmentValue); verticalImageAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalImageAlignEnum(verticalAlignmentValue); horizontalAlignmentValue = null; verticalAlignmentValue = null; } }
@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) { horizontalAlignmentValue = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getByValue(horizontalAlignment); verticalAlignmentValue = net.sf.jasperreports.engine.type.VerticalAlignEnum.getByValue(verticalAlignment); scaleImageValue = ScaleImageEnum.getByValue(scaleImage); onErrorTypeValue = OnErrorTypeEnum.getByValue(onErrorType); horizontalAlignment = null; verticalAlignment = null; scaleImage = null; } if (linkType == null) { linkType = JRHyperlinkHelper.getLinkType(HyperlinkTypeEnum.getByValue(hyperlinkType)); } if (linkTarget == null) { linkTarget = JRHyperlinkHelper.getLinkTarget(HyperlinkTargetEnum.getByValue(hyperlinkTarget)); } if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2) { horizontalImageAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalImageAlignEnum(horizontalAlignmentValue); verticalImageAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalImageAlignEnum(verticalAlignmentValue); horizontalAlignmentValue = null; verticalAlignmentValue = null; } }
public boolean hasItemHyperlinks() { return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); }
public boolean hasItemHyperlink() { return !JRHyperlinkHelper.isEmpty(getItemHyperlink()); }
public boolean hasSectionHyperlinks() { return !JRHyperlinkHelper.isEmpty(getSectionHyperlink()); }
@Override public Dataset getCustomDataset() { double total = 0; List<Double> sortedValues = new ArrayList<Double>(); for(Number nv: values.values()) { double dvalue = nv.doubleValue(); total += dvalue; sortedValues.add(dvalue); } Collections.sort(sortedValues); Double minValue = null; if (getMinPercentage() != null && getMinPercentage().intValue() >= 0 && getMinPercentage().intValue() <= 100)//FIXMENOW why intValue? { minValue = new Double((getMinPercentage().doubleValue() * total) / 100); } if (getMaxCount() != null && getMaxCount().intValue() >= 0 && getMaxCount().intValue() <= values.size()) { Double minValue2 = sortedValues.get(sortedValues.size() - getMaxCount().intValue()); minValue = minValue != null && minValue.doubleValue() > minValue2.doubleValue() ? minValue : minValue2; } int otherCount = 0; Comparable<?> lastOtherKey = null; Number lastOtherValue = null; double otherTotal = 0; DefaultPieDataset dataset = new DefaultPieDataset(); for(Iterator<Comparable<?>> it = values.keySet().iterator(); it.hasNext();) { Comparable<?> key = it.next(); Number value = values.get(key); if ( minValue == null || value.doubleValue() >= minValue.doubleValue() ) { dataset.setValue(key, value); } else { otherCount++; lastOtherKey = key; lastOtherValue = value; otherTotal += value.doubleValue(); } } if (otherCount == 1) { dataset.setValue(lastOtherKey, lastOtherValue); } else if (otherCount > 1) { otherKey = otherKey == null ? "Other" : otherKey; dataset.setValue(otherKey, new Double(otherTotal)); labels.put(otherKey, otherLabel); if (!JRHyperlinkHelper.isEmpty(getOtherSectionHyperlink())) { sectionHyperlinks.put(otherKey, otherSectionHyperlink); } } return dataset; }
@Override public HyperlinkTypeEnum getHyperlinkTypeValue() { return JRHyperlinkHelper.getHyperlinkTypeValue(this); }
@Override public byte getHyperlinkTarget() { return JRHyperlinkHelper.getHyperlinkTarget(this); }
@Override public HyperlinkTargetEnum getHyperlinkTargetValue() { return JRHyperlinkHelper.getHyperlinkTargetValue(getLinkTarget()); }
@Override public HyperlinkTypeEnum getHyperlinkTypeValue() { return JRHyperlinkHelper.getHyperlinkTypeValue(getLinkType()); }
@Override public void setHyperlinkTarget(HyperlinkTargetEnum hyperlinkTarget) { setLinkTarget(JRHyperlinkHelper.getLinkTarget(hyperlinkTarget)); }
@Override public void setHyperlinkType(HyperlinkTypeEnum hyperlinkType) { setLinkType(JRHyperlinkHelper.getLinkType(hyperlinkType)); }
@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) { horizontalAlignmentValue = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getByValue(horizontalAlignment); verticalAlignmentValue = net.sf.jasperreports.engine.type.VerticalAlignEnum.getByValue(verticalAlignment); rotationValue = RotationEnum.getByValue(rotation); runDirectionValue = RunDirectionEnum.getByValue(runDirection); lineSpacingValue = LineSpacingEnum.getByValue(lineSpacing); horizontalAlignment = null; verticalAlignment = null; rotation = null; lineSpacing = null; } if (isStyledText != null) { markup = isStyledText.booleanValue() ? JRCommonText.MARKUP_STYLED_TEXT : JRCommonText.MARKUP_NONE; isStyledText = null; } if (linkType == null) { linkType = JRHyperlinkHelper.getLinkType(HyperlinkTypeEnum.getByValue(hyperlinkType)); } if (linkTarget == null) { linkTarget = JRHyperlinkHelper.getLinkTarget(HyperlinkTargetEnum.getByValue(hyperlinkTarget)); } 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); horizontalAlignmentValue = null; verticalAlignmentValue = null; } }
@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) { horizontalAlignmentValue = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getByValue(horizontalAlignment); verticalAlignmentValue = net.sf.jasperreports.engine.type.VerticalAlignEnum.getByValue(verticalAlignment); scaleImageValue = ScaleImageEnum.getByValue(scaleImage); onErrorTypeValue = OnErrorTypeEnum.getByValue(onErrorType); horizontalAlignment = null; verticalAlignment = null; scaleImage = null; } if (linkType == null) { linkType = JRHyperlinkHelper.getLinkType(HyperlinkTypeEnum.getByValue(hyperlinkType)); } if (linkTarget == null) { linkTarget = JRHyperlinkHelper.getLinkTarget(HyperlinkTargetEnum.getByValue(hyperlinkTarget)); } if (renderer != null && renderable == null) { if (renderer instanceof Renderable) { renderable = (Renderable)renderer; } else { renderable = net.sf.jasperreports.engine.RenderableUtil.getWrappingRenderable(renderer); } } if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2) { horizontalImageAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalImageAlignEnum(horizontalAlignmentValue); verticalImageAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalImageAlignEnum(verticalAlignmentValue); horizontalAlignmentValue = null; verticalAlignmentValue = null; } }