Package com.extjs.gxt.ui.client.util

Examples of com.extjs.gxt.ui.client.util.Rectangle


        if (data.isSplit()) {
          initSplitBar(LayoutRegion.SOUTH, north, data);
        } else {
          removeSplitBar(north);
        }
        Rectangle b = new Rectangle();
        Margins m = data.getMargins();
        float s = data.getSize() <= 1 ? data.getSize() * size.height : data.getSize();
        b.height = (int) s;
        b.width = w - (m.left + m.right);
        b.x = m.left;
        b.y = m.top;
        centerY = b.height + b.y + m.bottom;
        centerH -= centerY;
        b.x += sLeft;
        b.y += sTop;
        applyLayout(north, b);
      } else {
        removeSplitBar(north);
      }

    }
    if (south != null) {
      BorderLayoutData data = (BorderLayoutData) getLayoutData(south);
      south.setVisible(!data.isHidden());
      if (!data.isHidden()) {
        if (south.getData("init") == null) {
          initPanel(south);
        }
        if (data.isSplit()) {
          initSplitBar(LayoutRegion.NORTH, south, data);
        } else {
          removeSplitBar(south);
        }
        Rectangle b = south.getBounds(false);
        Margins m = data.getMargins();
        float s = data.getSize() <= 1 ? data.getSize() * size.height : data.getSize();
        b.height = (int) s;
        b.width = w - (m.left + m.right);
        b.x = m.left;
        int totalHeight = (b.height + m.top + m.bottom);
        b.y = h - totalHeight + m.top;
        centerH -= totalHeight;
        b.x += sLeft;
        b.y += sTop;
        applyLayout(south, b);
      } else {
        removeSplitBar(south);
      }
    }

    if (west != null) {
      BorderLayoutData data = (BorderLayoutData) getLayoutData(west);
      west.setVisible(!data.isHidden());
      if (!data.isHidden()) {
        if (west.getData("init") == null) {
          initPanel(west);
        }

        if (data.isSplit()) {
          initSplitBar(LayoutRegion.EAST, west, data);
        } else {
          removeSplitBar(west);
        }

        Rectangle box = new Rectangle();
        Margins m = data.getMargins();
        float s = data.getSize() <= 1 ? data.getSize() * size.width : data.getSize();
        box.width = (int) s;
        box.height = centerH - (m.top + m.bottom);
        box.x = m.left;
        box.y = centerY + m.top;
        int totalWidth = (box.width + m.left + m.right);
        centerX += totalWidth;
        centerW -= totalWidth;
        box.x += sLeft;
        box.y += sTop;
        applyLayout(west, box);

      } else {
        removeSplitBar(west);
      }

    }
    if (east != null) {
      BorderLayoutData data = (BorderLayoutData) getLayoutData(east);
      east.setVisible(!data.isHidden());
      if (!data.isHidden()) {
        if (east.getData("init") == null) {
          initPanel(east);
        }

        if (data.isSplit()) {
          initSplitBar(LayoutRegion.WEST, east, data);
        } else {
          removeSplitBar(east);
        }
        Rectangle b = east.getBounds(false);
        Margins m = data.getMargins();
        float s = data.getSize() <= 1 ? data.getSize() * size.width : data.getSize();
        b.width = (int) s;
        b.height = centerH - (m.top + m.bottom);
        int totalWidth = (b.width + m.left + m.right);
        b.x = w - totalWidth + m.left;
        b.y = centerY + m.top;
        centerW -= totalWidth;
        b.x += sLeft;
        b.y += sTop;
        applyLayout(east, b);
      } else {
        removeSplitBar(east);
      }
    }

    lastCenter = new Rectangle(centerX, centerY, centerW, centerH);

    if (center != null) {
      BorderLayoutData data = (BorderLayoutData) getLayoutData(center);
      Margins m = data.getMargins();
      lastCenter.x = centerX + m.left;
View Full Code Here


    if (constrainViewport) {
      int clientHeight = Window.getClientHeight() + XDOM.getBodyScrollTop();
      int clientWidth = Window.getClientWidth() + XDOM.getBodyScrollLeft();

      Rectangle r = el().getBounds();

      int x = r.x;
      int y = r.y;

      if (y + r.height > clientHeight) {
View Full Code Here

    }
  }

  private Layer ghost() {
    Layer g = ghost != null ? ghost : createGhost();
    Rectangle box = getBounds(false);
    g.setBounds(box, true);
    int h = bwrap.getHeight();
    g.getChild(1).setHeight(h - 1, true);
    return g;
  }
View Full Code Here

        }
      }
      rendered = true;
    }

    Rectangle rect = target.getBounds();
    int w = rect.width - target.getBorderWidth("lr");
    int h = rect.height - target.getBorderWidth("tb");
    int centerW = w, centerH = h, centerY = 0, centerX = 0;

    north = getRegionWidget(LayoutRegion.NORTH);
    south = getRegionWidget(LayoutRegion.SOUTH);
    west = getRegionWidget(LayoutRegion.WEST);
    east = getRegionWidget(LayoutRegion.EAST);
    center = getRegionWidget(LayoutRegion.CENTER);

    if (north != null) {
      BorderLayoutData data = (BorderLayoutData) getLayoutData(north);
      if (north.getData("init") == null) {
        initPanel(north);
      }
      if (data.isSplit()) {
        initSplitBar(LayoutRegion.SOUTH, north, data);
      } else {
        removeSplitBar(LayoutRegion.SOUTH);
      }
      Rectangle b = new Rectangle();
      Margins m = data.getMargins();
      float s = data.getSize() < 1 ? data.getSize() * rect.height : data.getSize();
      b.height = (int) s;
      b.width = w - (m.left + m.right);
      b.x = m.left;
      b.y = m.top;
      centerY = b.height + b.y + m.bottom;
      centerH -= centerY;
      applyLayout(north, b);

    }
    if (south != null) {
      BorderLayoutData data = (BorderLayoutData) getLayoutData(south);
      if (south.getData("init") == null) {
        initPanel(south);
      }
      if (data.isSplit()) {
        initSplitBar(LayoutRegion.NORTH, south, data);
      } else {
        removeSplitBar(LayoutRegion.NORTH);
      }
      Rectangle b = south.getBounds(false);
      Margins m = data.getMargins();
      float s = data.getSize() < 1 ? data.getSize() * rect.height : data.getSize();
      b.height = (int) s;
      b.width = w - (m.left + m.right);
      b.x = m.left;
      int totalHeight = (b.height + m.top + m.bottom);
      b.y = h - totalHeight + m.top;
      centerH -= totalHeight;
      applyLayout(south, b);
    }

    if (west != null) {
      if (west.getData("init") == null) {
        initPanel(west);
      }
      BorderLayoutData data = (BorderLayoutData) getLayoutData(west);
      if (data.isSplit()) {
        initSplitBar(LayoutRegion.EAST, west, data);
      } else {
        removeSplitBar(LayoutRegion.EAST);
      }

      Rectangle box = new Rectangle();
      Margins m = data.getMargins();
      float s = data.getSize() < 1 ? data.getSize() * rect.width : data.getSize();
      box.width = (int) s;
      box.height = centerH - (m.top + m.bottom);
      box.x = m.left;
      box.y = centerY + m.top;
      int totalWidth = (box.width + m.left + m.right);
      centerX += totalWidth;
      centerW -= totalWidth;
      applyLayout(west, box);
    }
    if (east != null) {
      if (east.getData("init") == null) {
        initPanel(east);
      }
      BorderLayoutData data = (BorderLayoutData) getLayoutData(east);
      if (data.isSplit()) {
        initSplitBar(LayoutRegion.WEST, east, data);
      } else {
        removeSplitBar(LayoutRegion.WEST);
      }
      Rectangle b = east.getBounds(false);
      Margins m = data.getMargins();
      float s = data.getSize() < 1 ? data.getSize() * rect.width : data.getSize();
      b.width = (int) s;
      b.height = centerH - (m.top + m.bottom);
      int totalWidth = (b.width + m.left + m.right);
      b.x = w - totalWidth + m.left;
      b.y = centerY + m.top;
      centerW -= totalWidth;
      applyLayout(east, b);
    }

    lastCenter = new Rectangle(centerX, centerY, centerW, centerH);

    if (center != null) {
      BorderLayoutData data = (BorderLayoutData) getLayoutData(center);
      Margins m = data.getMargins();
      lastCenter.x = centerX + m.left;
View Full Code Here

    return l;
  }

  private void fitContainer() {
    if (container != null) {
      Rectangle bounds = fly(container).getBounds();
      setPagePosition(bounds.x, bounds.y);
      setSize(bounds.width, bounds.height);
    } else {
      setPosition(0, 0);
      setSize(XDOM.getViewportSize().width, XDOM.getViewportSize().height);
View Full Code Here

    }
  }

  private Layer ghost() {
    Layer g = ghost != null ? ghost : createGhost();
    Rectangle box = getBounds(false);
    g.setBounds(box, true);
    int h = bwrap.getHeight();
    g.getChild(1).setHeight(h - 1, true);
    return g;
  }
View Full Code Here

  public void sync() {
    if (!isAttached() || !resizeWidget.isAttached()) {
      return;
    }
    Rectangle rect = resizeEl.getBounds();
    int x = rect.x;
    int y = rect.y;

    if (!XDOM.isVisibleBox) {
      y -= resizeEl.getFrameWidth("t");
View Full Code Here

          de.width = w;
          break;
      }
    }

    startBounds = new Rectangle();
    startBounds.y = de.y;
    startBounds.x = de.x;

    boolean v = region == LayoutRegion.WEST || region == LayoutRegion.EAST;
    int size;
View Full Code Here

  @Override
  public void show(Element elem, String pos) {
    super.show(elem, pos);
    el().updateZIndex(0);
    int tPanelWidth = 100;
    Rectangle box = menuBWrap.getBounds();
    menuPanel.setWidth(box.width - tPanelWidth);
    menuPanel.setHeight(box.height);
    toolsPanel.setWidth(tPanelWidth);
    toolsPanel.setX(box.x + box.width - tPanelWidth);
    toolsPanel.setHeight(box.height);
View Full Code Here

    if (GXT.isIE) {
      setStyleAttribute("filter", "progid:DXImageTransform.Microsoft.alpha("
          + "opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius=" + offset + ")");
    }

    adjusts = new Rectangle();
    int radius = offset / 2;

    switch (shadowPosition) {
      case SIDES:
        adjusts.width = offset * 2;
 
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.util.Rectangle

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.