------------------The MacOS Look and Feel---------------------- Actual version: 0.28 (20 August 1999) compatible Swing 1.1.1 final Name and description: public String getName() { return "MacOS"; } public String getID() { return "MacOS"; } public String getDescription() { return "The Apple Mac OS(tm) Look and Feel"; } Contributors: Bradley Smith (bsmith@banta-im.com) Jason Giles (jgiles@chaoticsoftware.com) Michael Heuer (heuermh@shore.net) David Himelright (vitriol@mindless.com) Luca Lutterotti (Luca.Lutterotti@ing.unitn.it) the Swing team (thanks to Tom Santos and Steve Wilson to provide the original Mac L&F) ..... Included in the package: - macos.jar the MacOS L&F archive - swingall.jar the patched swing archive for the MacOS L&F (fully compatible with the standard swingall.jar archive from Swing 1.1.1 final) - MacOS_swing.jar contains only the hacked classes of the Swing. To be used with the standard swingall.jar from Sun. Putting this archive in your MRJClasses folder, it will force the use of the hacked classes instead of the original Swing classes (only for the modified). Be careful, do not change the name. MRJ load them in order by name, so the hacked classes will be loaded before the swingall.jar and any other jar in your project folder. - SwingSet.jar & SwingSet the SwingSet example modified for the MacOS L&F and for the swing.properties file - * src source code folders (for SwingSet, Swing and MacOS L&F). - Swing.properties usage how to use the swing.properties file included in "put in MRJ Libraries/lib" ---------- Instructions ----------------- To see the example included (SwingSet): 1) drag the swing.properties file contained in the folder "put in MRJ Libraries/lib" in System Folder:Extensions:MRJ Libraries:lib this will let's now to the swing which L&F are availables. Attention: the mac.jar is no more included in the distribution. The original one is available from the Swing connection (www.TheSwingConnection.com) or you may pick up one from the old Java on Mac page. Put the mac.jar in the same folder of the SwingSet application to have it available (you need to add it in the swing.properties file and in the JBound swingset application). 2) double click the SwingSet JBound application to start. The MacOS look and feel works only on the Macintosh with MRJ 2.1 or later. You need also a patched swingall.jar archive included in this distribution. The MacOS L&F don't work whitout. To use the MacOS L&F you should have the swingall.jar and the macos.jar files in your classpath (use a JBound application builded with JBindery or put them in the MRJClasses folder). In your source code you should put a line like: try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.macos.MacOSLookAndFeel"); } catch (Exception exc) { System.err.println("Error loading L&F: " + exc); } at the beginning of your program or applet, to use this look and feel. Or have a look in the SwingSet example on how to switch between different L&Fs using the swing.properties file definitions (you don't need any more to change your source code to add a new L&F). Also: If you need more than one menuBar per Frame (like in the SwingSet example) I added a trick. One menuBar is the principal (by default) and for the others you must set that are non principal using the command: JMenuBar asecondMenuBar = new JMenuBar(); asecondMenuBar.setPrincipalMenuBar(false); Look at the SwingSet example for more. If you add to the menuBar a Menu with the text starting with "Help", like: new JMenu("Help"); the MacOS L&F will put this menu in the Mac help menu. You will not get two help menus. About the SwingSet example included: it's not the original one from the Swing team. This example has the MacOS L&F as the starting L&F. ------------ Principal features -------------- This L&F was derived by the Mac L&F from the Swing Team Components modified: - progressBar - tabPanel (it supports now also tabs placed on the left, right and bottom). - default button - textFields - comboBox - Some borders - FileChooser Components added: - a real Mac menuBar on top of the screen including CheckBox and RadioButtons. - support for Mac OS appearance (theme colors, smart scrolling....) Version 0.28 - Corrected another bug in the MacOSTreeUI; some icons changed for a better look. - Hacked again the swingall.jar to permit the use of 'alt'+key characters. Will works only for the MacOS, unchanged for the other L&Fs. Version 0.27 - Corrected a bug in the MacOSTreeUI causing incorrect mouse event behaviour and another not checking properly null pointer for icons (thanks to David Hobley). Version 0.26 - Corrected a bug that was using the JMenuItem.getText() as return action command instead of the correct actionCommand string. - The doublearrows separation line now is visible. Version 0.25 - Corrected a bug preventing it to work on Mac OS version prior to 8.5. Version 0.24 - Recompiled for the Swing version 1.1.1 final - The MacOS L&F now recognise if the arrows are both at one end in the ScrollBar (only when the MacOS L&F is loaded the first time by the application and MacOS 8.5 or later). There is a cosmetic bug preventing to see the separation black line between the arrows. Also the thumb is proportional in this case. - Mnemonics are translated to use the apple (command) button instead of the ctrl button as modifier. Version 0.23 - Waiting for the next Swing release...... - Corrected bug in the JFileChooser causing a wrong creation of the directory tree in the first appearance of the MacOS filechooser. - Corrected a bug causing the disappearing of some JSeparators. - Now the command action in the Menu is not altered and constrained to the menu label. Version 0.22 - Swing 1.1.1 beta2 compatible. - JScrollPane have a Mac border. Version 0.21 - More Icons in the iconFactory (David Himelright) for speed improvement and appearance support. Arrows in the JTree, RadioButtons. - SplitPanel support when the panels don't have a border (added a bump by Michael Heuer). This is at the moment a very quick hack with direct cut-n-paste from the MetalL&F. - SpliPanel bumper in MacOS frameBar style (it's an acceptable style?). - Added TreeNode and TreeLeaf Icons to the IconFactory (LL). Now the selected node and leaf change color. Due to a bug in the MRJ the Node Icon (a folder icon) is not represented correctly (some white spots). - JFileChooser fixed. Missing support to show only visible files, the eject button and the filter comboBox. Filtering is only extension based. ------------ Know issues -------------- - Icons not supported (not visibles) in the menuBar - In the menuBar Alt, Cmd and Ctrl KeyEvents are translated in the Mac Option Key modifier. The Shift is supported as an addition to the modifiers. - All the modifiers and icons are supported and not translated if the menuBar is bounded to the frame (using jmenubar.setPrincipalMenuBar(false);); but in this case the jmenubar will appear in the frame and not on top of the screen. - The creation of Menu and MenuItems cause the creation of some listener. Thus the modification of some menu Component properties may cause the generation of some Events. It is adviced to add the listener for menu actions after the setting of the Menu Components has finished (it's a good programming practice in any case). - Don't work with the standard swingall.jar. To run it you need the patched swingall.jar distributed with the macos.jar; this file contains also some provisory fixing of bugs causing wrong behaviour in the MacOS L&F. The MacOS L&F is the system L&F for the Mac. - Radiobuttons and checkBoxes don't have the final appearance but the old Mac style. When icons will be supported also the appearance will be the one for the MacOS. -------------------------------------- Send bugs or suggestions to: Luca.Lutterotti@ing.unitn.it