Package com.positive.charts.plot

Examples of com.positive.charts.plot.CrosshairState


    // the anchor point is typically the point where the mouse last
    // clicked - the crosshairs will be driven off this point...
    if ((anchor != null) && !dataArea.contains(anchor)) {
      anchor = null;
    }
    final CrosshairState crosshairState = new CrosshairState();
    crosshairState.setCrosshairDistance(Double.POSITIVE_INFINITY);
    crosshairState.setAnchor(anchor);

    crosshairState.setAnchorX(Double.NaN);
    crosshairState.setAnchorY(Double.NaN);
    if (anchor != null) {
      final ValueAxis domainAxis = this.getDomainAxis();
      if (domainAxis != null) {
        double x;
        if (orient == PlotOrientation.VERTICAL) {
          x = domainAxis.java2DToValue(anchor.x, dataArea, this
              .getDomainAxisEdge());
        } else {
          x = domainAxis.java2DToValue(anchor.y, dataArea, this
              .getDomainAxisEdge());
        }
        crosshairState.setAnchorX(x);
      }
      final ValueAxis rangeAxis = this.getRangeAxis();
      if (rangeAxis != null) {
        double y;
        if (orient == PlotOrientation.VERTICAL) {
          y = rangeAxis.java2DToValue(anchor.y, dataArea, this
              .getRangeAxisEdge());
        } else {
          y = rangeAxis.java2DToValue(anchor.x, dataArea, this
              .getRangeAxisEdge());
        }
        crosshairState.setAnchorY(y);
      }
    }
    crosshairState.setCrosshairX(this.getDomainCrosshairValue());
    crosshairState.setCrosshairY(this.getRangeCrosshairValue());
    gc.setClipping(dataArea);

    AxisState domainAxisState = (AxisState) axisStateMap.get(this
        .getDomainAxis());
    if (domainAxisState == null) {
View Full Code Here

TOP

Related Classes of com.positive.charts.plot.CrosshairState

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.