Package org.eclipse.wb.draw2d.geometry

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


  }

  private void command_ANCHOR_vertical(WidgetInfo widget, Anchor anchor) throws Exception {
    Location location = getLocation(widget, false);
    DocumentElement layer = location.layer;
    Rectangle bounds = widget.getBounds();
    if (location.leading != null && location.size != null) {
      if (anchor == Anchor.NONE) {
        layer.setAttribute("top", null);
        layer.setAttribute("height", null);
      }
      if (anchor == Anchor.TRAILING) {
        int bottom = getBounds().height - bounds.bottom();
        layer.setAttribute("top", null);
        setPixels(location.leading, "bottom", bottom);
      }
      if (anchor == Anchor.BOTH) {
        int bottom = getBounds().height - bounds.bottom();
        layer.setAttribute("height", null);
        setPixels(location.leading, "bottom", bottom);
      }
      return;
    }
    if (location.trailing != null && location.size != null) {
      if (anchor == Anchor.NONE) {
        layer.setAttribute("bottom", null);
        layer.setAttribute("height", null);
      }
      if (anchor == Anchor.LEADING) {
        int top = bounds.top();
        layer.setAttribute("bottom", null);
        setPixels(location.trailing, "top", top);
      }
      if (anchor == Anchor.BOTH) {
        int top = bounds.top();
        layer.setAttribute("height", null);
        setPixels(location.trailing, "top", top);
      }
      return;
    }
    if (location.leading != null && location.trailing != null) {
      if (anchor == Anchor.NONE) {
        layer.setAttribute("top", null);
        layer.setAttribute("bottom", null);
      }
      if (anchor == Anchor.LEADING) {
        layer.setAttribute("bottom", null);
        setPixels(location.leading, "height", bounds.height);
      }
      if (anchor == Anchor.TRAILING) {
        layer.setAttribute("top", null);
        setPixels(location.trailing, "height", bounds.height);
      }
      return;
    }
    // no anchor yet
    if (anchor != Anchor.NONE) {
      if (anchor == Anchor.LEADING) {
        layer.setAttribute("top", bounds.top() + "px");
        layer.setAttribute("height", bounds.height + "px");
      }
      if (anchor == Anchor.TRAILING) {
        layer.setAttribute("bottom", getBounds().height - bounds.bottom() + "px");
        layer.setAttribute("height", bounds.height + "px");
      }
      if (anchor == Anchor.BOTH) {
        layer.setAttribute("top", bounds.top() + "px");
        layer.setAttribute("bottom", getBounds().height - bounds.bottom() + "px");
      }
    }
  }
View Full Code Here


    // TextDisplayPropertyEditor
    //
    ////////////////////////////////////////////////////////////////////////////
    @Override
    protected String getText(Property property) throws Exception {
      Rectangle bounds = m_object.getBounds();
      String width;
      String height;
      {
        Object widthObject = m_sizeElementProperties[0].getValue();
        if (widthObject instanceof String) {
View Full Code Here

        "{RootLayoutPanel.get()} {local-unique: rootPanel} {/RootLayoutPanel.get()/ /rootPanel.add(panel)/}",
        "  {new: com.google.gwt.user.client.ui.DockLayoutPanel} {local-unique: panel} {/new DockLayoutPanel(Unit.PX)/ /rootPanel.add(panel)/}");
    frame.refresh();
    DockLayoutPanelInfo panel = getJavaInfoByName("panel");
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    // Unit property
    {
      GenericProperty unitProperty = (GenericProperty) panel.getPropertyByTitle("Unit");
      assertNotNull(unitProperty);
      {
View Full Code Here

            "    }",
            "  }",
            "}");
    panel.refresh();
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    {
      WidgetInfo button = getJavaInfoByName("button");
      Rectangle bounds = button.getBounds();
      int widthGreatThat =
          Expectations.get(75, new IntValue[]{new IntValue("flanker-windows", 70)});
      assertThat(bounds.width).isGreaterThan(widthGreatThat);
      assertThat(bounds.height).isEqualTo(300);
    }
View Full Code Here

        "{RootLayoutPanel.get()} {local-unique: rootPanel} {/RootLayoutPanel.get()/ /rootPanel.add(panel)/}",
        "  {new: com.google.gwt.user.client.ui.SplitLayoutPanel} {local-unique: panel} {/new SplitLayoutPanel()/ /rootPanel.add(panel)/}");
    frame.refresh();
    DockLayoutPanelInfo panel = getJavaInfoByName("panel");
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    // no Unit property
    {
      GenericProperty unitProperty = (GenericProperty) panel.getPropertyByTitle("Unit");
      assertNull(unitProperty);
    }
View Full Code Here

            "    }",
            "  }",
            "}");
    panel.refresh();
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    {
      WidgetInfo button = getJavaInfoByName("button");
      Rectangle bounds = button.getBounds();
      assertThat(bounds.width).isEqualTo(200);
      assertThat(bounds.height).isEqualTo(300);
    }
  }
View Full Code Here

      }
    }
    // if still no cell, use (0,0)
    if (m_target.m_column == -1) {
      m_target.m_column = 0;
      Rectangle clientArea = getHostFigure().getClientArea();
      m_target.m_feedbackBounds.x = clientArea.x + 5;
      m_target.m_feedbackBounds.width = clientArea.width - 5 - 5;
    }
    if (m_target.m_row == -1) {
      m_target.m_row = 0;
      Rectangle clientArea = getHostFigure().getClientArea();
      m_target.m_feedbackBounds.y = clientArea.y + 5;
      m_target.m_feedbackBounds.height = clientArea.height - 5 - 5;
    }
  }
View Full Code Here

  @Override
  protected void drawCustomBorder(Figure figure, Graphics graphics) {
    if (m_object.shouldDrawDotsBorder()) {
      graphics.setForegroundColor(IColorConstants.gray);
      graphics.setLineStyle(SWT.LINE_DOT);
      Rectangle area = figure.getClientArea();
      graphics.drawRectangle(0, 0, area.width - 1, area.height - 1);
    }
  }
View Full Code Here

    for (int index = 0; index < widgets.size(); index++) {
      WidgetInfo widget = widgets.get(index);
      // use "1 +" because first TD is "gwt-TabBarFirst"
      Object tabElement = dom.getChild(tabBarRowElement, 1 + index);
      tabElement = dom.getChild(tabElement, 0);
      Rectangle tabBounds = state.getAbsoluteBounds(tabElement);
      absoluteToRelative(tabBounds);
      // remember tab and bounds
      m_widgetHandles.add(new WidgetHandle(widget));
      m_widgetToHandleBounds.put(widget, tabBounds);
    }
View Full Code Here

    return new Figure();
  }

  @Override
  protected void refreshVisuals() {
    Rectangle bounds = getHandle().getBounds();
    getFigure().setBounds(bounds);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.draw2d.geometry.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.