Package rocket.style.client

Examples of rocket.style.client.InlineStyle


    final int sliderWidth = this.getOffsetWidth();
    final int sliderHeight = this.getOffsetHeight();

    final Widget handle = this.getHandle();
    final Element handleElement = handle.getElement();
    final InlineStyle handleInlineStyle = InlineStyle.getInlineStyle(handleElement );
   
    final int handleWidth = handle.getOffsetWidth();
    final int handleHeight = handle.getOffsetHeight();

    // make mouse coordinates relative to top/left of slider.
    int mouseX = event.getPageX() - widgetX;
    mouseX = Math.max(0, Math.min(mouseX, sliderWidth - handleWidth / 2));

    final int newX = this.updateSliderValue(mouseX, this.getMaximumXValue(), sliderWidth, handleWidth);
    this.setXValue(newX);

    int left = mouseX - handleWidth / 2;
    handleInlineStyle.setInteger(Css.LEFT, left, CssUnit.PX);

    int mouseY = event.getPageY() - widgetY;
    mouseY = Math.max(0, Math.min(mouseY, sliderHeight - handleHeight / 2));
    final int newY = this.updateSliderValue(mouseY, this.getMaximumYValue(), sliderHeight, handleHeight);

    this.setYValue(newY);

    final int top = mouseY - handleHeight / 2;
    handleInlineStyle.setInteger(Css.TOP, top, CssUnit.PX);

    event.cancelBubble(true);
    event.stop();// stops text selection in Opera
  }
View Full Code Here


    final Widget handle = this.getHandle();
    final int sliderLength = this.getOffsetWidth() - handle.getOffsetWidth();
    final int newLeft = Math.round(1.0f * this.getXValue() * sliderLength / this.getMaximumXValue());

    final InlineStyle handleInlineStyle = InlineStyle.getInlineStyle( handle.getElement() );
    handleInlineStyle.setString(Css.POSITION, "absolute");
    handleInlineStyle.setInteger(Css.LEFT, newLeft, CssUnit.PX);

    this.getEventListenerDispatcher().getChangeEventListeners().fireChange(this);
  }
View Full Code Here

    final Widget handle = this.getHandle();
    final int sliderLength = this.getOffsetHeight() - handle.getOffsetHeight();
    final int newTop = Math.round(1.0f * this.getYValue() * sliderLength / this.getMaximumYValue());

    final InlineStyle handleInlineStyle = InlineStyle.getInlineStyle( handle.getElement() );
    handleInlineStyle.setString(Css.POSITION, "absolute");
    handleInlineStyle.setInteger(Css.TOP, newTop, CssUnit.PX);

    this.getEventListenerDispatcher().getChangeEventListeners().fireChange(this);
  }
View Full Code Here

  protected int getRelativeHandleCoordinate() {
    return InlineStyle.getInlineStyle(this.getHandle().getElement() ).getInteger( this.getHandleCoordinateStylePropertyName(), CssUnit.PX, 0);
  }

  protected void setRelativeHandleCoordinate(final int coordinate) {
    final InlineStyle inlineStyle = InlineStyle.getInlineStyle(this.getHandle().getElement());
    inlineStyle.setString(Css.POSITION, "absolute");
    inlineStyle.setString(Css.LEFT, "0px");
    inlineStyle.setString(Css.TOP, "0px");
    inlineStyle.setInteger(this.getHandleCoordinateStylePropertyName(), coordinate, 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.