Skip to content

Commit decf54f

Browse files
committed
Added documentation and changed preset themes
1 parent d1830d3 commit decf54f

File tree

4 files changed

+40
-23
lines changed

4 files changed

+40
-23
lines changed

src/com/demo/QueueManagerDemo.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ public static void main(String[] args) throws Exception {
2626
break;
2727
case 1:
2828
note = factory.buildTextNotification("TextNotification", "Subtitle");
29+
break;
2930
case 2:
30-
note = factory.buildAcceptNotification("AcceptNotification", "Click accept or decline");
31-
31+
note = factory.buildAcceptNotification("AcceptNotification", "Do you accept?");
32+
break;
3233
}
3334
// note.setCloseOnClick(true);
3435
// make it show in the queue for five seconds

src/com/notification/NotificationFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,12 @@ public AcceptNotification buildAcceptNotification(String title, String subtitle,
154154
* @return
155155
*/
156156
public IconNotification buildIconNotification(String title, String subtitle, ImageIcon icon) {
157-
IconNotification iconNote = new IconNotification(icon);
157+
IconNotification iconNote = new IconNotification();
158158
iconNote.setWindowTheme(m_pack.windowTheme);
159159
iconNote.setTextTheme(m_pack.textTheme);
160160
iconNote.setTitle(title);
161161
iconNote.setSubtitle(subtitle);
162+
iconNote.setIcon(icon);
162163

163164
return iconNote;
164165
}

src/com/notification/types/IconNotification.java

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ public class IconNotification extends BorderLayoutNotification {
2626

2727
public static final int ICON_PADDING = 10;
2828

29-
public IconNotification(ImageIcon icon) {
29+
public IconNotification() {
3030
m_iconLabel = new JLabel();
31-
m_iconLabel.setIcon(icon);
3231
m_titleLabel = new JLabel();
3332
m_subtitleLabel = new JLabel();
3433

@@ -50,40 +49,56 @@ public void setIcon(ImageIcon icon) {
5049
m_iconLabel.setIcon(icon);
5150
}
5251

53-
protected TextTheme getTextTheme() {
54-
return m_theme;
55-
}
56-
5752
/**
58-
* @param theme
59-
* the two Fonts that should be used.
53+
* @return the title String
6054
*/
61-
public void setTextTheme(TextTheme theme) {
62-
m_theme = theme;
63-
m_titleLabel.setFont(theme.title);
64-
m_subtitleLabel.setFont(theme.subtitle);
65-
m_titleLabel.setForeground(theme.titleColor);
66-
m_subtitleLabel.setForeground(theme.subtitleColor);
67-
}
68-
6955
public String getTitle() {
7056
return m_title;
7157
}
7258

59+
/**
60+
* Sets the title String.
61+
*
62+
* @param title
63+
*/
7364
public void setTitle(String title) {
7465
m_titleLabel.setText(title);
7566
m_title = title;
7667
}
7768

69+
/**
70+
* @return the subtitle String
71+
*/
7872
public String getSubtitle() {
7973
return m_subtitle;
8074
}
8175

76+
/**
77+
* Sets the subtitle String.
78+
*
79+
* @param subtitle
80+
*/
8281
public void setSubtitle(String subtitle) {
8382
m_subtitleLabel.setText(subtitle);
8483
m_subtitle = subtitle;
8584
}
8685

86+
protected TextTheme getTextTheme() {
87+
return m_theme;
88+
}
89+
90+
/**
91+
* @param theme
92+
* the two Fonts that should be used.
93+
*/
94+
public void setTextTheme(TextTheme theme) {
95+
m_theme = theme;
96+
m_titleLabel.setFont(theme.title);
97+
m_subtitleLabel.setFont(theme.subtitle);
98+
m_titleLabel.setForeground(theme.titleColor);
99+
m_subtitleLabel.setForeground(theme.subtitleColor);
100+
}
101+
87102
@Override
88103
public void setWindowTheme(WindowTheme theme) {
89104
super.setWindowTheme(theme);

src/com/theme/ThemePackagePresets.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public static ThemePackage cleanLight() {
1818
window.height = 100;
1919

2020
TextTheme text = new TextTheme();
21-
text.title = new Font("Arial", Font.BOLD, 25);
22-
text.subtitle = new Font("Arial", Font.PLAIN, 20);
21+
text.title = new Font("Arial", Font.BOLD, 22);
22+
text.subtitle = new Font("Arial", Font.PLAIN, 16);
2323
text.titleColor = new Color(10, 10, 10);
2424
text.subtitleColor = new Color(10, 10, 10);
2525

@@ -40,8 +40,8 @@ public static ThemePackage cleanDark() {
4040
window.height = 100;
4141

4242
TextTheme text = new TextTheme();
43-
text.title = new Font("Arial", Font.BOLD, 25);
44-
text.subtitle = new Font("Arial", Font.PLAIN, 20);
43+
text.title = new Font("Arial", Font.BOLD, 22);
44+
text.subtitle = new Font("Arial", Font.PLAIN, 16);
4545
text.titleColor = new Color(200, 200, 200);
4646
text.subtitleColor = new Color(200, 200, 200);
4747

0 commit comments

Comments
 (0)