use of net.sf.jtreemap.swing.DefaultValue in project beakerx by twosigma.
the class TreeMapNodeSerializerTest method serializeTooltipOfTreeMapNode_resultJsonHasTooltip.
@Test
public void serializeTooltipOfTreeMapNode_resultJsonHasTooltip() throws IOException {
// when
TreeMapNode treeMapNode = new TreeMapNode("010", 1, new DefaultValue(1.5));
treeMapNode.setUserObject(values);
treeMapNodeSerializer.serialize(treeMapNode, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("tooltip")).isTrue();
Assertions.assertThat(actualObj.get("tooltip").asText()).isEqualTo("some tooltip");
}
use of net.sf.jtreemap.swing.DefaultValue in project beakerx by twosigma.
the class TreeMapNodeSerializerTest method serializeColorOfTreeMapNode_resultJsonHasColor.
@Test
public void serializeColorOfTreeMapNode_resultJsonHasColor() throws IOException {
// when
TreeMapNode treeMapNode = new TreeMapNode("010", 1, new DefaultValue(1.5));
treeMapNode.setUserObject(values);
treeMapNodeSerializer.serialize(treeMapNode, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("color")).isTrue();
}
use of net.sf.jtreemap.swing.DefaultValue in project beakerx by twosigma.
the class TreeMapSerializerTest method initTestStubData.
@Before
public void initTestStubData() throws IOException {
KernelManager.register(new KernelTest());
sw = new StringWriter();
jgen = mapper.getJsonFactory().createJsonGenerator(sw);
treeMap = new TreeMap(new TreeMapNode("label", 1, new DefaultValue(1.5)));
}
use of net.sf.jtreemap.swing.DefaultValue in project beakerx by twosigma.
the class TreeMapTest method createWidget.
@Override
public TreeMap createWidget() {
TreeMapNode node = new TreeMapNode("0");
TreeMapNode node01 = new TreeMapNode("01");
node01.add(new TreeMapNode("011", 1, new DefaultValue(1)));
node.add(node01);
TreeMap treeMap = new TreeMap(node);
treeMap.display();
kernel.clearMessages();
return treeMap;
}
use of net.sf.jtreemap.swing.DefaultValue in project beakerx by twosigma.
the class GradientColorProviderTest method initStubData.
@Before
public void initStubData() {
KernelManager.register(new KernelTest());
treeMap = new TreeMap();
treeMap.setRoot(new TreeMapNode("020", 2, new DefaultValue(2)));
node01 = new TreeMapNode("010", 1, new DefaultValue(1));
}
Aggregations