/src/main/java/com/bff/slimserver/musicjukebox/ui/components/podcast/PodcastInfoPanel.java
https://code.google.com/ · Java · 677 lines · 553 code · 83 blank · 41 comment · 69 complexity · d5c70a17a6e1058b2cbb713f12c30dd0 MD5 · raw file
- /*
- * SongInfoPanel.java
- *
- * Created on September 19, 2005, 3:04 PM
- */
- package com.bff.slimserver.musicjukebox.ui.components.podcast;
-
- import com.bff.slimserver.musicjukebox.ui.ThumbnailPanel;
- import com.bff.bjj.ui.component.ColorProperties;
- import com.bff.bjj.ui.component.BJJPanel;
- import com.bff.bjj.utils.Resources;
- import java.awt.BorderLayout;
- import java.awt.Dimension;
- import org.bff.squeezeserver.domain.podcast.PodcastAudioDetails;
-
- /**
- *
- * @author Bill
- */
- public class PodcastInfoPanel
- extends BJJPanel {
-
- private ThumbnailPanel thumbnailPanel;
- private boolean showArt;
- private static final int MAX_URL_SIZE = 50;
-
- public PodcastInfoPanel() {
- this(null, false);
- }
-
- public PodcastInfoPanel(boolean showImageArt) {
- this(null, showImageArt);
- }
-
- public PodcastInfoPanel(PodcastAudioDetails podcast, boolean showImageArt) {
- initComponents();
-
- this.showArt = showImageArt;
-
- if (showImageArt) {
- thumbnailPanel = new ThumbnailPanel();
- thumbnailPanel.setPreferredSize(new Dimension(300, 300));
- thumbPanel.add(thumbnailPanel);
- } else {
- remove(thumbPanel);
- remove(songScrollPane);
- add(songScrollPane, BorderLayout.CENTER);
- }
-
- if (podcast != null) {
- validateFields(podcast);
- setSongInfo(podcast);
- }
- }
-
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
- private void initComponents() {
- java.awt.GridBagConstraints gridBagConstraints;
-
- jPanel2 = new BJJPanel();
- thumbPanel = new BJJPanel();
- thumbPanel.setBackground(ColorProperties.PANEL_COVER_ART_BACKGROUND);
- jPanel3 = new BJJPanel();
- detailTabbedPane = new javax.swing.JTabbedPane();
- songScrollPane = new javax.swing.JScrollPane();
- jPanel1 = new BJJPanel();
- jLabel1 = new javax.swing.JLabel();
- lblArtist = new javax.swing.JLabel();
- jLabel3 = new javax.swing.JLabel();
- lblAlbum = new javax.swing.JLabel();
- jLabel5 = new javax.swing.JLabel();
- lblTitle = new javax.swing.JLabel();
- jLabel7 = new javax.swing.JLabel();
- lblTrack = new javax.swing.JLabel();
- jLabel9 = new javax.swing.JLabel();
- lblYear = new javax.swing.JLabel();
- jLabel11 = new javax.swing.JLabel();
- lblBitrate = new javax.swing.JLabel();
- jLabel12 = new javax.swing.JLabel();
- lblComment = new javax.swing.JLabel();
- jLabel13 = new javax.swing.JLabel();
- lblType = new javax.swing.JLabel();
- jLabel14 = new javax.swing.JLabel();
- lblDate = new javax.swing.JLabel();
- jLabel15 = new javax.swing.JLabel();
- lblUrl = new javax.swing.JLabel();
- jLabel19 = new javax.swing.JLabel();
- lblDuration = new javax.swing.JLabel();
- jLabel20 = new javax.swing.JLabel();
- lblExplicit = new javax.swing.JLabel();
- descriptionPanel = new BJJPanel();
- spDescription = new javax.swing.JScrollPane();
- taDescription = new javax.swing.JTextArea();
- summaryPanel = new javax.swing.JPanel();
- spSummary = new javax.swing.JScrollPane();
- taSummary = new javax.swing.JTextArea();
- subTitlePanel = new javax.swing.JPanel();
- spSubtitle = new javax.swing.JScrollPane();
- taSubtitle = new javax.swing.JTextArea();
-
- setForeground(new java.awt.Color(102, 102, 102));
- setLayout(new java.awt.BorderLayout());
-
- jPanel2.setMaximumSize(new java.awt.Dimension(310, 310));
-
- thumbPanel.setMaximumSize(new java.awt.Dimension(300, 300));
- thumbPanel.setMinimumSize(new java.awt.Dimension(300, 300));
- thumbPanel.setPreferredSize(new java.awt.Dimension(300, 300));
- jPanel2.add(thumbPanel);
-
- add(jPanel2, java.awt.BorderLayout.NORTH);
-
- jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Details"));
- jPanel3.setLayout(new java.awt.BorderLayout());
-
- songScrollPane.setBorder(null);
-
- jPanel1.setLayout(new java.awt.GridBagLayout());
-
- jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel1.setText("Artist:");
- jLabel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel1, gridBagConstraints);
-
- lblArtist.setForeground(new java.awt.Color(0, 102, 255));
- lblArtist.setMaximumSize(new java.awt.Dimension(300, 0));
- lblArtist.setMinimumSize(new java.awt.Dimension(300, 25));
- lblArtist.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblArtist, gridBagConstraints);
-
- jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel3.setText("Album:");
- jLabel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel3, gridBagConstraints);
-
- lblAlbum.setForeground(new java.awt.Color(0, 102, 255));
- lblAlbum.setMinimumSize(new java.awt.Dimension(300, 25));
- lblAlbum.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblAlbum, gridBagConstraints);
-
- jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel5.setText("Title:");
- jLabel5.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 2;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel5, gridBagConstraints);
-
- lblTitle.setForeground(new java.awt.Color(0, 102, 255));
- lblTitle.setMinimumSize(new java.awt.Dimension(300, 25));
- lblTitle.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 2;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblTitle, gridBagConstraints);
-
- jLabel7.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel7.setText("Track:");
- jLabel7.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 3;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel7, gridBagConstraints);
-
- lblTrack.setForeground(new java.awt.Color(0, 102, 255));
- lblTrack.setMinimumSize(new java.awt.Dimension(300, 25));
- lblTrack.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 3;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblTrack, gridBagConstraints);
-
- jLabel9.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel9.setText("Year:");
- jLabel9.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 4;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel9, gridBagConstraints);
-
- lblYear.setForeground(new java.awt.Color(0, 102, 255));
- lblYear.setMinimumSize(new java.awt.Dimension(300, 25));
- lblYear.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 4;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblYear, gridBagConstraints);
-
- jLabel11.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel11.setText("Bitrate:");
- jLabel11.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 5;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel11, gridBagConstraints);
-
- lblBitrate.setForeground(new java.awt.Color(0, 102, 255));
- lblBitrate.setMinimumSize(new java.awt.Dimension(300, 25));
- lblBitrate.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 5;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblBitrate, gridBagConstraints);
-
- jLabel12.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel12.setText("Comment:");
- jLabel12.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 6;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel12, gridBagConstraints);
-
- lblComment.setForeground(new java.awt.Color(0, 102, 255));
- lblComment.setMinimumSize(new java.awt.Dimension(300, 25));
- lblComment.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 6;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblComment, gridBagConstraints);
-
- jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel13.setText("Type:");
- jLabel13.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 7;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel13, gridBagConstraints);
-
- lblType.setForeground(new java.awt.Color(0, 102, 255));
- lblType.setMinimumSize(new java.awt.Dimension(300, 25));
- lblType.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 7;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblType, gridBagConstraints);
-
- jLabel14.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel14.setText("Date:");
- jLabel14.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 9;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel14, gridBagConstraints);
-
- lblDate.setForeground(new java.awt.Color(0, 102, 255));
- lblDate.setMinimumSize(new java.awt.Dimension(300, 25));
- lblDate.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 9;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblDate, gridBagConstraints);
-
- jLabel15.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel15.setText("Url:");
- jLabel15.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 8;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel15, gridBagConstraints);
-
- lblUrl.setForeground(new java.awt.Color(0, 102, 255));
- lblUrl.setMinimumSize(new java.awt.Dimension(300, 25));
- lblUrl.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 8;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblUrl, gridBagConstraints);
-
- jLabel19.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel19.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel19.setText("Duration:");
- jLabel19.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 10;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel19, gridBagConstraints);
-
- lblDuration.setForeground(new java.awt.Color(0, 102, 255));
- lblDuration.setMinimumSize(new java.awt.Dimension(300, 25));
- lblDuration.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 10;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblDuration, gridBagConstraints);
-
- jLabel20.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel20.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
- jLabel20.setText("Explicit:");
- jLabel20.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 5));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 11;
- gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
- jPanel1.add(jLabel20, gridBagConstraints);
-
- lblExplicit.setForeground(new java.awt.Color(0, 102, 255));
- lblExplicit.setMinimumSize(new java.awt.Dimension(300, 25));
- lblExplicit.setPreferredSize(new java.awt.Dimension(300, 25));
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 11;
- gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
- jPanel1.add(lblExplicit, gridBagConstraints);
-
- songScrollPane.setViewportView(jPanel1);
-
- detailTabbedPane.addTab(Resources.getMessage(Resources.LABEL_KEY.TAB_TITLE_DETAILS), songScrollPane);
-
- descriptionPanel.setLayout(new java.awt.BorderLayout());
-
- taDescription.setBackground(jPanel1.getBackground());
- taDescription.setColumns(20);
- taDescription.setLineWrap(true);
- taDescription.setRows(5);
- spDescription.setViewportView(taDescription);
-
- descriptionPanel.add(spDescription, java.awt.BorderLayout.CENTER);
-
- detailTabbedPane.addTab(Resources.getMessage(Resources.LABEL_KEY.TAB_TITLE_DESCRIPTION), descriptionPanel);
-
- summaryPanel.setLayout(new java.awt.BorderLayout());
-
- taSummary.setBackground(jPanel1.getBackground());
- taSummary.setColumns(20);
- taSummary.setLineWrap(true);
- taSummary.setRows(5);
- spSummary.setViewportView(taSummary);
-
- summaryPanel.add(spSummary, java.awt.BorderLayout.CENTER);
-
- detailTabbedPane.addTab(Resources.getMessage(Resources.LABEL_KEY.TAB_TITLE_SUMMARY), summaryPanel);
-
- subTitlePanel.setLayout(new java.awt.BorderLayout());
-
- taSubtitle.setBackground(jPanel1.getBackground());
- taSubtitle.setColumns(20);
- taSubtitle.setLineWrap(true);
- taSubtitle.setRows(5);
- spSubtitle.setViewportView(taSubtitle);
-
- subTitlePanel.add(spSubtitle, java.awt.BorderLayout.CENTER);
-
- detailTabbedPane.addTab(Resources.getMessage(Resources.LABEL_KEY.TAB_TITLE_SUBTITLE), subTitlePanel);
-
- jPanel3.add(detailTabbedPane, java.awt.BorderLayout.CENTER);
-
- add(jPanel3, java.awt.BorderLayout.CENTER);
- }// </editor-fold>//GEN-END:initComponents
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JPanel descriptionPanel;
- private javax.swing.JTabbedPane detailTabbedPane;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel11;
- private javax.swing.JLabel jLabel12;
- private javax.swing.JLabel jLabel13;
- private javax.swing.JLabel jLabel14;
- private javax.swing.JLabel jLabel15;
- private javax.swing.JLabel jLabel19;
- private javax.swing.JLabel jLabel20;
- private javax.swing.JLabel jLabel3;
- private javax.swing.JLabel jLabel5;
- private javax.swing.JLabel jLabel7;
- private javax.swing.JLabel jLabel9;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JPanel jPanel2;
- private javax.swing.JPanel jPanel3;
- private javax.swing.JLabel lblAlbum;
- private javax.swing.JLabel lblArtist;
- private javax.swing.JLabel lblBitrate;
- private javax.swing.JLabel lblComment;
- private javax.swing.JLabel lblDate;
- private javax.swing.JLabel lblDuration;
- private javax.swing.JLabel lblExplicit;
- private javax.swing.JLabel lblTitle;
- private javax.swing.JLabel lblTrack;
- private javax.swing.JLabel lblType;
- private javax.swing.JLabel lblUrl;
- private javax.swing.JLabel lblYear;
- private javax.swing.JScrollPane songScrollPane;
- private javax.swing.JScrollPane spDescription;
- private javax.swing.JScrollPane spSubtitle;
- private javax.swing.JScrollPane spSummary;
- private javax.swing.JPanel subTitlePanel;
- private javax.swing.JPanel summaryPanel;
- private javax.swing.JTextArea taDescription;
- private javax.swing.JTextArea taSubtitle;
- private javax.swing.JTextArea taSummary;
- private javax.swing.JPanel thumbPanel;
- // End of variables declaration//GEN-END:variables
-
- /**
- * Pass null to remove all info
- * @param song
- */
- public void setSongInfo(PodcastAudioDetails song) {
- try {
- if (song != null) {
- validateFields(song);
-
- if (showArt) {
- thumbnailPanel.loadImage(song);
- }
- } else {
- lblAlbum.setText("");
- lblArtist.setText("");
- lblTitle.setText("");
- lblTrack.setText("");
-
- jLabel12.setVisible(true);
- lblComment.setVisible(true);
- lblComment.setText("");
-
- setBitrate("");
-
- jLabel9.setVisible(true);
- lblYear.setVisible(true);
- lblYear.setText("");
- if (showArt) {
- thumbnailPanel.removeImage();
- }
- }
-
- } catch (NullPointerException npe) {
- //dont give a shit
- npe.printStackTrace();
- }
- }
-
- public void setBitrate(String bitrate) {
- lblBitrate.setText(bitrate);
- /*
- if (bitrate < 0) {
- jLabel11.setVisible(false);
- lblBitrate.setVisible(false);
- } else {
- jLabel11.setVisible(true);
- lblBitrate.setVisible(true);
- }
-
- if (bitrate > 0) {
- jLabel11.setVisible(true);
- lblBitrate.setVisible(true);
- if (bitrate > 1000) {
- lblBitrate.setText(Integer.toString(bitrate / 1000) + " kpbs");
- } else {
- lblBitrate.setText(Integer.toString(bitrate) + " kbps");
- }
- }
- */
-
- }
-
- private void validateFields(PodcastAudioDetails podcast) {
-
- lblTitle.setText(podcast.getTitle());
-
- if (podcast.getComment() == null || "".equals(podcast.getComment())) {
- jLabel12.setVisible(false);
- lblComment.setVisible(false);
- lblComment.setText(podcast.getComment());
- } else {
- jLabel12.setVisible(true);
- lblComment.setVisible(true);
- }
-
- if (podcast.getBitrate() == null || "".equals(podcast.getBitrate())) {
- jLabel11.setVisible(false);
- lblBitrate.setVisible(false);
- } else {
- jLabel11.setVisible(true);
- lblBitrate.setVisible(true);
- setBitrate(podcast.getBitrate());
- }
-
- if (podcast.getArtist() == null || "".equals(podcast.getArtist())) {
- jLabel1.setVisible(false);
- lblArtist.setVisible(false);
- } else {
- jLabel1.setVisible(true);
- lblArtist.setVisible(true);
- lblArtist.setText(podcast.getArtist());
- }
-
- if (podcast.getAlbum() == null
- || "".equals(podcast.getAlbum().getName())
- || podcast.getAlbum().getName() == null) {
- jLabel3.setVisible(false);
- lblAlbum.setVisible(false);
- } else {
- jLabel3.setVisible(true);
- lblAlbum.setVisible(true);
- lblAlbum.setText(podcast.getAlbum().getName());
- }
-
- if (podcast.getTrack() < 1) {
- jLabel7.setVisible(false);
- lblTrack.setVisible(false);
- } else {
- jLabel7.setVisible(true);
- lblTrack.setVisible(true);
- lblTrack.setText(Integer.toString(podcast.getTrack()));
- }
-
- if (podcast.getYear() == null || "".equals(podcast.getYear()) || "0".equals(podcast.getYear())) {
- jLabel9.setVisible(false);
- lblYear.setVisible(false);
- } else {
- jLabel9.setVisible(true);
- lblYear.setVisible(true);
- lblYear.setText(podcast.getYear());
- }
-
- if (podcast.isRemote() && podcast.getType() != null && !"".equalsIgnoreCase(podcast.getType())) {
- jLabel13.setVisible(true);
- lblType.setVisible(true);
- lblType.setText(podcast.getType());
- } else {
- jLabel13.setVisible(false);
- lblType.setVisible(false);
- }
-
- if (podcast.getPubDate() != null && !"".equalsIgnoreCase(podcast.getPubDate())) {
- jLabel14.setVisible(true);
- lblDate.setVisible(true);
- lblDate.setText(podcast.getPubDate());
- } else {
- jLabel14.setVisible(false);
- lblDate.setVisible(false);
- }
-
- if (podcast.getUrl() != null && !"".equalsIgnoreCase(podcast.getUrl())) {
- jLabel15.setVisible(true);
- lblUrl.setVisible(true);
- lblUrl.setText(podcast.getUrl().length() < MAX_URL_SIZE ? podcast.getUrl() : podcast.getUrl().substring(0, MAX_URL_SIZE - 3) + "...");
- } else {
- jLabel15.setVisible(false);
- lblUrl.setVisible(false);
- }
-
- if (podcast.getDescription() != null && !"".equalsIgnoreCase(podcast.getDescription())) {
- detailTabbedPane.addTab(Resources.getMessage(Resources.LABEL_KEY.TAB_TITLE_DESCRIPTION), descriptionPanel);
- taDescription.setText(podcast.getDescription());
- } else {
- detailTabbedPane.remove(descriptionPanel);
- }
-
- if (podcast.getSummary() != null && !"".equalsIgnoreCase(podcast.getSummary())) {
- detailTabbedPane.addTab(Resources.getMessage(Resources.LABEL_KEY.TAB_TITLE_SUMMARY), summaryPanel);
- taSummary.setText(podcast.getSummary());
- } else {
- detailTabbedPane.remove(summaryPanel);
- }
-
- if (podcast.getSubTitle() != null
- && !"".equalsIgnoreCase(podcast.getSubTitle())
- && !podcast.getSubTitle().equalsIgnoreCase(podcast.getSummary())
- && !podcast.getSubTitle().equalsIgnoreCase(podcast.getDescription())) {
- detailTabbedPane.addTab(Resources.getMessage(Resources.LABEL_KEY.TAB_TITLE_SUBTITLE), subTitlePanel);
- taSubtitle.setText(podcast.getSummary());
- } else {
- detailTabbedPane.remove(subTitlePanel);
- }
-
- if (podcast.getDuration() != null && !"".equalsIgnoreCase(podcast.getDuration())) {
- jLabel19.setVisible(true);
- lblDuration.setVisible(true);
- lblDuration.setText(podcast.getDuration());
- } else {
- jLabel19.setVisible(false);
- lblDuration.setVisible(false);
- }
-
- if (podcast.getExplicit() != null && !"".equalsIgnoreCase(podcast.getExplicit())) {
- jLabel20.setVisible(true);
- lblExplicit.setVisible(true);
- lblExplicit.setText(podcast.getExplicit());
- } else {
- jLabel20.setVisible(false);
- lblExplicit.setVisible(false);
- }
-
- jPanel1.revalidate();
- }
- }