RE: Java Runtime Matrix for UserLinux
Hi Robert, if you can submit me a small paragraph describing JamVM, I'll add it to the link list on the Classpath site. -Patrik --On Montag, 5. Januar 2004 05:30 + Robert Lougher <[EMAIL PROTECTED]> wrote: Hi, Sorry for the empty post - first day back into work tomorrow :) What I meant to say: Any reasons for missing out JamVM (http::/jamvm.sourceforge.net)? It's been using Classpath since 1.0.0 (12-Mar-2003). Quite a few people are using it successfully, and I think a number of people on this list have given it a test. Thanks, Rob. Original Message Follows From: Dalibor Topic <[EMAIL PROTECTED]> To: GNU Classpath <[EMAIL PROTECTED]> Subject: Java Runtime Matrix for UserLinux Date: Sun, 04 Jan 2004 20:40:28 +0100 Hi all, I've started a java runtime matrix in the UserLinux wiki, that will serve as the foundation for their decision which runtime to pick. So if you feel like having your runtime as the default java runtime in UserLinux, please consider filling in the blanks for your project. If you don't please remove it from the matrix. You can find the matrix here: http://cgi.userlinux.com/cgi-bin/wiki.pl?Java_Runtime_Matrix cheers, dalibor topic ___ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath _ Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo ___ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath Patrik Reali http://www.reali.ch/~patrik/ ___ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath
[PATCH] fixes to swing button implementation
hi, this patch implements JButton as near as I can tell "correctly" -- that is, moving full responsibility for event handling and painting into the plaf, teaching the model about properties and listeners, delegating state from the component to the model, following the spec for state transitions in the model, etc. it also includes some small changes to rendering the button. ok to commit? -graydon 2004-01-06 Graydon Hoare <[EMAIL PROTECTED]> * javax/swing/AbstractButton.java: Re-implement most of class. * javax/swing/DefaultButtonModel.java: Likewise. * javax/swing/BasicButtonUI.java: Likewise. * javax/swing/plaf/basic/BasicGraphicsUtils.java (getPreferredButtonSize): Incorporate margins into button size. Index: javax/swing/AbstractButton.java === RCS file: /cvs/gcc/gcc/libjava/javax/swing/AbstractButton.java,v retrieving revision 1.3 diff -u -b -w -r1.3 AbstractButton.java --- javax/swing/AbstractButton.java 14 Jul 2003 05:33:30 - 1.3 +++ javax/swing/AbstractButton.java 6 Jan 2004 20:04:32 - @@ -38,6 +38,8 @@ package javax.swing; +import java.awt.AWTEventMulticaster; +import java.awt.AWTEvent; import java.awt.Graphics; import java.awt.Image; import java.awt.Insets; @@ -62,12 +64,16 @@ import javax.swing.event.ChangeListener; import javax.swing.plaf.ButtonUI; import javax.swing.text.AttributeSet; +import java.util.Vector; +import java.io.Serializable; /** * Provides basic button functionality * * @author Ronald Veldema ([EMAIL PROTECTED]) + * @author Graydon Hoare ([EMAIL PROTECTED]) */ + public abstract class AbstractButton extends JComponent implements ItemSelectable, SwingConstants { @@ -85,7 +91,31 @@ ButtonModel model; Insets margin; + ActionListener actionListener; + ItemListener itemListener; + + // ChangeEvents are not AWTEvents, can't use multicaster + Vector changeListeners = new Vector (); + + public static final String BORDER_PAINTED_CHANGED_PROPERTY = "borderPainted"; + public static final String CONTENT_AREA_FILLED_CHANGED_PROPERTY = "contentAreaFilled"; + public static final String DISABLED_ICON_CHANGED_PROPERTY = "disabledIcon"; + public static final String DISABLED_SELECTED_ICON_CHANGED_PROPERTY = "disabledSelectedIcon"; public static final String FOCUS_PAINTED_CHANGED_PROPERTY = "focusPainted"; + public static final String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY = "horizontalAlignment"; + public static final String HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY = "horizontalTextPosition"; + public static final String ICON_CHANGED_PROPERTY = "icon"; + public static final String MARGIN_CHANGED_PROPERTY = "margin"; + public static final String MNEMONIC_CHANGED_PROPERTY = "mnemonic"; + public static final String MODEL_CHANGED_PROPERTY = "model"; + public static final String PRESSED_ICON_CHANGED_PROPERTY = "pressedIcon"; + public static final String ROLLOVER_ENABLED_CHANGED_PROPERTY = "rolloverEnabled"; + public static final String ROLLOVER_ICON_CHANGED_PROPERTY = "rolloverIcon"; + public static final String ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY = "rolloverSelectedIcon"; + public static final String SELECTED_ICON_CHANGED_PROPERTY = "selectedIcon"; + public static final String TEXT_CHANGED_PROPERTY = "text"; + public static final String VERTICAL_ALIGNMENT_CHANGED_PROPERTY = "verticalAlignment"; + public static final String VERTICAL_TEXT_POSITION_CHANGED_PROPERTY = "verticalTextPosition"; /** * AccessibleAbstractButton @@ -340,7 +370,6 @@ { c.getModel().setArmed(false); - System.out.println("LOST FOCUS"); if (c.isFocusPainted()) { c.repaint(); @@ -348,7 +377,6 @@ } public void focusGained(FocusEvent event) { - System.out.println("GAIN FOCUS"); } } @@ -369,6 +397,9 @@ addFocusListener( new JFocusListener(this) ); setModel(new DefaultButtonModel(this)); +model.addActionListener (new ButtonActionListener ()); +model.addChangeListener (new ButtonChangeListener ()); +model.addItemListener (new ButtonItemListener ()); updateUI(); // get a proper ui } @@ -386,156 +417,295 @@ { getModel().setActionCommand(aCommand); } public void addActionListener(ActionListener l) - {getModel().addActionListener(l);} +{ + actionListener = AWTEventMulticaster.add (actionListener, l); + if (actionListener != null) + enableEvents (AWTEvent.ACTION_EVENT_MASK); +} public void removeActionListener(ActionListener l) - {getModel().removeActionListener(l);} - - public void addChangeListener(ChangeListener l) - { getModel().addChangeListener(l); } - - public void removeChangeListener(ChangeListener l) - { getModel().removeChangeListener(l);} +{ + actionListener = AWTEventMulticaster.remove (actionListener, l); +}
Re: [PATCH] fixes to swing button implementation
graydon hoare <[EMAIL PROTECTED]> wrote on Tue, 6 Jan 2004 15:05:53 -0500: >+ // ChangeEvents are not AWTEvents, can't use multicaster >+ Vector changeListeners = new Vector (); Using Vector means a lot of synchronization operations. java.util.ArrayList/LinkedList are not synchronized, which makes their usage more efficient. But probably, it would best tp use javax.swing.event.EventListenerList here (which, by coincidence, became functional this afternoon...). See the Javadoc in Classpath for how to use it efficiently. Or, for a more concrete example of its use, have a look at the method javax.swing.DefaultBoundedRangeModel.fireStateChanged. A general stylistic question: foo ().bar (baz) or foo().bar(baz)? AbstractButton.getMargin(): I'm not sure whether or not it should return a clone of the internal Insets object... A simple Mauve testcase could check for this. >Index: javax/swing/DefaultButtonModel.java >=== >+ActionListener actionListener; >+ItemListener itemListener; >+ >+// ChangeEvents are not AWTEvents >+Vector changeListeners = new Vector (); See above: it probably would be advisable to use javax.swing.event.EventListenerList instead of Vector. >+boolean armed = false; >+boolean enabled = true; >+boolean pressed = false; >+boolean rolledOver = false; >+boolean selected = false; >+int mnemonic; >+String actionCommand; Weird. From looking at the J2SE 1.4.2 API specification, I would expect: protected int stateMask; // e.g. ARMED | SELECTED protected int mnemonic; protected String actionCommand; >Index: javax/swing/plaf/basic/BasicButtonUI.java >=== > public void installUI(final JComponent c) > { > super.installUI(c); >@@ -68,6 +124,12 @@ > pressedBackgroundColor = new Color(150,150,150); > pressedBackgroundColor = new Color(150,150,150); > normalBackgroundColor= new Color(192,192,192); It seems strange that these colors are hard-coded. Shouldn't they come from the UIManager? A final comment: Please, please, please write documentation and Mauve test cases. With javax.swing.DefaultBoundedRangeModel, I've just made the experience myself how immensely useful this is for finding bugs, and for making sure that changes don't break things. A part from this, IMHO the code look good. Best regards, -- Sascha Sascha Brawer, [EMAIL PROTECTED], http://www.dandelis.ch/people/brawer/ ___ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath
Re: [PATCH] fixes to swing button implementation
On Tue, Jan 06, 2004 at 10:17:04PM +0100, Sascha Brawer wrote: > graydon hoare <[EMAIL PROTECTED]> wrote on Tue, 6 Jan 2004 15:05:53 -0500: > > >+ // ChangeEvents are not AWTEvents, can't use multicaster > >+ Vector changeListeners = new Vector (); > > Using Vector means a lot of synchronization operations. > java.util.ArrayList/LinkedList are not synchronized, which makes their > usage more efficient. But probably, it would best tp use > javax.swing.event.EventListenerList here (which, by coincidence, became > functional this afternoon...). See the Javadoc in Classpath for how to > use it efficiently. Or, for a more concrete example of its use, have a > look at the method javax.swing.DefaultBoundedRangeModel.fireStateChanged. > > A general stylistic question: foo ().bar (baz) or foo().bar(baz)? > > AbstractButton.getMargin(): I'm not sure whether or not it should return > a clone of the internal Insets object... A simple Mauve testcase could > check for this. > > >Index: javax/swing/DefaultButtonModel.java > >=== > >+ActionListener actionListener; > >+ItemListener itemListener; > >+ > >+// ChangeEvents are not AWTEvents > >+Vector changeListeners = new Vector (); > > See above: it probably would be advisable to use > javax.swing.event.EventListenerList instead of Vector. The EventListenerList stuff is already on my disc since some time for most JContainer subclasses. I said graydon not to do it. Michael ___ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath
Re: Patch: merge GTK peers from libgcj to Classpath
> "Tom" == Thomas Fitzsimmons <[EMAIL PROTECTED]> writes: Tom> This patch merges into Classpath the improvements made to libgcj's GTK Tom> peers since the savannah break-in. Tom> OK to commit? Yeah. The general rule, as I understand it, is if something has gone through libgcj patch review then it is ok for Classpath. (The exceptions being code which is purposely not merged between the two, but there isn't much of this.) Tom ___ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath
FOSDEM talk about SableVM
Hi Mark and everybody, I am attaching *introduction* (not an abstract, at least not this time) to the talk I am going to give at FOSDEM [*] in Debian/Free Java room. This may or may not make it into some prospective web page for Java room - so it's just to give you idea what's in store. Beware - the real meat begins near the end of this introduction :-) Cheers, Grzegorz B. Prokopski [*] http://www.fosdem.org/ 21-22 Feb 2004, Brussels Belgium PS: Crossposting to SableVM ML for obvious reasons, to GNU CP as the forum where Java room at FOSDEM was actively discussed and to debian-java, as we're to share room with Debian people (huh, I'll have to share room with myself! ;-) and apparently the areas of interest actually overlap. -- Grzegorz B. Prokopski <[EMAIL PROTECTED]> Debian GNU/Linux http://www.debian.org SableVM - LGPLed JVM http://www.sablevm.org Title: "SableVM - the Apache of Java Virtual Machines" Recommended background: basic knowledge of Java and C. = = = - - - Introduction to the talk - - - = = = SableVM is a robust and efficient Free (LGPL) Java Virtual Machine. SableVM started - like many other free JVMs - as an academic research project. But unlike almost every such project - the goal was NOT fixed on some specific subset of Java features, instead - SableVM has been designed from ground up as a *complete* Java Virtual Machine, with number of other robustness and maintainability features, and with desired lifetime greatly exceeding inital author's academic goal. Today SableVM and its design are already proven to be outstanding in many fields, like ex. portability - where medium time spent on port to a completly new architecture is proven to be less than an hour, or performance of its highly portable interpreter (written in plain C) comparable with handwritten assembly-using, hardly-portable interpreters. Probably a strong evidence of SableVM (now Project) vitality is that it will soon feature SableJIT - a easily-retargettable Just In Time compiler, written by different person than the initial author. Also during the last year a number of people have contributed to SableVM and we hope this trend to incrase. On the Free Software side - Project priorities and features are exactly what one would love to be the case: the codebase is absolutely clean, we're able and willing to offer repository write access to every contributor, we release all our code under very permissive license (LGPL), we're of course glad to help any new contributor grasp our code quickly (which isn't anywhere near "hard"), we perceive close collaboration with other Free Software projects (like GNU Classpath) as high-priority, we also have all possible helpful project infrastructure one could imagine. The SableVM codebase has many interesting features and implements many advanced techniques. These features and techniques are often very unique, or they justmake your life (as user or developer) much easier: m4 macros one can use without m4 knowlege while preserving C syntax (and thus ex. highlighting), inlined engine (a compiler w/o a compiler one could say), portable JIT, moving garbage collector ability (yes, with JNI!), close integration with current GNU Classpath versions, Java Invocation Interface, ... That's where the real story begins... +---+ | For more informations see:| | * http://www.sablevm.org | | * http://devel.sablevm.org/wiki/WhySableVM| +---+ Speaker: Grzegorz B. Prokopski <[EMAIL PROTECTED]> is an active Free Software contributor and advocate. As Debian Developer he initially packaged SableVM and ported it to a number of platforms. Lately, SableVM became his main interest area, as a central piece of his Ph.D. research project. ___ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath