Skip to content

Commit e49c65b

Browse files
committed
Added banners to tips.
1 parent 374c9b1 commit e49c65b

File tree

11 files changed

+15
-0
lines changed

11 files changed

+15
-0
lines changed
62.1 KB
Loading

src/main/java/com/dlsc/jfxcentral/data/ImageManager.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.dlsc.jfxcentral.data.model.News;
99
import com.dlsc.jfxcentral.data.model.Person;
1010
import com.dlsc.jfxcentral.data.model.RealWorldApp;
11+
import com.dlsc.jfxcentral.data.model.Tip;
1112
import com.dlsc.jfxcentral.data.model.Tool;
1213
import com.dlsc.jfxcentral.data.model.Tutorial;
1314
import com.dlsc.jfxcentral.data.model.Video;
@@ -50,6 +51,10 @@ public ObjectProperty<Image> downloadBannerImageProperty(Download download) {
5051
return localImageProperty(new File(DataRepository.getInstance().getRepositoryDirectory(), "downloads/" + download.getId() + "/"), "banner.jpg", "download-banner-" + download.getId(), MISSING_IMAGE);
5152
}
5253

54+
public ObjectProperty<Image> tipBannerImageProperty(Tip tip) {
55+
return localImageProperty(new File(DataRepository.getInstance().getRepositoryDirectory(), "tips/" + tip.getId() + "/"), "banner.jpg", "tip-banner-" + tip.getId(), MISSING_IMAGE);
56+
}
57+
5358
public ObjectProperty<Image> blogPageImageProperty(Blog blog) {
5459
return localImageProperty(new File(DataRepository.getInstance().getRepositoryDirectory(), "blogs/" + blog.getId() + "/"), "page-small.png", "blog-page-" + blog.getId(), MISSING_IMAGE);
5560
}

src/test/java/com/dlsc/jfxcentral/data/ImageManagerTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ public void shouldGetDownloadBanner() {
6666
});
6767
}
6868

69+
@Test
70+
public void shouldGetTipBanner() {
71+
// when .. then
72+
DataRepository.getInstance().getTips().forEach(item -> {
73+
ObjectProperty<Image> property = ImageManager.getInstance().tipBannerImageProperty(item);
74+
assertNotNull(property, "image property is null for item ID " + item.getId());
75+
assertNotNull(property.get(), "image is missing for item ID " + item.getId());
76+
});
77+
}
78+
6979
@Test
7080
public void shouldGetBlogPageImage() {
7181
// when .. then

tips/application_flags/banner.jpg

44.4 KB
Loading

tips/customlayouts/banner.jpg

78.1 KB
Loading

tips/darcula/banner.jpg

62.1 KB
Loading

tips/hiresicons/banner.jpg

101 KB
Loading

tips/ikonli/banner.jpg

101 KB
Loading

tips/invisiblenodes/banner.jpg

101 KB
Loading

tips/masking/banner.jpg

101 KB
Loading

0 commit comments

Comments
 (0)