jsugar

Added a small readme file, listing features and constraints.

Author
Vngngdn
Date
July 16, 2016, 3:55 p.m.
Hash
9a80574732fe8211110e423a94492b42966365f4
Parent
a05e76e3c1e4e4821bea9d34af3f60919b75d321
Modified file
README.md

README.md

56 additions and 0 deletions.

View changes Hide changes
+
1
======
+
2
+
3
JSugar is a tiny, stupid framework, in an attempt to hide away the tons of
+
4
useless cruft that you get from working with Java's Swing.
+
5
+
6
Features
+
7
--------
+
8
+
9
Purely speaking, JSugar does not add anything new compared to when you're using
+
10
Swing. It does however, offer some considerable advantages over using Swing
+
11
directly:
+
12
+
13
* Easy creation of windows, that offer a series of convenient methods like
+
14
  createButton(), allowing for easy creation of small GUI programs.
+
15
* Built-in support for action triggering; Just say which method should be
+
16
  triggered where, and you're done.
+
17
* Easy learning curve, compared to manually handling Swing. Create a new Window,
+
18
  slap some components on it, add the methods it needs to call on trigger, and
+
19
  done.
+
20
* Relies mainly on primitive types, like integer arrays, and classes that are
+
21
  available in every recent OpenJDK version, like Strings.
+
22
* Completely [free software](https://www.gnu.org/philosophy/free-sw.html).
+
23
* Very lightweight. It's just a bunch of source files that you can directly link
+
24
  to. Putting it in a seperate jar will cause more harm than good.
+
25
* Only RuntimeExceptions will be thrown, avoiding *exception infection* that
+
26
  you'll get from using self-defined exceptions in Java.
+
27
* Documentation available through JavaDoc. I do my very best to provide clear
+
28
  documentation, so you know how to use this without having to figure it out
+
29
  yourself.
+
30
* Components you add are returned to the caller, so if you do need some more
+
31
  advanced stuff, you can add it yourself.
+
32
+
33
Limitations
+
34
-----------
+
35
+
36
The convenience causes some limitations, but they're fairly minor, and if you're
+
37
using JSugar, it's very unlikely you'd be bothered by them anyway, but here they
+
38
are:
+
39
+
40
* You can't add your own panels to the window, but you'll most likely just want
+
41
  to add some components to the window itself.
+
42
* The panels default to double buffering (which you should do anyway) and the
+
43
  flow layout.
+
44
* The window is automatically updated whenever a new component is added. When
+
45
  using Swing 'natively', you could postpone updating, but why did you add a
+
46
  component then in the first place?
+
47
* *Trigger methods* can only have 1 parameter, or none at all. That 1 parameter
+
48
  must be of type java.awt.event.ActionEvent. This should be enough for >80% of
+
49
  use cases, and if you really need more flexibility, you can add your own
+
50
  action handlers manually.
+
51
* Pressing the X in the title bar of the window closes it. >95% of use cases do
+
52
  this anyway.
+
53
* Some silly stuff like adding icons to buttons is not possible, you'll have to
+
54
  do that yourself. Yet for most use cases, you might just do the sane thing and
+
55
  add text.
+
56