harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chunrong Lai (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4825) [classlib][awt] Can not use XORMode to erase what was drawn previously
Date Thu, 20 Sep 2007 07:34:31 GMT
[classlib][awt] Can not use XORMode to erase what was drawn previously
----------------------------------------------------------------------

                 Key: HARMONY-4825
                 URL: https://issues.apache.org/jira/browse/HARMONY-4825
             Project: Harmony
          Issue Type: Sub-task
          Components: Classlib
         Environment: Win32
            Reporter: Chunrong Lai
            Priority: Critical



 A common trick in XORMode is to draw something, in XORMode, a second time to erase what was
drawn the first time. But this does not work in Harmony to me. See below reproducer:

import java.awt.*;
import javax.swing.*;

public class DrawStringTest extends JFrame {
   int xPosition = 100;
   int yPosition = 100;
   public static void  main(String[] args){
      DrawStringTest aTest = new DrawStringTest();
      aTest.setSize(800, 600);
      aTest.show();
   }
   public DrawStringTest(){}
   public void paint(Graphics g){
       super.paint(g);
       System.out.println("drawString at " + xPosition + ", " + yPosition);
       g.drawString("XOR mode drawString test", xPosition, yPosition);
       g.setXORMode(getBackground());
       for (int i = 0; i < 5; i ++) {
            g.drawString("XOR mode drawString test", xPosition, yPosition);
            //used to erase what was drawn previously
            xPosition += 100;
            yPosition += 100;
            if (xPosition > 600) xPosition = 100;
            if (yPosition > 400) yPosition = 100;
            g.drawString("XOR mode drawString test", xPosition, yPosition);
       }
       g.setPaintMode();
   }
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message