Package net.sf.jasperreports.engine.base

Examples of net.sf.jasperreports.engine.base.JRBaseFont


    color = jrPlot.getNeedleColor();
    if (color != null)
      chartPlot.setNeedlePaint(color);

    JRBaseFont font = new JRBaseFont();
    JRFontUtil.copyNonNullOwnProperties(getPlotSettings().getTickLabelFont(), font);
    JRFontUtil.copyNonNullOwnProperties(jrPlot.getTickLabelFont(), font);
    font = new JRBaseFont(getChart(), font);
    chartPlot.setTickLabelFont(JRFontUtil.getAwtFont(font, getLocale()));

    // Set how the value is displayed.
    JRValueDisplay display = jrPlot.getValueDisplay();
    if (display != null)
    {
      if (display.getColor() != null)
      {
        chartPlot.setValuePaint(display.getColor());
      }

      if (display.getMask() != null)
      {
        chartPlot.setTickLabelFormat(new DecimalFormat(display.getMask()));
      }
     
      font = new JRBaseFont();
      JRFontUtil.copyNonNullOwnProperties(getPlotSettings().getDisplayFont(), font);
      JRFontUtil.copyNonNullOwnProperties(jrPlot.getValueDisplay().getFont(), font);
      font = new JRBaseFont(getChart(), font);
      chartPlot.setValueFont(JRFontUtil.getAwtFont(font, getLocale()));

    }

    color = jrPlot.getTickColor();
View Full Code Here


        (range.getUpperBound() - range.getLowerBound())/6,
        15
        );
    scale.setTickRadius(0.9);
    scale.setTickLabelOffset(0.16);
    JRBaseFont font = new JRBaseFont();
    JRFontUtil.copyNonNullOwnProperties(getPlotSettings().getTickLabelFont(), font);
    JRFontUtil.copyNonNullOwnProperties(jrPlot.getTickLabelFont(), font);
    font = new JRBaseFont(getChart(), font);
    scale.setTickLabelFont(JRFontUtil.getAwtFont(font, getLocale()));
    scale.setMajorTickStroke(new BasicStroke(1f));
    scale.setMinorTickStroke(new BasicStroke(0.3f));
    scale.setMajorTickPaint(jrPlot.getTickColor());
    scale.setMinorTickPaint(jrPlot.getTickColor());

    scale.setTickLabelsVisible(true);
    scale.setFirstTickLabelVisible(true);

    dialPlot.addScale(0, scale);
    List intervals = jrPlot.getIntervals();
    if (intervals != null && intervals.size() > 0)
    {
      int size = Math.min(3, intervals.size());
      int colorStep = 0;
      if(size > 0)
        colorStep = 255 / size;
     
      for(int i = 0; i < size; i++)
      {
        JRMeterInterval interval = (JRMeterInterval)intervals.get(i);
        Range intervalRange = convertRange(interval.getDataRange());

        Color color = new Color(255 - colorStep * i, 0 + colorStep * i, 0);
       
        StandardDialRange dialRange =
          new StandardDialRange(
            intervalRange.getLowerBound(),
            intervalRange.getUpperBound(),
            interval.getBackgroundColor() == null
              ? color
              : interval.getBackgroundColor()
            );
        dialRange.setInnerRadius(0.41);
        dialRange.setOuterRadius(0.41);
        dialPlot.addLayer(dialRange);
      }
    }

    JRValueDisplay display = jrPlot.getValueDisplay();
    String displayVisibility = display != null && getChart().hasProperties() ?
      getChart().getPropertiesMap().getProperty(DefaultChartTheme.PROPERTY_DIAL_VALUE_DISPLAY_VISIBLE) : "false";

    if(Boolean.parseBoolean(displayVisibility))
    {
      DialValueIndicator dvi = new DialValueIndicator(0);
      dvi.setBackgroundPaint(ChartThemesConstants.TRANSPARENT_PAINT);
//      dvi.setFont(JRFontUtil.getAwtFont(jrFont).deriveFont(10f).deriveFont(Font.BOLD));
      dvi.setOutlinePaint(ChartThemesConstants.TRANSPARENT_PAINT);
      dvi.setPaint(Color.WHITE);

      String pattern = display.getMask() != null ? display.getMask() : "#,##0.####";
      if(pattern != null)
        dvi.setNumberFormat( new DecimalFormat(pattern));
      dvi.setRadius(0.15);
      dvi.setValueAnchor(RectangleAnchor.CENTER);
      dvi.setTextAnchor(TextAnchor.CENTER);
      //dvi.setTemplateValue(Double.valueOf(getDialTickValue(dialPlot.getValue(0),dialUnitScale)));
      dialPlot.addLayer(dvi);
    }
    String label = getChart().hasProperties() ?
        getChart().getPropertiesMap().getProperty(DefaultChartTheme.PROPERTY_DIAL_LABEL) : null;
   
    if(label != null)
    {
      JRFont displayFont = new JRBaseFont();
      JRFontUtil.copyNonNullOwnProperties(getPlotSettings().getDisplayFont(), displayFont);
      JRFontUtil.copyNonNullOwnProperties(jrPlot.getValueDisplay().getFont(), displayFont);
      displayFont = new JRBaseFont(getChart(), displayFont);
      Font themeDisplayFont = JRFontUtil.getAwtFont(displayFont, getLocale());
     
      String[] textLines = label.split("\\n");
      for(int i = 0; i < textLines.length; i++)
      {
View Full Code Here

    //The legend visibility is already taken into account in the jfreeChart object's constructor
    LegendTitle legend = jfreeChart.getLegend();
    if (legend != null)
    {
      LegendSettings legendSettings = getLegendSettings();
      JRBaseFont font = new JRBaseFont();
      JRFontUtil.copyNonNullOwnProperties(legendSettings.getFont(), font);
      JRFontUtil.copyNonNullOwnProperties(getChart().getLegendFont(), font);
      font = new JRBaseFont(getChart(), font);
      legend.setItemFont(JRFontUtil.getAwtFont(font, getLocale()));

      Paint forePaint = getChart().getOwnLegendColor();
      if (forePaint == null && legendSettings.getForegroundPaint() != null)
      {
View Full Code Here

      Double labelAngle = axisSettings.getLabelAngle();
      if(labelAngle != null)
        axis.setLabelAngle(labelAngle.doubleValue());

      JRBaseFont font = new JRBaseFont();
      JRFontUtil.copyNonNullOwnProperties(axisSettings.getLabelFont(), font);
      JRFontUtil.copyNonNullOwnProperties(labelFont, font);
      font = new JRBaseFont(getChart(), font);
      axis.setLabelFont(JRFontUtil.getAwtFont(font, getLocale()));
     
      RectangleInsets labelInsets = axisSettings.getLabelInsets();
      if(labelInsets != null)
      {
View Full Code Here

   
    axis.setTickLabelsVisible(axisTickLabelsVisible);

    if(axisTickLabelsVisible)
    {
      JRBaseFont font = new JRBaseFont();
      JRFontUtil.copyNonNullOwnProperties(axisSettings.getTickLabelFont(), font);
      JRFontUtil.copyNonNullOwnProperties(tickLabelFont, font);
      font = new JRBaseFont(getChart(), font);
      axis.setTickLabelFont(JRFontUtil.getAwtFont(font, getLocale()));
     
      RectangleInsets tickLabelInsets = axisSettings.getTickLabelInsets();
      if(tickLabelInsets != null)
      {
View Full Code Here

      TitleSettings titleSettings,
      JRFont titleFont,
      Paint titleForegroundPaint,
      RectangleEdge titleEdge)
  {
    JRBaseFont font = new JRBaseFont();
    JRFontUtil.copyNonNullOwnProperties(titleSettings.getFont(), font);
    JRFontUtil.copyNonNullOwnProperties(titleFont, font);
    font = new JRBaseFont(getChart(), font);
    title.setFont(JRFontUtil.getAwtFont(font, getLocale()));
   
    HorizontalAlignment hAlign = titleSettings.getHorizontalAlignment();
    if(hAlign != null)
      title.setHorizontalAlignment(hAlign);
View Full Code Here

      && (runLimit = iterator.getRunLimit()) <= styledText.length()
      )
    {

      Map styledTextAttributes = iterator.getAttributes();
      JRFont styleFont = new JRBaseFont(styledTextAttributes);
      Color styleForeground = (Color) styledTextAttributes.get(TextAttribute.FOREGROUND);
      Color styleBackground = (Color) styledTextAttributes.get(TextAttribute.BACKGROUND);

      writer.write("\\f");
      writer.write(String.valueOf(getFontIndex(styleFont, getTextLocale(text))));
      writer.write("\\fs");
      writer.write(String.valueOf(2 * styleFont.getFontSize()));

      if (styleFont.isBold())
      {
        writer.write("\\b");
      }
      if (styleFont.isItalic())
      {
        writer.write("\\i");
      }
      if (styleFont.isUnderline())
      {
        writer.write("\\ul");
      }
      if (styleFont.isStrikeThrough())
      {
        writer.write("\\strike");
      }

      if (TextAttribute.SUPERSCRIPT_SUPER.equals(styledTextAttributes.get(TextAttribute.SUPERSCRIPT)))
View Full Code Here

    super(plot, chart);
   
    JRHighLowPlot highLowPlot = plot instanceof JRHighLowPlot ? (JRHighLowPlot)plot : null;
    if (highLowPlot == null)
    {
      timeAxisLabelFont = new JRBaseFont(chart, null);
      timeAxisTickLabelFont = new JRBaseFont(chart, null);
      valueAxisLabelFont = new JRBaseFont(chart, null);
      valueAxisTickLabelFont = new JRBaseFont(chart, null);
    }
    else
    {
      timeAxisLabelFont = new JRBaseFont(chart, highLowPlot.getTimeAxisLabelFont());
      timeAxisTickLabelFont = new JRBaseFont(chart, highLowPlot.getTimeAxisTickLabelFont());
      valueAxisLabelFont = new JRBaseFont(chart, highLowPlot.getValueAxisLabelFont());
      valueAxisTickLabelFont = new JRBaseFont(chart, highLowPlot.getValueAxisTickLabelFont());
    }
  }
View Full Code Here

    showOpenTicks = highLowPlot.getShowOpenTicks();
    showCloseTicks = highLowPlot.getShowCloseTicks();

    timeAxisLabelExpression = factory.getExpression( highLowPlot.getTimeAxisLabelExpression() );
    timeAxisLabelFont = new JRBaseFont(highLowPlot.getChart(), highLowPlot.getTimeAxisLabelFont());
    timeAxisLabelColor = highLowPlot.getOwnTimeAxisLabelColor();
    timeAxisTickLabelFont = new JRBaseFont(highLowPlot.getChart(), highLowPlot.getTimeAxisTickLabelFont());
    timeAxisTickLabelColor = highLowPlot.getOwnTimeAxisTickLabelColor();
    timeAxisTickLabelMask = highLowPlot.getTimeAxisTickLabelMask();
    timeAxisVerticalTickLabels = highLowPlot.getTimeAxisVerticalTickLabels();
    timeAxisLineColor = highLowPlot.getOwnTimeAxisLineColor();
   
    valueAxisLabelExpression = factory.getExpression( highLowPlot.getValueAxisLabelExpression() );
    domainAxisMinValueExpression = factory.getExpression( highLowPlot.getDomainAxisMinValueExpression() );
    domainAxisMaxValueExpression = factory.getExpression( highLowPlot.getDomainAxisMaxValueExpression() );
    rangeAxisMinValueExpression = factory.getExpression( highLowPlot.getRangeAxisMinValueExpression() );
    rangeAxisMaxValueExpression = factory.getExpression( highLowPlot.getRangeAxisMaxValueExpression() );
    valueAxisLabelFont = new JRBaseFont(highLowPlot.getChart(), highLowPlot.getValueAxisLabelFont());
    valueAxisLabelColor = highLowPlot.getOwnValueAxisLabelColor();
    valueAxisTickLabelFont = new JRBaseFont(highLowPlot.getChart(), highLowPlot.getValueAxisTickLabelFont());
    valueAxisTickLabelColor = highLowPlot.getOwnValueAxisTickLabelColor();
    valueAxisTickLabelMask = highLowPlot.getValueAxisTickLabelMask();
    valueAxisVerticalTickLabels = highLowPlot.getValueAxisVerticalTickLabels();
    valueAxisLineColor = highLowPlot.getOwnValueAxisTickLabelColor();
  }
View Full Code Here

    JRFillObjectFactory factory
    )
  {
    super(barPlot, factory);

    categoryAxisLabelFont = new JRBaseFont(barPlot.getChart(), barPlot.getCategoryAxisLabelFont());
    categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor();
    categoryAxisTickLabelFont = new JRBaseFont(barPlot.getChart(), barPlot.getCategoryAxisTickLabelFont());
    categoryAxisTickLabelColor = barPlot.getOwnCategoryAxisTickLabelColor();
    categoryAxisLineColor = barPlot.getOwnCategoryAxisLineColor();
   
    valueAxisLabelFont = new JRBaseFont(barPlot.getChart(), barPlot.getValueAxisLabelFont());
    valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor();
    valueAxisTickLabelFont = new JRBaseFont(barPlot.getChart(), barPlot.getValueAxisTickLabelFont());
    valueAxisTickLabelColor = barPlot.getOwnValueAxisTickLabelColor();
    valueAxisLineColor = barPlot.getOwnValueAxisLineColor();
   
  }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.base.JRBaseFont

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.