Package org.timepedia.chronoscope.client.canvas

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


  }

  public void reset() {
    log("reset");
    this.layer = null;
    this.bounds = new Bounds();
  }
View Full Code Here


    bounds.setPosition(x, y);
    if (null == layer) { return; }

    layer.save();

    Bounds lb = layer.getBounds();
    if (!bounds.equals(lb)) {
      lb.setPosition(x,y);
      layer.setBounds(lb);
    }

    layer.restore();
View Full Code Here

      p.init();
      p.layout();

      // p.setPosition(layer.getBounds().x + totalWidth, layer.getBounds().y);
      Bounds b = p.getBounds();
      p.setLayerOffset(totalWidth, 0);
      totalWidth += b.width;
      maxHeight = Math.max(maxHeight, b.height);
    }

    Bounds leftBounds = new Bounds(bounds.x, bounds.y, totalWidth, maxHeight);
    log("leftBounds:"+leftBounds);
    return leftBounds;
  }
View Full Code Here

      p.init();
      p.layout();

      // p.setPosition(view.getWidth() - totalWidth, layer.getBounds().y);
      Bounds b = p.getBounds();
      p.setLayerOffset(totalWidth, 0);
      totalWidth += b.width;
      maxHeight = Math.max(maxHeight, b.height);
    }

    Bounds rightBounds = new Bounds(view.getWidth() - totalWidth, bounds.y, totalWidth, maxHeight);
    log("rightBounds:"+rightBounds);
    return rightBounds;
  }
View Full Code Here

    for (AxisPanel p : subPanels) {
      log("calcTopBounds panel "+p.getLayer().getLayerId() + p.getBounds() + " layer bounds:"+p.getLayer().getBounds());
      p.init();
      p.layout();

      Bounds b = p.getBounds();
      // p.setPosition(bounds.x + totalHeight, bounds.y);
      totalHeight += b.height;
      maxWidth = Math.max(maxWidth, b.width);
    }
    Bounds topBounds = new Bounds(
      0, 0, maxWidth, totalHeight);// + TOP_PANEL_PAD);
    log("topBounds:"+topBounds);
    return topBounds;
  }
View Full Code Here

    for (AxisPanel p : subPanels) {
      log("calcBottomBounds panel "+p.getLayer().getLayerId() + p.getBounds() + " layer bounds:"+p.getLayer().getBounds());
      p.init();
      p.layout();

      Bounds b = p.getBounds();
      totalHeight += b.height;
      p.setPosition(bounds.x, view.getHeight()-totalHeight);
      maxWidth = Math.max(maxWidth, b.width);
    }
    Bounds bottomBounds = new Bounds(
      bounds.x, bounds.y, maxWidth, totalHeight + TOP_PANEL_PAD);
    log("bottomBounds:"+bottomBounds);
    return bottomBounds;
  }
View Full Code Here

    return bottomBounds;
  }

  public void setBounds(Bounds bounds) {
    log ("setBounds "+bounds);
    this.bounds = new Bounds(bounds);
    if (null != layer) {
      if (null != parent && !layer.equals(parent.getLayer())) {
        layer.save();

        layer.setBounds(bounds);
View Full Code Here

    bounds.y = y;
    if (null == layer) { return; }

    layer.save();

    Bounds lb = layer.getBounds();
    setBounds(new Bounds(x, y, lb.width, lb.height));

    Panel parentPanel = getParent();
    /* if ((parentPanel != null) && parentPanel.getLayer().equals(layer)) {
    log("parentPanel = "+parentPanel.getLayer().getLayerId() + " "
    +parentPanel.getLayer().getBounds());

    log("layerOffsetX = "+x +" + "+ parentPanel.getLayerOffsetX());
    layerOffsetX = x + parentPanel.getLayerOffsetX();
    layerOffsetY = y + parentPanel.getLayerOffsetY();

    }

    layerOffsetX = x;
    layerOffsetY = y;  */
    for (AxisPanel subPanel : subPanels) {
      // subPanel.setLayerOffset(layerOffsetX, layerOffsetY);
      Bounds subBounds = subPanel.getBounds();
      subPanel.setBounds(new Bounds(x, y, subBounds.width, subBounds.height));
    }

    layer.restore();
  }
View Full Code Here

        return;
    }

    layer.save();

    Bounds lb = layer.getBounds();
    layer.setBounds(new Bounds(lb.x, lb.y, width, lb.height));

    switch (position) {
      case LEFT:
        break;
      case RIGHT:
        break;
      case TOP:
        for (AxisPanel p : this.subPanels) {
          Bounds b = p.getBounds();
          if (width != p.getBounds().width) {
            p.setBounds(new Bounds(b.x, b.y, width, b.height));
          }
        }
        break;
      case BOTTOM:
        for (AxisPanel p : this.subPanels) {
          Bounds b = p.getBounds();
          if (width != p.getBounds().width) {
            p.setBounds(new Bounds(b.x, b.y, width, b.height));
          }
        }
        break;
    }
View Full Code Here

    bounds.height = height;
    if (null == layer) { return; }

    layer.save();

    Bounds lb = layer.getBounds();
    layer.setBounds(new Bounds(lb.x, lb.y, lb.width, height));

    switch (position) {
      case LEFT:
        for (AxisPanel p : this.subPanels) {
          Bounds b = p.getBounds();
          if (height != p.getBounds().height) {
            p.setBounds(new Bounds(b.x, b.y, b.width, height));
          }
        }
        break;
      case RIGHT:
        for (AxisPanel p : this.subPanels) {
          Bounds b = p.getBounds();
          if (height != p.getBounds().height) {
            p.setBounds(new Bounds(b.x, b.y, b.width, height));
          }
        }
        break;
      case TOP:
        break;
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.