Package org.eclipse.wb.draw2d.geometry

Examples of org.eclipse.wb.draw2d.geometry.Insets


        "  }",
        "}");
    refresh();
    WidgetInfo widget = getJavaInfoByName("widget");
    // decorations
    assertEquals(new Insets(0), widget.getMargins());
    assertEquals(new Insets(3), widget.getBorders());
    assertEquals(new Insets(1, 8, 1, 8), widget.getPaddings());
    // set new size, tweak to take decorations into account
    widget.getSizeSupport().setSize(100, 50);
    assertEquals(new Dimension(100, 50), widget.getBounds().getSize());
    // source
    int clientWidth = 100 - (0 + 0 + 0) * 2;
 
View Full Code Here


            "}"});
    canvas.refresh();
    //
    TabSetInfo tabSet = canvas.getChildren(TabSetInfo.class).get(0);
    // check bounds
    Insets insets = tabSet.getTabInsets();
    int barThickness = tabSet.getTabBarThickness();
    TabInfo selectedTab = tabSet.getSelectedTab();
    Rectangle tabSetBounds = tabSet.getModelBounds();
    assertThat(selectedTab.getModelBounds()).isEqualTo(
        new Rectangle(insets.left, insets.right, tabSetBounds.width
            - barThickness
            - insets.getWidth(), tabSetBounds.height - insets.getHeight()));
  }
View Full Code Here

    canvas.refresh();
    //
    TabSetInfo tabSet = canvas.getChildren(TabSetInfo.class).get(0);
    // check bounds
    Rectangle tabSetBounds = tabSet.getModelBounds();
    Insets insets = tabSet.getTabInsets();
    int barThickness = tabSet.getTabBarThickness();
    TabInfo selectedTab = tabSet.getSelectedTab();
    assertThat(selectedTab.getModelBounds()).isEqualTo(
        new Rectangle(insets.left, barThickness + insets.right, tabSetBounds.width
            - insets.getWidth(),//Canvas_Test.BUTTON_WIDTH,
            tabSetBounds.height - barThickness - insets.getHeight()//Canvas_Test.BUTTON_HEIGHT
        ));
  }
View Full Code Here

      assertSame(panel.getChildrenWidgets().get(2), gridInfo.getOccupied(0, 1));
      assertSame(null, gridInfo.getOccupied(1, 1));
    }
    // getInsets()
    {
      Insets insets = gridInfo.getInsets();
      assertEquals(new Insets(), insets);
    }
    // virtual columns
    {
      assertTrue(gridInfo.hasVirtualColumns());
      assertEquals(5, gridInfo.getVirtualColumnGap());
View Full Code Here

  /**
   * Fetches "client area insets". Usually "margins + borders", but complex components may require
   * special handling.
   */
  protected void fetchClientAreaInsets() throws Exception {
    Insets insets = new Insets();
    insets.add(m_margins);
    insets.add(m_borders);
    setClientAreaInsets(insets);
  }
View Full Code Here

   * Transforms given absolute {@link Translatable} into this {@link UIObjectInfo} model.
   */
  public final void absoluteToModel(Translatable translatable) {
    absoluteToRelative(translatable);
    {
      Insets clientAreaInsets = getClientAreaInsets();
      translatable.translate(-clientAreaInsets.left, -clientAreaInsets.top);
    }
  }
View Full Code Here

      int clientWidth = size.width;
      int clientHeight = size.height;
      // exclude decorations
      if (m_object.getObject() != null) {
        if (executeBooleanScript("setSize.excludeMargin")) {
          Insets margins = m_object.getMargins();
          clientWidth -= margins.getWidth();
          clientHeight -= margins.getHeight();
        }
        if (executeBooleanScript("setSize.excludeBorder")) {
          Insets borders = m_object.getBorders();
          clientWidth -= borders.getWidth();
          clientHeight -= borders.getHeight();
        }
        if (executeBooleanScript("setSize.excludePadding")) {
          Insets paddings = m_object.getPaddings();
          clientWidth -= paddings.getWidth();
          clientHeight -= paddings.getHeight();
        }
      }
      // set size in pixels
      String width = clientWidth + "px";
      String height = clientHeight + "px";
View Full Code Here

    return component.getPreferredSize();
  }

  public Dimension getContainerSize() {
    Dimension size = m_panel.getModelBounds().getSize().getCopy();
    Insets insets = m_panel.getClientAreaInsets();
    return size.shrink(insets.getWidth(), insets.getHeight());
  }
View Full Code Here

      }
      shell.setSize(shellBounds.width, shellBounds.height);
    }
    // in "strict" mode RootPanel (i.e. "body") has size required by widgets, so force size
    if (state.isStrictMode()) {
      Insets margins = state.getMargins(m_rootPanel.getElement());
      Insets borders = state.getBorders(m_rootPanel.getElement());
      int width = size.width - margins.getWidth() - borders.getWidth();
      int height = size.height - margins.getHeight() - borders.getHeight();
      ReflectionUtils.invokeMethod(m_rootPanel.getObject(), "setPixelSize(int,int)", width, height);
    }
  }
View Full Code Here

  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected void addFeedbacks() throws Exception {
    if (m_panel.getTopWidget() == null) {
      addFeedback0(0, 0, 1, 0.5, new Insets(0, 0, 5, 0), "top");
    }
    if (m_panel.getBottomWidget() == null) {
      addFeedback0(0, 0.5, 1, 1, new Insets(5, 0, 0, 0), "bottom");
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.draw2d.geometry.Insets

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.