All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.scudata.ide.vdb.control.TransferableObject Maven / Gradle / Ivy

Go to download

SPL(Structured Process Language) A programming language specially for structured data computing.

There is a newer version: 20241126
Show newest version
package com.scudata.ide.vdb.control;

import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;

public class TransferableObject implements Transferable {
	private Object object;

	public static final DataFlavor objectFlavor = new DataFlavor(TransferableObject.class, "object");

	static DataFlavor[] flavors = { objectFlavor };

	public TransferableObject(Object object) {
		this.object = object;
	}

	public DataFlavor[] getTransferDataFlavors() {
		return flavors;
	}

	public boolean isDataFlavorSupported(DataFlavor flavor) {
		return flavor.equals(objectFlavor);
	}

	public synchronized Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
		if (flavor.equals(objectFlavor)) {
			return object;
		} else {
			return null;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy