Revision: 4057
          http://vexi.svn.sourceforge.net/vexi/?rev=4057&view=rev
Author:   clrg
Date:     2011-03-20 22:52:04 +0000 (Sun, 20 Mar 2011)

Log Message:
-----------
Add fillTriangle, drawLine to DoubleBufferedSurface and remove stubs from AWT, 
Swing implementation

Modified Paths:
--------------
    trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java
    trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java
    trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java

Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java
===================================================================
--- trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java   
2011-03-20 16:28:58 UTC (rev 4056)
+++ trunk/org.vexi-core.main/src/main/java/org/vexi/core/Surface.java   
2011-03-20 22:52:04 UTC (rev 4057)
@@ -850,17 +850,40 @@
             backbuffer.drawGlyph(source, dx, dy, cx1, cy1, cx2, cy2, argb);
         }
 
+        /** Fill a trapezoid area on the backbuffer where:
+         *     x1 .--------. x2  y1
+         *       /        /
+         *   x3 '--------' x4    y2
+         */
         public void fillTrapezoid(int x1, int x2, int y1, int x3, int x4, int 
y2, int color) {
             backbuffer.fillTrapezoid(x1, x2, y1, x3, x4, y2, color);
         }
+        
+        /** Draw a line on the backbuffer between points (x1,y1) and (x2,y2) */
+        public void drawLine(int x1, int y1, int x2, int y2, int color) {
+            backbuffer.drawLine(x1, y1, x2, y2, color);
+        }
+        
+        /** Fill a triangle of the given color */
+        public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int 
y3, int color) {
+            backbuffer.fillTriangle(x1, y1, x2, y2, x3, y3, color);
+        }
 
         /** This is how subclasses signal a 'shallow dirty', indicating that 
although the backbuffer is valid, the screen is not */
         public final void refreshFromBackbuffer(int x, int y, int w, int h) {
             blit(x, y, w, h);
         }
 
-        // copies a region from the doublebuffer to this surface
+        /** Copy a region from the source image to the on-screen graphics of 
the surface where:
+         *  - source is the image to copy from (usually the backbuffer)
+         *  - (sx,sy) is the top left corner of the area to copy
+         *  - the source area size is derived from the destination area
+         *  - (dx,dy) is the top left corner of the destination drawing area
+         *  - (dx2,dy2) is the bottom right corner of the destination drawing 
area
+         */
         public abstract void blit(PixelBuffer source, int sx, int sy, int dx, 
int dy, int dx2, int dy2);
+        
+        /** Perform a blit of the area at coordinate (x,y) of size 'width' and 
'height' */
         protected void blit(int x, int y, int w, int h) {
             blit(backbuffer, x, y, x, y, w + x, h + y);
         }

Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java
===================================================================
--- trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java       
2011-03-20 16:28:58 UTC (rev 4056)
+++ trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java       
2011-03-20 22:52:04 UTC (rev 4057)
@@ -895,14 +895,6 @@
                 return String.valueOf(c);
             }
         }
-        public void drawLine(int x1, int y1, int x2, int y2, int color) {
-            // TODO Auto-generated method stub
-            throw new Error("FIXME: not yet implemented");
-        }
-        public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int 
y3, int color) {
-            // TODO Auto-generated method stub
-            throw new Error("FIXME: not yet implemented");
-        }
     }
 
     protected void _decodeJPEG(InputStream is, Picture p) {

Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java
===================================================================
--- trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java     
2011-03-20 16:28:58 UTC (rev 4056)
+++ trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java     
2011-03-20 22:52:04 UTC (rev 4057)
@@ -1044,14 +1044,6 @@
                 return String.valueOf(c);
             }
         }
-        public void drawLine(int x1, int y1, int x2, int y2, int color) {
-            // TODO Auto-generated method stub
-            throw new Error("FIXME: not yet implemented");
-        }
-        public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int 
y3, int color) {
-            // TODO Auto-generated method stub
-            throw new Error("FIXME: not yet implemented");
-        }
     }
 
     /** Processes the supplied InputStream and converts it to a format


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to