Package org.timepedia.chronoscope.client.canvas

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


  }

  public void initRightLayer() {
    log ("initRightLayer rightPanelBounds:"+rightPanelBounds);
    if (null == rightPanelBounds) {
      rightPanelBounds = new Bounds(0,0,49,view.getHeight()*0.75);
    }

    rightPanel.setLayer(view.getCanvas().createLayer(Layer.RANGE_AXIS_RIGHT, rightPanelBounds));
  }
View Full Code Here


  private Bounds bounds;

  public static int DEFAULT_HEIGHT=32;

  public TopPanel() {
    bounds = new Bounds();
  }
View Full Code Here

    compositePanel.draw();
  }
 
  @Override
  protected void initHook() {
    if(null == bounds) { bounds = new Bounds(0, 0, view.getWidth(), 0); }

    initCompositePanel();
    initLayer();
    if (isEnabled()) {
      initLegendAxisPanel();
View Full Code Here

   
    if (enabled) {
      initHook();
    } else { // disable the legend
      if (legendAxisPanel != null) {
        legendAxisPanel.setBounds(new Bounds(0,0,1,1));
        compositePanel.remove(legendAxisPanel);
        initHook();
      }
    }
  }
View Full Code Here

   */
  public Bounds getPreferredBounds() {
    if (components.isEmpty()) {
      return super.getPreferredBounds();
    }
    Bounds b = new Bounds(Integer.MAX_VALUE, Integer.MAX_VALUE, 0, 0);

    for (Component c : components) {
      Bounds bc = c.getPreferredBounds();
      b.x = Math.min(b.x, bc.x);
      b.y = Math.min(b.y, bc.y);
      b.width = Math.max(b.width, bc.x + bc.width - b.x);
      b.height = Math.max(b.height, bc.y + bc.height - b.y);
    }
View Full Code Here

    // otherwise, run any event handlers registered on this component
//  }

  public void paint(Layer layer) {
    for (S component : components) {
      Bounds b = component.getBounds();
      // isolate component rendering
      layer.save();
      layer.translate(b.x, b.y);
      //TODO check performance of adding layer.clip()
      // layer.beginPath(); layer.rect(0, 0, b.width, b.height);
View Full Code Here

  public void clearDrawCaches() {
    overviewDrawn = false;
  }

  public Bounds getBounds() {
    return isOverviewVisible() ? new Bounds(overviewAxisPanel.getBounds(), domainAxisPanel.getBounds())
            : domainAxisPanel.getBounds();
  }
View Full Code Here

    return height;
  }

  public void setBounds(Bounds bounds) {
    log("setBounds "+bounds);
    this.bounds = new Bounds(bounds);
    // compositePanel.setBounds(bounds);

    Bounds axisBounds = domainAxisPanel.getBounds();
    Bounds overBounds = overviewAxisPanel.getBounds();

    domainAxisPanel.setBounds(new Bounds(
            bounds.x, bounds.y, bounds.width, axisBounds.height));

    overviewAxisPanel.setBounds(new Bounds(
            bounds.x, bounds.y + axisBounds.height, bounds.width, overBounds.height));

  }
View Full Code Here

      double overviewHeight = isEnabled() && isOverviewVisible() ? OverviewAxisPanel.OVERVIEW_HEIGHT : 0.0;
      double axisHeight = DomainAxisPanel.MIN_HEIGHT; // TODO - get real height
      double axisY = (double)(view.getHeight()) - overviewHeight - axisHeight;
      double axisX = plot.getBounds().x;

      Bounds domainAxisPanelBounds = new Bounds(axisX, axisY, axisWidth, axisHeight);
      log ("initDomainAxisPanel bounds:"+domainAxisPanelBounds);
      domainAxisPanel.setBounds(domainAxisPanelBounds);
    }

    domainAxisPanel.setValueAxis(new DomainAxis(plot));
View Full Code Here

      // NOTE - plot.x and plot.width should be set before this is called.
      double overviewX = plot.getBounds().x;
      double overviewWidth = plot.getBounds().width;

      Bounds overviewAxisPanelBounds = new Bounds(overviewX, overviewY, overviewWidth, overviewHeight);
      log ("initOverviewAxisPanel bounds:"+overviewAxisPanelBounds);
      overviewAxisPanel.setBounds(overviewAxisPanelBounds);
    }

    overviewAxisPanel.setValueAxis(new OverviewAxis(plot, "overview"));
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.