g.drawRect( this.dragItem.getBounds().x, this.dragItem.getBounds().y, this.imgFolder.getImage().getWidth( this ), this.imgFolder.getImage().getHeight( this ) );
g.drawRect( this.dragItem.getBounds().x, this.dragItem.getBounds().y, this.imgFolder.getImage().getWidth( this ), this.imgFolder.getImage().getHeight( this ) );
// Draw images.
Enumeration enum = this.vectorImages.elements();
int count = 0;
while ( enum.hasMoreElements() ) {
DesktopImage d = ( DesktopImage )enum.nextElement();
if ( this.dragItem == d )
continue;
Rectangle r = new Rectangle( d.getBounds().x, d.getBounds().y, d.getImage().getWidth( this ), d.getImage().getHeight( this ) );
r = new Rectangle( this.highlightedImage.getBounds().x, this.highlightedImage.getBounds().y, this.highlightedImage.getImage().getWidth( this ), this.highlightedImage.getImage().getHeight( this ) );
else
r = new Rectangle( this.highlightedImage.getBounds().x, this.highlightedImage.getBounds().y, this.highlightedImage.getBounds().width, this.highlightedImage.getBounds().height );
if ( r.contains( e.getX(), e.getY() ) ) {
// Move folder
String path = this.highlightedImage.getPath();
if ( path != null ) {
File f = new File( path );
if ( f.exists() && f.isDirectory() ) {
if ( this.dragItem != this.vectorImages.elementAt( 1 ) ) {
// System.out.println( "Oops!" );
File fSource = new File( this.dragItem.getPath() );
boolean b = this.moveItem( fSource, f );
this.vectorImages.removeElement( this.dragItem );
for ( int j = 0; j < vectorWindows.size(); j++ ) {
DesktopFrame d = ( DesktopFrame )vectorWindows.elementAt( j );