Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: distributing menu bars accross windows ...



Sciss,

Here's what the JHotDraw application framework can do for you::

On 27.08.2006, at 15:40, Sciss wrote:
the list of problems with menus which i currently have is:
- track focus of document frames ...

An Application keeps track of the "current" project using a focus listener on the Project windows.
Interested parties can register as a property change listener on Application and update their state accordingly.


- maintain a window menu with all active documents ...

An Application keeps track of all open Project's and of the current project, and updates its window menu(s) accordingly.


- maintain a view menu with checkable items that must be updated for all menu copies
(this already works)

Changing the state of a javax.swing.Action object updates all associated JMenuItem's.


- have a mechanism to populate one screen menubar with different menus that are copied to all
menu-enabled windows where no particular windows "knows" about all menus but gets a copy
with greyed-out items that do not relate to this window
(this kind of works but the implementation really sucks at the moment)

Action's can register as property change listener to Application, and disable/enable depending on the "current" project.
This works regardless wether there is a single menu bar for all Project windows or whether there is a menu on each Project window. Because the "current" project changes on focus change on the Project windows.


- be able to share common menu items although their action changes depending on the window ...

ditto

- now with switchable config between multiple windows (mac os) and internal frames (windows / linux)
a mechanism to distribute some menus to the outer window, some to the internal frames

ApplicationModel only delivers Action's to Application that shall be placed on the global menu bars.
Project can put onto it's viewing area whatever it likes.


- be able to create items in menus and their copies dynamically ...

Not supported by the framework.
Interesting idea though. Maybe one could add a "recreateMenus" action to the Application interface, or something.


- disable menus for some windows according to their state (e.g. one document is rendering stuff, so the menu
should be disabled ; when i switch to another doc, the menu should be normally accessible)

ditto of ditto further above

as far as i can judge, these should be common problems for multiple document applications so it's really strange there isn't any readymade solution in java for these as the amount of work to get all these things running is quite high.

Although these are common problems. It is very hard to find a common solution for all the various application types there are.
The application framework of JHotDraw is focused on drawing editors. I don't know how many types of applications can be supported by this framework without bloating it up too much.



if someone has a framework that handles all these things, that would be really nice. otherwise i guess it's a job of one or two days (including modification of all classes already existing). but i was just curious whether people on windows (i don't have a machine at hand now) expect menus to go to the outer frame or the internal frames (and in the latter case how to split them up).

IMO, in an MDI application, only the outer frame should have a menu bar, document windows shouldn't have one.
I think it is okay, if palette windows have a menu button, but they shouldn't have a menu bar.


Thinking about palettes: The framework does not handle them in a platform independent way. Only DefaultOSXApplication supports them. Maybe, I should add a Palette interface or something to it.



Best,
Werner
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >distributing menu bars accross windows ... (From: Sciss <email@hidden>)
 >Re: distributing menu bars accross windows ... (From: Werner Randelshofer <email@hidden>)
 >Re: distributing menu bars accross windows ... (From: Sciss <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.