Package org.timepedia.chronoscope.client

Examples of org.timepedia.chronoscope.client.XYPlot


    extends AbstractEventHandler<MouseUpHandler> implements MouseUpHandler {

  public void onMouseUp(MouseUpEvent event) {
    ChartState chartInfo = getChartState(event);
    Chart chart = chartInfo.chart;
    XYPlot plot = chart.getPlot();
    int x = getLocalX(event);
    int y = getLocalY(event);
    OverviewAxisMouseMoveHandler.setHiliteRelativeGrabX(Double.NaN);

    CompoundUIAction uiAction = chartInfo.getCompoundUIAction();
View Full Code Here


    extends AbstractEventHandler<MouseMoveHandler> implements MouseMoveHandler {

  public void onMouseMove(MouseMoveEvent event) {
    ChartState chartInfo = getChartState(event);
    Chart chart = chartInfo.chart;
    XYPlot plot = chart.getPlot();
    int x = getLocalX(event);
    int y = getLocalY(event);

    CompoundUIAction uiAction = chartInfo.getCompoundUIAction();
    if (uiAction.isSelecting(plot)) {
      chart.setAnimating(true);
      plot.setHighlight(uiAction.getStartX(), x);
    } else if (uiAction.getSource() != null && uiAction
        .isDragging(uiAction.getSource())) {
      int dragThd = uiAction.isDragStarted(plot) ? 1
          : (uiAction.getSource() instanceof Overlay ? 5 : 10);

      boolean dragThresholdReached = Math.abs(uiAction.getStartX() - x)
          > dragThd;
      if (dragThresholdReached) {
        if (uiAction.getSource() instanceof Overlay) {
          if (!uiAction.isDragStarted(plot)) {
            plot.fireEvent(new ChartDragStartEvent(plot, x));
            uiAction.setDragStarted(true);
            uiAction.setDragStartX(uiAction.getStartX());
          }
          ((Overlay) uiAction.getSource()).fire(new ChartDragEvent(plot, x));
          chart.setHover(x,y);
        } else {
          chart.setAnimating(true);
          chart.scrollPixels(uiAction.getStartX() - x);
        }
        uiAction.setStartX(x);
        event.stopPropagation();
        event.preventDefault();
      }
    } else if ((null != plot) && (null != plot.getBounds()) && (plot.getBounds().inside(x, y))) {
      if (chart.setHover(x, y)) {
        chart.setCursor(Cursor.CLICKABLE);
      } else {
        chart.setCursor(Cursor.DRAGGABLE);
      }
View Full Code Here

              public void onOverlayClick(Overlay overlay, int x, int y) {
                m.openInfoWindow(DOM.getInnerHTML(infoWindow[0]));
              }
            });
          }
          XYPlot plot = chart.getPlot();
          plot.addOverlay(m);
          String[] hdrs = getTableHeaders(elt);
          if (hdrs != null && hdrs.length > 1) {
            plot.getDomainAxisPanel().getValueAxis().setLabel(hdrs[0]);
            for (int k = 1; k < hdrs.length; k++) {
              plot.getRangeAxis(k - 1).setLabel(hdrs[k]);
            }
          }
        }
      }
      latch.decrement();
View Full Code Here

        // ------
        chartPanel = Chronoscope.createTimeseriesChart(datasets, dim[0], dim[1]);

        // marker
        final XYPlot plot = chartPanel.getChart().getPlot();

        plot.addPlotFocusHandler(new PlotFocusHandler(){
            public void onFocus(final PlotFocusEvent event)
            {
                if(event.getFocusDataset()>=0) // zooming
                {
                    ChronoDate chronoDate = ChronoDate.get(event.getDomain());
View Full Code Here

TOP

Related Classes of org.timepedia.chronoscope.client.XYPlot

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.