package java.awt.dnd;
import java.awt.Component;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;
import java.awt.Point;
import java.awt.datatransfer.FlavorMap;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.Serializable;
import java.util.EventListener;
import java.util.TooManyListenersException;
public class DropTarget
implements DropTargetListener, EventListener, Serializable
{
private static final long serialVersionUID = -6283860791671019047L;
public static class DropTargetAutoScroller
implements ActionListener
{
private Component component;
private Point point;
protected DropTargetAutoScroller (Component c, Point p)
{
component = c;
point = p;
}
protected void updateLocation (Point newLocn)
{
point = newLocn;
}
protected void stop ()
{
}
public void actionPerformed (ActionEvent e)
{
}
}
private Component component;
private FlavorMap flavorMap;
private int actions;
private DropTargetContext dropTargetContext;
private DropTargetListener dropTargetListener;
private boolean active = true;
public DropTarget ()
{
this (null, 0, null, true, null);
}
public DropTarget (Component c, DropTargetListener dtl)
{
this (c, 0, dtl, true, null);
}
public DropTarget (Component c, int i, DropTargetListener dtl)
{
this (c, i, dtl, true, null);
}
public DropTarget (Component c, int i, DropTargetListener dtl, boolean b)
{
this (c, i, dtl, b, null);
}
public DropTarget (Component c, int i, DropTargetListener dtl, boolean b,
FlavorMap fm)
{
if (GraphicsEnvironment.isHeadless ())
throw new HeadlessException ();
component = c;
actions = i;
dropTargetListener = dtl;
flavorMap = fm;
setActive (b);
}
public void setComponent (Component c)
{
component = c;
}
public Component getComponent ()
{
return component;
}
public void setDefaultActions (int ops)
{
actions = ops;
}
public int getDefaultActions ()
{
return actions;
}
public void setActive (boolean active)
{
this.active = active;
}
public boolean isActive()
{
return active;
}
public void addDropTargetListener (DropTargetListener dtl)
throws TooManyListenersException
{
dropTargetListener = dtl;
}
public void removeDropTargetListener(DropTargetListener dtl)
{
dropTargetListener = null;
}
public void dragEnter(DropTargetDragEvent dtde)
{
}
public void dragOver(DropTargetDragEvent dtde)
{
}
public void dropActionChanged(DropTargetDragEvent dtde)
{
}
public void dragExit(DropTargetEvent dte)
{
}
public void drop(DropTargetDropEvent dtde)
{
}
public FlavorMap getFlavorMap()
{
return flavorMap;
}
public void setFlavorMap(FlavorMap fm)
{
flavorMap = fm;
}
public void addNotify(java.awt.peer.ComponentPeer peer)
{
}
public void removeNotify(java.awt.peer.ComponentPeer peer)
{
}
public DropTargetContext getDropTargetContext()
{
if (dropTargetContext == null)
dropTargetContext = createDropTargetContext ();
return dropTargetContext;
}
protected DropTargetContext createDropTargetContext()
{
return new DropTargetContext (this);
}
protected DropTarget.DropTargetAutoScroller createDropTargetAutoScroller
(Component c, Point p)
{
return new DropTarget.DropTargetAutoScroller (c, p);
}
protected void initializeAutoscrolling(Point p)
{
}
protected void updateAutoscroll(Point dragCursorLocn)
{
}
protected void clearAutoscroll()
{
}
}