예제 #1
0
  @Test
  public void layoutCausesDirtyRegion() throws Exception {
    panel.doLayout();

    ArrayList<Rectangle> list = new ArrayList<Rectangle>();
    root.getAndClearDirtyRegions(list);
    assertEquals(1, list.size());
    assertEquals(panel.getAbsoluteBounds(), list.get(0));
  }
예제 #2
0
  @Before
  public void setUp() throws Exception {
    assumeTrue(TestUtil.notHeadless());
    parent = new MockProp();
    parent.setLocation(0, 0);
    parent.setSize(100, 100);
    style = parent.getStyle();
    panel = new TextPanel(parent, "Some Text");
    parent.add(panel);
    root = new ScenePanel(new FakePropProxy());
    root.setStage(new MockStage());
    root.add(parent);
    style.setTextColor("green");
    parent.prop.sceneProxy = new FakeSceneProxy();

    defaultFontFace = style.getFontFace();
    defaultFontSize = style.getFontSize();
    defaultFontStyle = style.getFontStyle();
    defaultTextColor = style.getCompiledTextColor().getColor();
  }
예제 #3
0
  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");
  }