Commit 9c6637c8 by Michael Koch Committed by Michael Koch

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
parent 28f2a265
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> 2004-03-19 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* verify.cc: Undef PC. * verify.cc: Undef PC.
......
...@@ -53,14 +53,12 @@ import java.awt.geom.*; ...@@ -53,14 +53,12 @@ import java.awt.geom.*;
public class AffineTransformOp implements BufferedImageOp, RasterOp public class AffineTransformOp implements BufferedImageOp, RasterOp
{ {
public static final int TYPE_BILINEAR = 0; public static final int TYPE_BILINEAR = 0;
public static final int TYPE_NEAREST_NEIGHBOR = 1; public static final int TYPE_NEAREST_NEIGHBOR = 1;
private AffineTransform transform; private AffineTransform transform;
private RenderingHints hints; private RenderingHints hints;
/** /**
* Construct AffineTransformOp with the given xform and interpolationType. * Construct AffineTransformOp with the given xform and interpolationType.
* Interpolation type can be either TYPE_BILINEAR or TYPE_NEAREST_NEIGHBOR. * Interpolation type can be either TYPE_BILINEAR or TYPE_NEAREST_NEIGHBOR.
...@@ -68,8 +66,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -68,8 +66,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param xform AffineTransform that will applied to the source image * @param xform AffineTransform that will applied to the source image
* @param interpolationType type of interpolation used * @param interpolationType type of interpolation used
*/ */
public AffineTransformOp (AffineTransform xform, int interpolationType)
AffineTransformOp (AffineTransform xform, int interpolationType)
{ {
this.transform = xform; this.transform = xform;
...@@ -89,8 +86,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -89,8 +86,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param xform AffineTransform that will applied to the source image * @param xform AffineTransform that will applied to the source image
* @param hints rendering hints that will be used during transformation * @param hints rendering hints that will be used during transformation
*/ */
public AffineTransformOp (AffineTransform xform, RenderingHints hints)
AffineTransformOp (AffineTransform xform, RenderingHints hints)
{ {
this.transform = xform; this.transform = xform;
this.hints = hints; this.hints = hints;
...@@ -107,7 +103,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -107,7 +103,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param destCM color model for the destination image * @param destCM color model for the destination image
* @return new compatible destination image * @return new compatible destination image
*/ */
public BufferedImage createCompatibleDestImage (BufferedImage src, public BufferedImage createCompatibleDestImage (BufferedImage src,
ColorModel destCM) ColorModel destCM)
{ {
...@@ -132,7 +127,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -132,7 +127,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @throws RasterFormatException if resulting width or height of raster is 0 * @throws RasterFormatException if resulting width or height of raster is 0
* @return new compatible raster * @return new compatible raster
*/ */
public WritableRaster createCompatibleDestRaster (Raster src) public WritableRaster createCompatibleDestRaster (Raster src)
{ {
Rectangle rect = (Rectangle) getBounds2D (src); Rectangle rect = (Rectangle) getBounds2D (src);
...@@ -155,7 +149,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -155,7 +149,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param dst destination image * @param dst destination image
* @return transformed source image * @return transformed source image
*/ */
public BufferedImage filter (BufferedImage src, BufferedImage dst) public BufferedImage filter (BufferedImage src, BufferedImage dst)
{ {
...@@ -187,7 +180,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -187,7 +180,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param dst destination raster * @param dst destination raster
* @return transformed raster * @return transformed raster
*/ */
public WritableRaster filter (Raster src, WritableRaster dst) public WritableRaster filter (Raster src, WritableRaster dst)
{ {
throw new UnsupportedOperationException ("not implemented yet"); throw new UnsupportedOperationException ("not implemented yet");
...@@ -200,7 +192,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -200,7 +192,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param src image to be transformed * @param src image to be transformed
* @return bounds of the transformed image. * @return bounds of the transformed image.
*/ */
public Rectangle2D getBounds2D (BufferedImage src) public Rectangle2D getBounds2D (BufferedImage src)
{ {
return getBounds2D (src.getRaster()); return getBounds2D (src.getRaster());
...@@ -212,7 +203,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -212,7 +203,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param src raster to be transformed * @param src raster to be transformed
* @return bounds of the transformed raster. * @return bounds of the transformed raster.
*/ */
public Rectangle2D getBounds2D (Raster src) public Rectangle2D getBounds2D (Raster src)
{ {
// determine new size for the transformed raster. // determine new size for the transformed raster.
...@@ -232,7 +222,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -232,7 +222,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* *
* @return interpolation type * @return interpolation type
*/ */
public int getInterpolationType () public int getInterpolationType ()
{ {
if(hints.containsValue (RenderingHints.VALUE_INTERPOLATION_BILINEAR)) if(hints.containsValue (RenderingHints.VALUE_INTERPOLATION_BILINEAR))
...@@ -249,7 +238,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -249,7 +238,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* @param dstPt destination point * @param dstPt destination point
* @return the location of the transformed source point. * @return the location of the transformed source point.
*/ */
public Point2D getPoint2D (Point2D srcPt, Point2D dstPt) public Point2D getPoint2D (Point2D srcPt, Point2D dstPt)
{ {
return transform.transform (srcPt, dstPt); return transform.transform (srcPt, dstPt);
...@@ -259,7 +247,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -259,7 +247,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* *
* @return rendering hints * @return rendering hints
*/ */
public RenderingHints getRenderingHints () public RenderingHints getRenderingHints ()
{ {
return hints; return hints;
...@@ -270,7 +257,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp ...@@ -270,7 +257,6 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* *
* @return transform * @return transform
*/ */
public AffineTransform getTransform () public AffineTransform getTransform ()
{ {
return transform; return transform;
......
...@@ -89,12 +89,12 @@ public abstract class JComponent extends Container implements Serializable ...@@ -89,12 +89,12 @@ public abstract class JComponent extends Container implements Serializable
{ {
static final long serialVersionUID = -5242478962609715464L; static final long serialVersionUID = -5242478962609715464L;
EventListenerList listenerList = new EventListenerList(); protected EventListenerList listenerList = new EventListenerList();
/** /**
* accessibleContext * accessibleContext
*/ */
AccessibleContext accessibleContext; protected AccessibleContext accessibleContext;
Dimension pref,min,max; Dimension pref,min,max;
Border border; Border border;
......
...@@ -293,9 +293,9 @@ public class JList extends JComponent implements Accessible, Scrollable ...@@ -293,9 +293,9 @@ public class JList extends JComponent implements Accessible, Scrollable
// ListSelectionListener events // ListSelectionListener events
public void valueChanged(ListSelectionEvent event) public void valueChanged(ListSelectionEvent event)
{ {
JList.this.fireSelectionValueChanged(event.firstIndex, JList.this.fireSelectionValueChanged(event.getFirstIndex(),
event.lastIndex, event.getLastIndex(),
event.isAdjusting); event.getValueIsAdjusting());
JList.this.repaint(); JList.this.repaint();
} }
}; };
......
...@@ -199,10 +199,10 @@ public class JViewport extends JComponent ...@@ -199,10 +199,10 @@ public class JViewport extends JComponent
public Component getView() public Component getView()
{ {
if (ncomponents > 0) if (getComponentCount() == 0)
return component[0];
else
return null; return null;
return getComponents()[0];
} }
public void setView(Component v) public void setView(Component v)
...@@ -214,8 +214,9 @@ public class JViewport extends JComponent ...@@ -214,8 +214,9 @@ public class JViewport extends JComponent
public void addImpl(Component comp, Object constraints, int index) public void addImpl(Component comp, Object constraints, int index)
{ {
if (ncomponents > 0) if (getComponentCount() > 0)
remove(component[0]); remove(getComponents()[0]);
super.addImpl(comp, constraints, index); super.addImpl(comp, constraints, index);
} }
......
...@@ -136,7 +136,6 @@ public class Timer implements Serializable ...@@ -136,7 +136,6 @@ public class Timer implements Serializable
return verbose; return verbose;
} }
public void setDelay(int delay) public void setDelay(int delay)
{ {
interval = delay; interval = delay;
...@@ -147,7 +146,6 @@ public class Timer implements Serializable ...@@ -147,7 +146,6 @@ public class Timer implements Serializable
return (int)interval; return (int)interval;
} }
public void setInitialDelay(int initialDelay) public void setInitialDelay(int initialDelay)
{ {
init_delay = initialDelay; init_delay = initialDelay;
...@@ -158,12 +156,12 @@ public class Timer implements Serializable ...@@ -158,12 +156,12 @@ public class Timer implements Serializable
repeat_ticks = flag; repeat_ticks = flag;
} }
boolean isRunning() public boolean isRunning()
{ {
return running; return running;
} }
void start() public void start()
{ {
if (isRunning()) if (isRunning())
{ {
...@@ -173,7 +171,7 @@ public class Timer implements Serializable ...@@ -173,7 +171,7 @@ public class Timer implements Serializable
new Waker().start(); new Waker().start();
} }
void stop() public void stop()
{ {
running = false; running = false;
} }
......
...@@ -369,13 +369,13 @@ public class UIDefaults extends Hashtable ...@@ -369,13 +369,13 @@ public class UIDefaults extends Hashtable
return o instanceof String ? (String) o : null; return o instanceof String ? (String) o : null;
} }
int getInt(Object key) public int getInt(Object key)
{ {
Object o = get(key); Object o = get(key);
return o instanceof Integer ? ((Integer) o).intValue() : 0; 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); Object o = get(key, l);
return o instanceof Integer ? ((Integer) o).intValue() : 0; return o instanceof Integer ? ((Integer) o).intValue() : 0;
......
...@@ -190,7 +190,7 @@ public class BasicListUI extends ListUI ...@@ -190,7 +190,7 @@ public class BasicListUI extends ListUI
public void mousePressed(MouseEvent event) public void mousePressed(MouseEvent event)
{ {
// System.err.println("got mouse click event " + 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) if (row == -1)
return; return;
...@@ -263,13 +263,13 @@ public class BasicListUI extends ListUI ...@@ -263,13 +263,13 @@ public class BasicListUI extends ListUI
public void propertyChange(PropertyChangeEvent e) public void propertyChange(PropertyChangeEvent e)
{ {
// System.err.println(this + ".propertyChange(" + 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) if (e.getOldValue() != null && e.getOldValue() instanceof ListModel)
((ListModel) e.oldValue).removeListDataListener(BasicListUI.this.listDataListener); ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener);
if (e.newValue != null && e.newValue instanceof ListModel) if (e.getNewValue() != null && e.getNewValue() instanceof ListModel)
((ListModel) e.newValue).addListDataListener(BasicListUI.this.listDataListener); ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener);
} }
BasicListUI.this.damageLayout(); BasicListUI.this.damageLayout();
} }
......
...@@ -472,7 +472,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, ...@@ -472,7 +472,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
* A helper class that allows us to draw icons for * A helper class that allows us to draw icons for
* the JButton. * the JButton.
*/ */
private class arrowIcon implements Icon private static class arrowIcon implements Icon
{ {
/** The polygon that describes the icon. */ /** The polygon that describes the icon. */
private Polygon arrow; private Polygon arrow;
......
...@@ -64,7 +64,7 @@ public class BasicViewportUI extends ViewportUI ...@@ -64,7 +64,7 @@ public class BasicViewportUI extends ViewportUI
{ {
public void stateChanged(ChangeEvent event) public void stateChanged(ChangeEvent event)
{ {
JViewport v = (JViewport)event.source; JViewport v = (JViewport) event.getSource();
v.repaint(); v.repaint();
} }
} }
......
...@@ -473,13 +473,13 @@ public abstract class JTextComponent extends JComponent ...@@ -473,13 +473,13 @@ public abstract class JTextComponent extends JComponent
} }
public TextUI getUI() public TextUI getUI()
{ return (TextUI) ui; {
return (TextUI) UIManager.getUI(this);
} }
public void updateUI() public void updateUI()
{ {
TextUI b = (TextUI)UIManager.getUI(this); setUI(getUI());
setUI(b);
} }
public Dimension getPreferredScrollableViewportSize() public Dimension getPreferredScrollableViewportSize()
......
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