diff options
Diffstat (limited to 'cmpcj/src')
5 files changed, 139 insertions, 62 deletions
diff --git a/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java b/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java index a254192..a7e575f 100644 --- a/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java +++ b/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java @@ -36,6 +36,16 @@ public class Media { }; + public String getFormat() { + return format; + } + + + public int getHeight() { + return height; + } + + public String getName() { return name; } @@ -56,6 +66,26 @@ public class Media { } + public int getWidth() { + return width; + } + + + public boolean isHD() { + return height > 576; + } + + + public void setFormat(String format) { + this.format = format; + } + + + public void setHeight(int height) { + this.height = height; + } + + public void setName(String name) { this.name = name; } @@ -96,8 +126,16 @@ public class Media { this.type = SupportedMediaType.Invalid; } + + public void setWidth(int width) { + this.width = width; + } + private String name; private SupportedMediaType type; + private String format; private String path; private String search; + private int width; + private int height; } diff --git a/cmpcj/src/de/schwarzrot/cmpc/ui/MediaClient.java b/cmpcj/src/de/schwarzrot/cmpc/ui/MediaClient.java index 9237106..70da17f 100644 --- a/cmpcj/src/de/schwarzrot/cmpc/ui/MediaClient.java +++ b/cmpcj/src/de/schwarzrot/cmpc/ui/MediaClient.java @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== * - * File: MediaClient.java - * Created: - * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> - * Project: cmpc - a java frontend (client) part of compound media player - * uses external players to play the media + * File: MediaClient.java Created: Author: <a + * href="mailto:geronimo013@gmx.de">Geronimo</a> Project: cmpc - a java frontend + * (client) part of compound media player uses external players to play the + * media * * CMP - compound media player * - * is a client/server mediaplayer intended to play any media from any workstation - * without the need to export or mount shares. cmps is an easy to use backend - * with a (ready to use) HTML-interface. Additionally the backend supports - * authentication via HTTP-digest authorization. - * cmpc is a client with vdr-like osd-menues. + * is a client/server mediaplayer intended to play any media from any + * workstation without the need to export or mount shares. cmps is an easy to + * use backend with a (ready to use) HTML-interface. Additionally the backend + * supports authentication via HTTP-digest authorization. cmpc is a client with + * vdr-like osd-menues. * - * Copyright (c) 2012 Reinhard Mantey, some rights reserved! - * published under Creative Commons by-sa - * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under + * Creative Commons by-sa For details see + * http://creativecommons.org/licenses/by-sa/3.0/ * - * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * The cmp project's homepage is at + * http://projects.vdr-developer.org/projects/cmp * * -------------------------------------------------------------- */ @@ -165,8 +165,8 @@ public class MediaClient extends JComponent implements MediaClientExecutor { JTextField filterEdit = new JTextField(30); FilterList<Media> textFilteredMedia = new FilterList<Media>(filteredMedias, new TextComponentMatcherEditor<Media>(filterEdit, new MediaTextFilterator())); - DefaultEventTableModel<Media> mediaTableModel = new DefaultEventTableModel<Media>(textFilteredMedia, - new MediaTableFormat()); + MediaTableFormat tf = new MediaTableFormat(); + DefaultEventTableModel<Media> mediaTableModel = new DefaultEventTableModel<Media>(textFilteredMedia, tf); JTable mediaJTable = new JTable(mediaTableModel); @SuppressWarnings({ "unused", "rawtypes" }) TableComparatorChooser tableSorter = TableComparatorChooser.install(mediaJTable, sortedMedias, @@ -189,7 +189,13 @@ public class MediaClient extends JComponent implements MediaClientExecutor { }); mediaTypesScrollPane.setPreferredSize(new Dimension(100, 100)); mediaTypesScrollPane.setBackground(Color.BLACK); - mediaJTable.getColumnModel().getColumn(0).setMaxWidth(80); + int mx = mediaJTable.getColumnModel().getColumnCount(); + for (int i = 0; i < mx; ++i) { + int cw = tf.getColumnWidth(i); + + if (cw > 0) + mediaJTable.getColumnModel().getColumn(i).setMaxWidth(cw); + } mediaJTable.getColumnModel().getColumn(0).setCellRenderer(new DefaultTableCellRenderer()); mediaJTable.getColumnModel().getColumn(1).setCellRenderer(new DefaultTableCellRenderer()); mediaJTable.addMouseListener(new MediaExecutor(mediaJTable, textFilteredMedia, this)); diff --git a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTableFormat.java b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTableFormat.java index 7fa5452..d427e83 100644 --- a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTableFormat.java +++ b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTableFormat.java @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== * - * File: MediaTableFormat.java - * Created: - * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> - * Project: cmpc - a java frontend (client) part of compound media player - * uses external players to play the media + * File: MediaTableFormat.java Created: Author: <a + * href="mailto:geronimo013@gmx.de">Geronimo</a> Project: cmpc - a java frontend + * (client) part of compound media player uses external players to play the + * media * * CMP - compound media player * - * is a client/server mediaplayer intended to play any media from any workstation - * without the need to export or mount shares. cmps is an easy to use backend - * with a (ready to use) HTML-interface. Additionally the backend supports - * authentication via HTTP-digest authorization. - * cmpc is a client with vdr-like osd-menues. + * is a client/server mediaplayer intended to play any media from any + * workstation without the need to export or mount shares. cmps is an easy to + * use backend with a (ready to use) HTML-interface. Additionally the backend + * supports authentication via HTTP-digest authorization. cmpc is a client with + * vdr-like osd-menues. * - * Copyright (c) 2012 Reinhard Mantey, some rights reserved! - * published under Creative Commons by-sa - * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under + * Creative Commons by-sa For details see + * http://creativecommons.org/licenses/by-sa/3.0/ * - * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * The cmp project's homepage is at + * http://projects.vdr-developer.org/projects/cmp * * -------------------------------------------------------------- */ @@ -33,7 +33,7 @@ import de.schwarzrot.cmpc.domain.Media; public class MediaTableFormat implements TableFormat<Media> { @Override public int getColumnCount() { - return 2; + return 5; } @@ -43,6 +43,12 @@ public class MediaTableFormat implements TableFormat<Media> { case 0: return "Type"; case 1: + return "Format"; + case 2: + return "Width"; + case 3: + return "Height"; + case 4: return "Name"; default: throw new IllegalStateException(); @@ -56,9 +62,33 @@ public class MediaTableFormat implements TableFormat<Media> { case 0: return m.getType(); case 1: + return m.getFormat(); + case 2: + return m.getWidth(); + case 3: + return m.getHeight(); + case 4: return m.getName(); default: throw new IllegalStateException(); } } + + + public int getColumnWidth(int column) { + switch (column) { + case 0: + return 80; + case 1: + return 100; + case 2: + return 60; + case 3: + return 60; + case 4: + return -1; + default: + throw new IllegalStateException(); + } + } } diff --git a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTextFilterator.java b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTextFilterator.java index e41c81f..aa035d9 100644 --- a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTextFilterator.java +++ b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTextFilterator.java @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== * - * File: MediaTextFilterator.java - * Created: - * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> - * Project: cmpc - a java frontend (client) part of compound media player - * uses external players to play the media + * File: MediaTextFilterator.java Created: Author: <a + * href="mailto:geronimo013@gmx.de">Geronimo</a> Project: cmpc - a java frontend + * (client) part of compound media player uses external players to play the + * media * * CMP - compound media player * - * is a client/server mediaplayer intended to play any media from any workstation - * without the need to export or mount shares. cmps is an easy to use backend - * with a (ready to use) HTML-interface. Additionally the backend supports - * authentication via HTTP-digest authorization. - * cmpc is a client with vdr-like osd-menues. + * is a client/server mediaplayer intended to play any media from any + * workstation without the need to export or mount shares. cmps is an easy to + * use backend with a (ready to use) HTML-interface. Additionally the backend + * supports authentication via HTTP-digest authorization. cmpc is a client with + * vdr-like osd-menues. * - * Copyright (c) 2012 Reinhard Mantey, some rights reserved! - * published under Creative Commons by-sa - * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under + * Creative Commons by-sa For details see + * http://creativecommons.org/licenses/by-sa/3.0/ * - * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * The cmp project's homepage is at + * http://projects.vdr-developer.org/projects/cmp * * -------------------------------------------------------------- */ @@ -36,5 +36,6 @@ public class MediaTextFilterator implements TextFilterator<Media> { public void getFilterStrings(List<String> baseList, Media m) { baseList.add(m.getName()); baseList.add(m.getSearch()); + baseList.add(m.getFormat()); } } diff --git a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTypeSelect.java b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTypeSelect.java index 033ee53..24cd506 100644 --- a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTypeSelect.java +++ b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTypeSelect.java @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== * - * File: MediaTypeSelect.java - * Created: - * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> - * Project: cmpc - a java frontend (client) part of compound media player - * uses external players to play the media + * File: MediaTypeSelect.java Created: Author: <a + * href="mailto:geronimo013@gmx.de">Geronimo</a> Project: cmpc - a java frontend + * (client) part of compound media player uses external players to play the + * media * * CMP - compound media player * - * is a client/server mediaplayer intended to play any media from any workstation - * without the need to export or mount shares. cmps is an easy to use backend - * with a (ready to use) HTML-interface. Additionally the backend supports - * authentication via HTTP-digest authorization. - * cmpc is a client with vdr-like osd-menues. + * is a client/server mediaplayer intended to play any media from any + * workstation without the need to export or mount shares. cmps is an easy to + * use backend with a (ready to use) HTML-interface. Additionally the backend + * supports authentication via HTTP-digest authorization. cmpc is a client with + * vdr-like osd-menues. * - * Copyright (c) 2012 Reinhard Mantey, some rights reserved! - * published under Creative Commons by-sa - * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under + * Creative Commons by-sa For details see + * http://creativecommons.org/licenses/by-sa/3.0/ * - * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * The cmp project's homepage is at + * http://projects.vdr-developer.org/projects/cmp * * -------------------------------------------------------------- */ @@ -141,7 +141,9 @@ public class MediaTypeSelect extends AbstractMatcherEditor<Media> implements Lis private static final String[] iconFiles; static { iconFiles = new String[] { "images/folder_black.png", "images/folder_black_music.png", - "images/folder_black_movies.png", "images/folder_black_dvd.png", "images/folder_black_vdr_old.png", - "images/folder_black_vdr.png", "images/folder_black_photos.png", "images/folder_black.png" }; + "images/folder_black_movies.png", "images/folder_black_i_movies.png", "images/folder_black_dvd.png", + "images/folder_black_i_dvd.png", "images/folder_black_vdr_old.png", + "images/folder_black_i_vdr_old.png", "images/folder_black_vdr.png", "images/folder_black_i_vdr.png", + "images/folder_black_photos.png", "images/folder_black.png" }; } } |