Package elemental.css

Examples of elemental.css.CSSStyleDeclaration$Display


  private Element createContainer() {
    Element container = Elements.createDivElement();

    final int containerSize = 500;
    CSSStyleDeclaration containerStyle = container.getStyle();
    containerStyle.setWidth(containerSize, CSSStyleDeclaration.Unit.PX);
    containerStyle.setHeight(containerSize, CSSStyleDeclaration.Unit.PX);
    containerStyle.setPosition(CSSStyleDeclaration.Position.ABSOLUTE);
    containerStyle.setLeft(-containerSize, CSSStyleDeclaration.Unit.PX);
    containerStyle.setTop(-containerSize, CSSStyleDeclaration.Unit.PX);

    Elements.getBody().appendChild(container);

    return container;
  }
View Full Code Here


   * that if you specify the horizontal and vertical position, the image will
   * not be the only content of the element.
   */
  public static void applyImageResource(Element elem, ImageResource image, String hPos,
      String vPos) {
    CSSStyleDeclaration style = elem.getStyle();
    style.setBackgroundImage("url(" + image.getSafeUri().asString() + ")");
    style.setProperty("background-repeat", "no-repeat");
    style.setProperty("background-position", hPos + " " + vPos);
    style.setOverflow("hidden");
  }
View Full Code Here

      final int h = (int) (dy * value) - topPadding;
      final int w = (int) dx - padding * 2;

      // Create the vertical bar.
      final Element bar = div(css.bar());
      final CSSStyleDeclaration barStyle = bar.getStyle();
      barStyle.setLeft(x, Unit.PX);
      barStyle.setBottom("0");
      barStyle.setHeight(h, Unit.PX);
      barStyle.setWidth(w, Unit.PX);

      // Add a count at the top.
      final Element count = div(css.count());
      count.setTextContent("" + value);

      bar.appendChild(count);
      root.appendChild(bar);
    }

    // Render labels
    for (int i = 0, n = histogram.length(); i <= n; ++i) {
      final int x = (int) (dx * i);
      final int w = (int) dx;

      final String time = secondsToTime(i * Model.SECONDS_PER_HISTOGRAM_BUCKET, false);

      final Element label = div(css.label());
      label.setTextContent(time);
      final CSSStyleDeclaration labelStyle = label.getStyle();
      labelStyle.setLeft(x - dx, Unit.PX);
      labelStyle.setWidth(w, Unit.PX);
      root.appendChild(label);

      // TODO(knorton): Heh, that's pretty trashy. I should fix that. :-)
      final Element tick =
          div(time.charAt(time.length() - 1) == '0' && time.charAt(time.length() - 2) == '0'
View Full Code Here

  public void testSequence() {
    ProcessDefinition processDefinition = ProcessFactory.build("sequence")
        .compositeNode("sequence").initial().behaviour(new Sequence())
          .needsPrevious()
          .node("one").behaviour(new Display("one"))
          .node("2").behaviour(new WaitState())
          .node("two").behaviour(new Display("two"))
        .compositeEnd()
    .done();

    Execution execution = processDefinition.startExecution();
    execution.signal();
View Full Code Here

  public void testExecutionAndThread() {
    ProcessDefinition processDefinition = ProcessFactory.build("automatic")
        .node("wait 1").initial().behaviour(new WaitState())
          .transition().to("automatic 1")
        .node("automatic 1").behaviour(new Display("one"))
          .transition().to("wait 2")
        .node("wait 2").behaviour(new WaitState())
          .transition().to("automatic 2")
        .node("automatic 2").behaviour(new Display("two"))
          .transition().to("automatic 3")
        .node("automatic 3").behaviour(new Display("three"))
          .transition().to("automatic 4")
        .node("automatic 4").behaviour(new Display("four"))
          .transition().to("wait 3")
        .node("wait 3").behaviour(new WaitState())
    .done();
   
    Execution execution = processDefinition.startExecution();
View Full Code Here

TOP

Related Classes of elemental.css.CSSStyleDeclaration$Display

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.