Skip to content

Commit 22c2dcf

Browse files
feat(ui): add species specimen analyte icons
Closes #1427
1 parent 35a8f1c commit 22c2dcf

6 files changed

Lines changed: 67 additions & 3 deletions

File tree

datamanager-app/src/main/java/life/qbic/datamanager/views/general/icon/IconFactory.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import com.vaadin.flow.component.icon.Icon;
44
import com.vaadin.flow.component.icon.VaadinIcon;
5+
import com.vaadin.flow.component.icon.SvgIcon;
6+
import java.util.stream.StreamResource;
57

68
/**
79
* <b>Icon Factory</b>
@@ -13,6 +15,15 @@
1315
*/
1416
public class IconFactory {
1517

18+
private static final StreamResource GENETICS_ICON_RESOURCE = new StreamResource("genetics.svg",
19+
() -> IconFactory.class.getClassLoader().getResourceAsStream("icons/genetics.svg"));
20+
21+
private static final StreamResource TEST_TUBE_ICON_RESOURCE = new StreamResource("test_tube.svg",
22+
() -> IconFactory.class.getClassLoader().getResourceAsStream("icons/test_tube.svg"));
23+
24+
private static final StreamResource ATOM_ICON_RESOURCE = new StreamResource("atom.svg",
25+
() -> IconFactory.class.getClassLoader().getResourceAsStream("icons/atom.svg"));
26+
1627
private IconFactory() {}
1728

1829
public static Icon warningIcon() {
@@ -21,4 +32,22 @@ public static Icon warningIcon() {
2132
return icon;
2233
}
2334

35+
public static Icon dnaIcon() {
36+
var icon = new SvgIcon(GENETICS_ICON_RESOURCE);
37+
icon.addClassNames("icon-size-m");
38+
return icon;
39+
}
40+
41+
public static Icon testTubeIcon() {
42+
var icon = new SvgIcon(TEST_TUBE_ICON_RESOURCE);
43+
icon.addClassNames("icon-size-m");
44+
return icon;
45+
}
46+
47+
public static Icon atomIcon() {
48+
var icon = new SvgIcon(ATOM_ICON_RESOURCE);
49+
icon.addClassNames("icon-size-m");
50+
return icon;
51+
}
52+
2453
}

datamanager-app/src/main/java/life/qbic/datamanager/views/projects/project/info/ProjectSummaryComponent.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import life.qbic.datamanager.views.general.DetailBox.Header;
5454
import life.qbic.datamanager.views.general.Heading;
5555
import life.qbic.datamanager.views.general.IconLabel;
56+
import life.qbic.datamanager.views.general.IconFactory;
5657
import life.qbic.datamanager.views.general.OntologyTermDisplay;
5758
import life.qbic.datamanager.views.general.PageArea;
5859
import life.qbic.datamanager.views.general.Tag;
@@ -568,19 +569,19 @@ private void buildExperimentInformationSection() {
568569
experimentInformationSection.setHeader(
569570
new SectionHeader(new SectionTitle("Experiment Information")));
570571
speciesDetailBox = new DetailBox();
571-
var speciesHeader = new Header("Species");
572+
var speciesHeader = new Header(IconFactory.dnaIcon(), "Species");
572573
speciesDetailBox.setHeader(speciesHeader);
573574
speciesDetailBox.setContent(new EmptyContent());
574575
speciesDetailBox.addClassNames(FIXED_MEDIUM_WIDTH_CSS);
575576

576577
specimenDetailBox = new DetailBox();
577-
var specimenHeader = new Header("Specimen");
578+
var specimenHeader = new Header(IconFactory.testTubeIcon(), "Specimen");
578579
specimenDetailBox.setHeader(specimenHeader);
579580
specimenDetailBox.setContent(new EmptyContent());
580581
specimenDetailBox.addClassName(FIXED_MEDIUM_WIDTH_CSS);
581582

582583
analyteDetailBox = new DetailBox();
583-
var analyteHeader = new Header("Analytes");
584+
var analyteHeader = new Header(IconFactory.atomIcon(), "Analytes");
584585
analyteDetailBox.setHeader(analyteHeader);
585586
analyteDetailBox.setContent(new EmptyContent());
586587
analyteDetailBox.addClassName(FIXED_MEDIUM_WIDTH_CSS);
Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading

datamanager-app/src/main/resources/impressum/LegalNotice.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,24 @@ <h2 id="m169">Image credits</h2>
8484
Icons</a> on <a
8585
href="https://iconscout.com" class="text-underline font-size-sm" target="_blank"
8686
rel="noopener noreferrer">IconScout</a></p>
87+
<p><a href="https://fonts.google.com/icons" class="text-underline font-size-sm"
88+
target="_blank" rel="noopener noreferrer">DNA Helix</a> by <a
89+
href="https://fonts.google.com/icons" class="text-underline font-size-sm" target="_blank"
90+
rel="noopener noreferrer">Google</a>
91+
on <a href="https://fonts.google.com" class="text-underline font-size-sm" target="_blank"
92+
rel="noopener noreferrer">Google Fonts</a> (Material Symbols, Apache License 2.0)</p>
93+
<p><a href="https://fonts.google.com/icons" class="text-underline font-size-sm"
94+
target="_blank" rel="noopener noreferrer">Test Tube</a> by <a
95+
href="https://fonts.google.com/icons" class="text-underline font-size-sm" target="_blank"
96+
rel="noopener noreferrer">Google</a>
97+
on <a href="https://fonts.google.com" class="text-underline font-size-sm" target="_blank"
98+
rel="noopener noreferrer">Google Fonts</a> (Material Symbols, Apache License 2.0)</p>
99+
<p><a href="https://lucide.dev/icons/atom" class="text-underline font-size-sm"
100+
target="_blank" rel="noopener noreferrer">Atom</a> by <a
101+
href="https://github.com/phosphor-icons" class="text-underline font-size-sm" target="_blank"
102+
rel="noopener noreferrer">Phosphor Icons</a>
103+
on <a href="https://lucide.dev" class="text-underline font-size-sm" target="_blank"
104+
rel="noopener noreferrer">Lucide</a> (ISC License)</p>
87105
<p><a href="https://commons.wikimedia.org/wiki/File:ROR_logo.svg"
88106
class="text-underline font-size-sm"
89107
target="_blank" rel="noopener noreferrer">RoR Icon</a> by <a href="https://ror.org/"

0 commit comments

Comments
 (0)