Changeset 10801 in josm
- Timestamp:
- 2016-08-15T13:25:30+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/datatransfer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/datatransfer/ClipboardUtils.java
r10611 r10801 148 148 }); 149 149 } 150 151 /** 152 * Returns a new {@link DataFlavor} for the given class and human-readable name. 153 * @param c class 154 * @param humanPresentableName the human-readable string used to identify this flavor 155 * @return a new {@link DataFlavor} for the given class and human-readable name 156 * @since 10801 157 */ 158 public static DataFlavor newDataFlavor(Class<?> c, String humanPresentableName) { 159 try { 160 return new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType + ";class=" + c.getName(), 161 humanPresentableName, c.getClassLoader()); 162 } catch (ClassNotFoundException e) { 163 throw new IllegalArgumentException(e); 164 } 165 } 150 166 } -
trunk/src/org/openstreetmap/josm/gui/datatransfer/LayerTransferable.java
r10605 r10801 63 63 * Data flavor for {@link Layer}s which are wrapped in {@link Data}. 64 64 */ 65 public static final DataFlavor LAYER_DATA = new DataFlavor( 66 DataFlavor.javaJVMLocalObjectMimeType + ";class=" + Data.class.getName(), "Layers"); 65 public static final DataFlavor LAYER_DATA = ClipboardUtils.newDataFlavor(Data.class, "Layers"); 67 66 68 67 private final Data data; -
trunk/src/org/openstreetmap/josm/gui/datatransfer/data/LayerTransferData.java
r10605 r10801 7 7 import java.util.List; 8 8 9 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils; 9 10 import org.openstreetmap.josm.gui.datatransfer.LayerTransferable; 10 11 import org.openstreetmap.josm.gui.layer.Layer; … … 20 21 * This is a data flavor for all layer types 21 22 */ 22 public static final DataFlavor FLAVOR = new DataFlavor( 23 DataFlavor.javaJVMLocalObjectMimeType + ";class=" + LayerTransferData.class.getName(), "Layer"); 23 public static final DataFlavor FLAVOR = ClipboardUtils.newDataFlavor(LayerTransferData.class, "Layer"); 24 24 25 25 /** -
trunk/src/org/openstreetmap/josm/gui/datatransfer/data/OsmLayerTransferData.java
r10745 r10801 7 7 import java.util.List; 8 8 9 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils; 9 10 import org.openstreetmap.josm.gui.datatransfer.LayerTransferable; 10 11 import org.openstreetmap.josm.gui.layer.LayerManager; … … 23 24 * @see #FLAVORS 24 25 */ 25 public static final DataFlavor OSM_FLAVOR = new DataFlavor( 26 DataFlavor.javaJVMLocalObjectMimeType + ";class=" + LayerTransferData.class.getName(), "Layer"); 26 public static final DataFlavor OSM_FLAVOR = ClipboardUtils.newDataFlavor(OsmLayerTransferData.class, "Layer"); 27 27 28 28 /**
Note:
See TracChangeset
for help on using the changeset viewer.