News:

Tekforums.net - The improved home of Tekforums! :D

Main Menu

Er...Sam?!

Started by M3ta7h3ad, March 28, 2006, 15:44:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Christopher Monkey

Thats pretty good M3.... id love to look at the code you used for it all!

M3ta7h3ad

lol righty! just done my demo :)

Not slept a wink, and probably wont today either so much damn work this week.

Added a "fit to window" function in the 5 minutes before my demonstration, and had to get around a gazillion errors including changing all the damn for each loops and stringbuilders I put in, as the Macs here in cardiff uni dont have java 1.5 installed.

Grrr... dont know why they made it so we have to demo on them they are friggin horrible for programming. Will add a fresh screenie montage with the new panel in :) looks quite nice.

Comments from the demo were that im a borderline first, depending on how good the short report I write about the program is. woot!!! :)

Christopher Monkey

Coolies..... Just wanted to see your code to see how youd done it... havent picked up java since july!!

M3ta7h3ad

Ill post the code once its all been assessed and marked :) Dont want someone nicking my code and then me getting done for plagiarism cause someones googled it up. Should be alright to post up in a few weeks :)

(its not tidy however... rather messy code, with several bodges :) but it works :))

Christopher Monkey

Now thats the kind of coding thatll get you a job with micro$oft

M3ta7h3ad

What sucks is that my program suffers from an actual documented bug on the java bug site. It was found by another one of my mates here when he was coding his.

Basically if you shove a JPanel in a JScrollPane and set the layoutmanager to flowlayout JScrollPane screws up completely and disregards max min sizes and whatnot.

So instead of my thumbnails making a nice page of thumbnails I can scroll down, it just plows straight across and makes the panel huge and scrolls horizontally. However it does work from time to time... it depends on what it feels like.

Christopher Monkey

lol.... dont you just love bugs!!

Christopher Monkey

M3.... how are you reading you image files in to your app? Does the app seach your HDD or rdo you have to manually assign them / their folder?

M3ta7h3ad

my app uses a JFileChooser and loads the files in a chosen directory into a files array.

it then gets the current working directory of the jFileChooser and appends "\\"+files[j] to it to start iterating through the images.

Christopher Monkey

Fair enough...could you expand it easily to encompass a whole machine along the lines of picassa?

M3ta7h3ad

erm.. itd be a wee bit more complex in that Id have to identify directories and what not, but yeah dont see why it wouldnt be possible. :)

Christopher Monkey

Surely you could just set it to trawl from root, and if it found any files ending .jpg, .gif etc it added them into the thumbnail window, with a tag specifying where it had come from?

M3ta7h3ad

Quote from: Christopher MonkeySurely you could just set it to trawl from root, and if it found any files ending .jpg, .gif etc it added them into the thumbnail window, with a tag specifying where it had come from?

That would be the issue.

How would it trawl without finding out that a file is a directory.

Also whats root? they could be like me, have a multi harddrive machine. Id need to augment the program for it to detect the different volumes/partitions on a machine... or at least offer an interface for the user to input it, itd be poor design if it was a case of enter in the drive letter... as opposed to a list of volumes and Tick boxes.

It wouldnt take much more work to be honest but meh, also afaik java only handles jpg and gif files as icons and images, so png, tiff, bmp, and the other million and one formats out there wouldnt work in it without some hefty bodgage. :)

And youd probably need to implement a binary tree of stacks to keep track of the files, which is a whore in itself to implement :) Its a lot more than just "trawl root" :) lol.

While my program does pretty things with images and stuff the reason it is simple is because it does no trawling :D lol

Christopher Monkey

Good point.... like i said earler... ive not touched it for a year, so appologies for over simplifiying the problem :D

M3ta7h3ad

Quote from: Christopher MonkeyGood point.... like i said earler... ive not touched it for a year, so appologies for over simplifiying the problem :D

lol no worries mate.

Its not too complex, in fact it would make for a good project, and I have libraries ive written myself that I could import in and use for some of the stuff (binary tree stack crap), but it would just take ages. Perhaps a summer project :)