You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/10/19 19:25:01 UTC

svn commit: r826727 - in /incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk: LocalManifest.java Manifest.java RemoteManifest.java

Author: tvolkert
Date: Mon Oct 19 17:25:01 2009
New Revision: 826727

URL: http://svn.apache.org/viewvc?rev=826727&view=rev
Log:
Removed support for URL and isRepresentationClassByteBuffer() cases in Manifest and its implementations

Modified:
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/LocalManifest.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Manifest.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/RemoteManifest.java

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/LocalManifest.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/LocalManifest.java?rev=826727&r1=826726&r2=826727&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/LocalManifest.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/LocalManifest.java Mon Oct 19 17:25:01 2009
@@ -20,7 +20,6 @@
 import java.awt.datatransfer.Transferable;
 import java.awt.datatransfer.UnsupportedFlavorException;
 import java.io.File;
-import java.net.URL;
 
 import org.apache.pivot.collections.ArrayList;
 import org.apache.pivot.collections.HashMap;
@@ -36,7 +35,6 @@
     private String text = null;
     private Image image = null;
     private FileList fileList = null;
-    private URL url = null;
     private HashMap<String, Object> values = new HashMap<String, Object>();
 
     @Override
@@ -94,24 +92,6 @@
     }
 
     @Override
-    public URL getURL() {
-        return url;
-    }
-
-    public void putURL(URL url) {
-        if (url == null) {
-            throw new IllegalArgumentException("url is null.");
-        }
-
-        this.url = url;
-    }
-
-    @Override
-    public boolean containsURL() {
-        return url != null;
-    }
-
-    @Override
     public Object getValue(String key) {
         return values.get(key);
     }
@@ -152,10 +132,6 @@
                 // No-op
             }
         }
-
-        if (localManifest.containsURL()) {
-            transferDataFlavors.add(new DataFlavor(URL.class, URL.class.getName()));
-        }
     }
 
     @Override
@@ -185,24 +161,6 @@
             }
 
             transferData = buf.toString();
-        } else if (dataFlavor.getRepresentationClass() == URL.class) {
-            transferData = localManifest.getURL();
-        } else if (dataFlavor.isRepresentationClassByteBuffer()) {
-            // TODO
-            /*
-                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-
-                Object value = localManifest.getValue(key);
-
-                try {
-                    serializer.writeObject(value, byteArrayOutputStream);
-                    byteArrayOutputStream.close();
-                    ByteBuffer byteBuffer = ByteBuffer.wrap(byteArrayOutputStream.toByteArray());
-
-                } catch(Exception exception) {
-                    System.err.println(exception);
-                }
-             */
         }
 
         return transferData;

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Manifest.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Manifest.java?rev=826727&r1=826726&r2=826727&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Manifest.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Manifest.java Mon Oct 19 17:25:01 2009
@@ -17,7 +17,6 @@
 package org.apache.pivot.wtk;
 
 import java.io.IOException;
-import java.net.URL;
 
 import org.apache.pivot.io.FileList;
 import org.apache.pivot.wtk.media.Image;
@@ -44,9 +43,6 @@
     public FileList getFileList() throws IOException;
     public boolean containsFileList();
 
-    public URL getURL() throws IOException;
-    public boolean containsURL();
-
     public Object getValue(String key) throws IOException;
     public boolean containsValue(String key);
 }

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/RemoteManifest.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/RemoteManifest.java?rev=826727&r1=826726&r2=826727&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/RemoteManifest.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/RemoteManifest.java Mon Oct 19 17:25:01 2009
@@ -26,7 +26,6 @@
 import java.io.StringReader;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 
 import org.apache.pivot.io.FileList;
 import org.apache.pivot.wtk.media.Image;
@@ -43,7 +42,6 @@
     private DataFlavor imageDataFlavor = null;
     private DataFlavor fileListDataFlavor = null;
     private DataFlavor uriListDataFlavor = null;
-    private DataFlavor urlDataFlavor = null;
 
     private static final String URI_LIST_MIME_TYPE = "text/uri-list";
     private static final String FILE_URI_SCHEME = "file";
@@ -66,14 +64,6 @@
                 } else if (dataFlavor.getMimeType().startsWith(URI_LIST_MIME_TYPE)
                     && dataFlavor.getRepresentationClass() == String.class) {
                     uriListDataFlavor = dataFlavor;
-                } else if (dataFlavor.getRepresentationClass() == URL.class) {
-                    urlDataFlavor = dataFlavor;
-                } else if (dataFlavor.isRepresentationClassByteBuffer()) {
-                    // TODO If we have a serializer for the type, deserialize it
-
-                    // TODO Do we still need a workaround for Sun bug #4147507
-                    // (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4147507)
-                    // if we are using ByteBuffers?
                 }
             }
         }
@@ -160,23 +150,6 @@
     }
 
     @Override
-    public URL getURL() throws IOException {
-        URL url = null;
-        try {
-            url = (URL)transferable.getTransferData(urlDataFlavor);
-        } catch (UnsupportedFlavorException exception) {
-            // No-op
-        }
-
-        return url;
-    }
-
-    @Override
-    public boolean containsURL() {
-        return (urlDataFlavor != null);
-    }
-
-    @Override
     public Object getValue(String key) {
         return null;
     }