diff options
Diffstat (limited to 'client/trunk/src/com/fourisland/instadisc/IDSubscriptionListCellRenderer.java')
| -rw-r--r-- | client/trunk/src/com/fourisland/instadisc/IDSubscriptionListCellRenderer.java | 36 |
1 files changed, 36 insertions, 0 deletions
| diff --git a/client/trunk/src/com/fourisland/instadisc/IDSubscriptionListCellRenderer.java b/client/trunk/src/com/fourisland/instadisc/IDSubscriptionListCellRenderer.java new file mode 100644 index 0000000..546f3ac --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/IDSubscriptionListCellRenderer.java | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | /* | ||
| 2 | * To change this template, choose Tools | Templates | ||
| 3 | * and open the template in the editor. | ||
| 4 | */ | ||
| 5 | package com.fourisland.instadisc; | ||
| 6 | |||
| 7 | import com.fourisland.instadisc.Database.Subscription; | ||
| 8 | import java.awt.Component; | ||
| 9 | import javax.swing.JLabel; | ||
| 10 | import javax.swing.JList; | ||
| 11 | import javax.swing.ListCellRenderer; | ||
| 12 | |||
| 13 | /** | ||
| 14 | * | ||
| 15 | * @author hatkirby | ||
| 16 | */ | ||
| 17 | class IDSubscriptionListCellRenderer extends JLabel implements ListCellRenderer { | ||
| 18 | |||
| 19 | public Component getListCellRendererComponent(JList arg0, Object arg1, int arg2, boolean arg3, boolean arg4) { | ||
| 20 | this.setText(((Subscription) arg1).getTitle()); | ||
| 21 | |||
| 22 | if (arg3) { | ||
| 23 | this.setForeground(arg0.getSelectionForeground()); | ||
| 24 | this.setBackground(arg0.getSelectionBackground()); | ||
| 25 | } else { | ||
| 26 | this.setForeground(arg0.getForeground()); | ||
| 27 | this.setBackground(arg0.getBackground()); | ||
| 28 | } | ||
| 29 | |||
| 30 | this.setOpaque(true); | ||
| 31 | this.setFont(arg0.getFont()); | ||
| 32 | this.setEnabled(arg0.isEnabled()); | ||
| 33 | |||
| 34 | return this; | ||
| 35 | } | ||
| 36 | } | ||
