Commit a0ea8550 by Michael Koch Committed by Michael Koch

Timer.java, [...]: New versions from classpath.

2003-06-24  Michael Koch  <konqueror@gmx.de>

	* javax/swing/Timer.java,
	javax/swing/plaf/ActionMapUIResource.java,
	javax/swing/plaf/ButtonUI.java,
	javax/swing/plaf/ColorChooserUI.java,
	javax/swing/plaf/ColorUIResource.java,
	javax/swing/plaf/ComboBoxUI.java,
	javax/swing/plaf/ComponentInputMapUIResource.java,
	javax/swing/plaf/basic/BasicBorders.java:
	New versions from classpath.
	* javax/swing/plaf/basic/BasicSplitPaneDivider.java.
	javax/swing/plaf/basic/BasicSplitPaneUI.java:
	New file from classpath.
	* javax/swing/plaf/basic/doc-files/BasicBorders-1.png,
	javax/swing/plaf/basic/doc-files/BasicBorders-2.png,
	javax/swing/plaf/basic/doc-files/BasicBorders.FieldBorder-1.png,
	javax/swing/plaf/doc-files/ComponentUI-1.dia,
	javax/swing/plaf/doc-files/ComponentUI-1.png:
	New binary files from classpath.

From-SVN: r68409
parent 20afd475
2003-06-24 Michael Koch <konqueror@gmx.de>
* javax/swing/Timer.java,
javax/swing/plaf/ActionMapUIResource.java,
javax/swing/plaf/ButtonUI.java,
javax/swing/plaf/ColorChooserUI.java,
javax/swing/plaf/ColorUIResource.java,
javax/swing/plaf/ComboBoxUI.java,
javax/swing/plaf/ComponentInputMapUIResource.java,
javax/swing/plaf/basic/BasicBorders.java:
New versions from classpath.
* javax/swing/plaf/basic/BasicSplitPaneDivider.java.
javax/swing/plaf/basic/BasicSplitPaneUI.java:
New file from classpath.
* javax/swing/plaf/basic/doc-files/BasicBorders-1.png,
javax/swing/plaf/basic/doc-files/BasicBorders-2.png,
javax/swing/plaf/basic/doc-files/BasicBorders.FieldBorder-1.png,
javax/swing/plaf/doc-files/ComponentUI-1.dia,
javax/swing/plaf/doc-files/ComponentUI-1.png:
New binary files from classpath.
2003-06-24 Michael Koch <konqueror@gmx.de>
* java/io/LineNumberReader.java
(skip): Dont do line number accounting here as this is already done in
read(), simplified.
......
......@@ -47,12 +47,13 @@ import javax.swing.event.EventListenerList;
public class Timer implements Serializable
{
protected EventListenerList listenerList = new EventListenerList();
int ticks;
static boolean verbose;
boolean running;
boolean repeat_ticks = true;
long interval, init_delay;
Vector actions = new Vector();
class Waker extends Thread
{
......@@ -86,23 +87,44 @@ public class Timer implements Serializable
public void addActionListener(ActionListener listener)
{
actions.addElement(listener);
listenerList.add (ActionListener.class, listener);
}
public void removeActionListener(ActionListener listener)
{
actions.removeElement(listener);
listenerList.remove (ActionListener.class, listener);
}
/**
* @since 1.3
*/
public EventListener[] getListeners (Class listenerType)
{
return listenerList.getListeners (listenerType);
}
/**
* @since 1.4
*/
public ActionListener[] getActionListeners ()
{
return (ActionListener[]) listenerList.getListeners (ActionListener.class);
}
void fireActionPerformed()
protected void fireActionPerformed (ActionEvent event)
{
for (int i=0;i<actions.size();i++)
ActionListener[] listeners = getActionListeners();
for (int i = 0; i < listeners.length; i++)
{
ActionListener a = (ActionListener) actions.elementAt(i);
a.actionPerformed(new ActionEvent(this, ticks, "Timer"));
listeners [i].actionPerformed (event);
}
}
void fireActionPerformed ()
{
fireActionPerformed (new ActionEvent (this, ticks, "Timer"));
}
public static void setLogTimers(boolean flag)
{
......
/* ActionMapUIResource.java --
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -37,26 +37,28 @@ exception statement from your version. */
package javax.swing.plaf;
// Imports
import javax.swing.*;
import javax.swing.ActionMap;
/**
* ActionMapUIResource
* @author Andrew Selkirk
* @version 1.0
* An <code>ActionMap</code> that implements the {@link UIResource}
* interface to indicate that it belongs to a pluggable
* LookAndFeel.
*
* @see javax.swing.ActionMap
*
* @author Andrew Selkirk
* @author Sascha Brawer (brawer@dandelis.ch)
*/
public class ActionMapUIResource extends ActionMap implements UIResource {
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor ActionMapUIResource
*/
public ActionMapUIResource() {
// TODO
} // ActionMapUIResource()
} // ActionMapUIResource
public class ActionMapUIResource
extends ActionMap
implements UIResource
{
/**
* Constructs a new ActionMapUIResource.
*/
public ActionMapUIResource()
{
/* The constructor does nothing. */
}
}
/* ButtonUI.java
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -38,6 +38,15 @@ exception statement from your version. */
package javax.swing.plaf;
public class ButtonUI extends ComponentUI
/**
* An abstract base class for delegates that implement the pluggable
* look and feel for a <code>JButton</code>.
*
* @see javax.swing.JButton
*
* @author Sascha Brawer (brawer@dandelis.ch)
*/
public abstract class ButtonUI
extends ComponentUI
{
}
/* ColorChooserUI.java --
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -38,22 +38,23 @@ exception statement from your version. */
package javax.swing.plaf;
/**
* ColorChooserUI
* @author Andrew Selkirk
* @version 1.0
* An abstract base class for delegates that implement the pluggable
* look and feel for a <code>JColorChooser</code>.
*
* @see javax.swing.JColorChooser
*
* @author Andrew Selkirk
* @author Sascha Brawer (brawer@dandelis.ch)
*/
public abstract class ColorChooserUI extends ComponentUI {
public abstract class ColorChooserUI
extends ComponentUI
{
/**
* Constructs a ColorChooserUI.
*/
public ColorChooserUI()
{
/* The constructor does not do anything. */
}
}
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor ColorChooserUI
*/
public ColorChooserUI() {
// TODO
} // ColorChooserUI()
} // ColorChooserUI
/* ColorUIResource.java
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -37,26 +37,78 @@ exception statement from your version. */
package javax.swing.plaf;
import java.awt.Color;
/**
* STUBBED
* A Color that is marked as <code>UIResource</code>, which indicates that
* the color has been installed by a pluggable LookAndFeel. Such colors
* are replaced when the LookAndFeel changes.
*
* @see java.awt.Color
*
* @author Sascha Brawer (brawer@dandelis.ch)
*/
public class ColorUIResource extends Color implements UIResource
public class ColorUIResource
extends Color
implements UIResource
{
public ColorUIResource(Color c)
/**
* Constructs a <code>ColorUIResource</code> using the specified
* red, green, and blue values, which must be given as integers in
* the range of 0-255. The alpha channel value will default to 255,
* meaning that the color is fully opaque.
*
* @param r the red intensity, which must be in the range [0 .. 255].
* @param g the green intensity, which must be in the range [0 .. 255].
* @param b the blue intensity, which must be in the range [0 .. 255].
*/
public ColorUIResource(int r, int g, int b)
{
super(c.getRGB());
super(r, g, b);
}
public ColorUIResource(float r, float g, float b)
/**
* Consructs a <code>ColorUIResource</code> using the specified
* RGB value. The blue value is in bits 0-7, green in bits 8-15, and
* red in bits 16-23. The other bits are ignored. The alpha value is set
* to 255, meaning that the color is fully opaque.
*
* @param rgb the rgb value, as discussed above.
*/
public ColorUIResource(int rgb)
{
super(r, g, b, 1.0f);
super(rgb);
}
public ColorUIResource(int rgb)
/**
* Constructs a <code>ColorUIResource</code> using the specified
* red, green, and blue intensities, which must be given as floats in
* the range of 0-1. The alpha channel value will default to 1.0f,
* meaning that the color is fully opaque.
*
* @param r the red intensity, which must be in the range [0.0 .. 1.0].
* @param g the green intensity, which must be in the range [0.0 .. 1.0].
* @param b the blue intensity, which must be in the range [0.0 .. 1.0].
*/
public ColorUIResource(float r, float g, float b)
{
super(rgb, false);
super(r, g, b);
}
public ColorUIResource(int r, int g, int b)
/**
* Constructs a <code>ColorUIResource</code>, using the intensities
* of another color.
*
* @param c the color whose intensities will be considered when
* constructing this <code>ColorUIResource</code>.
*/
public ColorUIResource(Color c)
{
super(r, g, b, 255);
super(c.getRGB());
}
} // class ColorUIResource
}
......@@ -37,52 +37,60 @@ exception statement from your version. */
package javax.swing.plaf;
// Imports
import javax.swing.*;
import javax.swing.JComboBox;
/**
* ComboBoxUI
* @author Andrew Selkirk
* @version 1.0
* An abstract base class for delegates that implement the pluggable
* look and feel for a <code>JButton</code>.
*
* @see javax.swing.JComboBox
*
* @author Andrew Selkirk
* @author Sascha Brawer (brawer@dandelis.ch)
*/
public abstract class ComboBoxUI extends ComponentUI {
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor ComboBoxUI
*/
public ComboBoxUI() {
// TODO
} // ComboBoxUI()
//-------------------------------------------------------------
// Methods ----------------------------------------------------
//-------------------------------------------------------------
/**
* setPopupVisible
* @param combobox TODO
* @param visible TODO
*/
public abstract void setPopupVisible(JComboBox combobox, boolean visible);
/**
* isPopupVisible
* @param combobox TODO
* @returns boolean
*/
public abstract boolean isPopupVisible(JComboBox combobox);
/**
* isFocusTraversable
* @param combobox TODO
* @returns boolean
*/
public abstract boolean isFocusTraversable(JComboBox combobox);
} // ComboBoxUI
public abstract class ComboBoxUI
extends ComponentUI
{
/**
* Constructs a new <code>ComboBoxUI</code>.
*/
public ComboBoxUI()
{
}
/**
* Sets the visibility of the popup button.
*
* @param c the <code>JComboBox</code> whose popup
* is shown or hidden.
*
* @param visible <code>true</code> to show the popup, <code>false</code>
* to hide it.
*/
public abstract void setPopupVisible(JComboBox c, boolean visible);
/**
* Determines whether the popup button is currently visible.
*
* @param c the <code>JComboBox</code> whose popup visibility
* is retrieved.
*
* @return <code>true</code> if the popup button is currently
* visible, <code>false</code> otherwise.
*/
public abstract boolean isPopupVisible(JComboBox c);
/**
* Determines whether the combo box can receive input focus.
*
* @param c <code>JComboBox</code> whose focus traversability
* is to be retrieved.
*
* @returns <code>true</code> if <code>c</code> can receive
* input focus, <code>false</code> otherwise.
*/
public abstract boolean isFocusTraversable(JComboBox c);
}
/* ComponentInputMapUIResource.java --
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -37,28 +37,34 @@ exception statement from your version. */
package javax.swing.plaf;
// Imports
import javax.swing.*;
import javax.swing.ComponentInputMap;
import javax.swing.JComponent;
/**
* ComponentInputMapUIResource
* @author Andrew Selkirk
* @version 1.0
* A <code>ComponentInputMap</code> that implements the {@link UIResource}
* interface to indicate that it belongs to a pluggable
* LookAndFeel.
*
* @see javax.swing.ComponentInputMap
* @see javax.swing.InputMap
*
* @author Andrew Selkirk
* @author Sascha Brawer (brawer@dandelis.ch)
*/
public class ComponentInputMapUIResource extends ComponentInputMap implements UIResource {
//-------------------------------------------------------------
// Initialization ---------------------------------------------
//-------------------------------------------------------------
/**
* Constructor ComponentInputMapUIResource
* @param component TODO
*/
public ComponentInputMapUIResource(JComponent component) {
super(component);
// TODO
} // ComponentInputMapUIResource()
public class ComponentInputMapUIResource
extends ComponentInputMap
implements UIResource
{
/**
* Constructs a new <code>ComponentInputMapUIResource</code>.
*
* @param component the <code>JComponent</code> associated with
* this <code>InputMap</code>.
*/
public ComponentInputMapUIResource(JComponent component)
{
super(component);
}
}
} // ComponentInputMapUIResource
/* BasicSplitPaneUI.java
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.swing.plaf.basic;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.event.ActionListener;
import java.awt.event.FocusListener;
import java.beans.PropertyChangeListener;
import javax.swing.JComponent;
import javax.swing.JSplitPane;
import javax.swing.KeyStroke;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.SplitPaneUI;
/**
* FIXME: Stubbed to allow compiling other classes,
* no real implementation.
*/
public class BasicSplitPaneUI
extends SplitPaneUI
{
protected static final String NON_CONTINUOUS_DIVIDER
= "nonContinuousDivider";
protected static int KEYBOARD_DIVIDER_MOVE_OFFSET;
protected JSplitPane splitPane;
protected BasicSplitPaneDivider divider;
protected PropertyChangeListener propertyChangeListener;
protected FocusListener focusListener;
protected int dividerSize;
protected Component nonContinuousLayoutDivider;
protected boolean draggingHW;
protected int beginDragDividerLocation;
protected KeyStroke upKey;
protected KeyStroke downKey;
protected KeyStroke leftKey;
protected KeyStroke rightKey;
protected KeyStroke homeKey;
protected KeyStroke endKey;
protected KeyStroke dividerResizeToggleKey;
protected ActionListener keyboardUpLeftListener;
protected ActionListener keyboardDownRightListener;
protected ActionListener keyboardHomeListener;
protected ActionListener keyboardEndListener;
protected ActionListener keyboardResizeToggleListener;
public static ComponentUI createUI(JComponent c)
{
BasicSplitPaneUI newUI;
newUI = new BasicSplitPaneUI();
newUI.installUI(c);
return newUI;
}
public BasicSplitPaneUI()
{
propertyChangeListener = createPropertyChangeListener();
focusListener = createFocusListener();
}
public void installUI(JComponent c)
{
}
protected void installDefaults()
{
}
protected void installListeners()
{
}
protected void installKeyboardListeners()
{
}
protected void installKeyboardActions()
{
}
public void uninstallUI(JComponent c)
{
}
protected void uninstallDefaults()
{
}
protected void uninstallListeners()
{
}
protected void uninstallKeyboardActions()
{
}
protected PropertyChangeListener createPropertyChangeListener()
{
return null;
}
protected FocusListener createFocusListener()
{
return null;
}
protected ActionListener createKeyboardUpLeftListener()
{
return null;
}
protected ActionListener createKeyboardDownRightListener()
{
return null;
}
protected ActionListener createKeyboardHomeListener()
{
return null;
}
protected ActionListener createKeyboardEndListener()
{
return null;
}
protected ActionListener createKeyboardResizeToggleListener()
{
return null;
}
public int getOrientation()
{
return splitPane.getOrientation();
}
public void setOrientation(int orientation)
{
}
public boolean isContinuousLayout()
{
return false;
}
public void setContinuousLayout(boolean b)
{
}
public int getLastDragLocation()
{
return 0;
}
public void setLastDragLocation(int l)
{
}
public BasicSplitPaneDivider getDivider()
{
return divider;
}
protected Component createDefaultNonContinuousLayoutDivider()
{
return null;
}
protected void setNonContinuousLayoutDivider(Component newDivider)
{
setNonContinuousLayoutDivider(newDivider, true /* false? */);
}
protected void setNonContinuousLayoutDivider(Component newDivider,
boolean rememberSizes)
{
nonContinuousLayoutDivider = newDivider;
}
public Component getNonContinuousLayoutDivider()
{
return nonContinuousLayoutDivider;
}
public JSplitPane getSplitPane()
{
return splitPane;
}
public BasicSplitPaneDivider createDefaultDivider()
{
return null;
}
public void resetToPreferredSizes(JSplitPane jc)
{
}
public void setDividerLocation(JSplitPane jc, int location)
{
}
public int getDividerLocation(JSplitPane jc)
{
return 0;
}
public int getMinimumDividerLocation(JSplitPane jc)
{
return 0;
}
public int getMaximumDividerLocation(JSplitPane jc)
{
return 0;
}
public void finishedPaintingChildren(JSplitPane jc, Graphics g)
{
}
public void paint(Graphics g, JComponent jc)
{
}
public Dimension getPreferredSize(JComponent jc)
{
return null;
}
public Dimension getMinimumSize(JComponent jc)
{
return null;
}
public Dimension getMaximumSize(JComponent jc)
{
return null;
}
public Insets getInsets(JComponent jc)
{
return new Insets(0, 0, 0, 0);
}
protected void resetLayoutManager()
{
}
protected void startDragging()
{
}
protected void dragDividerTo(int location)
{
}
protected void finishDraggingTo(int location)
{
}
protected int getDividerBorderSize()
{
return 0;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment