Package rocket.style.client

Examples of rocket.style.client.InlineStyle


  protected TileDivPanel createInnerPanel() {
    final TileDivPanel panel = new TileDivPanel();
    final Element element = panel.getElement();

    final InlineStyle inlineStyle = InlineStyle.getInlineStyle( element );
    inlineStyle.setString(Css.OVERFLOW, "hidden");

    inlineStyle.setString(Css.POSITION, "relative");
    inlineStyle.setInteger(Css.TOP, 0, CssUnit.PX);
    inlineStyle.setInteger(Css.LEFT, 0, CssUnit.PX);

    inlineStyle.setInteger(Css.WIDTH, Short.MAX_VALUE, CssUnit.PX);
    inlineStyle.setInteger(Css.HEIGHT, Short.MAX_VALUE, CssUnit.PX);
    return panel;
  }
View Full Code Here


  }

  protected Widget createWidget() {
    final DivPanel panel = this.createDivPanel();

    final InlineStyle inlineStyle = InlineStyle.getInlineStyle( panel.getElement() );
    inlineStyle.setString(Css.POSITION, "relative");
    inlineStyle.setInteger(Css.LEFT, 0, CssUnit.PX);
    inlineStyle.setInteger(Css.TOP, 0, CssUnit.PX);

    return panel;
  }
View Full Code Here

    // position the opened menuList...

    // Must set absolute coordinates in order to read the coordinates of
    // element accurately IE6 bug
    final Element menuListElement = menuList.getElement();
    final InlineStyle menuListInlineStyle = InlineStyle.getInlineStyle(menuListElement );
    final ComputedStyle menuListComputedStyle = ComputedStyle.getComputedStyle(menuListElement );
   
    menuListInlineStyle.setString(Css.POSITION, "absolute");
    menuListInlineStyle.setInteger(Css.LEFT, 0, CssUnit.PX);
    menuListInlineStyle.setInteger(Css.TOP, 0, CssUnit.PX);

    int x = Dom.getContainerLeftOffset(menuListElement);
    int y = Dom.getContainerTopOffset(menuListElement);

    while (true) {
      final MenuListOpenDirection openDirection = menuList.getOpenDirection();

      if (MenuListOpenDirection.LEFT == openDirection) {
        x = x - menuListComputedStyle.getInteger(Css.WIDTH, CssUnit.PX, 0);
        x = x + menuListComputedStyle.getInteger(Css.BORDER_RIGHT_WIDTH, CssUnit.PX, 0);
        x++;

        y = y - menuListComputedStyle.getInteger(Css.BORDER_TOP_WIDTH, CssUnit.PX, 0);
        break;
      }
      if (MenuListOpenDirection.UP == openDirection) {
        x = x - menuListComputedStyle.getInteger(Css.BORDER_LEFT_WIDTH, CssUnit.PX, 0);

        y = y - menuListComputedStyle.getInteger(Css.HEIGHT, CssUnit.PX, 0);
        y = y + menuListComputedStyle.getInteger(Css.BORDER_BOTTOM_WIDTH, CssUnit.PX, 0);
        y--;
        break;
      }
      if (MenuListOpenDirection.RIGHT == openDirection) {
        x = x + menuListComputedStyle.getInteger(Css.WIDTH, CssUnit.PX, 0);
        x = x - menuListComputedStyle.getInteger(Css.BORDER_LEFT_WIDTH, CssUnit.PX, 0);
        x--;

        y = y - menuListComputedStyle.getInteger(Css.BORDER_TOP_WIDTH, CssUnit.PX, 0);
        break;
      }
      Checker.same("openDirection", MenuListOpenDirection.DOWN, openDirection);

      x = x - menuListComputedStyle.getInteger(Css.BORDER_LEFT_WIDTH, CssUnit.PX, 0);

      y = y + menuListComputedStyle.getInteger(Css.HEIGHT, CssUnit.PX, 0); // parentMenuList
      y = y - menuListComputedStyle.getInteger(Css.BORDER_TOP_WIDTH, CssUnit.PX, 0);
      y--;
      break;
    }
    menuListInlineStyle.setString(Css.POSITION, "absolute");
    menuListInlineStyle.setInteger(Css.LEFT, x, CssUnit.PX);
    menuListInlineStyle.setInteger(Css.TOP, y, CssUnit.PX);
    menuListInlineStyle.setInteger(Css.Z_INDEX, 1, CssUnit.NONE);

    // notify listeners
    menuList.getMenu().fireMenuOpened(event, this);
  }
View Full Code Here

  public void setMenuList(final MenuList menuList) {
    Checker.notNull("parameter:menuList", menuList);
    this.menuList = menuList;

    final InlineStyle inlineStyle = InlineStyle.getInlineStyle( menuList.getElement() );
    inlineStyle.setString(Css.VISIBILITY, "hidden");
    inlineStyle.setString(Css.DISPLAY, "none");

    final DivPanel divPanel = this.getDivPanel();
    divPanel.remove(0);
    divPanel.add(menuList);
  }
View Full Code Here

  @Override
  protected void afterCreateWidget() {
    this.setItems(createItems());
   
    final InlineStyle inlineStyle = InlineStyle.getInlineStyle( DOM.getChild(this.getElement(), 0) );
    inlineStyle.setString(Css.OVERFLOW_X, "hidden");
    inlineStyle.setString(Css.OVERFLOW_Y, "hidden");
  }
View Full Code Here

      break;
    }
  }

  protected void adjustYCoordinate(final Widget widget, final int delta) {
    final InlineStyle inlineStyle = InlineStyle.getInlineStyle( widget.getElement() );
   
    final int y = inlineStyle.getInteger(Css.TOP, CssUnit.PX, 0);

    inlineStyle.setString(Css.POSITION, "absolute");
    inlineStyle.setInteger(Css.LEFT, 0, CssUnit.PX);
    inlineStyle.setInteger(Css.TOP, y + delta, CssUnit.PX);
  }
View Full Code Here

    while (more) {
      final Widget widget = widgets.next();
      final SplitterItem item = items.next();

      // set the widget position...
      final InlineStyle widgetInlineStyle = InlineStyle.getInlineStyle( widget.getElement() );

      widgetInlineStyle.setString(Css.POSITION, "absolute");
      widgetInlineStyle.setInteger(Css.LEFT, 0, CssUnit.PX);
      widgetInlineStyle.setInteger(Css.TOP, top, CssUnit.PX);
      widgetInlineStyle.setString(Css.OVERFLOW, "hidden");

      // set the size(width/height)...
      widget.setWidth("100%");

      // is the last widget ???
      if (false == widgets.hasNext()) {
        widget.setHeight((availableHeight - top) + "px");
        break;
      }

      // calculate the new width...
      final int weight = item.getSizeShare();
      final int height = (int) (ratio * weight);
      widget.setHeight(height + "px");

      top = top + height;

      final Widget splitter = (Widget) widgets.next();

      // set the splitter position...
      final InlineStyle splitterInlineStyle = InlineStyle.getInlineStyle( splitter.getElement() );
      splitterInlineStyle.setString(Css.POSITION, "absolute");
      splitterInlineStyle.setInteger(Css.LEFT, 0, CssUnit.PX);
      splitterInlineStyle.setInteger(Css.TOP, top, CssUnit.PX);
      splitterInlineStyle.setString(Css.OVERFLOW, "hidden");

      // set the splitters size...
      splitter.setWidth("100%");
      splitter.setHeight(splitterHeight + "px");

View Full Code Here

      // the enclosing div - with no border or margins...this makes it
      // easy to calculate the available width for widgets.
      final Element child = DOM.createDiv();

      final InlineStyle childInlineStyle = InlineStyle.getInlineStyle(child);
      childInlineStyle.setInteger(Css.MARGIN, 0, CssUnit.PX);
      childInlineStyle.setInteger(Css.BORDER, 0, CssUnit.PX);
      childInlineStyle.setInteger(Css.WIDTH, 100, CssUnit.PERCENTAGE);
      childInlineStyle.setInteger(Css.HEIGHT, 100, CssUnit.PERCENTAGE);
      childInlineStyle.setString(Css.POSITION, "relative");

      parent.appendChild(child);

      return parent;
    }
View Full Code Here

      dragStartEvent.setMousePageY(mousePageY);

      final int newX = mousePageX + xOffset - elementPageX;
      final int newY = mousePageY + yOffset - elementPageY;

      final InlineStyle draggedInlineStyle = InlineStyle.getInlineStyle( dragged.getElement());
      draggedInlineStyle.setString(Css.POSITION, "absolute");
      draggedInlineStyle.setInteger(Css.LEFT, newX, CssUnit.PX);
      draggedInlineStyle.setInteger(Css.TOP, newY, CssUnit.PX);
      break;
    }
  }
View Full Code Here

      dragMoveEvent.setMousePageY(mousePageY);

      final int newX = mousePageX + xOffset - elementPageX;
      final int newY = mousePageY + yOffset - elementPageY;

      final InlineStyle draggedInlineStyle = InlineStyle.getInlineStyle(draggedWidget.getElement());
      draggedInlineStyle.setString( Css.POSITION, "absolute");
      draggedInlineStyle.setInteger(Css.LEFT, newX, CssUnit.PX);
      draggedInlineStyle.setInteger(Css.TOP, newY, CssUnit.PX);

      draggedPanel.setWidget(draggedWidget);
      break;
    }
  }
View Full Code Here

TOP

Related Classes of rocket.style.client.InlineStyle

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.