harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Strigun (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-4814) [classlib][awt] method Graphics.clearRect works incorrectly
Date Tue, 18 Sep 2007 16:20:47 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-4814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vladimir Strigun updated HARMONY-4814:
--------------------------------------

    Attachment: Harmony-4814.diff

patch for the issue

> [classlib][awt] method Graphics.clearRect works incorrectly 
> ------------------------------------------------------------
>
>                 Key: HARMONY-4814
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4814
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vladimir Strigun
>         Attachments: Harmony-4814.diff
>
>
> Here is the testcase for reproducing the issue:
> import java.awt.Color;
> import java.awt.Graphics;
> import java.awt.Font;
> import java.awt.Rectangle;
> import java.awt.event.MouseEvent;
> import java.awt.event.MouseListener;
> import javax.swing.JFrame;
> public class TestClearRect extends JFrame implements MouseListener
> {
> 	
> 	public TestClearRect()
> 	{
> 		this.setBounds(new Rectangle(100, 100, 740, 580));
> 		this.setBackground(new Color(0, 0, 255));
> 		setTitle("TestClearRect");
> 		this.addMouseListener(this);
> 		this.setVisible(true);
> 	}
> 	
> 	public void paint(Graphics g)
> 	{
> 		super.paint(g);
>         g.setFont(new Font("", Font.BOLD, 22));
> 		g.drawString("Click left mouse button to invoke clearRect method ", 10, 100);
> 	}
> 	
> 	public void mouseClicked(MouseEvent e){}
> 	public void mousePressed(MouseEvent e)
> 	{
> 		if (e.getButton() == MouseEvent.BUTTON1)
> 		{
> 			testclearRect();
> 		}
> 		else if (e.getButton() == MouseEvent.BUTTON3)
> 		{
> 			System.exit(0);
> 		}
> 	}
> 	public void mouseReleased(MouseEvent e){}
> 	public void mouseEntered(MouseEvent e){}
> 	public void mouseExited(MouseEvent e){}
> 	
> 	private void testclearRect()
> 	{
> 		Graphics g = this.getGraphics();
> 		g.clearRect(0, 0, this.getWidth(), this.getHeight());
> 	}
> 	
> 	public static void main(String[] args)
> 	{
> 		new TestClearRect();
> 	}
> }
> On RI after mouse click, background color changed to blue, while on Harmony it changed
to black (default value).

-- 
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