Hi,
I need to develop a program that can draw schedules graphically,
allowing the user to manipulate time intervals at will by allowing them
to drag bars around in a timeline and change their lengths. This data
will eventually update a database. Having developed a 3D Graphics
intensive application in the past whose design degenerated into a hack
job because it was never done properly, I wanted to do this one right
(particularly since I'm being paid for this one!). Here are my
questions:
* As the graphics are merely 2D, would it be easier just to use the
Graphics2D class to implement the graphical schedule as opposed to
using JOGL, whislt allowing user interaction? Does Graphics2D have a
concept of a Canvas? I come from a JOGL background and have worked on a
very similar program using JOGL and I have the source code, but it
doesn't seem particularly install-friendly for the client as it doesn't
come with the standard distro.
* As far as program design goes, I'm a bit lost. How does one design a
wonderful GUI, then link it up to actual functionality? As you might
see, there could be potentially heaps of events that would need to be
handled in this program. My old 3D program stored the entry point into
the "real" functionalities by storing a reference to that particular
class in the GUI class. That class then delegated the requested
commands to a heap of other different classes. It all became very, very
messy as the program grew. The ActionListeners were everywhere. I've
had a look at some design patterns, but they're pretty vague sometimes.
I'd appreciate any ideas, thanks!!
Jenny
Oliver Wong - 23 Mar 2006 23:53 GMT
> Hi,
>
[quoted text clipped - 14 lines]
> doesn't seem particularly install-friendly for the client as it doesn't
> come with the standard distro.
The "Dragging bars around in a timeline" stuff doesn't sound like any
Swing component that I'm aware of, so I suspect you'll have to program most
of this manually (or else scour Google for someone who may have alreayd done
it for you, and still their code).
As to whether you should do it in JOGL or Graphics2D, assuming your
client is okay with either one, you should program it in whichever API
you're more familiar with, to make your life as easy as possible. If you're
equally familiar with either one, go with Graphcis2D, because then you don't
require OpenGL to be present on the target system.
I don't know what a "Canvas" is in the context of JOGL, but there is a
class called "Canvas" in in AWT. Maybe you could look at that to see if it
is conceptually similar to the Canvas from JOGL.
> * As far as program design goes, I'm a bit lost. How does one design a
> wonderful GUI, then link it up to actual functionality? As you might
[quoted text clipped - 5 lines]
> messy as the program grew. The ActionListeners were everywhere. I've
> had a look at some design patterns, but they're pretty vague sometimes.
MVC (Model View Controller) is "classic" GUI design pattern. Some people
prefer MVP (Model View Presenter), but personally I don't think MVP really
adds anything, and I use the terms almost interchangeably.
- Oliver