Package limelight.styles

Examples of limelight.styles.RichStyle


  }

  private void createStyles()
  {
    root.setStyles(new HashMap<String, RichStyle>());
    RichStyle myStyle = new RichStyle();
    root.getStyles().put("my_style", myStyle);
    myStyle.setFontFace("Helvetica");
    myStyle.setFontStyle("bold");
    myStyle.setFontSize("20");
    myStyle.setTextColor("red");

    RichStyle myOtherStyle = new RichStyle();
    root.getStyles().put("my_other_style", myOtherStyle);
    myOtherStyle.setFontFace("Cuneiform");
    myOtherStyle.setFontStyle("italic");
    myOtherStyle.setFontSize("19");
    myOtherStyle.setTextColor("blue");

    RichStyle sizeOnlyStyle = new RichStyle();
    root.getStyles().put("size_only_style", sizeOnlyStyle);
    sizeOnlyStyle.setFontSize("25");
  }
View Full Code Here


    StyleObserver observer = new MockStyleObserver();

    styledText = new StyledText("Some Text", "fizz", "bang");
    styledText.setupStyles(styles, defaultStyle, observer);

    RichStyle style = styledText.getStyle();
    assertSame(style1, style.getExtention(0));
    assertSame(style2, style.getExtention(1));
    assertSame(defaultStyle, style.getExtention(2));
    assertEquals(true, style.hasObserver(observer));
  }
View Full Code Here

  }

  private void makeSampleStyles()
  {
    styles = new HashMap<String, RichStyle>();
    style1 = new RichStyle();
    style2 = new RichStyle();
    styles.put("fizz", style1);
    styles.put("bang", style2);
    defaultStyle = new RichStyle();
  }
View Full Code Here

    styledText = new StyledText("Some Text", "fizz", "bang");
    styledText.setupStyles(styles, defaultStyle, new MockStyleObserver());

    styledText.teardownStyles();

    RichStyle style = styledText.getStyle();
    assertEquals(false, style1.hasObserver(style));
    assertEquals(false, style2.hasObserver(style));
    assertEquals(false, defaultStyle.hasObserver(style));
  }
View Full Code Here

    styledText = new StyledText("Some Text", "fizz", "bang");
    styledText.setupStyles(styles, defaultStyle, observer);
    styledText.setupStyles(styles, defaultStyle, observer);

    RichStyle style = styledText.getStyle();
    assertEquals(3, style.getExtentions().size());
    assertEquals(1, style.getObservers().size());
  }
View Full Code Here

  @Test
  public void shouldBuildFont() throws Exception
  {
    styledText = new StyledText("Blah");
    styledText.setupStyles(new HashMap<String, RichStyle>(), new RichStyle(), new MockStyleObserver());
    styledText.getStyle().setFontFace("Courier");
    styledText.getStyle().setFontStyle("plain");
    styledText.getStyle().setFontSize(12);

    Font font = styledText.getFont();
View Full Code Here

    final Scene scene = production.loadScene("aScene", Opts.with("name", "aScene", "path", "aScene"));

    final Map<String, RichStyle> styles = production.loadStyles(scene, new HashMap<String, RichStyle>());

    assertEquals(2, styles.size());
    final RichStyle high = styles.get("high");
    assertEquals("0", high.getX());
    assertEquals("99", high.getY());
    assertEquals("on", high.getFloat());
    final RichStyle far = styles.get("far");
    assertEquals("99", far.getX());
    assertEquals("0", far.getY());
    assertEquals("off", far.getFloat());
  }
View Full Code Here

    fs.createTextFile("/styles.xml", "<styles><one width='100'/><two extends='one' height='200'/></styles>");
    final HashMap<String, RichStyle> styles = new HashMap<String, RichStyle>();
    Xml.toStyles("/styles.xml", styles, new HashMap<String, RichStyle>());

    assertEquals(2, styles.size());
    final RichStyle one = styles.get("one");
    final RichStyle two = styles.get("two");
    assertEquals("100", two.getWidth());
    assertEquals("200", two.getHeight());
    assertEquals(true, two.hasExtension(one));
  }
View Full Code Here

  {
    final HashMap<String, RichStyle> styles = new HashMap<String, RichStyle>();
    Xml.toStyles("/styles.xml", styles, new HashMap<String, RichStyle>());

    assertEquals(3, styles.size());
    final RichStyle one = styles.get("one");
    final RichStyle two = styles.get("two");
    final RichStyle three = styles.get("three");
    assertEquals("100", three.getWidth());
    assertEquals("200", three.getHeight());
    assertEquals(true, three.hasExtension(one));
    assertEquals(true, three.hasExtension(two));
  }
View Full Code Here

    fs.createTextFile("/extensions.xml", "<styles><one width='100'/></styles>");
    final Map<String, RichStyle> extensions = Xml.toStyles("/extensions.xml", new HashMap<String, RichStyle>(), new HashMap<String, RichStyle>());
    fs.createTextFile("/styles.xml", "<styles><two extends='one' height='200'/></styles>");
    final Map<String, RichStyle> styles = Xml.toStyles("/styles.xml", new HashMap<String, RichStyle>(), extensions);

    final RichStyle one = extensions.get("one");
    final RichStyle two = styles.get("two");
    assertEquals("100", two.getWidth());
    assertEquals("200", two.getHeight());
    assertEquals(true, two.hasExtension(one));

  }
View Full Code Here

TOP

Related Classes of limelight.styles.RichStyle

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.