private void setImage() { Image image = createImage(descriptor.getImage()); if (image != null) { Rectangle bounds = image.getBounds(); JsonArray imageData = new JsonArray(); imageData.add(ImageFactory.getImagePath(image)); imageData.add(bounds.width); imageData.add(bounds.height); remoteObject.set(PROPERTY_IMAGE, imageData); } }
@Test public void testRenderFooterImage() throws IOException { Image image = loadImage(display, Fixture.IMAGE_100x50); column.setFooterImage(image); lca.renderChanges(column); TestMessage message = Fixture.getProtocolMessage(); String imageLocation = ImageFactory.getImagePath(image); JsonArray expected = JsonArray.readFrom("[\"" + imageLocation + "\", 100, 50 ]"); assertEquals(expected, message.findSetProperty(column, "footerImage")); }
private void setImage() { Image image = createImage(descriptor.getImage()); if (image != null) { Rectangle bounds = image.getBounds(); Object[] imageData = new Object[] { ImageFactory.getImagePath(image), Integer.valueOf(bounds.width), Integer.valueOf(bounds.height) }; remoteObject.set(PROPERTY_IMAGE, imageData); } }