Omnimaga

General Discussion => Technology and Development => Computer Projects and Ideas => Topic started by: Munchor on December 21, 2010, 05:49:02 pm

Title: JavaTyper - a text editor in Java
Post by: Munchor on December 21, 2010, 05:49:02 pm
Yes, there are better text editors.

Yes, this one is good but when compared to most of the existing ones, it sucks.

Yes, it is good because I made it.

Yes, you should try it.

Yes, most of the code is mine, but I found a few things on the web.

No, it is not open-source.

Yes, it is good-looking.

Yes, it has Save/Open capabilities.

Yes, I will be uploading it.

Yes, you have lost the game.

Yes, it allows indentation with the TAB key.

Yes, it is an executable .jar file.

Yes, I am uploading it.

Yes, for the time being it is not a very good program.

Yes, it will be one day, hopefully.

Yes, the file is not large and the program is fast, but not super-fast.
Title: Re: JavaTyper - a text editor in Java
Post by: jnesselr on December 21, 2010, 06:38:43 pm
I looked at the source. Java is pretty easily de-compilable.

Anyway, It looks pretty good.
Title: Re: JavaTyper - a text editor in Java
Post by: DJ Omnimaga on December 21, 2010, 06:55:00 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?
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 21, 2010, 07:44:01 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 :)
Title: Re: JavaTyper - a text editor in Java
Post by: nemo on December 21, 2010, 07:57:33 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 :)

It supports Unicode. Java supports Unicode and i'm assuming you're using a JTextArea, so the text editor does support unicode.
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 21, 2010, 08:00:00 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 :)

It supports Unicode. Java supports Unicode and i'm assuming you're using a JTextArea, so the text editor does support unicode.

I am using TextArea so it does support unicode :D
Title: Re: JavaTyper - a text editor in Java
Post by: DJ Omnimaga on December 21, 2010, 08:01:12 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?
Title: Re: JavaTyper - a text editor in Java
Post by: nemo 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.
Title: Re: JavaTyper - a text editor in Java
Post by: DJ Omnimaga on December 22, 2010, 02:13:58 am
Ah ok, I see. :P
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 22, 2010, 06:02:07 am
Yes, it opens .exe's too, but it displays the crazy code :) .txt's work perfectly, though :)
Title: Re: JavaTyper - a text editor in Java
Post by: yunhua98 on December 22, 2010, 11:28:58 am
very nice!  I just tried it, and it looks great.  :D
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 22, 2010, 11:30:01 am
/me glances at 14 downloads :P

very nice!  I just tried it, and it looks great.  :D

Thanks :)
Title: Re: JavaTyper - a text editor in Java
Post by: Builderboy on December 22, 2010, 03:18:07 pm
It looks great :D Great job ^^ are there any other features you are planning on implementing?
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 22, 2010, 03:48:19 pm
It looks great :D Great job ^^ are there any other features you are planning on implementing?

I will when I have time :)
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 23, 2010, 02:24:28 pm
Sorry for double post, but this is an update.

Added an 'Are you Sure' function for Open and Exit.
New now opens a new frame.
The X button now closes the frame instead of the program.
Added Select All, Cut, Copy, Paste and Clear functions.

I really need to add Undo/Redo so that this has some value, but I can't do it, anybody knows how to?

:) Attached the file! Tell em what you think.
Title: Re: JavaTyper - a text editor in Java
Post by: jnesselr on December 23, 2010, 02:32:57 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.
Title: Re: JavaTyper - a text editor in Java
Post by: shrear on December 23, 2010, 03:02:53 pm
Nice!
definitely a fine program :)

Single issue I can say is the text size, if I had to read a whole page my eyes would really start to hurt...
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 23, 2010, 03:41:21 pm
Nice!
definitely a fine program :)

Single issue I can say is the text size, if I had to read a whole page my eyes would really start to hurt...


Some irony, hein?

Next version will have an option to choose the size, I'm already making it. For now, I only added it to 12, quick update :).
Title: Re: JavaTyper - a text editor in Java
Post by: nemo 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 (http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/undo/package-summary.html), 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.
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 24, 2010, 02:18:18 pm
http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/undo/package-summary.html (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?
Title: Re: JavaTyper - a text editor in Java
Post by: nemo on December 24, 2010, 02:19:46 pm
http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/undo/package-summary.html (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.
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 27, 2010, 07:49:40 am
JavaTyper new version is out!

New Features:
> Change Background to Black or White (meaning changing text color to black or white);
> New Icon for the main frame;
> Small optimizations, like importing only the things I need.

Screenshots:
>http://img20.imageshack.us/img20/7290/screenshot0001f.png (http://img20.imageshack.us/img20/7290/screenshot0001f.png)
>http://img830.imageshack.us/img830/1690/screenshot0002p.png (http://img830.imageshack.us/img830/1690/screenshot0002p.png)
>http://img692.imageshack.us/img692/1913/screenshot0003a.png (http://img692.imageshack.us/img692/1913/screenshot0003a.png)
Title: Re: JavaTyper - a text editor in Java
Post by: Yeong on December 27, 2010, 08:10:40 am
lol that is my topic on graduation project
Thanks for making my project easier.
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 27, 2010, 08:42:46 am
Great, if you need any help I'm willing to help you with code or anything.


Also, I hate releasing two versions in the same day, but this one is just an optimized version of the other one  8)

I am proud to announce that this version is 16.9KB large and the other one was 18.4KB large.  :w00t:


Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 27, 2010, 02:25:19 pm
Sorry for double post, but here's a new version! The first version was 18.4, last was 16.9 and this one is 15.9KB!

Title: Re: JavaTyper - a text editor in Java
Post by: DJ Omnimaga on December 27, 2010, 06:39:48 pm
Nice, it gets smaller. For the black background mode you should make the cursor white, though.
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 27, 2010, 06:41:16 pm
Nice, it gets smaller. For the black background mode you should make the cursor white, though.

I know ??? But don't know how to :S
Title: Re: JavaTyper - a text editor in Java
Post by: DJ Omnimaga on December 27, 2010, 10:24:07 pm
Oh ok, I thought you could maybe edit it.
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 31, 2010, 11:57:28 am
Oh ok, I thought you could maybe edit it.

Sorry, I don't get what you mean :S
Title: Re: JavaTyper - a text editor in Java
Post by: nemo on December 31, 2010, 01:54:51 pm
i think you can change the cursor (i.e. go from the standard cursor to the hourglass waiting cursor, etc), but i don't think you can actually change the cursor's attributes like color.
Title: Re: JavaTyper - a text editor in Java
Post by: Munchor on December 31, 2010, 02:00:20 pm
i think you can change the cursor (i.e. go from the standard cursor to the hourglass waiting cursor, etc), but i don't think you can actually change the cursor's attributes like color.

Neither do I, I'll only work on JavaTyper in a long time, since I'm quite busy with Assemblex now :)