/** * */ protected Shape provideShape(Graphics2D g, Object comp, int width, int height) { if(getImage() != null) { BufferedImage img = getImage(); int imgWidth = img.getWidth(); int imgHeight = img.getHeight(); return calculateLayout(imgWidth, imgHeight, width, height); } return new Rectangle(0,0,0,0); }
assertThat(ip.getImage(), is(nullValue())); assertThat(ip.getImageScale(), is(1d)); assertThat(ip.getScaleType(), is(ImagePainter.ScaleType.InsideFit));
/** * */ @Override protected Shape provideShape(Graphics2D g, Object comp, int width, int height) { if(getImage() != null) { BufferedImage bi = getImage(); int imgWidth = bi.getWidth(); int imgHeight = bi.getHeight(); return calculateLayout(imgWidth, imgHeight, width, height); } return new Rectangle(0,0,0,0); }
/** * */ @Override protected Shape provideShape(Graphics2D g, Object comp, int width, int height) { if(getImage() != null) { BufferedImage bi = getImage(); int imgWidth = bi.getWidth(); int imgHeight = bi.getHeight(); return calculateLayout(imgWidth, imgHeight, width, height); } return new Rectangle(0,0,0,0); }
/** * */ @Override protected Shape provideShape(Graphics2D g, Object comp, int width, int height) { if(getImage() != null) { BufferedImage bi = getImage(); int imgWidth = bi.getWidth(); int imgHeight = bi.getHeight(); return calculateLayout(imgWidth, imgHeight, width, height); } return new Rectangle(0,0,0,0); }