Examples of G2TextMeasurer


Examples of com.positive.charts.util.G2TextMeasurer

        || (position == RectangleEdge.BOTTOM)) {
      final float maxWidth = (float) w;
      g2.setFont(this.font);
      this.content = TextUtilities.createTextBlock(this.text, this.font,
          this.paint, maxWidth, this.maximumLinesToDisplay,
          new G2TextMeasurer(g2));
      this.content.setLineAlignment(this.textAlignment);
      final Size2D contentSize = this.content.calculateDimensions(g2);
      if (this.expandToFitSpace) {
        return new Size2D(maxWidth, contentSize.getHeight());
      } else {
        return contentSize;
      }
    } else if ((position == RectangleEdge.LEFT)
        || (position == RectangleEdge.RIGHT)) {
      final float maxWidth = Float.MAX_VALUE;
      g2.setFont(this.font);
      this.content = TextUtilities.createTextBlock(this.text, this.font,
          this.paint, maxWidth, this.maximumLinesToDisplay,
          new G2TextMeasurer(g2));
      this.content.setLineAlignment(this.textAlignment);
      final Size2D contentSize = this.content.calculateDimensions(g2);

      // transpose the dimensions, because the title is rotated
      if (this.expandToFitSpace) {
View Full Code Here

Examples of com.positive.charts.util.G2TextMeasurer

        || (position == RectangleEdge.BOTTOM)) {
      final float maxWidth = (float) widthRange.getUpperBound();
      g2.setFont(this.font);
      this.content = TextUtilities.createTextBlock(this.text, this.font,
          this.paint, maxWidth, this.maximumLinesToDisplay,
          new G2TextMeasurer(g2));
      this.content.setLineAlignment(this.textAlignment);
      final Size2D contentSize = this.content.calculateDimensions(g2);
      if (this.expandToFitSpace) {
        return new Size2D(maxWidth, contentSize.getHeight());
      } else {
        return contentSize;
      }
    } else if ((position == RectangleEdge.LEFT)
        || (position == RectangleEdge.RIGHT)) {
      final float maxWidth = (float) heightRange.getUpperBound();
      g2.setFont(this.font);
      this.content = TextUtilities.createTextBlock(this.text, this.font,
          this.paint, maxWidth, this.maximumLinesToDisplay,
          new G2TextMeasurer(g2));
      this.content.setLineAlignment(this.textAlignment);
      final Size2D contentSize = this.content.calculateDimensions(g2);

      // transpose the dimensions, because the title is rotated
      if (this.expandToFitSpace) {
View Full Code Here

Examples of com.positive.charts.util.G2TextMeasurer

  protected TextBlock createLabel(final Comparable category,
      final float width, final RectangleEdge edge, final GC g2) {
    final TextBlock label = TextUtilities.createTextBlock(category
        .toString(), this.getTickLabelFont(category), this
        .getTickLabelPaint(category), width,
        this.maximumCategoryLabelLines, new G2TextMeasurer(g2));
    return label;
  }
View Full Code Here

Examples of org.jfree.chart.text.G2TextMeasurer

            g2.setFont(this.noDataMessageFont);
            g2.setPaint(this.noDataMessagePaint);
            TextBlock block = TextUtilities.createTextBlock(
                    this.noDataMessage, this.noDataMessageFont,
                    this.noDataMessagePaint, 0.9f * (float) area.getWidth(),
                    new G2TextMeasurer(g2));
            block.draw(g2, (float) area.getCenterX(),
                    (float) area.getCenterY(), TextBlockAnchor.CENTER);
        }
        g2.setClip(savedClip);
    }
View Full Code Here

Examples of org.jfree.chart.text.G2TextMeasurer

     */
    protected TextBlock createLabel(Comparable category, float width,
            RectangleEdge edge, Graphics2D g2) {
        TextBlock label = TextUtilities.createTextBlock(category.toString(),
                getTickLabelFont(category), getTickLabelPaint(category), width,
                this.maximumCategoryLabelLines, new G2TextMeasurer(g2));
        return label;
    }
View Full Code Here

Examples of org.jfree.chart.text.G2TextMeasurer

        if (position == RectangleEdge.TOP || position == RectangleEdge.BOTTOM) {
            float maxWidth = (float) w;
            g2.setFont(this.font);
            this.content = TextUtilities.createTextBlock(this.text, this.font,
                    this.paint, maxWidth, this.maximumLinesToDisplay,
                    new G2TextMeasurer(g2));
            this.content.setLineAlignment(this.textAlignment);
            Size2D contentSize = this.content.calculateDimensions(g2);
            if (this.expandToFitSpace) {
                return new Size2D(maxWidth, contentSize.getHeight());
            }
            else {
                return contentSize;
            }
        }
        else if (position == RectangleEdge.LEFT || position
                == RectangleEdge.RIGHT) {
            float maxWidth = Float.MAX_VALUE;
            g2.setFont(this.font);
            this.content = TextUtilities.createTextBlock(this.text, this.font,
                    this.paint, maxWidth, this.maximumLinesToDisplay,
                    new G2TextMeasurer(g2));
            this.content.setLineAlignment(this.textAlignment);
            Size2D contentSize = this.content.calculateDimensions(g2);

            // transpose the dimensions, because the title is rotated
            if (this.expandToFitSpace) {
View Full Code Here

Examples of org.jfree.chart.text.G2TextMeasurer

        if (position == RectangleEdge.TOP || position == RectangleEdge.BOTTOM) {
            float maxWidth = (float) widthRange.getUpperBound();
            g2.setFont(this.font);
            this.content = TextUtilities.createTextBlock(this.text, this.font,
                    this.paint, maxWidth, this.maximumLinesToDisplay,
                    new G2TextMeasurer(g2));
            this.content.setLineAlignment(this.textAlignment);
            Size2D contentSize = this.content.calculateDimensions(g2);
            if (this.expandToFitSpace) {
                return new Size2D(maxWidth, contentSize.getHeight());
            }
            else {
                return contentSize;
            }
        }
        else if (position == RectangleEdge.LEFT || position
                == RectangleEdge.RIGHT) {
            float maxWidth = (float) heightRange.getUpperBound();
            g2.setFont(this.font);
            this.content = TextUtilities.createTextBlock(this.text, this.font,
                    this.paint, maxWidth, this.maximumLinesToDisplay,
                    new G2TextMeasurer(g2));
            this.content.setLineAlignment(this.textAlignment);
            Size2D contentSize = this.content.calculateDimensions(g2);

            // transpose the dimensions, because the title is rotated
            if (this.expandToFitSpace) {
View Full Code Here

Examples of org.jfree.chart.text.G2TextMeasurer

            String label = this.labelGenerator.generateSectionLabel(
                    this.dataset, leftKeys.getKey(i));
            if (label != null) {
                TextBlock block = TextUtilities.createTextBlock(label,
                        this.labelFont, this.labelPaint, maxLabelWidth,
                        new G2TextMeasurer(g2));
                TextBox labelBox = new TextBox(block);
                labelBox.setBackgroundPaint(this.labelBackgroundPaint);
                labelBox.setOutlinePaint(this.labelOutlinePaint);
                labelBox.setOutlineStroke(this.labelOutlineStroke);
                if (this.shadowGenerator == null) {
View Full Code Here

Examples of org.jfree.text.G2TextMeasurer

  protected TextBlock createLabel(final Comparable category, final float width,
                                  final RectangleEdge edge, final Graphics2D g2)
  {
    return TextUtilities.createTextBlock(format.format(new Object[]{category}),
        getTickLabelFont(category), getTickLabelPaint(category), width,
        getMaximumCategoryLabelLines(), new G2TextMeasurer(g2));
  }
View Full Code Here

Examples of org.jfree.text.G2TextMeasurer

  protected TextBlock createLabel(final Comparable category, final float width,
                                  final RectangleEdge edge, final Graphics2D g2) {
      return TextUtilities.createTextBlock(format.format(new Object[]{category}),
          getTickLabelFont(category), getTickLabelPaint(category), width,
          getMaximumCategoryLabelLines(), new G2TextMeasurer(g2));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.