public Object createObject(Attributes atts) throws JRException {
      // Grab the chart from the object stack.
      StandardChartSettings chartSettings = (StandardChartSettings) digester.peek();

      // Set the text color
      String attrValue = atts.getValue(JRXmlConstants.ATTRIBUTE_textColor);
      if (attrValue != null && attrValue.length() > 0) {
        Color color = JRColorUtil.getColor(attrValue, null);
        chartSettings.setLegendColor(color);
      }

      // Set the background color
      attrValue = atts.getValue(JRXmlConstants.ATTRIBUTE_backgroundColor);
      if (attrValue != null && attrValue.length() > 0) {
        Color color = JRColorUtil.getColor(attrValue, null);
        chartSettings.setLegendBackgroundColor(color);
      }

      EdgeEnum position = EdgeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_position));
      if (position != null) {
        chartSettings.setLegendPosition(position);
      }

      return chartSettings;
    }
    public Object createObject(Attributes atts) {
      StandardChartSettings chartSettings = (StandardChartSettings) digester.peek();

      EdgeEnum position = EdgeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_position));
      if (position != null) {
        chartSettings.setTitlePosition(position);
      }

      Color color =
          JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_color), Color.black);
      if (color != null) {
        chartSettings.setTitleColor(color);
      }

      return chartSettings;
    }
예제 #3
0
 /** @deprecated Replaced by {@link #setLegendPosition(EdgeEnum)} */
 public void setLegendPosition(Byte legendPosition) {
   setLegendPosition(EdgeEnum.getByValue(legendPosition));
 }
예제 #4
0
  private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();

    if (lineBox == null) {
      lineBox = new JRBaseLineBox(this);
      JRBoxUtil.setToBox(
          border,
          topBorder,
          leftBorder,
          bottomBorder,
          rightBorder,
          borderColor,
          topBorderColor,
          leftBorderColor,
          bottomBorderColor,
          rightBorderColor,
          padding,
          topPadding,
          leftPadding,
          bottomPadding,
          rightPadding,
          lineBox);
      border = null;
      topBorder = null;
      leftBorder = null;
      bottomBorder = null;
      rightBorder = null;
      borderColor = null;
      topBorderColor = null;
      leftBorderColor = null;
      bottomBorderColor = null;
      rightBorderColor = null;
      padding = null;
      topPadding = null;
      leftPadding = null;
      bottomPadding = null;
      rightPadding = 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_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;
      }
    }
  }
예제 #5
0
 /** @deprecated Replaced by {@link #setTitlePosition(EdgeEnum)} */
 public void setTitlePosition(Byte titlePosition) {
   setTitlePosition(EdgeEnum.getByValue(titlePosition));
 }