Package org.gwt.mosaic.core.client

Examples of org.gwt.mosaic.core.client.Dimension


      // dragging
      Location widgetLocation = new WidgetLocation(context.boundaryPanel, null);
      final int[] border = DOM.getBorderSizes(context.boundaryPanel.getElement());
      boundaryOffsetX = widgetLocation.getLeft() + border[3];
      boundaryOffsetY = widgetLocation.getTop() + border[0];
      final Dimension box = DOM.getClientSize(boundaryPanel.getElement());
      dropTargetClientWidth = box.width;
      dropTargetClientHeight = box.height;

      layoutData = (BorderLayoutData) BaseLayout.getLayoutData(widget);
      draggableOldAbsoluteLeft = context.draggable.getAbsoluteLeft();
View Full Code Here


    panelWidth = width;
    panelHeight = height;
  }

  public Dimension getPreferredSize(LayoutPanel layoutPanel) {
    final Dimension result = new Dimension();

    try {
      if (layoutPanel == null) {
        return result;
      }
View Full Code Here

    try {
      if (layoutPanel == null) {
        return;
      }

      final Dimension box = DOM.getClientSize(layoutPanel.getElement());
      int totalWidth = box.width;
      int totalHeight = box.height;

      final int deltaX = totalWidth - panelWidth;
      final int deltaY = totalHeight - panelHeight;

      final int size = layoutPanel.getWidgetCount();

      for (int i = 0; i < size; i++) {
        Widget child = layoutPanel.getWidget(i);
        if (child instanceof DecoratorPanel) {
          child = ((DecoratorPanel) child).getWidget();
        }

        if (!DOM.isVisible(child.getElement())) {
          continue;
        }

        AbsoluteLayoutData layoutData = (AbsoluteLayoutData) getLayoutData(child);
        if (layoutData == null) {
          layoutData = new AbsoluteLayoutData(0, 0);
          setLayoutData(child, layoutData);
        }
       
        Dimension clientSize = null;

        if (layoutData.widgetWidth == -1) {
          if (clientSize == null) {
            clientSize = WidgetHelper.getPreferredSize(child);
          }
View Full Code Here

  protected int getDecoratorFrameWidth(DecoratorPanel decPanel, Widget child) {
    return decPanel.getOffsetWidth() - child.getOffsetWidth();
  }

  protected Dimension getDecoratorFrameSize(DecoratorPanel decPanel, Widget child) {
    return new Dimension(decPanel.getOffsetWidth() - child.getOffsetWidth(),
        decPanel.getOffsetHeight() - child.getOffsetHeight());
  }
View Full Code Here

  public HorizontalAlignmentConstant getHorizontalAlignment() {
    return horizontalAlignment;
  }

  public Dimension getPreferredSize(LayoutPanel layoutPanel) {
    final Dimension result = new Dimension();

    try {
      if (layoutPanel == null || !init(layoutPanel)) {
        return result;
      }

      result.setSize(WidgetHelper.getPreferredSize(child));

      if (layoutData.hasDecoratorPanel()) {
        final Dimension d = getDecoratorFrameSize(layoutData.decoratorPanel,
            child);
        result.width += d.width;
        result.height += d.height;
      }
View Full Code Here

    try {
      if (layoutPanel == null || !init(layoutPanel)) {
        return;
      }

      final Dimension box = DOM.getClientSize(layoutPanel.getElement());

      final int left = paddings[3];
      final int top = paddings[0];
      int width = box.width - (paddings[1] + paddings[3]);
      int height = box.height - (paddings[0] + paddings[2]);

      if (layoutData.hasDecoratorPanel()) {
        final Dimension d = getDecoratorFrameSize(layoutData.decoratorPanel,
            child);
        width -= d.width;
        height -= d.height;
      }
View Full Code Here

   *
   * @see org.mosaic.ui.client.layout.HasLayout#getPreferredSize()
   */
  public Dimension getPreferredSize() {
    if (!isAttached()) {
      return new Dimension();
    }
    if (preferredSizeCache.width == -1 && preferredSizeCache.height == -1) {
      preferredSizeCache = layout.getPreferredSize(this);
      WidgetHelper.setSize(this, preferredSizeCache);
      // layout.flushCache();
View Full Code Here

   * margins.
   *
   * @see org.gwt.mosaic.ui.client.layout.LayoutManager#getPreferredSize(org.gwt.mosaic.ui.client.layout.LayoutPanel)
   */
  public Dimension getPreferredSize(LayoutPanel layoutPanel) {
    final Dimension result = new Dimension();

    try {
      if (layoutPanel == null || !init(layoutPanel)) {
        return result;
      }

      for (int r = 0; r < rows; r++) {
        int cellWidth = 0;
        int cellHeight = 0;
        for (int c = 0; c < cols; c++) {
          Widget widget = widgetMatrix[c][r];
          if (widget == null || widget == SPAN) {
            continue;
          }
          if (widget instanceof DecoratorPanel) {
            widget = ((DecoratorPanel) widget).getWidget();
          }

          GridLayoutData layoutData = (GridLayoutData) getLayoutData(widget);

          final Dimension dim = WidgetHelper.getPreferredSize(widget);

          int flowWidth, flowHeight;

          flowWidth = dim.getWidth();
          flowHeight = dim.getHeight();

          cellWidth = Math.max(cellWidth, (int) Math.ceil((double) flowWidth
              / (double) layoutData.colspan));

          cellHeight = Math.max(cellHeight, (int) Math.ceil((double) flowHeight
View Full Code Here

    try {
      if (layoutPanel == null || !init(layoutPanel)) {
        return;
      }

      final Dimension box = DOM.getClientSize(layoutPanel.getElement());

      int width = box.width - (paddings[1] + paddings[3]);
      int height = box.height - (paddings[0] + paddings[2]);
      int left = paddings[3];
      int top = paddings[0];

      final int spacing = layoutPanel.getWidgetSpacing();

      // adjust for spacing
      width -= ((cols - 1) * spacing);
      height -= ((rows - 1) * spacing);

      final int colWidth = width / cols;
      final int rowHeight = height / rows;

      for (int r = 0; r < rows; r++) {
        for (int c = 0; c < cols; c++) {
          Widget widget = widgetMatrix[c][r];
          if (widget == null || widget == SPAN) {
            continue;
          }
          if (widget instanceof DecoratorPanel) {
            widget = ((DecoratorPanel) widget).getWidget();
          }

          int cellWidth;
          int cellHeight;

          final GridLayoutData layoutData = (GridLayoutData) getLayoutData(widget);
          if (layoutData.hasDecoratorPanel()) {
            final Dimension decPanelFrameSize = getDecoratorFrameSize(
                layoutData.decoratorPanel, widget);
            cellWidth = colWidth * layoutData.colspan - decPanelFrameSize.width
                + spacing * (layoutData.colspan - 1);
            cellHeight = rowHeight * layoutData.rowspan
                - decPanelFrameSize.height + spacing * (layoutData.rowspan - 1);
View Full Code Here

    WindowUtil.addMinimizeButton(windowPanel, Caption.CaptionRegion.RIGHT);

    // show window
    final int width = Window.getClientWidth()-200;
    final int height = Window.getClientHeight()-100;
    windowPanel.setContentSize(new Dimension(width, height));
    windowPanel.center();
  }
View Full Code Here

TOP

Related Classes of org.gwt.mosaic.core.client.Dimension

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.