Examples of DropTargetContext


Examples of java.awt.dnd.DropTargetContext

        dropStatus   = STATUS_WAIT; // drop pending ACK
        dropComplete = false;

        if (c.isShowing() && dt != null && dt.isActive()) {
            DropTargetContext dtc = dt.getDropTargetContext();

            currentDT = dt;

            if (currentDTC != null) {
                currentDTC.removeNotify();
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

     */

    protected void processExitMessage(SunDropTargetEvent event) {
        Component         c   = (Component)event.getSource();
        DropTarget        dt  = c.getDropTarget();
        DropTargetContext dtc = null;

        if (dt == null) {
            currentDT = null;
            currentT  = null;

View Full Code Here

Examples of java.awt.dnd.DropTargetContext

                                      boolean operationChanged) {
        Component         c    = (Component)event.getSource();
        Point             hots = event.getPoint();
        int               id   = event.getID();
        DropTarget        dt   = c.getDropTarget();
        DropTargetContext dtc  = null;

        if (c.isShowing() && (dt != null) && dt.isActive()) {
            if (currentDT != dt) {
                if (currentDTC != null) {
                    currentDTC.removeNotify();
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

        dropStatus   = STATUS_WAIT; // drop pending ACK
        dropComplete = false;

        if (c.isShowing() && dt != null && dt.isActive()) {
            DropTargetContext dtc = dt.getDropTargetContext();

            currentDT = dt;

            if (currentDTC != null) {
                currentDTC.removeNotify();
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

    public void dragEnter (DropTargetDragEvent event)
    {
        // debug messages for diagnostics
        // event.acceptDrag (DnDConstants.ACTION_MOVE);
        // System.out.println ("dragEnter");
        DropTargetContext context;
        Component component;
        SubFilterList list;

        // find the enclosing filter
        context = event.getDropTargetContext ();
        component = context.getComponent ();
        while (     (null != component)
                && !(component instanceof SubFilterList)
                && !(component == mMainPanel))
            component = component.getParent ();
        if (component instanceof SubFilterList)
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

    public void dragExit (DropTargetEvent event)
    {
        // debug messages for diagnostics
        // event.acceptDrag (DnDConstants.ACTION_MOVE);
        // System.out.println ("dragEnter");
        DropTargetContext context;
        Component component;
        SubFilterList list;

        // find the enclosing filter
        context = event.getDropTargetContext ();
        component = context.getComponent ();
        while (     (null != component)
                && !(component instanceof SubFilterList)
                && !(component == mMainPanel))
            component = component.getParent ();
        if (component instanceof SubFilterList)
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

     * This is invoked when a drop has occurred.
     * @param event The drop event.
     */
    public void drop (DropTargetDropEvent event)
    {
        DropTargetContext context;
        Component component;
        SubFilterList list;
        String s;
        Point point;
        Filter[] filters;
        boolean accept;

        // find the enclosing filter
        context = event.getDropTargetContext ();
        component = context.getComponent ();
        while (     (null != component)
                && !(component instanceof SubFilterList)
                && !(component == mMainPanel))
            component = component.getParent ();
        if (component instanceof SubFilterList)
            list = (SubFilterList)component;
        else
            list = null;
        // so either list is the enclosing list,
        // or list is null and the target component is the main panel

        try
        {
            accept = false;
            Transferable transferable = event.getTransferable();
                                  
            // we accept only Strings     
            if (transferable.isDataFlavorSupported (DataFlavor.stringFlavor))
            {
                accept = true;
                event.acceptDrop (DnDConstants.ACTION_MOVE);
                s = (String)transferable.getTransferData (DataFlavor.stringFlavor);
                point = event.getLocation ();
                try
                {
                    // get the filter and add into the target
                    filters = Filter.reconstitute (s, new Parser (mURLField.getText ()));
                    if (0 < filters.length)
                        insertFilters (filters, point, list);
                    if (null != list)
                        list.setSelected (false);
                }
                catch (Exception e)
                {
                    e.printStackTrace ();
                }
                // signal the drop was successful
                context.dropComplete (accept);
            }
            else
                event.rejectDrop();
        }
        catch (IOException exception)
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

      }
    }
  }

  static JComponent getComponent(DropTargetEvent e) {
    DropTargetContext context = e.getDropTargetContext();
    return (JComponent) context.getComponent();
  }
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

        public void dropActionChanged(DropTargetDragEvent dtde) {
        }

        public void drop(DropTargetDropEvent dtde) {
            Point p = dtde.getLocation();
            DropTargetContext dtc = dtde.getDropTargetContext();
            JTree tree = (JTree) dtc.getComponent();
            // Sets the original glass pane
            setOriginalGlassPane(tree);
            // Cancel tree item expanding
            dragOverTreePath = null;
            // Get the parent and sibling paths and nodes
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

         * @param dtde
         *            DropTargetDragEvent
         */
        private void updatePositionIndicator(DropTargetDragEvent dtde) {
            Point p = dtde.getLocation();
            DropTargetContext dtc = dtde.getDropTargetContext();
            JTree tree = (JTree) dtc.getComponent();
            // Current path
            TreePath currentPath = tree.getPathForLocation(p.x, p.y);
            Rectangle bounds = tree.getPathBounds(currentPath);
            // Upper area of the tree node
            if (p.y <= bounds.y + visualTipOffset) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.