Search in sources :

Example 1 with SimpleIntegerValue

use of limelight.styles.values.SimpleIntegerValue in project limelight by slagyr.

the class StyleAttributeTest method shouldMarkAsDirtyByDefaultWhenStyleChanged.

@Test
public void shouldMarkAsDirtyByDefaultWhenStyleChanged() throws Exception {
    assertEquals(false, panel.markedAsDirty);
    attribute.applyChange(panel, new SimpleIntegerValue(25));
    assertEquals(true, panel.markedAsDirty);
}
Also used : SimpleIntegerValue(limelight.styles.values.SimpleIntegerValue) Test(org.junit.Test)

Example 2 with SimpleIntegerValue

use of limelight.styles.values.SimpleIntegerValue in project limelight by slagyr.

the class StyleAttributeTest method shouldExpireBufferedImageCacheByDefaultWhenStyleChange.

@Test
public void shouldExpireBufferedImageCacheByDefaultWhenStyleChange() throws Exception {
    Context.instance().bufferedImageCache.cache(panel, new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB));
    attribute.applyChange(panel, new SimpleIntegerValue(25));
    assertEquals(null, Context.instance().bufferedImageCache.retrieve(panel));
}
Also used : SimpleIntegerValue(limelight.styles.values.SimpleIntegerValue) BufferedImage(java.awt.image.BufferedImage) Test(org.junit.Test)

Example 3 with SimpleIntegerValue

use of limelight.styles.values.SimpleIntegerValue in project limelight by slagyr.

the class StyleAttributeTest method setUp.

@Before
public void setUp() throws Exception {
    panel = new MockChangeablePanel();
    attribute = new StyleAttribute("NAME", new IntegerAttributeCompiler(), new SimpleIntegerValue(50));
    Context.instance().bufferedImageCache = new SimpleCache<Panel, BufferedImage>();
}
Also used : MockChangeablePanel(limelight.ui.model.MockChangeablePanel) Panel(limelight.ui.Panel) MockChangeablePanel(limelight.ui.model.MockChangeablePanel) SimpleIntegerValue(limelight.styles.values.SimpleIntegerValue) IntegerAttributeCompiler(limelight.styles.compiling.IntegerAttributeCompiler) BufferedImage(java.awt.image.BufferedImage) Before(org.junit.Before)

Example 4 with SimpleIntegerValue

use of limelight.styles.values.SimpleIntegerValue in project limelight by slagyr.

the class NoneableAttributeTest method testEquality.

public void testEquality() throws Exception {
    assertEquals(true, none.equals(none));
    assertEquals(true, none.equals(new NoneableValue<SimpleIntegerValue>(null)));
    assertEquals(false, none.equals(fifty));
    assertEquals(true, fifty.equals(fifty));
    assertEquals(true, fifty.equals(new NoneableValue<SimpleIntegerValue>(new SimpleIntegerValue(50))));
    assertEquals(false, none.equals(null));
}
Also used : SimpleIntegerValue(limelight.styles.values.SimpleIntegerValue)

Aggregations

SimpleIntegerValue (limelight.styles.values.SimpleIntegerValue)4 BufferedImage (java.awt.image.BufferedImage)2 Test (org.junit.Test)2 IntegerAttributeCompiler (limelight.styles.compiling.IntegerAttributeCompiler)1 Panel (limelight.ui.Panel)1 MockChangeablePanel (limelight.ui.model.MockChangeablePanel)1 Before (org.junit.Before)1