summaryrefslogtreecommitdiff
path: root/gnu/java/awt/peer
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/java/awt/peer')
-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, 179 insertions, 96 deletions
diff --git a/gnu/java/awt/peer/ClasspathFontPeer.java b/gnu/java/awt/peer/ClasspathFontPeer.java
index 96677a4af..2f7768e02 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 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2014 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -129,7 +129,8 @@ public abstract class ClasspathFontPeer
super(max, 0.75f, true);
max_entries = max;
}
- protected boolean removeEldestEntry(Map.Entry eldest)
+ @Override
+ protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
{
return size() > max_entries;
}
@@ -191,7 +192,7 @@ public abstract class ClasspathFontPeer
return name;
}
- public static void copyStyleToAttrs (int style, Map attrs)
+ public static void copyStyleToAttrs (int style, Map<TextAttribute,Object> attrs)
{
if ((style & Font.BOLD) == Font.BOLD)
attrs.put (TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
@@ -204,18 +205,18 @@ public abstract class ClasspathFontPeer
attrs.put (TextAttribute.POSTURE, TextAttribute.POSTURE_REGULAR);
}
- protected static void copyFamilyToAttrs (String fam, Map attrs)
+ protected static void copyFamilyToAttrs (String fam, Map<TextAttribute,Object> attrs)
{
if (fam != null)
attrs.put (TextAttribute.FAMILY, fam);
}
- public static void copySizeToAttrs (float size, Map attrs)
+ public static void copySizeToAttrs (float size, Map<TextAttribute,Object> attrs)
{
attrs.put (TextAttribute.SIZE, new Float (size));
}
- protected static void copyTransformToAttrs (AffineTransform trans, Map attrs)
+ protected static void copyTransformToAttrs (AffineTransform trans, Map<TextAttribute,Object> attrs)
{
if (trans != null)
{
@@ -255,12 +256,12 @@ public abstract class ClasspathFontPeer
}
- protected void setStandardAttributes (String name, Map attribs)
+ protected void setStandardAttributes (String name, Map<TextAttribute,Object> attribs)
{
String family = this.familyName;
AffineTransform trans = this.transform;
- float size = this.size;
- int style = this.style;
+ float setSize = this.size;
+ int setStyle = this.style;
if (attribs.containsKey (TextAttribute.FAMILY))
family = (String) attribs.get (TextAttribute.FAMILY);
@@ -272,27 +273,27 @@ public abstract class ClasspathFontPeer
{
Float weight = (Float) attribs.get (TextAttribute.WEIGHT);
if (weight.floatValue () >= TextAttribute.WEIGHT_BOLD.floatValue ())
- style += Font.BOLD;
+ setStyle += Font.BOLD;
}
if (attribs.containsKey (TextAttribute.POSTURE))
{
Float posture = (Float) attribs.get (TextAttribute.POSTURE);
if (posture.floatValue () >= TextAttribute.POSTURE_OBLIQUE.floatValue ())
- style += Font.ITALIC;
+ setStyle += Font.ITALIC;
}
if (attribs.containsKey (TextAttribute.SIZE))
{
Float sz = (Float) attribs.get (TextAttribute.SIZE);
- size = sz.floatValue ();
+ setSize = sz.floatValue ();
// Pango doesn't accept 0 as a font size.
- if (size < 1)
- size = 1;
+ if (setSize < 1)
+ setSize = 1;
}
else
- size = 12;
+ setSize = 12;
if (attribs.containsKey (TextAttribute.TRANSFORM))
{
@@ -301,10 +302,10 @@ public abstract class ClasspathFontPeer
trans = ta.getTransform ();
}
- setStandardAttributes (name, family, style, size, trans);
+ setStandardAttributes (name, family, setStyle, setSize, trans);
}
- protected void getStandardAttributes (Map attrs)
+ protected void getStandardAttributes (Map<TextAttribute,Object> attrs)
{
copyFamilyToAttrs (this.familyName, attrs);
copySizeToAttrs (this.size, attrs);
@@ -315,15 +316,15 @@ public abstract class ClasspathFontPeer
/* Begin public API */
- public ClasspathFontPeer (String name, Map attrs)
+ public ClasspathFontPeer (String name, Map<TextAttribute,Object> attrs)
{
setStandardAttributes (name, attrs);
}
public ClasspathFontPeer (String name, int style, int size)
{
- setStandardAttributes (name, (String)null, style,
- (float)size, (AffineTransform)null);
+ setStandardAttributes (name, (String)null, style, size,
+ (AffineTransform)null);
}
/**
@@ -333,7 +334,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;
@@ -346,7 +347,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;
@@ -359,7 +360,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;
@@ -372,7 +373,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;
@@ -385,7 +386,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;
@@ -398,7 +399,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;
@@ -411,7 +412,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;
@@ -424,7 +425,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);
@@ -437,7 +438,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);
@@ -450,13 +451,13 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
-
- public Font deriveFont (Font font, int style, float size)
+ @SuppressWarnings("unused")
+ public Font deriveFont (Font font, int newStyle, float newSize)
{
- Map attrs = new HashMap ();
+ Map<TextAttribute,Object> attrs = new HashMap<TextAttribute,Object>();
getStandardAttributes (attrs);
- copyStyleToAttrs (style, attrs);
- copySizeToAttrs (size, attrs);
+ copyStyleToAttrs (newStyle, attrs);
+ copySizeToAttrs (newSize, attrs);
return tk().getFont (logicalName, attrs);
}
@@ -467,12 +468,12 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
-
- public Font deriveFont (Font font, float size)
+ @SuppressWarnings("unused")
+ public Font deriveFont (Font font, float newSize)
{
- Map attrs = new HashMap ();
+ Map<TextAttribute,Object> attrs = new HashMap<TextAttribute,Object>();
getStandardAttributes (attrs);
- copySizeToAttrs (size, attrs);
+ copySizeToAttrs (newSize, attrs);
return tk().getFont (logicalName, attrs);
}
@@ -483,12 +484,12 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
-
- public Font deriveFont (Font font, int style)
+ @SuppressWarnings("unused")
+ public Font deriveFont (Font font, int newStyle)
{
- Map attrs = new HashMap ();
+ Map<TextAttribute,Object> attrs = new HashMap<TextAttribute,Object>();
getStandardAttributes (attrs);
- copyStyleToAttrs (style, attrs);
+ copyStyleToAttrs (newStyle, attrs);
return tk().getFont (logicalName, attrs);
}
@@ -499,12 +500,12 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
-
- public Font deriveFont (Font font, int style, AffineTransform t)
+ @SuppressWarnings("unused")
+ public Font deriveFont (Font font, int newStyle, AffineTransform t)
{
- Map attrs = new HashMap ();
+ Map<TextAttribute,Object> attrs = new HashMap<TextAttribute,Object>();
getStandardAttributes (attrs);
- copyStyleToAttrs (style, attrs);
+ copyStyleToAttrs (newStyle, attrs);
copyTransformToAttrs (t, attrs);
return tk().getFont (logicalName, attrs);
}
@@ -516,10 +517,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 attrs = new HashMap ();
+ Map<TextAttribute,Object> attrs = new HashMap<TextAttribute,Object>();
getStandardAttributes (attrs);
copyTransformToAttrs (t, attrs);
return tk().getFont (logicalName, attrs);
@@ -532,8 +533,9 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
-
- public Font deriveFont (Font font, Map attrs)
+ @SuppressWarnings("unused")
+ public Font deriveFont (Font font,
+ Map<? extends AttributedCharacterIterator.Attribute,?> attrs)
{
return tk().getFont (logicalName, attrs);
}
@@ -545,10 +547,10 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
-
- public Map getAttributes (Font font)
+ @SuppressWarnings("unused")
+ public Map<TextAttribute,?> getAttributes (Font font)
{
- HashMap h = new HashMap ();
+ HashMap<TextAttribute,Object> h = new HashMap<TextAttribute,Object>();
getStandardAttributes (h);
return h;
}
@@ -560,8 +562,8 @@ public abstract class ClasspathFontPeer
* useful if you are sharing peers between Font objects. Otherwise it may
* be ignored.
*/
-
- public AttributedCharacterIterator.Attribute[] getAvailableAttributes(Font font)
+ @SuppressWarnings("unused")
+ public static AttributedCharacterIterator.Attribute[] getAvailableAttributes(Font font)
{
AttributedCharacterIterator.Attribute a[] =
new AttributedCharacterIterator.Attribute[5];
@@ -580,7 +582,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)
@@ -595,7 +597,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 ();
@@ -608,13 +610,12 @@ 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 ();
- else
- return TextAttribute.POSTURE_REGULAR.floatValue ();
+ return TextAttribute.POSTURE_REGULAR.floatValue ();
}
@@ -625,7 +626,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 03ed1d2df..3d200d80f 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 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2014 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 d5162106f..946ed25be 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 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2014 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -56,8 +56,10 @@ public class QtFramePeer extends QtWindowPeer implements FramePeer
super( kit, owner );
}
+ @Override
protected native void init();
+ @Override
protected void setup()
{
super.setup();
@@ -81,12 +83,14 @@ 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 ) ?
@@ -94,6 +98,7 @@ public class QtFramePeer extends QtWindowPeer implements FramePeer
return new Insets(mbHeight, 0, 0, 0);
}
+ @Override
public void setIconImage(Image im)
{
if (im instanceof QtImage)
@@ -102,11 +107,13 @@ 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 )
@@ -126,35 +133,41 @@ 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 f68cc0dbd..29655ffa5 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 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2014 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -144,6 +144,7 @@ public abstract class QtGraphics extends Graphics2D
public synchronized native void delete();
+ @Override
public void dispose()
{
}
@@ -162,7 +163,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 parent );
+ private native void cloneNativeContext( QtGraphics parentGraphics );
private native void setColor(int r, int g, int b, int a);
private native void drawNative( QPainterPath p );
private native void fillNative( QPainterPath p );
@@ -193,19 +194,23 @@ 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 )
@@ -215,43 +220,48 @@ 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( (double)rect.x, (double)rect.y,
- (double)rect.width, (double)rect.height );
+ return stroked.intersects( rect.x, rect.y, rect.width, rect.height );
}
- return s.intersects( (double)rect.x, (double)rect.y,
- (double)rect.width, (double)rect.height );
+ return s.intersects( rect.x, rect.y, rect.width, rect.height );
}
// ******************* Font ***********************
+ @Override
public Font getFont()
{
return font;
}
+ @Override
public void setFont(Font font)
{
if( font == null )
@@ -261,9 +271,10 @@ public abstract class QtGraphics extends Graphics2D
setFontNative( (QtFontPeer)font.getPeer() );
}
- public FontMetrics getFontMetrics(Font font)
+ @Override
+ public FontMetrics getFontMetrics(Font f)
{
- return new QtFontMetrics(font, this);
+ return new QtFontMetrics(f, this);
}
// ***************** Clipping *********************
@@ -271,31 +282,37 @@ 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)
@@ -306,6 +323,7 @@ public abstract class QtGraphics extends Graphics2D
// ***************** Drawing primitives *********************
+ @Override
public void draw(Shape s)
{
if( nativeStroking )
@@ -314,37 +332,40 @@ 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((double)x1, (double)y1, (double)x2, (double)y2, true) );
+ drawNative( new QPainterPath(x1, y1, x2, y2, true) );
else
- draw( new Line2D.Double((double)x1, (double)y1, (double)x2, (double)y2) );
+ draw( new Line2D.Double(x1, y1, x2, y2) );
}
+ @Override
public void drawRect(int x, int y, int width, int height)
{
if( nativeStroking )
- drawNative( new QPainterPath((double)x, (double)y,
- (double)width, (double)height) );
+ drawNative( new QPainterPath(x, y, width, height) );
else
fillNative( new QPainterPath
( currentStroke.createStrokedShape
(new Rectangle2D.Double
- ((double)x, (double)y,
- (double)width, (double)height) ) ) );
+ (x, y, width, 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;
@@ -353,6 +374,7 @@ public abstract class QtGraphics extends Graphics2D
setColor( c );
}
+ @Override
public void drawRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight)
{
@@ -360,6 +382,7 @@ public abstract class QtGraphics extends Graphics2D
arcWidth, arcHeight) );
}
+ @Override
public void fillRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight)
{
@@ -367,17 +390,19 @@ public abstract class QtGraphics extends Graphics2D
arcWidth, arcHeight) );
}
+ @Override
public void drawOval(int x, int y, int width, int height)
{
- draw( new Ellipse2D.Double((double)x, (double)y,
- (double)width, (double)height) );
+ draw( new Ellipse2D.Double(x, y, width, 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)
{
@@ -385,6 +410,7 @@ public abstract class QtGraphics extends Graphics2D
Arc2D.OPEN) );
}
+ @Override
public void fillArc(int x, int y, int width, int height,
int arcStart, int arcAngle)
{
@@ -392,38 +418,46 @@ 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, (double)x, (double)y);
+ drawStringNative(string, x, y);
}
+ @Override
public void drawString(String string, float x, float y)
{
- drawStringNative(string, (double)x, (double)y);
+ drawStringNative(string, x, y);
}
+ @Override
public void drawString (AttributedCharacterIterator ci, int x, int y)
{
// FIXME - to something more correct ?
@@ -433,6 +467,7 @@ public abstract class QtGraphics extends Graphics2D
drawString(s, x, y);
}
+ @Override
public void drawString(AttributedCharacterIterator ci,
float x, float y)
{
@@ -443,12 +478,14 @@ 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)
@@ -461,113 +498,131 @@ public abstract class QtGraphics extends Graphics2D
obs);
}
- public boolean drawImage(Image image, int x, int y, Color bgcolor,
+ @Override
+ public boolean drawImage(Image image, int x, int y, Color background,
ImageObserver observer)
{
if (image instanceof QtImage)
- return ((QtImage)image).drawImage (this, x, y, bgcolor, observer);
+ return ((QtImage)image).drawImage (this, x, y, background, observer);
return (new QtImage(image.getSource())).drawImage (this, x, y,
- bgcolor, observer);
+ background, observer);
}
-
+
+ @Override
public boolean drawImage(Image image,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
- Color bgcolor, ImageObserver observer)
+ Color background, ImageObserver observer)
{
if (image instanceof QtImage)
return ((QtImage)image).drawImage(this, dx1, dy1, dx2, dy2,
- sx1, sy1, sx2, sy2, bgcolor, observer);
+ sx1, sy1, sx2, sy2, background, observer);
return (new QtImage(image.getSource())).drawImage(this, dx1, dy1,
dx2, dy2,
sx1, sy1, sx2, sy2,
- bgcolor, observer);
+ background, observer);
}
+ @Override
public boolean drawImage(Image image, int x, int y,
- int width, int height, Color bgcolor,
+ int width, int height, Color background,
ImageObserver observer)
{
if (image instanceof QtImage)
return ((QtImage)image).drawImage (this, x, y, width, height,
- bgcolor, observer);
+ background, observer);
return (new QtImage(image.getSource())).drawImage (this, x, y,
width, height,
- bgcolor, observer);
+ background, 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);
}
- public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver 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)
{
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.
@@ -584,11 +639,13 @@ 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)
@@ -617,11 +674,13 @@ public abstract class QtGraphics extends Graphics2D
}
}
+ @Override
public Composite getComposite()
{
return composite;
}
+ @Override
public void setPaint(Paint p)
{
if( p == null )
@@ -649,6 +708,7 @@ public abstract class QtGraphics extends Graphics2D
" paints yet.");
}
+ @Override
public Paint getPaint()
{
// FIXME
@@ -657,21 +717,25 @@ public abstract class QtGraphics extends Graphics2D
// ********************** Rendering Hints *************************
- public void addRenderingHints(Map hints)
+ @Override
+ 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 );
@@ -679,6 +743,7 @@ public abstract class QtGraphics extends Graphics2D
updateRenderingHints();
}
+ @Override
public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
{
renderingHints.put( hintKey, hintValue );
@@ -692,21 +757,25 @@ public abstract class QtGraphics extends Graphics2D
////////////////////////////// unimplemented /////////////////////
+ @Override
public FontRenderContext getFontRenderContext()
{
throw new UnsupportedOperationException("Not implemented yet");
}
- public void drawRenderableImage(RenderableImage image, AffineTransform xform)
+ @Override
+ public void drawRenderableImage(RenderableImage image, AffineTransform transform)
{
throw new UnsupportedOperationException("Not implemented yet");
}
- public void drawRenderedImage(RenderedImage image, AffineTransform xform)
+ @Override
+ public void drawRenderedImage(RenderedImage image, AffineTransform transform)
{
throw new UnsupportedOperationException("Not implemented yet");
}
+ @Override
public void drawImage(BufferedImage image, BufferedImageOp op, int x, int y)
{
throw new UnsupportedOperationException("Not implemented yet");