This represents a library resource. @author Douglas Brown @version 1.0
| 39 | * @version 1.0 |
| 40 | */ |
| 41 | public class LibraryResource implements Comparable<LibraryResource> { |
| 42 | |
| 43 | static class Attachment { |
| 44 | Node node; |
| 45 | String type; |
| 46 | String url; |
| 47 | String filename; |
| 48 | int size; |
| 49 | |
| 50 | Attachment(Node node, String type, String url, String filename, int size) { |
| 51 | this.node = node; |
| 52 | this.type = type; |
| 53 | this.url = url; |
| 54 | this.filename = filename; |
| 55 | this.size = size; |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public String toString() { |
| 60 | return "[Attachment " + node |
| 61 | + " " + type + " " |
| 62 | + url + " " + |
| 63 | filename + " " + |
| 64 | size + "]"; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | |
| 69 | |
| 70 | // static constants |
| 71 | public static final String META_AUTHOR = "Author"; //$NON-NLS-1$ |
| 72 | public static final String META_CONTACT = "Contact"; //$NON-NLS-1$ |
| 73 | public static final String META_KEYWORDS = "Keywords"; //$NON-NLS-1$ |
| 74 | public static final String[] META_TYPES = { META_AUTHOR, META_CONTACT, META_KEYWORDS }; |
| 75 | public static final String UNKNOWN_TYPE = "Unknown"; //$NON-NLS-1$ |
| 76 | public static final String COLLECTION_TYPE = "Collection"; //$NON-NLS-1$ |
| 77 | public static final String TRACKER_TYPE = "Tracker"; //$NON-NLS-1$ |
| 78 | public static final String EJS_TYPE = "EJS"; //$NON-NLS-1$ |
| 79 | public static final String VIDEO_TYPE = "Video"; //$NON-NLS-1$ |
| 80 | public static final String IMAGE_TYPE = "Image"; //$NON-NLS-1$ |
| 81 | public static final String HTML_TYPE = "HTML"; //$NON-NLS-1$ |
| 82 | public static final String PDF_TYPE = "PDF"; //$NON-NLS-1$ |
| 83 | public static final String DATA_TYPE = "Data"; //$NON-NLS-1$ |
| 84 | public static final String URL_TYPE = "URL"; //$NON-NLS-1$ |
| 85 | protected static final String[] RESOURCE_TYPES = { TRACKER_TYPE, EJS_TYPE, VIDEO_TYPE, IMAGE_TYPE, HTML_TYPE, |
| 86 | PDF_TYPE, DATA_TYPE, URL_TYPE, UNKNOWN_TYPE }; |
| 87 | |
| 88 | // static fields |
| 89 | protected static List<String> allResourceTypes = new ArrayList<String>(); |
| 90 | protected static ResizableIcon htmlIcon, videoIcon, trackerIcon, ejsIcon, |
| 91 | pdfIcon, unknownIcon, imageIcon, dataIcon, urlIcon, collectionIcon; |
| 92 | protected static DecimalFormat megabyteFormat; |
| 93 | protected static Font bodyFont = new JButton().getFont().deriveFont(12f); |
| 94 | protected static Font h1Font = bodyFont.deriveFont(24f); |
| 95 | protected static Font h2Font = bodyFont.deriveFont(16f); |
| 96 | protected static Font h3Font = bodyFont.deriveFont(14f); |
| 97 | |
| 98 | static { |
nothing calls this directly
no test coverage detected