public String getUniqueIdentifier() { String root = ""; String path = GalleryViewer.reverseWebReady(data.objectFilename.replace(':', '_')); if (data.type == GalleryViewer.WEB) { root = GalleryViewer.webGalleryName; } if (data.type == GalleryViewer.CD) { root = GalleryViewer.cdGalleryName; } if (data.type == GalleryViewer.LOCAL) { root = GalleryViewer.localGalleryName; } int index = path.lastIndexOf(".xml"); if (index > -1 && index < path.length()) { int dirIndex = path.lastIndexOf(java.io.File.separator); if (dirIndex > -1 && dirIndex < path.length()) { path = path.substring(0, dirIndex); } else { path = ""; } } if (path != "") { path = java.io.File.separator + path; } String toReturn = root + path; return toReturn; }
public void galleryMouseEntered() { if (!mouseOver) { mouseOver = true; if (hasAttribution) { mainViewer.diplayAttribution(data); } GalleryObject.this.repaint(); } }
public void galleryMouseExited() { if (mouseOver) { mouseOver = false; if (hasAttribution) { mainViewer.removeAttribution(); } GalleryObject.this.repaint(); } }
public static void storeThumbnail(String thumbFilename, java.awt.Image toStore, long timeStamp) { if (toStore != null) { String codec = "png"; java.io.File thumbFile = GalleryViewer.createFile(thumbFilename); if (thumbFile != null) { try { java.io.FileOutputStream fos = new java.io.FileOutputStream(thumbFile); java.io.BufferedOutputStream bos = new java.io.BufferedOutputStream(fos); java.io.DataOutputStream dos = new java.io.DataOutputStream(bos); edu.cmu.cs.stage3.image.ImageIO.store(codec, dos, toStore); dos.flush(); fos.close(); thumbFile.setLastModified(timeStamp); } catch (InterruptedException ie) { } catch (java.io.IOException ioe) { } } } }
public void set(GalleryViewer.ObjectXmlData dataIn) throws java.lang.IllegalArgumentException { if (dataIn != null) { clean(); data = dataIn; mainViewer = data.mainViewer; if (data.transferable != null) { this.setTransferable(data.transferable); } if (data.directoryData != null) { rootPath = data.directoryData.rootNode.rootPath; } else if (data.parentDirectory != null) { rootPath = data.parentDirectory.rootNode.rootPath; } else { } displayName = GalleryViewer.cleanUpName(dataIn.name); updateGUI(); wakeUp(); } else { clean(); data = null; mainViewer = null; } }
public void respondToMouse() { if (mainViewer != null) { mainViewer.displayModelDialog(data, image); } }