Examples of RectangleAnchor


Examples of com.positive.charts.data.util.RectangleAnchor

      gc.fillRectangle(area);
      bounds = area;
    }

    final String label = marker.getLabel();
    final RectangleAnchor anchor = marker.getLabelAnchor();
    if (label != null) {
      final Font labelFont = marker.getLabelFont();
      gc.setFont(labelFont);
      gc.setForeground(marker.getLabelPaint());
      final Point coordinates = this
View Full Code Here

Examples of com.positive.charts.data.util.RectangleAnchor

      gc.setForeground(marker.getPaint());
      marker.getStroke().set(gc);
      GCUtilities.draw(gc, line);

      final String label = marker.getLabel();
      final RectangleAnchor anchor = marker.getLabelAnchor();
      if (label != null) {
        final Font labelFont = marker.getLabelFont();
        gc.setFont(labelFont);
        gc.setForeground(marker.getLabelPaint());
        final Point coordinates = this
            .calculateRangeMarkerTextAnchorPoint(gc, orientation,
                dataArea.getRectangle(), line.getBounds(),
                marker.getLabelOffset(),
                LengthAdjustmentType.EXPAND, anchor);
        TextUtilities.drawAlignedString(label, gc, coordinates.x,
            coordinates.y, marker.getLabelTextAnchor());
      }

      gc.setAlpha(oldAlpha);
    } else if (marker instanceof IntervalMarker) {

      final IntervalMarker im = (IntervalMarker) marker;
      final double start = im.getStartValue();
      final double end = im.getEndValue();
      final Range range = axis.getRange();
      if (!(range.intersects(start, end))) {
        return;
      }

      final int oldAlpha = gc.getAlpha();
      gc.setAlpha(marker.getAlpha());

      final double start2d = axis.valueToJava2D(start, dataArea
          .getRectangle(), plot.getRangeAxisEdge());
      final double end2d = axis.valueToJava2D(end, dataArea
          .getRectangle(), plot.getRangeAxisEdge());

      final PlotOrientation orientation = plot.getOrientation();
      Rectangle rect = null;
      if (orientation == PlotOrientation.HORIZONTAL) {
        rect = RectangleUtil.Double(Math.min(start2d, end2d), dataArea
            .getMinY(), Math.abs(end2d - start2d), dataArea
            .getHeight());
      } else if (orientation == PlotOrientation.VERTICAL) {
        rect = RectangleUtil.Double(dataArea.getMinX(), Math.min(
            start2d, end2d), dataArea.getWidth(), Math.abs(end2d
            - start2d));
      }
      final Color p = marker.getPaint();
      gc.setBackground(p);
      gc.fillRectangle(rect);

      // now draw the outlines, if visible...
      if ((im.getOutlinePaint() != null)
          && (im.getOutlineStroke() != null)) {
        final int x0 = RectangleUtil.getMinX(rect);
        final int x1 = RectangleUtil.getMaxX(rect);
        final int y0 = RectangleUtil.getMinY(rect);
        final int y1 = RectangleUtil.getMaxY(rect);
        if (orientation == PlotOrientation.VERTICAL) {
          final Line line = Line.Double(x0, y0, x1, y0);
          gc.setForeground(im.getOutlinePaint());
          im.getOutlineStroke().set(gc);
          GCUtilities.draw(gc, line);
          line.setLine(x0, y1, x1, y1);
          GCUtilities.draw(gc, line);
        } else { // PlotOrientation.HORIZONTAL
          final Line line = Line.Double(x0, y0, x0, y1);
          gc.setForeground(im.getOutlinePaint());
          im.getOutlineStroke().set(gc);
          GCUtilities.draw(gc, line);
          line.setLine(x1, y0, x1, y1);
          GCUtilities.draw(gc, line);
        }
      }

      final String label = marker.getLabel();
      final RectangleAnchor anchor = marker.getLabelAnchor();
      if (label != null) {
        final Font labelFont = marker.getLabelFont();
        gc.setFont(labelFont);
        gc.setForeground(marker.getLabelPaint());
        final Point coordinates = this
View Full Code Here

Examples of org.jfree.chart.ui.RectangleAnchor

     * @param anchor  the anchor (<code>null</code> not permitted).
     *
     * @see #getLabelAnchor()
     */
    public void setLabelAnchor(RectangleAnchor anchor) {
        RectangleAnchor old = this.labelAnchor;
        this.labelAnchor = anchor;
        this.pcs.firePropertyChange("labelAnchor", old, anchor);
    }
View Full Code Here

Examples of org.jfree.chart.ui.RectangleAnchor

            g2.setStroke(crosshair.getStroke());
            g2.draw(line);
            if (crosshair.isLabelVisible()) {
                String label = crosshair.getLabelGenerator().generateLabel(
                        crosshair);
                RectangleAnchor anchor = crosshair.getLabelAnchor();
                Point2D pt = calculateLabelPoint(line, anchor, 5, 5);
                float xx = (float) pt.getX();
                float yy = (float) pt.getY();
                TextAnchor alignPt = textAlignPtForLabelAnchorH(anchor);
                Shape hotspot = TextUtilities.calculateRotatedStringBounds(
View Full Code Here

Examples of org.jfree.ui.RectangleAnchor

            g2.setStroke(crosshair.getStroke());
            g2.draw(line);
            if (crosshair.isLabelVisible()) {
                String label = crosshair.getLabelGenerator().generateLabel(
                        crosshair);
                RectangleAnchor anchor = crosshair.getLabelAnchor();
                Point2D pt = calculateLabelPoint(line, anchor, 5, 5);
                float xx = (float) pt.getX();
                float yy = (float) pt.getY();
                TextAnchor alignPt = textAlignPtForLabelAnchorH(anchor);
                Shape hotspot = TextUtilities.calculateRotatedStringBounds(
View Full Code Here

Examples of org.jfree.ui.RectangleAnchor

            g2.setStroke(crosshair.getStroke());
            g2.draw(line);
            if (crosshair.isLabelVisible()) {
                String label = crosshair.getLabelGenerator().generateLabel(
                        crosshair);
                RectangleAnchor anchor = crosshair.getLabelAnchor();
                Point2D pt = calculateLabelPoint(line, anchor, 5, 5);
                float xx = (float) pt.getX();
                float yy = (float) pt.getY();
                TextAnchor alignPt = textAlignPtForLabelAnchorV(anchor);
                Shape hotspot = TextUtilities.calculateRotatedStringBounds(
View Full Code Here

Examples of org.jfree.ui.RectangleAnchor

        }
        return result;
    }

    private RectangleAnchor flipAnchorH(RectangleAnchor anchor) {
        RectangleAnchor result = anchor;
        if (anchor.equals(RectangleAnchor.TOP_LEFT)) {
            result = RectangleAnchor.TOP_RIGHT;
        }
        else if (anchor.equals(RectangleAnchor.TOP_RIGHT)) {
            result = RectangleAnchor.TOP_LEFT;
View Full Code Here

Examples of org.jfree.ui.RectangleAnchor

        }
        return result;
    }

    private RectangleAnchor flipAnchorV(RectangleAnchor anchor) {
        RectangleAnchor result = anchor;
        if (anchor.equals(RectangleAnchor.TOP_LEFT)) {
            result = RectangleAnchor.BOTTOM_LEFT;
        }
        else if (anchor.equals(RectangleAnchor.TOP_RIGHT)) {
            result = RectangleAnchor.BOTTOM_RIGHT;
View Full Code Here

Examples of org.jfree.ui.RectangleAnchor

      if(this._blnIsAnnotationAlreadyAdded_)
            throw new UnsupportedOperationException("!!!Annotation already added!!!!");
     
      this._blnIsAnnotationAlreadyAdded_ = true;
     
      RectangleAnchor rec = null;
      double dblX = GfrDouble.DBL_NDV;
      double dblY = GfrDouble.DBL_NDV;

      if (mode == INT_TOP_RIGHT)
      {
View Full Code Here

Examples of org.jfree.ui.RectangleAnchor

            g2.fill(path);
            g2.setPaint(marker.getOutlinePaint());
            g2.draw(path);

            String label = marker.getLabel();
            RectangleAnchor anchor = marker.getLabelAnchor();
            if (label != null) {
                Font labelFont = marker.getLabelFont();
                g2.setFont(labelFont);
                g2.setPaint(marker.getLabelPaint());
                Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
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.