This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 53975 - make class DragDropUtilities public
Summary: make class DragDropUtilities public
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 4.x
Hardware: All Windows ME/2000
: P3 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2005-01-25 15:08 UTC by Stanislav Aubrecht
Modified: 2008-12-22 20:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
DragDropUtilities (966 bytes, patch)
2005-01-25 15:09 UTC, Stanislav Aubrecht
Details | Diff
Toolbar (3.47 KB, patch)
2005-01-25 15:09 UTC, Stanislav Aubrecht
Details | Diff
TopComponentDragSupport (2.14 KB, patch)
2005-01-25 15:10 UTC, Stanislav Aubrecht
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Aubrecht 2005-01-25 15:08:14 UTC
class org.openide.explorer.view.DragDropUtilities
has methods createCustomCursor and
createBufferedImage that are used to create custom
cursor image for drag'n'drop operations.

the source code of these two methods is duplicated
in classes org.openide.awt.Toolbar and
org.netbeans.core.windows.view.dnd.TopComponentDragSupport.

making class DragDropUtilities and its method
createCustomCursor public will simplify the code
of the other two classes. see the attached diff.
Comment 1 Stanislav Aubrecht 2005-01-25 15:09:20 UTC
Created attachment 19949 [details]
DragDropUtilities
Comment 2 Stanislav Aubrecht 2005-01-25 15:09:56 UTC
Created attachment 19950 [details]
Toolbar
Comment 3 Stanislav Aubrecht 2005-01-25 15:10:29 UTC
Created attachment 19951 [details]
TopComponentDragSupport
Comment 4 _ rkubacki 2005-01-26 13:58:22 UTC
sounds good.

OTOH createBufferedImage is already a copy from (package private
class) o.o.util.IconManager. Shouldn't it be exposed somewhere in
utilities?
Comment 5 Jesse Glick 2005-01-26 18:29:20 UTC
Maybe rename to DragAndDropUtilities.

I agree that this is a poor place for createBufferedImage.
Comment 6 Jiri Rechtacek 2005-01-26 21:16:28 UTC
What about new class o.o.awt.Utilities? With these two methods as
initiation. Else handy place is o.o.util.Utilities.
Comment 7 Jaroslav Tulach 2005-01-27 07:27:26 UTC
We cannot use org.openide.explorer.* as openide/loaders does not yet
depend on it and the reason why the diff compiles is due to the fact
that openide.jar is not yet split into logical parts.

Creating new class in openide/awt, would work, but I prefer yet
another method addition to openide/util as there already is
createProgressCursor and surprisingly also createCustomCursor, so the
whole thing is just to make it public (at last it seems to me so).

I've CCed pnejedly as he may know whether we still need
createBufferedImage or this was just a hack for older JDKs and we can
just do new BufferedImage(...);

Btw. may I request some kind of test? At that the cursor has the right
size?
Comment 8 Stanislav Aubrecht 2005-02-02 10:36:31 UTC
to sum this issue up:
- make public method createCustomCursor in org.openide.util.Utilities
- remove duplicated code from classes:
org.openide.explorer.view.DragDropUtilities,
org.netbeans.core.windows.view.dnd.TopComponentDragSupport,
org.openide.awt.Toolbar

btw, how can i check the size of a cursor?
Comment 9 Jaroslav Tulach 2005-02-02 12:35:10 UTC
I do not know how to get any info about the cursor beyond the
getName(), toString(), getType(). That means you will likely not be
able to test for the cursor size. You may test that the WAIT_CURSOR is
returned if the system does not support custom cursors instead.
Comment 10 Stanislav Aubrecht 2005-02-03 16:24:09 UTC
done


Checking in src/org/openide/explorer/view/DragDropUtilities.java;
/cvs/openide/src/org/openide/explorer/view/DragDropUtilities.java,v 
<--  DragDropUtilities.java
new revision: 1.31; previous revision: 1.30
done
Checking in src/org/openide/explorer/view/ExplorerDragSupport.java;
/cvs/openide/src/org/openide/explorer/view/ExplorerDragSupport.java,v
 <--  ExplorerDragSupport.java
new revision: 1.14; previous revision: 1.13
done
Processing log script arguments...
More commits to come...
Checking in loaders/src/org/openide/awt/Toolbar.java;
/cvs/openide/loaders/src/org/openide/awt/Toolbar.java,v  <--  Toolbar.java
new revision: 1.24; previous revision: 1.23
done
Processing log script arguments...
More commits to come...
Checking in src/org/openide/util/Utilities.java;
/cvs/openide/src/org/openide/util/Utilities.java,v  <--  Utilities.java
new revision: 1.148; previous revision: 1.147
done
Processing log script arguments...
More commits to come...
Checking in test/unit/src/org/openide/util/UtilitiesTest.java;
/cvs/openide/test/unit/src/org/openide/util/UtilitiesTest.java,v  <--
 UtilitiesTest.java
new revision: 1.3; previous revision: 1.2
done
Checking in
windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java;
/cvs/core/windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java,v
 <--  TopComponentDragSupport.java
new revision: 1.18; previous revision: 1.17
done
Comment 11 Jaromir Uhrik 2005-07-14 16:18:51 UTC
Verified.