+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.
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.
* @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;
* @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;
* @param destCM color model for the destination image
* @return new compatible destination image
*/
-
public BufferedImage createCompatibleDestImage (BufferedImage src,
ColorModel destCM)
{
* @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);
* @param dst destination image
* @return transformed source image
*/
-
public BufferedImage filter (BufferedImage src, BufferedImage dst)
{
* @param dst destination raster
* @return transformed raster
*/
-
public WritableRaster filter (Raster src, WritableRaster dst)
{
throw new UnsupportedOperationException ("not implemented yet");
* @param src image to be transformed
* @return bounds of the transformed image.
*/
-
public Rectangle2D getBounds2D (BufferedImage src)
{
return getBounds2D (src.getRaster());
* @param src raster to be transformed
* @return bounds of the transformed raster.
*/
-
public Rectangle2D getBounds2D (Raster src)
{
// determine new size for the transformed raster.
*
* @return interpolation type
*/
-
public int getInterpolationType ()
{
if(hints.containsValue (RenderingHints.VALUE_INTERPOLATION_BILINEAR))
* @param dstPt destination point
* @return the location of the transformed source point.
*/
-
public Point2D getPoint2D (Point2D srcPt, Point2D dstPt)
{
return transform.transform (srcPt, dstPt);
*
* @return rendering hints
*/
-
public RenderingHints getRenderingHints ()
{
return hints;
*
* @return transform
*/
-
public AffineTransform getTransform ()
{
return transform;
{
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;
// 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();
}
};
public Component getView()
{
- if (ncomponents > 0)
- return component[0];
- else
+ if (getComponentCount() == 0)
return null;
+
+ return getComponents()[0];
}
public void setView(Component v)
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);
}
return verbose;
}
-
public void setDelay(int delay)
{
interval = delay;
return (int)interval;
}
-
public void setInitialDelay(int initialDelay)
{
init_delay = initialDelay;
repeat_ticks = flag;
}
- boolean isRunning()
+ public boolean isRunning()
{
return running;
}
- void start()
+ public void start()
{
if (isRunning())
{
new Waker().start();
}
- void stop()
+ public void stop()
{
running = false;
}
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;
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;
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();
}
* 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;
{
public void stateChanged(ChangeEvent event)
{
- JViewport v = (JViewport)event.source;
+ JViewport v = (JViewport) event.getSource();
v.repaint();
}
}
// 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()
{