~ubuntu-branches/debian/squeeze/latexdraw/squeeze

« back to all changes in this revision

Viewing changes to junit/test/TestLaTeXDrawCursor.java

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2009-05-03 23:49:35 UTC
  • Revision ID: james.westby@ubuntu.com-20090503234935-cls7n48x018g0vk2
Tags: upstream-2.0.2+1
ImportĀ upstreamĀ versionĀ 2.0.2+1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * TestLaTeXDrawCursor.java
 
3
 */
 
4
 
 
5
package junit.test;
 
6
 
 
7
import java.awt.Graphics2D;
 
8
import java.awt.Point;
 
9
import java.awt.Toolkit;
 
10
import java.awt.image.BufferedImage;
 
11
import java.net.URL;
 
12
 
 
13
import javax.swing.ImageIcon;
 
14
 
 
15
import junit.framework.TestCase;
 
16
 
 
17
import org.junit.Test;
 
18
 
 
19
/** 
 
20
 * This class contains tests the methods of the class <code>TestLaTeXDrawCursor</code>.<br>
 
21
 * <br>
 
22
 * This file is part of LaTeXDraw<br>
 
23
 * Copyright (c) 2005-2008 Arnaud BLOUIN<br>
 
24
 *<br>
 
25
 *  LaTeXDraw is free software; you can redistribute it and/or modify
 
26
 *  it under the terms of the GNU General Public License as published by
 
27
 *  the Free Software Foundation; either version 2 of the License, or
 
28
 *  any later version.<br>
 
29
 *<br>
 
30
 *  LaTeXDraw is distributed without any warranty; without even the 
 
31
 *  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
 
32
 *  PURPOSE. See the GNU General Public License for more details.<br>
 
33
 * 
 
34
 * <br>
 
35
 * 02/14/07<br>
 
36
 * @author Arnaud BLOUIN<br>
 
37
 * @version 2.0.0<br>
 
38
 */
 
39
@SuppressWarnings("nls")
 
40
public class TestLaTeXDrawCursor extends TestCase
 
41
{
 
42
 
 
43
        @Test
 
44
        public void testGetCursor()
 
45
        {
 
46
                try 
 
47
                {//TODO voir pourquoi ca marche pas.
 
48
//                      Cursor cursor = LaTeXDrawCursor.getCursor("/res/cursors/RotCWDown.gif", "rotate");//$NON-NLS-1$//$NON-NLS-2$
 
49
                BufferedImage bi = new BufferedImage(32, 32, BufferedImage.TYPE_INT_ARGB);
 
50
                Graphics2D graphic = (Graphics2D)bi.getGraphics();
 
51
                ImageIcon img;
 
52
                URL url = getClass().getResource("/res/cursors/RotCWDown.gif");
 
53
                        img = new ImageIcon(url);
 
54
                        graphic.drawImage(img.getImage(), null, null);
 
55
                        
 
56
                        assertNotNull(Toolkit.getDefaultToolkit().createCustomCursor(bi,new Point(0,0), "aa"));
 
57
                        
 
58
                        graphic.dispose();
 
59
                        bi.flush();
 
60
                }
 
61
                catch(Exception e)
 
62
                {
 
63
                        fail();
 
64
                }
 
65
        }
 
66
}
 
67
 
 
68