Package rocket.style.client

Examples of rocket.style.client.InlineStyle


   * onTestStarted() calling super.onTestStarted() followed by a call to this
   * method.
   */
  protected void addTestNameDivider() {
    final HTML html = new HTML();
    final InlineStyle inlineStyle = InlineStyle.getInlineStyle( html.getElement() );
    inlineStyle.setInteger(Css.WIDTH, 100, CssUnit.PERCENTAGE);
    inlineStyle.setInteger(Css.HEIGHT, 1, CssUnit.EM);
    inlineStyle.setInteger(Css.MARGIN, 4, CssUnit.PX);
    inlineStyle.setString(Css.COLOR, "black");
    inlineStyle.setString(Css.BACKGROUND_COLOR, "skyBlue");
    html.setText(this.getCurrentTestName());
    this.addWidget(html);
  }
View Full Code Here


    this.frame = null;
  }

  protected Element createFrame() {
    final Element frame = DOM.createIFrame();
    final InlineStyle inlineStyle = InlineStyle.getInlineStyle(frame);
    inlineStyle.setInteger(Css.WIDTH, 0, CssUnit.PX);
    inlineStyle.setInteger(Css.HEIGHT, 0, CssUnit.PX);
    inlineStyle.setInteger(Css.BORDER, 0, CssUnit.PX);
    inlineStyle.setInteger( Css.PADDING, 0, CssUnit.PX);
    inlineStyle.setInteger(Css.MARGIN, 0, CssUnit.PX);
    return frame;
  }
View Full Code Here

  }

  protected Element createPanelElement() {
    final Element panel = DOM.createDiv();

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

    final Element background = DOM.createSpan();
    background.setClassName(this.getBackgroundStyleName());
    panel.appendChild(background);

    final Element handle = DOM.createDiv();
    handle.setClassName(this.getHandleStyleName());
   
    final InlineStyle handleInlineStyle = InlineStyle.getInlineStyle( handle );
    handleInlineStyle.setString( Css.Z_INDEX, "1");
    handleInlineStyle.setString( Css.OVERFLOW_X, "hidden");
    handleInlineStyle.setString(Css.OVERFLOW_Y, "hidden");
    panel.appendChild(handle);

    return panel;
  }
View Full Code Here

    DOM.appendChild(childParent, element);
  }

  protected void updateBackgroundDimensions() {
    final Element element = this.getBackgroundWidgetElement();
    final InlineStyle backgroundInlineStyle = InlineStyle.getInlineStyle(element);
    final String originalWidth = backgroundInlineStyle.getString(Css.WIDTH);
    final String originalHeight = backgroundInlineStyle.getString(Css.HEIGHT);

    JavaScript.setString(element, "_" + Css.WIDTH, originalWidth);
    JavaScript.setString(element, "_" + Css.HEIGHT, originalHeight);

    final ComputedStyle elementComputedStyle = ComputedStyle.getComputedStyle( this.getElement() );
    final int widthInPixels = elementComputedStyle.getInteger(Css.WIDTH, CssUnit.PX, 0);
    backgroundInlineStyle.setInteger(Css.WIDTH, widthInPixels, CssUnit.PX);

    final int heightInPixels = elementComputedStyle.getInteger(Css.HEIGHT, CssUnit.PX, 0);
    backgroundInlineStyle.setInteger(Css.HEIGHT, heightInPixels, CssUnit.PX);
  }
View Full Code Here

  protected void restoreBackgroundWidgetDimensions() {
    final Element element = this.getBackgroundWidgetElement();
    final String width = JavaScript.getString(element, "_" + Css.WIDTH);
    final String height = JavaScript.getString(element, "_" + Css.HEIGHT);

    final InlineStyle inlineStyle = InlineStyle.getInlineStyle(element);
    if( null != width ){
      inlineStyle.setString(Css.WIDTH, width);
    }
    if( null != height ){
      inlineStyle.setString(Css.HEIGHT, height);
    }
  }
View Full Code Here

    Selection.enableTextSelection();
  }

  protected void onBackgroundMouseDown(final int mouseX, final int mouseY) {
    final Element handle = this.getHandle().getElement();
    final InlineStyle inlineStyle = InlineStyle.getInlineStyle(handle);
    final ComputedStyle computedStyle = ComputedStyle.getComputedStyle(handle);
   
    boolean killTimer = false;

    final int x = this.getXValue();
    final int handleX = computedStyle.getInteger(Css.LEFT, CssUnit.PX, 0);
    int deltaX = mouseX - handleX;
    if (0 != deltaX) {
      if (deltaX < 0) {
        this.onBeforeHandleXMouseDown();
      } else {
        this.onAfterHandleXMouseDown();
      }
      final int handleXAfter = computedStyle.getInteger(Css.LEFT, CssUnit.PX, 0);
      final int deltaXAfter = mouseX - handleXAfter;

      if (deltaX < 0 ^ deltaXAfter < 0) {
        this.setXValue(x);
        inlineStyle.setInteger(Css.LEFT, mouseX, CssUnit.PX);
        deltaX = 0;
      }
    }

    final int y = this.getYValue();
    final int handleY = computedStyle.getInteger( Css.TOP, CssUnit.PX, 0);
    int deltaY = mouseY - handleY;
    if (0 != deltaY) {
      if (deltaY < 0) {
        this.onBeforeHandleYMouseDown();
      } else {
        this.onAfterHandleYMouseDown();
      }
      final int handleYAfter = computedStyle.getInteger(Css.TOP, CssUnit.PX, 0);
      final int deltaYAfter = mouseY - handleYAfter;

      if (deltaY < 0 ^ deltaYAfter < 0) {
        this.setYValue(y);
        inlineStyle.setInteger(Css.TOP, mouseY, CssUnit.PX);
        deltaY = 0;
      }
    }
    if (killTimer || deltaX == 0 && deltaY == 0) {
      this.clearTimer();
View Full Code Here

   */
  protected void onBeforeHandleXMouseDown() {
    final int newValue = Math.max(0, this.getXValue() - this.getDeltaX());

    final Element handle = this.getHandle().getElement();
    final InlineStyle inlineStyle = InlineStyle.getInlineStyle(handle);
    final int left = inlineStyle.getInteger(Css.LEFT, CssUnit.PX, 0);
    this.setXValue(newValue);
    inlineStyle.setInteger(Css.LEFT, left - 1, CssUnit.PX);
  }
View Full Code Here

   * maximum xValue of this slider.
   */
  protected void onAfterHandleXMouseDown() {
    final int newValue = Math.min(this.getXValue() + this.getDeltaX(), this.getMaximumXValue());
   
    final InlineStyle handle = InlineStyle.getInlineStyle(this.getHandle().getElement() );
    final int left = handle.getInteger(Css.LEFT, CssUnit.PX, 0);
    this.setXValue(newValue);
    handle.setInteger(Css.LEFT, left + 1, CssUnit.PX);
  }
View Full Code Here

   * the minimum yValue of this slider.
   */
  protected void onBeforeHandleYMouseDown() {
    final int newValue = Math.max(0, this.getYValue() - this.getDeltaY());

    final InlineStyle handle = InlineStyle.getInlineStyle(this.getHandle().getElement() );
    final int top = handle.getInteger(Css.TOP, CssUnit.PX, 0);
    this.setYValue(newValue);
    handle.setInteger(Css.TOP, top - 1, CssUnit.PX);
  }
View Full Code Here

   * maximum yValue of this slider.
   */
  protected void onAfterHandleYMouseDown() {
    final int newValue = Math.min(this.getYValue() + this.getDeltaY(), this.getMaximumYValue());

    final InlineStyle handle = InlineStyle.getInlineStyle(this.getHandle().getElement() );
    final int top = handle.getInteger(Css.TOP, CssUnit.PX, 0);
    this.setYValue(newValue);
    handle.setInteger(Css.TOP, top + 1, CssUnit.PX);
  }
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.