summaryrefslogtreecommitdiff
path: root/gnu/java/awt
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2015-08-13 03:00:30 +0100
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2016-02-16 02:00:13 +0000
commit515871961ff934601b190bb32bf4fc42ddcf7e4d (patch)
treebd01845fb966a540e550d0755ac8bb4ca90621c5 /gnu/java/awt
parent5f98982eadb3c595d86d4af2825902a3ccf8f581 (diff)
downloadclasspath-515871961ff934601b190bb32bf4fc42ddcf7e4d.tar.gz
Revert undocumented changes accidentally included with last commit.
Diffstat (limited to 'gnu/java/awt')
-rw-r--r--gnu/java/awt/peer/ClasspathFontPeer.java123
-rw-r--r--gnu/java/awt/peer/qt/QtFontPeer.java2
-rw-r--r--gnu/java/awt/peer/qt/QtFramePeer.java15
-rw-r--r--gnu/java/awt/peer/qt/QtGraphics.java135
4 files changed, 96 insertions, 179 deletions
diff --git a/gnu/java/awt/peer/ClasspathFontPeer.java b/gnu/java/awt/peer/ClasspathFontPeer.java
index 2f7768e02..96677a4af 100644
--- a/gnu/java/awt/peer/ClasspathFontPeer.java
+++ b/gnu/java/awt/peer/ClasspathFontPeer.java
@@ -1,5 +1,5 @@
/* ClasspathFontPeer.java -- Font peer used by GNU Classpath.
- Copyright (C) 2003, 2004, 2014 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -129,8 +129,7 @@ public abstract class ClasspathFontPeer
super(max, 0.75f, true);
max_entries = max;
}
- @Override
- protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
+ protected boolean removeEldestEntry(Map.Entry eldest)
{
return size() > max_entries;
}
@@ -192,7 +191,7 @@ public abstract class ClasspathFontPeer
return name;
}
- public static void copyStyleToAttrs (int style, Map<TextAttribute,Object> attrs)
+ public static void copyStyleToAttrs (int style, Map attrs)
{
if ((style & Font.BOLD) == Font.BOLD)
attrs.put (TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
@@ -205,18 +204,18 @@ public abstract class ClasspathFontPeer
attrs.put (TextAttribute.POSTURE, TextAttribute.POSTURE_REGULAR);
}
- protected static void copyFamilyToAttrs (String fam, Map<TextAttribute,Object> attrs)
+ protected static void copyFamilyToAttrs (String fam, Map attrs)
{
if (fam != null)
attrs.put (TextAttribute.FAMILY, fam);
}
- public static void copySizeToAttrs (float size, Map<TextAttribute,Object> attrs)
+ public static void copySizeToAttrs (float size, Map attrs)
{
attrs.put (TextAttribute.SIZE, new Float (size));
}
- protected static void copyTransformToAttrs (AffineTransform trans, Map<TextAttribute,Object> attrs)
+ protected static void copyTransformToAttrs (AffineTransform trans, Map attrs)
{
if (trans != null)
{
@@ -256,12 +255,12 @@ public abstract class ClasspathFontPeer
}
- protected void setStandardAttributes (String name, Map<TextAttribute,Object> attribs)
+ protected void setStandardAttributes (String name, Map attribs)
{
String family = this.familyName;
AffineTransform trans = this.transform;
- float setSize = this.size;
- int setStyle = this.style;
+ float size = this.size;
+ int style = this.style;
if (attribs.containsKey (TextAttribute.FAMILY))
family = (String) attribs.get (TextAttribute.FAMILY);
@@ -273,27 +272,27 @@ public abstract class ClasspathFontPeer
{
Float weight = (Float) attribs.get (TextAttribute.WEIGHT);
if (weight.floatValue () >= TextAttribute.WEIGHT_BOLD.floatValue ())
- setStyle += Font.BOLD;
+ style += Font.BOLD;
}
if (attribs.containsKey (TextAttribute.POSTURE))
{
Float posture = (Float) attribs.get (TextAttribute.POSTURE);
if (posture.floatValue () >= TextAttribute.POSTURE_OBLIQUE.floatValue ())
- setStyle += Font.ITALIC;
+ style += Font.ITALIC;
}
if (attribs.containsKey (TextAttribute.SIZE))
{
Float sz = (Float) attribs.get (TextAttribute.SIZE);
- setSize = sz.floatValue ();
+ size = sz.floatValue ();
// Pango doesn't accept 0 as a font size.
- if (setSize < 1)
- setSize = 1;
+ if (size < 1)
+ size = 1;
}
else
- setSize = 12;
+ size = 12;
if (attribs.containsKey (TextAttribute.TRANSFORM))
{
@@ -302,10 +301,10 @@ public abstract class ClasspathFontPeer
trans = ta.getTransform ();
}
- setStandardAttributes (name, family, setStyle, setSize, trans);
+ setStandardAttributes (name, family, style, size, trans);
}
- protected void getStandardAttributes (Map<TextAttribute,Object> attrs)
+ protected void getStandardAttributes (Map attrs)
{
copyFamilyToAttrs (this.familyName, attrs);
copySizeToAttrs (this.size, attrs);
@@ -316,15 +315,15 @@ public abstract class ClasspathFontPeer
/* Begin public API */
- public ClasspathFontPeer (String name, Map<TextAttribute,Object> attrs)
+ public ClasspathFontPeer (String name, Map attrs)
{
setStandardAttributes (name, attrs);
}
public ClasspathFontPeer (String name, int style, int size)
{
- setStandardAttributes (name, (String)null, style, size,
- (AffineTransform)null);
+ setStandardAttributes (name, (String)null, style,
+ (float)size, (AffineTransform)null);
}
/**
@@ -334,7 +333,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public String getName (Font font)
{
return logicalName;
@@ -347,7 +346,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public String getFamily (Font font)
{
return familyName;
@@ -360,7 +359,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public String getFamily (Font font, Locale lc)
{
return familyName;
@@ -373,7 +372,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public String getFontName (Font font)
{
return faceName;
@@ -386,7 +385,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public String getFontName (Font font, Locale lc)
{
return faceName;
@@ -399,7 +398,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public float getSize (Font font)
{
return size;
@@ -412,7 +411,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public boolean isPlain (Font font)
{
return style == Font.PLAIN;
@@ -425,7 +424,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public boolean isBold (Font font)
{
return ((style & Font.BOLD) == Font.BOLD);
@@ -438,7 +437,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public boolean isItalic (Font font)
{
return ((style & Font.ITALIC) == Font.ITALIC);
@@ -451,13 +450,13 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
- public Font deriveFont (Font font, int newStyle, float newSize)
+
+ public Font deriveFont (Font font, int style, float size)
{
- Map<TextAttribute,Object> attrs = new HashMap<TextAttribute,Object>();
+ Map attrs = new HashMap ();
getStandardAttributes (attrs);
- copyStyleToAttrs (newStyle, attrs);
- copySizeToAttrs (newSize, attrs);
+ copyStyleToAttrs (style, attrs);
+ copySizeToAttrs (size, attrs);
return tk().getFont (logicalName, attrs);
}
@@ -468,12 +467,12 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
- public Font deriveFont (Font font, float newSize)
+
+ public Font deriveFont (Font font, float size)
{
- Map<TextAttribute,Object> attrs = new HashMap<TextAttribute,Object>();
+ Map attrs = new HashMap ();
getStandardAttributes (attrs);
- copySizeToAttrs (newSize, attrs);
+ copySizeToAttrs (size, attrs);
return tk().getFont (logicalName, attrs);
}
@@ -484,12 +483,12 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
- public Font deriveFont (Font font, int newStyle)
+
+ public Font deriveFont (Font font, int style)
{
- Map<TextAttribute,Object> attrs = new HashMap<TextAttribute,Object>();
+ Map attrs = new HashMap ();
getStandardAttributes (attrs);
- copyStyleToAttrs (newStyle, attrs);
+ copyStyleToAttrs (style, attrs);
return tk().getFont (logicalName, attrs);
}
@@ -500,12 +499,12 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
- public Font deriveFont (Font font, int newStyle, AffineTransform t)
+
+ public Font deriveFont (Font font, int style, AffineTransform t)
{
- Map<TextAttribute,Object> attrs = new HashMap<TextAttribute,Object>();
+ Map attrs = new HashMap ();
getStandardAttributes (attrs);
- copyStyleToAttrs (newStyle, attrs);
+ copyStyleToAttrs (style, attrs);
copyTransformToAttrs (t, attrs);
return tk().getFont (logicalName, attrs);
}
@@ -517,10 +516,10 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public Font deriveFont (Font font, AffineTransform t)
{
- Map<TextAttribute,Object> attrs = new HashMap<TextAttribute,Object>();
+ Map attrs = new HashMap ();
getStandardAttributes (attrs);
copyTransformToAttrs (t, attrs);
return tk().getFont (logicalName, attrs);
@@ -533,9 +532,8 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
- public Font deriveFont (Font font,
- Map<? extends AttributedCharacterIterator.Attribute,?> attrs)
+
+ public Font deriveFont (Font font, Map attrs)
{
return tk().getFont (logicalName, attrs);
}
@@ -547,10 +545,10 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
- public Map<TextAttribute,?> getAttributes (Font font)
+
+ public Map getAttributes (Font font)
{
- HashMap<TextAttribute,Object> h = new HashMap<TextAttribute,Object>();
+ HashMap h = new HashMap ();
getStandardAttributes (h);
return h;
}
@@ -562,8 +560,8 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
- public static AttributedCharacterIterator.Attribute[] getAvailableAttributes(Font font)
+
+ public AttributedCharacterIterator.Attribute[] getAvailableAttributes(Font font)
{
AttributedCharacterIterator.Attribute a[] =
new AttributedCharacterIterator.Attribute[5];
@@ -582,7 +580,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public AffineTransform getTransform (Font font)
{
if (transform == null)
@@ -597,7 +595,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public boolean isTransformed (Font font)
{
return ! transform.isIdentity ();
@@ -610,12 +608,13 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public float getItalicAngle (Font font)
{
if ((style & Font.ITALIC) == Font.ITALIC)
return TextAttribute.POSTURE_OBLIQUE.floatValue ();
- return TextAttribute.POSTURE_REGULAR.floatValue ();
+ else
+ return TextAttribute.POSTURE_REGULAR.floatValue ();
}
@@ -626,7 +625,7 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
- @SuppressWarnings("unused")
+
public int getStyle (Font font)
{
return style;
diff --git a/gnu/java/awt/peer/qt/QtFontPeer.java b/gnu/java/awt/peer/qt/QtFontPeer.java
index 3d200d80f..03ed1d2df 100644
--- a/gnu/java/awt/peer/qt/QtFontPeer.java
+++ b/gnu/java/awt/peer/qt/QtFontPeer.java
@@ -1,5 +1,5 @@
/* QtFontPeer.java --
- Copyright (C) 2005, 2006, 2014 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
diff --git a/gnu/java/awt/peer/qt/QtFramePeer.java b/gnu/java/awt/peer/qt/QtFramePeer.java
index 946ed25be..d5162106f 100644
--- a/gnu/java/awt/peer/qt/QtFramePeer.java
+++ b/gnu/java/awt/peer/qt/QtFramePeer.java
@@ -1,5 +1,5 @@
/* QtFramePeer.java --
- Copyright (C) 2005, 2014 Free Software Foundation, Inc.
+ Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -56,10 +56,8 @@ public class QtFramePeer extends QtWindowPeer implements FramePeer
super( kit, owner );
}
- @Override
protected native void init();
- @Override
protected void setup()
{
super.setup();
@@ -83,14 +81,12 @@ public class QtFramePeer extends QtWindowPeer implements FramePeer
dispose();
}
- @Override
public int getState()
{
// FIXME
return theState;
}
- @Override
public Insets getInsets()
{
int mbHeight = ( ((Frame)owner).getMenuBar() != null ) ?
@@ -98,7 +94,6 @@ public class QtFramePeer extends QtWindowPeer implements FramePeer
return new Insets(mbHeight, 0, 0, 0);
}
- @Override
public void setIconImage(Image im)
{
if (im instanceof QtImage)
@@ -107,13 +102,11 @@ public class QtFramePeer extends QtWindowPeer implements FramePeer
setIcon( new QtImage( im.getSource() ) );
}
- @Override
public void setMaximizedBounds(Rectangle rect)
{
// FIXME
}
- @Override
public void setMenuBar(MenuBar mb)
{
if( mb != null )
@@ -133,41 +126,35 @@ public class QtFramePeer extends QtWindowPeer implements FramePeer
setMenu( null );
}
- @Override
public void setResizable(boolean resizeable)
{
// FIXME
}
- @Override
public void setState(int s)
{
theState = s;
// FIXME
}
- @Override
public void setBoundsPrivate(int x, int y, int width, int height)
{
// TODO Auto-generated method stub
}
- @Override
public void updateAlwaysOnTop()
{
// TODO Auto-generated method stub
}
- @Override
public boolean requestWindowFocus()
{
// TODO Auto-generated method stub
return false;
}
- @Override
public Rectangle getBoundsPrivate()
{
// TODO: Implement this properly.
diff --git a/gnu/java/awt/peer/qt/QtGraphics.java b/gnu/java/awt/peer/qt/QtGraphics.java
index 29655ffa5..f68cc0dbd 100644
--- a/gnu/java/awt/peer/qt/QtGraphics.java
+++ b/gnu/java/awt/peer/qt/QtGraphics.java
@@ -1,5 +1,5 @@
/* QtGraphics.java --
- Copyright (C) 2005, 2006, 2014 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -144,7 +144,6 @@ public abstract class QtGraphics extends Graphics2D
public synchronized native void delete();
- @Override
public void dispose()
{
}
@@ -163,7 +162,7 @@ public abstract class QtGraphics extends Graphics2D
protected native void initVolatileImage(QtVolatileImage image);
// Creates a new native QPainter object on the same context.
- private native void cloneNativeContext( QtGraphics parentGraphics );
+ private native void cloneNativeContext( QtGraphics parent );
private native void setColor(int r, int g, int b, int a);
private native void drawNative( QPainterPath p );
private native void fillNative( QPainterPath p );
@@ -194,23 +193,19 @@ public abstract class QtGraphics extends Graphics2D
/**
* Context-sensitive methods are declared abstract.
*/
- @Override
public abstract Graphics create();
- @Override
public abstract void copyArea(int x, int y, int width, int height,
int dx, int dy);
- @Override
public abstract GraphicsConfiguration getDeviceConfiguration();
- @Override
+
public Color getColor()
{
return new Color(color.getRed(), color.getGreen(), color.getBlue());
}
- @Override
public void setColor(Color c)
{
if( c == null )
@@ -220,48 +215,43 @@ public abstract class QtGraphics extends Graphics2D
setColor(c.getRed(), c.getGreen(), c.getBlue(), alpha);
}
- @Override
public void setBackground(Color color)
{
bgcolor = new Color(color.getRed(), color.getGreen(), color.getBlue());
}
- @Override
public Color getBackground()
{
return new Color(bgcolor.getRed(), bgcolor.getGreen(), bgcolor.getBlue());
}
- @Override
public void setPaintMode()
{
}
- @Override
public void setXORMode(Color color)
{
// FIXME
}
- @Override
public boolean hit(Rectangle rect, Shape s, boolean onStroke)
{
if( onStroke )
{
Shape stroked = currentStroke.createStrokedShape( s );
- return stroked.intersects( rect.x, rect.y, rect.width, rect.height );
+ return stroked.intersects( (double)rect.x, (double)rect.y,
+ (double)rect.width, (double)rect.height );
}
- return s.intersects( rect.x, rect.y, rect.width, rect.height );
+ return s.intersects( (double)rect.x, (double)rect.y,
+ (double)rect.width, (double)rect.height );
}
// ******************* Font ***********************
- @Override
public Font getFont()
{
return font;
}
- @Override
public void setFont(Font font)
{
if( font == null )
@@ -271,10 +261,9 @@ public abstract class QtGraphics extends Graphics2D
setFontNative( (QtFontPeer)font.getPeer() );
}
- @Override
- public FontMetrics getFontMetrics(Font f)
+ public FontMetrics getFontMetrics(Font font)
{
- return new QtFontMetrics(f, this);
+ return new QtFontMetrics(font, this);
}
// ***************** Clipping *********************
@@ -282,37 +271,31 @@ public abstract class QtGraphics extends Graphics2D
/**
* Intersects the current clip with the shape
*/
- @Override
public void clip(Shape s)
{
intersectClipNative( new QPainterPath( s ) );
}
- @Override
public void clipRect(int x, int y, int width, int height)
{
intersectClipRectNative( x, y, width, height );
}
- @Override
public void setClip(int x, int y, int width, int height)
{
setClipRectNative( x, y, width, height );
}
- @Override
public Shape getClip()
{
return getClipNative().getPath();
}
- @Override
public native Rectangle getClipBounds();
/**
* Sets the clip
*/
- @Override
public void setClip(Shape clip)
{
if (clip == null)
@@ -323,7 +306,6 @@ public abstract class QtGraphics extends Graphics2D
// ***************** Drawing primitives *********************
- @Override
public void draw(Shape s)
{
if( nativeStroking )
@@ -332,40 +314,37 @@ public abstract class QtGraphics extends Graphics2D
fillNative( new QPainterPath( currentStroke.createStrokedShape( s ) ) );
}
- @Override
public void fill(Shape s)
{
fillNative( new QPainterPath(s) );
}
- @Override
public void drawLine(int x1, int y1, int x2, int y2)
{
if( nativeStroking )
- drawNative( new QPainterPath(x1, y1, x2, y2, true) );
+ drawNative( new QPainterPath((double)x1, (double)y1, (double)x2, (double)y2, true) );
else
- draw( new Line2D.Double(x1, y1, x2, y2) );
+ draw( new Line2D.Double((double)x1, (double)y1, (double)x2, (double)y2) );
}
- @Override
public void drawRect(int x, int y, int width, int height)
{
if( nativeStroking )
- drawNative( new QPainterPath(x, y, width, height) );
+ drawNative( new QPainterPath((double)x, (double)y,
+ (double)width, (double)height) );
else
fillNative( new QPainterPath
( currentStroke.createStrokedShape
(new Rectangle2D.Double
- (x, y, width, height) ) ) );
+ ((double)x, (double)y,
+ (double)width, (double)height) ) ) );
}
- @Override
public void fillRect(int x, int y, int width, int height)
{
fillNative( new QPainterPath( x, y, width, height ) );
}
- @Override
public void clearRect(int x, int y, int width, int height)
{
Color c = color;
@@ -374,7 +353,6 @@ public abstract class QtGraphics extends Graphics2D
setColor( c );
}
- @Override
public void drawRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight)
{
@@ -382,7 +360,6 @@ public abstract class QtGraphics extends Graphics2D
arcWidth, arcHeight) );
}
- @Override
public void fillRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight)
{
@@ -390,19 +367,17 @@ public abstract class QtGraphics extends Graphics2D
arcWidth, arcHeight) );
}
- @Override
public void drawOval(int x, int y, int width, int height)
{
- draw( new Ellipse2D.Double(x, y, width, height) );
+ draw( new Ellipse2D.Double((double)x, (double)y,
+ (double)width, (double)height) );
}
- @Override
public void fillOval(int x, int y, int width, int height)
{
fill( new Ellipse2D.Double(x, y, width, height) );
}
- @Override
public void drawArc(int x, int y, int width, int height,
int arcStart, int arcAngle)
{
@@ -410,7 +385,6 @@ public abstract class QtGraphics extends Graphics2D
Arc2D.OPEN) );
}
- @Override
public void fillArc(int x, int y, int width, int height,
int arcStart, int arcAngle)
{
@@ -418,46 +392,38 @@ public abstract class QtGraphics extends Graphics2D
Arc2D.CHORD) );
}
- @Override
public void drawPolyline(int xPoints[], int yPoints[], int npoints)
{
for( int i = 0; i < npoints - 1; i++)
drawLine(xPoints[i], yPoints[i], xPoints[i + 1], yPoints[i + 1]);
}
- @Override
public void drawPolygon(int xPoints[], int yPoints[], int npoints)
{
draw( new Polygon(xPoints, yPoints, npoints) );
}
- @Override
public void fillPolygon(int xPoints[], int yPoints[], int npoints)
{
fill( new Polygon(xPoints, yPoints, npoints) );
}
- @Override
public native void fill3DRect(int x, int y, int width, int height, boolean raised);
- @Override
public native void draw3DRect(int x, int y, int width, int height, boolean raised);
// *********************** Text rendering *************************
- @Override
public void drawString(String string, int x, int y)
{
- drawStringNative(string, x, y);
+ drawStringNative(string, (double)x, (double)y);
}
- @Override
public void drawString(String string, float x, float y)
{
- drawStringNative(string, x, y);
+ drawStringNative(string, (double)x, (double)y);
}
- @Override
public void drawString (AttributedCharacterIterator ci, int x, int y)
{
// FIXME - to something more correct ?
@@ -467,7 +433,6 @@ public abstract class QtGraphics extends Graphics2D
drawString(s, x, y);
}
- @Override
public void drawString(AttributedCharacterIterator ci,
float x, float y)
{
@@ -478,14 +443,12 @@ public abstract class QtGraphics extends Graphics2D
drawString(s, x, y);
}
- @Override
public void drawGlyphVector(GlyphVector v, float x, float y)
{
throw new RuntimeException("Not implemented");
}
// ******************* Image drawing ******************************
- @Override
public boolean drawImage(Image image,
AffineTransform Tx,
ImageObserver obs)
@@ -498,131 +461,113 @@ public abstract class QtGraphics extends Graphics2D
obs);
}
- @Override
- public boolean drawImage(Image image, int x, int y, Color background,
+ public boolean drawImage(Image image, int x, int y, Color bgcolor,
ImageObserver observer)
{
if (image instanceof QtImage)
- return ((QtImage)image).drawImage (this, x, y, background, observer);
+ return ((QtImage)image).drawImage (this, x, y, bgcolor, observer);
return (new QtImage(image.getSource())).drawImage (this, x, y,
- background, observer);
+ bgcolor, observer);
}
-
- @Override
+
public boolean drawImage(Image image,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
- Color background, ImageObserver observer)
+ Color bgcolor, ImageObserver observer)
{
if (image instanceof QtImage)
return ((QtImage)image).drawImage(this, dx1, dy1, dx2, dy2,
- sx1, sy1, sx2, sy2, background, observer);
+ sx1, sy1, sx2, sy2, bgcolor, observer);
return (new QtImage(image.getSource())).drawImage(this, dx1, dy1,
dx2, dy2,
sx1, sy1, sx2, sy2,
- background, observer);
+ bgcolor, observer);
}
- @Override
public boolean drawImage(Image image, int x, int y,
- int width, int height, Color background,
+ int width, int height, Color bgcolor,
ImageObserver observer)
{
if (image instanceof QtImage)
return ((QtImage)image).drawImage (this, x, y, width, height,
- background, observer);
+ bgcolor, observer);
return (new QtImage(image.getSource())).drawImage (this, x, y,
width, height,
- background, observer);
+ bgcolor, observer);
}
- @Override
public boolean drawImage(Image image, int x, int y, int width, int height,
ImageObserver observer)
{
return drawImage(image, x, y, width, height, null, observer);
}
- @Override
public boolean drawImage(Image image, int x, int y, ImageObserver observer)
{
return drawImage(image, x, y, null, observer);
}
- @Override
- public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2,
- ImageObserver observer)
+ public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
{
return drawImage(image, dx1, dy1, dx2, dy2,
sx1, sy1, sx2, sy2, null, observer);
}
// *********************** Transform methods *************************
- @Override
public AffineTransform getTransform()
{
return new AffineTransform( xform );
}
- @Override
public void setTransform(AffineTransform Tx)
{
xform = new AffineTransform( Tx );
setQtTransform( new QMatrix( xform ) );
}
- @Override
public void rotate(double theta)
{
xform.rotate( theta );
setQtTransform( new QMatrix( xform ) );
}
- @Override
public void rotate(double theta, double x, double y)
{
xform.rotate(theta, x, y);
setQtTransform( new QMatrix( xform ) );
}
- @Override
public void scale(double sx, double sy)
{
xform.scale(sx, sy);
setQtTransform( new QMatrix( xform ) );
}
- @Override
public void shear(double shx, double shy)
{
xform.shear(shx, shy);
setQtTransform( new QMatrix( xform ) );
}
- @Override
public void transform(AffineTransform Tx)
{
xform.concatenate( Tx );
setQtTransform( new QMatrix( xform ) );
}
- @Override
public void translate(double tx, double ty)
{
xform.translate( tx, ty );
setQtTransform( new QMatrix( xform ) );
}
- @Override
public void translate(int x, int y)
{
translate((double)x, (double)y);
}
// *************** Stroking, Filling, Compositing *****************
- @Override
public void setStroke(Stroke s)
{
try // ..to convert the stroke into a native one.
@@ -639,13 +584,11 @@ public abstract class QtGraphics extends Graphics2D
currentStroke = s;
}
- @Override
public Stroke getStroke()
{ // FIXME: return copy?
return currentStroke;
}
- @Override
public void setComposite(Composite comp)
{
if( comp == null)
@@ -674,13 +617,11 @@ public abstract class QtGraphics extends Graphics2D
}
}
- @Override
public Composite getComposite()
{
return composite;
}
- @Override
public void setPaint(Paint p)
{
if( p == null )
@@ -708,7 +649,6 @@ public abstract class QtGraphics extends Graphics2D
" paints yet.");
}
- @Override
public Paint getPaint()
{
// FIXME
@@ -717,25 +657,21 @@ public abstract class QtGraphics extends Graphics2D
// ********************** Rendering Hints *************************
- @Override
- public void addRenderingHints(Map<?,?> hints)
+ public void addRenderingHints(Map hints)
{
renderingHints.putAll( hints );
}
- @Override
public Object getRenderingHint(RenderingHints.Key hintKey)
{
return renderingHints.get( hintKey );
}
- @Override
public RenderingHints getRenderingHints()
{
return (RenderingHints) renderingHints.clone();
}
- @Override
public void setRenderingHints(Map<?,?> hints)
{
renderingHints = new RenderingHints( null );
@@ -743,7 +679,6 @@ public abstract class QtGraphics extends Graphics2D
updateRenderingHints();
}
- @Override
public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
{
renderingHints.put( hintKey, hintValue );
@@ -757,25 +692,21 @@ public abstract class QtGraphics extends Graphics2D
////////////////////////////// unimplemented /////////////////////
- @Override
public FontRenderContext getFontRenderContext()
{
throw new UnsupportedOperationException("Not implemented yet");
}
- @Override
- public void drawRenderableImage(RenderableImage image, AffineTransform transform)
+ public void drawRenderableImage(RenderableImage image, AffineTransform xform)
{
throw new UnsupportedOperationException("Not implemented yet");
}
- @Override
- public void drawRenderedImage(RenderedImage image, AffineTransform transform)
+ public void drawRenderedImage(RenderedImage image, AffineTransform xform)
{
throw new UnsupportedOperationException("Not implemented yet");
}
- @Override
public void drawImage(BufferedImage image, BufferedImageOp op, int x, int y)
{
throw new UnsupportedOperationException("Not implemented yet");