2004-03-19 Michael Koch <konqueror@gmx.de>

* java/awt/image/AffineTransformOp.java
	(AffineTransformOp): Made public.
	* javax/swing/JComponent.java
	(listenerList): Made protected.
	(accessibleContext): Likewise.
	* javax/swing/JList.java
	(valueChanged): Dont use internal fields of ListSelectionEvent.
	* javax/swing/JViewport.java
	(getView): Dont use internal fields of Component.
	(addImpl): Likewise.
	* javax/swing/Timer.java
	(isRunning): Made public.
	(start): Likewise.
	(stop): Likewise.
	* javax/swing/UIDefaults.java
	(getInt): Made public.
	* javax/swing/plaf/basic/BasicListUI.java
	(mousePressed): Dont use internal fields of MouseEvent.
	(propertyChanged): Dont use internal fields of PropertyChangeEvent.
	* javax/swing/plaf/basic/BasicScrollBarUI.java
	(arrowIcon): Made static.
	* javax/swing/plaf/basic/BasicViewportUI.java
	(stateChanged): Dont use internal field on ChangeEvent.
	* javax/swing/text/JTextComponent.java
	(getUI): Call UIManager.getUI().
	(updateUI): Use getUI().

From-SVN: r79699
This commit is contained in:
Michael Koch 2004-03-19 20:42:39 +00:00 committed by Michael Koch
parent 28f2a26519
commit 9c6637c8d9
11 changed files with 63 additions and 49 deletions

View File

@ -1,3 +1,32 @@
2004-03-19 Michael Koch <konqueror@gmx.de>
* java/awt/image/AffineTransformOp.java
(AffineTransformOp): Made public.
* javax/swing/JComponent.java
(listenerList): Made protected.
(accessibleContext): Likewise.
* javax/swing/JList.java
(valueChanged): Dont use internal fields of ListSelectionEvent.
* javax/swing/JViewport.java
(getView): Dont use internal fields of Component.
(addImpl): Likewise.
* javax/swing/Timer.java
(isRunning): Made public.
(start): Likewise.
(stop): Likewise.
* javax/swing/UIDefaults.java
(getInt): Made public.
* javax/swing/plaf/basic/BasicListUI.java
(mousePressed): Dont use internal fields of MouseEvent.
(propertyChanged): Dont use internal fields of PropertyChangeEvent.
* javax/swing/plaf/basic/BasicScrollBarUI.java
(arrowIcon): Made static.
* javax/swing/plaf/basic/BasicViewportUI.java
(stateChanged): Dont use internal field on ChangeEvent.
* javax/swing/text/JTextComponent.java
(getUI): Call UIManager.getUI().
(updateUI): Use getUI().
2004-03-19 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* verify.cc: Undef PC.

View File

@ -53,14 +53,12 @@ import java.awt.geom.*;
public class AffineTransformOp implements BufferedImageOp, RasterOp
{
public static final int TYPE_BILINEAR = 0;
public static final int TYPE_NEAREST_NEIGHBOR = 1;
private AffineTransform transform;
private RenderingHints hints;
/**
* Construct AffineTransformOp with the given xform and interpolationType.
* Interpolation type can be either TYPE_BILINEAR or TYPE_NEAREST_NEIGHBOR.
@ -68,8 +66,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param xform AffineTransform that will applied to the source image
* @param interpolationType type of interpolation used
*/
AffineTransformOp (AffineTransform xform, int interpolationType)
public AffineTransformOp (AffineTransform xform, int interpolationType)
{
this.transform = xform;
@ -89,8 +86,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param xform AffineTransform that will applied to the source image
* @param hints rendering hints that will be used during transformation
*/
AffineTransformOp (AffineTransform xform, RenderingHints hints)
public AffineTransformOp (AffineTransform xform, RenderingHints hints)
{
this.transform = xform;
this.hints = hints;
@ -107,7 +103,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param destCM color model for the destination image
* @return new compatible destination image
*/
public BufferedImage createCompatibleDestImage (BufferedImage src,
ColorModel destCM)
{
@ -132,7 +127,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @throws RasterFormatException if resulting width or height of raster is 0
* @return new compatible raster
*/
public WritableRaster createCompatibleDestRaster (Raster src)
{
Rectangle rect = (Rectangle) getBounds2D (src);
@ -155,7 +149,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param dst destination image
* @return transformed source image
*/
public BufferedImage filter (BufferedImage src, BufferedImage dst)
{
@ -187,7 +180,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param dst destination raster
* @return transformed raster
*/
public WritableRaster filter (Raster src, WritableRaster dst)
{
throw new UnsupportedOperationException ("not implemented yet");
@ -200,7 +192,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param src image to be transformed
* @return bounds of the transformed image.
*/
public Rectangle2D getBounds2D (BufferedImage src)
{
return getBounds2D (src.getRaster());
@ -212,7 +203,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param src raster to be transformed
* @return bounds of the transformed raster.
*/
public Rectangle2D getBounds2D (Raster src)
{
// determine new size for the transformed raster.
@ -232,7 +222,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
*
* @return interpolation type
*/
public int getInterpolationType ()
{
if(hints.containsValue (RenderingHints.VALUE_INTERPOLATION_BILINEAR))
@ -249,7 +238,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param dstPt destination point
* @return the location of the transformed source point.
*/
public Point2D getPoint2D (Point2D srcPt, Point2D dstPt)
{
return transform.transform (srcPt, dstPt);
@ -259,7 +247,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
*
* @return rendering hints
*/
public RenderingHints getRenderingHints ()
{
return hints;
@ -270,7 +257,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
*
* @return transform
*/
public AffineTransform getTransform ()
{
return transform;

View File

@ -89,12 +89,12 @@ public abstract class JComponent extends Container implements Serializable
{
static final long serialVersionUID = -5242478962609715464L;
EventListenerList listenerList = new EventListenerList();
protected EventListenerList listenerList = new EventListenerList();
/**
* accessibleContext
*/
AccessibleContext accessibleContext;
protected AccessibleContext accessibleContext;
Dimension pref,min,max;
Border border;

View File

@ -293,9 +293,9 @@ public class JList extends JComponent implements Accessible, Scrollable
// ListSelectionListener events
public void valueChanged(ListSelectionEvent event)
{
JList.this.fireSelectionValueChanged(event.firstIndex,
event.lastIndex,
event.isAdjusting);
JList.this.fireSelectionValueChanged(event.getFirstIndex(),
event.getLastIndex(),
event.getValueIsAdjusting());
JList.this.repaint();
}
};

View File

@ -199,10 +199,10 @@ public class JViewport extends JComponent
public Component getView()
{
if (ncomponents > 0)
return component[0];
else
if (getComponentCount() == 0)
return null;
return getComponents()[0];
}
public void setView(Component v)
@ -214,8 +214,9 @@ public class JViewport extends JComponent
public void addImpl(Component comp, Object constraints, int index)
{
if (ncomponents > 0)
remove(component[0]);
if (getComponentCount() > 0)
remove(getComponents()[0]);
super.addImpl(comp, constraints, index);
}

View File

@ -136,7 +136,6 @@ public class Timer implements Serializable
return verbose;
}
public void setDelay(int delay)
{
interval = delay;
@ -147,7 +146,6 @@ public class Timer implements Serializable
return (int)interval;
}
public void setInitialDelay(int initialDelay)
{
init_delay = initialDelay;
@ -158,12 +156,12 @@ public class Timer implements Serializable
repeat_ticks = flag;
}
boolean isRunning()
public boolean isRunning()
{
return running;
}
void start()
public void start()
{
if (isRunning())
{
@ -173,7 +171,7 @@ public class Timer implements Serializable
new Waker().start();
}
void stop()
public void stop()
{
running = false;
}

View File

@ -369,13 +369,13 @@ public class UIDefaults extends Hashtable
return o instanceof String ? (String) o : null;
}
int getInt(Object key)
public int getInt(Object key)
{
Object o = get(key);
return o instanceof Integer ? ((Integer) o).intValue() : 0;
}
int getInt(Object key, Locale l)
public int getInt(Object key, Locale l)
{
Object o = get(key, l);
return o instanceof Integer ? ((Integer) o).intValue() : 0;

View File

@ -190,7 +190,7 @@ public class BasicListUI extends ListUI
public void mousePressed(MouseEvent event)
{
// System.err.println("got mouse click event " + event);
int row = BasicListUI.this.convertYToRow(event.y);
int row = BasicListUI.this.convertYToRow(event.getY());
if (row == -1)
return;
@ -263,13 +263,13 @@ public class BasicListUI extends ListUI
public void propertyChange(PropertyChangeEvent e)
{
// System.err.println(this + ".propertyChange(" + e + ")");
if (e.source == BasicListUI.this.list)
if (e.getSource() == BasicListUI.this.list)
{
if (e.oldValue != null && e.oldValue instanceof ListModel)
((ListModel) e.oldValue).removeListDataListener(BasicListUI.this.listDataListener);
if (e.getOldValue() != null && e.getOldValue() instanceof ListModel)
((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener);
if (e.newValue != null && e.newValue instanceof ListModel)
((ListModel) e.newValue).addListDataListener(BasicListUI.this.listDataListener);
if (e.getNewValue() != null && e.getNewValue() instanceof ListModel)
((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener);
}
BasicListUI.this.damageLayout();
}

View File

@ -472,7 +472,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
* A helper class that allows us to draw icons for
* the JButton.
*/
private class arrowIcon implements Icon
private static class arrowIcon implements Icon
{
/** The polygon that describes the icon. */
private Polygon arrow;

View File

@ -64,7 +64,7 @@ public class BasicViewportUI extends ViewportUI
{
public void stateChanged(ChangeEvent event)
{
JViewport v = (JViewport)event.source;
JViewport v = (JViewport) event.getSource();
v.repaint();
}
}

View File

@ -472,15 +472,15 @@ public abstract class JTextComponent extends JComponent
// Sets the vertical position of the label's text, relative to its image.
}
public TextUI getUI()
{ return (TextUI) ui;
}
public TextUI getUI()
{
return (TextUI) UIManager.getUI(this);
}
public void updateUI()
{
TextUI b = (TextUI)UIManager.getUI(this);
setUI(b);
}
public void updateUI()
{
setUI(getUI());
}
public Dimension getPreferredScrollableViewportSize()
{