Package org.timepedia.chronoscope.client.canvas

Examples of org.timepedia.chronoscope.client.canvas.Bounds


  public void remove(Panel panel) {
    return; // no sub panels here: BottomPanel has the references to overviewPanel etc
  }

  public boolean click(int x, int y) {
    Bounds b = creditsLabel.getBounds();
    double nx = x - getBounds().x - getLayer().getBounds().x;
    double ny = y - getBounds().y - getLayer().getBounds().y;
    if (b.inside((int) nx, (int) ny)) {
      if (clickHandler != null) {
        clickHandler.onOverlayClick(null, x, y);
      }
    }
    return false;
View Full Code Here


  private View view;

  public ViewContainer(View view) {
    this.view = view;
    setBounds(new Bounds(0, 0, view.getWidth(), view.getHeight()));
  }
View Full Code Here

  public void repaint() {
    paint(view.getCanvas().getRootLayer());
  }

  protected void onComponentAdded(Component component) {
    component.setBounds(new Bounds(getBounds()));
  }
View Full Code Here

  private LayerJava2D backingLayer;

  public CanvasJava2D(View view, int w, int h) {
    super(view);
    rootLayer = createLayer("rootLayer", new Bounds(0, 0, w, h));
    backingLayer = new LayerJava2D(this, "backing", new Bounds(0, 0, w, h));
    rootLayer.setFillColor(Color.TRANSPARENT);
    rootLayer.clearRect(0, 0, w, h);
  }
View Full Code Here

        .fillRect(0, 0, backingLayer.getWidth(), backingLayer.getHeight());
    backingLayer.restore();

    int i = 0;
    for (Layer l : layers) {
      Bounds b = l.getBounds();

      if (l.isVisible() /* && !"rootLayer".equals(l.getLayerId()) && ("plotLayer".equals(l.getLayerId()) || "verticalAxis".equals(l.getLayerId()) ||
            "domainAxis".equals(l.getLayerId()) || "topLayer".equals(l.getLayerId())) */) {
        //    if(l.getLayerId().startsWith("highlight")) break;
//                System.out.println("layer " + l.getLayerId());
View Full Code Here

  public MockCanvas(MockView mockView, int width, int height) {
    super(mockView);

    this.width = width;
    this.height = height;
    rootLayer = createLayer("rootLayer", new Bounds(0, 0, width, height));
  }
View Full Code Here

      return;
    }
   
    OverviewAxisPanel oaPanel = plot.getOverviewAxisPanel();
    ValueAxis overviewAxis = oaPanel.getValueAxis();
    Bounds overviewAxisBounds = oaPanel.getBounds();
    Bounds hiliteBounds = oaPanel.getHighlightBounds();
    CompoundUIAction uiAction = chartInfo.getCompoundUIAction();
   
    // Translate the view (x,y) point into an (x,y) point relative to
    // the OverviewAxisPanel.
    Bounds plotBounds = plot.getBounds();
    int x = getLocalX(event) - (int)plotBounds.x;
    int y = getLocalY(event) - (int)plotBounds.bottomY();

    final boolean isInAxisBounds = null == hiliteBounds ? false: overviewAxisBounds.inside(x, y);
    final boolean isDragging = uiAction.isDragging(overviewAxis);
   
    //log("onMouseMove(" + x + ", " + y + ")" + ": inAxisBounds=" + isInAxisBounds + "; uiAction.startX=" + uiAction.getEndX());
View Full Code Here

   * Returns the component that the specified (x,y) chart coordinate is on. If
   * the (x,y) point does not fall on a recognized component, then null is
   * returned.
   */
  protected Object getComponent(int x, int y, XYPlot plot) {
    Bounds plotBounds = plot.getBounds();

    // First check if (x,y) hit the center plot
    if ((null != plotBounds) && (plotBounds.inside(x, y))) {
      Overlay o = plot.getOverlayAt(x, y);
      if (o != null && (o instanceof Draggable) && ((Draggable)o).isDraggable()) {
        return o;
      }
      return plot;
    }

    //
    // Now check if (x,y) hit the overview axis
    //

    OverviewAxisPanel oaPanel = plot.getOverviewAxisPanel();
    if (oaPanel != null && oaPanel.getLayer() != null) {
      Bounds layerBounds = oaPanel.getLayer().getBounds();
      Bounds oaPanelBounds = oaPanel.getBounds();
      double viewOffsetX = layerBounds.x + oaPanel.getLayerOffsetX();
      double viewOffsetY = layerBounds.y + oaPanel.getLayerOffsetY();
      Bounds oaPanelAbsBounds = new Bounds(viewOffsetX, viewOffsetY,
          oaPanelBounds.width, oaPanelBounds.height);
      if (oaPanelAbsBounds.inside(x, y)) {
        return oaPanel.getValueAxis();
      }
    }

    return null;
View Full Code Here

    int x = getLocalX(event);
    int y = getLocalY(event);

    if (y > (chart.getView().getHeight() - chart.getPlot().getOverviewAxisPanel().getBounds().height)) {
      int overviewX = (int)chart.getPlot().getBounds().x;
      Bounds highlightBounds = chart.getPlot().getOverviewAxisPanel().getHighlightBounds();
      if ( highlightBounds != null) {
        int hiliteX = (int) highlightBounds.x;
        System.out.println("   MOUSEDOWN    x:"+x+" overviewX:"+overviewX+" hiliteX:"+hiliteX);
        OverviewAxisMouseMoveHandler.setHiliteRelativeGrabX((double)((x - overviewX) - hiliteX));
      }
View Full Code Here

  }

  public void setBounds(Bounds bounds) {
    log("setBounds "+layerId + " bounds: "+ bounds);
    if (null == bounds) { return; }
    this.bounds = new Bounds(bounds);
    if (null != layerDivElement) {
      positionDomElements(layerDivElement, layerCanvasElement, bounds);
    }
  }
View Full Code Here

TOP

Related Classes of org.timepedia.chronoscope.client.canvas.Bounds

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.