Package com.positive.charts.util

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


        || (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

  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

TOP

Related Classes of com.positive.charts.util.G2TextMeasurer

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.