Пример #1
0
  public void testShouldNotBuildBufferWhenTransparencyChanges() throws Exception {
    SimpleCache<limelight.ui.Panel, BufferedImage> cache =
        new SimpleCache<limelight.ui.Panel, BufferedImage>();
    Context.instance().bufferedImageCache = cache;
    cache.cache(panel, new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB));

    panel.styleChanged(Style.TRANSPARENCY, new SimplePercentageAttribute(20));
    assertNotNull(cache.retrieve(panel));
  }
Пример #2
0
  public void testShouldBuildBufferWhenStyleChanges() throws Exception {
    SimpleCache<limelight.ui.Panel, BufferedImage> cache =
        new SimpleCache<limelight.ui.Panel, BufferedImage>();
    Context.instance().bufferedImageCache = cache;
    cache.cache(panel, new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB));

    panel.styleChanged(Style.WIDTH, new StaticDimensionAttribute(20));
    assertEquals(null, cache.retrieve(panel));
  }