Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - nemo

Pages: 1 ... 14 15 [16] 17 18 ... 82
226
Computer Projects and Ideas / Re: JavaTyper - a text editor in Java
« on: December 24, 2010, 02:19:46 pm »
http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/undo/package-summary.html

This looks as easy as in .NET:

Code: [Select]
textBox1.Undo();
textBox3.Redo();

While trying to implement a Font Dialog, I came across an automatic Font Dialog, but it needs to import stuff like:

Code: [Select]
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FontDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

Both NetBeans and Eclipse say that those imports are invalid. Is it a special download?

why do you need all those classes? and yes they seem like a package you would download from the internet for extended usability of Eclipse.

227
Computer Projects and Ideas / Re: The Silencer
« on: December 24, 2010, 02:14:22 pm »
screenshots?

228
Computer Projects and Ideas / Re: JavaTyper - a text editor in Java
« on: December 24, 2010, 02:13:32 pm »
I really need to add Undo/Redo so that this has some value, but I can't do it, anybody knows how to?
I know how to, but for a text editor, it's a little more complicated.  Essentially, you need to store a certain number of "actions" into a buffer (Say 30), and then be able to undo and redo them. I would have two stacks. One is for Undo, and one is for Redo. Actions go on to the Undo stack.  When you "undo" them, they swap to the redo stack, along with being undone. When you redo, if there are any on the "redo" stack, you swap them to the undo stack, and redo them.

As for how much text you decide is an "action", or how you deal with that, is up to you. As long as you can undo and redo it.

this is exactly what i do for my tilemap editor. i can give the method for manipulating the stacks if you want, scout. though it may be better to learn about the package javax.swing.undo, because it was built for redo/undo in things like a text editor. my tilemap editor is really simple because you can only undo or redo placing a tile. in a text editor it's probably more complex.

229
Computer Projects and Ideas / Re: Juggernaut
« on: December 24, 2010, 02:10:38 pm »
map editor almost done! today has been a day of error checking... error checking for faulty tiles, error checking for faulty input (Hot_Dog's Correlation Font Compiler)... i'm done with error checking for the day. no screenie, but you know you want to see the 666th line of code:
Code: [Select]
public Enemy(int tileX, int tileY){

also, i broke 1000 lines today. i'm at 1057. it's crazy managing this much code...

My longest program is 300 and I can't handle it without printing it, but woah 1000? I couldn't possibly handle that. They're in separate files, right?

nope, they're in the same file. i've just memorized approximately where certain sections of code are. ctrl+g allows me to jump to any line i want.
on a side note (This might have been answered before, sorry if I didn't see it), what java editor do you use?

as scout said, i use JCreator LE. it's lightweight but i also have eclipse if i'm in need of more features.

230
Axe / Re: recursive subroutines-Bad, Not recommended or neutral?
« on: December 23, 2010, 01:17:40 am »
Oh, I'd forgotten about that. One of the optimizations in the documentation is to not add a Return to the end of the program :P

that's an auto-optimization already.

231
Axe / Re: recursive subroutines-Bad, Not recommended or neutral?
« on: December 23, 2010, 01:10:56 am »
No. Too many returns will also crash your calc. One subroutine call, one return. If they do not match up, you're probably going to clear your RAM. Axe might not want to compile because it doesn't see that you're calling the routine more than once before returning.

too many returns would crash your calc if you were, say, trying to calculate the 50th fibonacci number recursively.

willrandship, as long as that If statement won't trigger while lbl other has been called, you're fine.

232
Correlation / Re: Request for a Java Programmer
« on: December 22, 2010, 06:31:50 pm »
fixed .jar file uploaded in the same place. i'm off to go to a movie, if there are any more bugs leave them here and i'll deal with them once i'm back.

233
Correlation / Re: Request for a Java Programmer
« on: December 22, 2010, 06:19:47 pm »
Much better!  Deep thought is right...I found my files on the desktop because my program and .bmp were in different folders.  But that's a minor detail, because I can say in the instructions "program and bitmap must be in same folder."

Okay, now the program allows illegal filenames (I put a ! in front of the program name), name needs to be forced to 8 characters, and, if possible, accept only monochrome bitmaps.

upper case A-Z only, right? i can do that.

234
Correlation / Re: Request for a Java Programmer
« on: December 22, 2010, 06:15:36 pm »
That's actually some pretty good code, nemo. I like the way you handle error messages, too.

i always used to get mad when i entered 5 pieces of information, and the software took the time to point out each error message individually, rather than just give me everything i'm doing wrong. thanks graphmastur

235
Correlation / Re: Request for a Java Programmer
« on: December 22, 2010, 06:10:28 pm »
Hmm...I'm not seeing the .8xp file (meaning I probably can't find it), and I still have the error message saying "Ending character must be larger than starting character" instead of "ending character must be larger than or equal to starting character."

Otherwise, nice job!

oh poop i neglected that error message. new version updated  :-[

andd i think the 8xp file is made in the same directory as the BMP. at least that's where it was for me.

236
Correlation / Re: Request for a Java Programmer
« on: December 22, 2010, 06:02:54 pm »
Wow, a lot happened in 2.5 hours...

Deep thought, thanks for the changes!  Nemo, you too!

I would like it, though, if all text boxes are blank at the beginning.  Also, I have a screenshot of a file I tried to compile and an error box with no error message.  Finally, your error message for ending/starting characters should be "larger than or equal to" as opposed to simply "larger than."

And just like Deep Thought, don't push yourself to go "above and beyond the call of duty."  Plain 'ol monochrome, uncompressed bitmaps are fine ;D

yep, i already reattached a fixed version, hoping no one would notice, but you did. new version attached in the same place.

237
Computer Projects and Ideas / Re: Juggernaut
« on: December 22, 2010, 05:59:31 pm »
map editor almost done! today has been a day of error checking... error checking for faulty tiles, error checking for faulty input (Hot_Dog's Correlation Font Compiler)... i'm done with error checking for the day. no screenie, but you know you want to see the 666th line of code:
Code: [Select]
public Enemy(int tileX, int tileY){

also, i broke 1000 lines today. i'm at 1057. it's crazy managing this much code...

238
Correlation / Re: Request for a Java Programmer
« on: December 22, 2010, 04:42:55 pm »
Deep Thought, forget the GUI, i've got it covered.

Great, some info if you need it:

My program doesn't prompt for the name of the font. It just takes the name of the bitmap, strips the ".bmp," runs toUpperCase(), and pads it with zeros until it's eight characters long. So basically, whatever the bitmap's called is what the .8xp is called. Not sure what Hot_Dog wants, though.

Any questions about the code, just ask me :)

i noticed that. the GUI has a name field though, so i plan on doing the same operation as you except take it from the name field.

i gotta say, your code is interesting to go through. how did you figure out that 16973 is the identification of BMP files?

anyway, hot dog, as you may or may not know i'm pretty good at dealing with images in java (*cough* juggernaut *cough*). i know a way i could extend the allowed filetypes to other lossless compressions, like PNG and GIF, granted that they are monochrome.
edit: nevermind, i could not. i wouldn't want to tamper with Deep Thought's code, now that i think about it.

edit2: done! hot dog, let me know if this works. jar file attached.

239
Correlation / Re: Request for a Java Programmer
« on: December 22, 2010, 04:10:26 pm »
Deep Thought, forget the GUI, i've got it covered.

Hot_Dog, approval? i can easily space it out by changing just a few numbers.

edit: oh, and it doesn't work yet. it's just the skeleton right now.

240
Computer Projects and Ideas / Re: JavaTyper - a text editor in Java
« on: December 21, 2010, 08:04:52 pm »
Nice. The only suggestion I would have though is to make the text larger, or maybe add an option menu to increase the size.

What text format does it support? Does it also support unicode?

It supporst most ASCII symbols like the STO arrow :) UNICODE I don't really know what that is :S

I am including a colour/text format option in a near future :)
Ah ok I was more wondering about formats like RTF, DOC, etc. But I was also curious about ASCII/UNICODE. Would it open Illusiat 81 readme fine, for example?

i think it would only support .txt files. it's like notepad, you can open whatever file you want but it won't always be human-readable. you could open a GIF but it wouldn't display an image, for example. it would give you the unicode representation of the gif data.

Pages: 1 ... 14 15 [16] 17 18 ... 82