Re: Desire to unify UI for HyperCard VisualBasic Java and HTMLform

From: rem642b_at_Yahoo.Com (RobertMaas_at_YahooGroups.Com)
Date: 08/21/04


Date: Fri, 20 Aug 2004 18:36:30 -0700


> From: "Michael N. Christoff" <mchristoff@sympatico.caREMOVETHIS>
> how are VB layouts more flexible than the standard Java layout
> managers?

Well I suppose with extremely contorted mis-use of GridBagLayout you
could emulate random placement, but it would be a pain to move a
component just a few pixels one way or another, which would require
figuring which grid cells it has move into or out of and fixing all the
parameters appropriately. But barring such pain, just using the
standard layout managers in the expected way, the difference is that
with the managers you are restricted to a sort os structured way of
laying things out, with cells or regions lined up horizontally or
vertically, and in GridBagLayout a component can occupy a rectangle of
cells but still that's pretty rigid. VisualBasic and HyperCard
drag-and-drop are totally unstructured. You can move a component to
anywhere you want, exactly (to the precise pixel you want) without
regard to how anything lines up vertically or horizontally, and you can
even overlap components, even have one component totally hiding
another. HC/VB are basically what you get if you don't use any layout
manager in Java, just manually place each component by explicit x,y
coordinates, except in HC/VB you have a GUI drag-and-drop editor
instead of having to key in numerical values for x,y. When I was
programming in HyperCard, when I wanted a program able to move an object
to different positions that I had planned in advance, or even create a
new object at runtime and position it in a particular place, what I'd
do usually was drag-and-drop the object, then issue a program command
to tell me the x,y coordinates of where it is, and copy&paste those
values into the program, then delete the object or move it far away
from the desired position, and run the program fragment to see if it
indeed puts the object the correct place.

When I was programming in Macintosh Allegro CommonLisp, likewise an OO
GUI environment like Java, without the GUI drag-and-drop editor like
VB/HC, one trick I used was to write a simple utility program fragment
that waited for a mouse click then printed the coordinates, and then
I'd click where I wanted the component to go in the window, copy&paste
whatever coordinates it printed out, and run the main program fragment
to see if putting it there has the right visual effect, then edit the
numbers manually to nudge it to slightly better position. But
drag-and-drop in HC was so much nicer for getting the size and position
of the component exactly where I wanted it the first time.

Note: The Java programming book (Liang) warns not to do the
no-layout-manager way of laying out things if you want the result to be
portable. Always use the layout managers in portable GUI design.

> PS: I have no trouble doing simple layouts in HTML using nested
> tables, but for some reason I still have enourmous trouble getting
> similar layouts using GridBagLayout.

Well although the HTML rowspan/colspan is totally crufty, whereby it
uses up slots and in positionning later components you have to be aware
the brower will skip any cells already used, still being able to
physically place the upper-left corner of each object visually within
the HTML source is slightly more author-friendly than having to
explicitly name the x,y coordinates by numbers. So I can easily
understand your trouble with GridBagLayout.

> I for one would be very interested in a simple TableLayout layout
> manager for Java based on HTML.

Now if we can only find a source of funding, so I can pay the rent
instead of becoming homeless in a few months when my credit cards max
out...

> do a search for 'Java Server Faces'. It allows one to build HTML
> 'component' that can be assembled together much like GUI widgets for
> thick client GUIs.

Aha, I did a Google search, followed links, and ended up at:
http://java.sun.com/j2ee/javaserverfaces/1.1/docs/api/javax/faces/component/html/package-summary.html
which seems to be the right stuff. Unfortunately it's J2EE, so it's not
available here on my ISP, so I can't play with it, sigh. But thanks for
the pointer, so now when I'm in the mood I can study that API and
compare it to what I would have re-invented and we can discuss
standardization of it all. Maybe I'll write a Common LISP
implementation of the same API that J2EE has there already, so programs
using one or the other could easily be translated from one language to
another. Would CLIM be the right starting point for such CL software?
Unfortunately I've never had access to any way to use CLIM (I doubt
it'd work over VT100 dialup), so I wouldn't be able to start from CLIM
and enhance it to become "CL Faces".

> MS has a similar system called 'Avalon', as does FlashMX (called MXML
> I believe).

By MS I assume you mean MicroSoft? Is this part of VB, or .NET, or what?
I'll skip Flash for now, too many pancakes already on the griddle...



Relevant Pages

  • Re: i need help
    ... or supply me with a sample source code of java wherein several layout ... managers are used in one single JFrame? ... different layout manager though. ... The Java Glossary ...
    (comp.lang.java.programmer)
  • i need help
    ... am a beginner programmer learning java. ... or supply me with a sample source code of java wherein several layout ... managers are used in one single JFrame? ...
    (comp.lang.java.programmer)
  • Re: VS.NET against JAVA
    ... Java's layout managers take a while to get used to, ... Java wins hands down IMO. ... The JIT compiler is a compiler :-) ... Well, I think it already does a fair amount of optimisation, but I'm ...
    (microsoft.public.dotnet.general)
  • Re: Graphic InterfaceBuilder for Java on Mac
    ... Is there some sort of InterfaceBuilder-type product that generates pure Java? ... The idea is to work directly with a graphical layout and get the precise ... output fields in the skeleton of a class definition as on the Mac, ... offerings are not available for the Mac. ...
    (comp.lang.java.softwaretools)
  • Re: netbeans
    ... It sounds like you might want to use CardLayout as the basic layout ... different type of form as a card. ... In addition to the standard Sun layout managers, ... JGoodies forms and MiG layout are ...
    (comp.lang.java.gui)