Java Doc for SWTUtils.java in  » Chart » jfreechart » org » jfree » experimental » swt » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Chart » jfreechart » org.jfree.experimental.swt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jfree.experimental.swt.SWTUtils

SWTUtils
public class SWTUtils (Code)
Utility class gathering some useful and general method. Mainly convert forth and back graphical stuff between awt and swt.


Field Summary
final protected static  JPanelDUMMY_PANEL
     A dummy JPanel used to provide font metrics.


Method Summary
public static  java.awt.ColortoAwtColor(Color color)
     Creates an awt color instance to match the rgb values of the specified swt color.
Parameters:
  color - The swt color to match.
public static  java.awt.FonttoAwtFont(Device device, FontData fontData, boolean ensureSameSize)
     Create an awt font by converting as much information as possible from the provided swt FontData.

Generally speaking, given a font size, an swt font will display differently on the screen than the corresponding awt one.

public static  java.awt.FonttoAwtFont(Device device, Font font)
     Create an awt font by converting as much information as possible from the provided swt Font.
Parameters:
  device - The swt device to draw on (display or gc device).
Parameters:
  font - The swt font to convert.
public static  MouseEventtoAwtMouseEvent(org.eclipse.swt.widgets.Event event)
     Creates an AWT MouseEvent from a swt event. This method helps passing SWT mouse event to awt components.
Parameters:
  event - The swt event.
public static  Point2DtoAwtPoint(Point p)
     Returns an AWT point with the same coordinates as the specified SWT point.
Parameters:
  p - the SWT point (null not permitted).
public static  Rectangle2DtoAwtRectangle(Rectangle rect)
     Transform a swt Rectangle instance into an awt one.
public static  ColortoSwtColor(Device device, java.awt.Paint paint)
     Creates a swt color instance to match the rgb values of the specified awt paint.
public static  ColortoSwtColor(Device device, java.awt.Color color)
     Creates a swt color instance to match the rgb values of the specified awt color.
public static  FontDatatoSwtFontData(Device device, java.awt.Font font, boolean ensureSameSize)
     Create a FontData object which encapsulate the essential data to create a swt font.
public static  PointtoSwtPoint(java.awt.Point p)
     Returns an SWT point with the same coordinates as the specified AWT point.
Parameters:
  p - the AWT point (null not permitted).
public static  PointtoSwtPoint(java.awt.geom.Point2D p)
     Returns an SWT point with the same coordinates as the specified AWT point (rounded to integer values).
Parameters:
  p - the AWT point (null not permitted).
public static  RectangletoSwtRectangle(Rectangle2D rect2d)
     Transform an awt Rectangle2d instance into a swt one. The coordinates are rounded to integer for the swt object.
Parameters:
  rect2d - The awt rectangle to map.

Field Detail
DUMMY_PANEL
final protected static JPanel DUMMY_PANEL(Code)
A dummy JPanel used to provide font metrics.





Method Detail
toAwtColor
public static java.awt.Color toAwtColor(Color color)(Code)
Creates an awt color instance to match the rgb values of the specified swt color.
Parameters:
  color - The swt color to match. an awt color abject.



toAwtFont
public static java.awt.Font toAwtFont(Device device, FontData fontData, boolean ensureSameSize)(Code)
Create an awt font by converting as much information as possible from the provided swt FontData.

Generally speaking, given a font size, an swt font will display differently on the screen than the corresponding awt one. Because the SWT toolkit use native graphical ressources whenever it is possible, this fact is plateform dependent. To address this issue, it is possible to enforce the method to return an awt font with the same height as the swt one.
Parameters:
  device - The swt device being drawn on (display or gc device).
Parameters:
  fontData - The swt font to convert.
Parameters:
  ensureSameSize - A boolean used to enforce the same size (in pixels) between the swt font and the newly created awt font. An awt font converted from the provided swt font.




toAwtFont
public static java.awt.Font toAwtFont(Device device, Font font)(Code)
Create an awt font by converting as much information as possible from the provided swt Font.
Parameters:
  device - The swt device to draw on (display or gc device).
Parameters:
  font - The swt font to convert. An awt font converted from the provided swt font.



toAwtMouseEvent
public static MouseEvent toAwtMouseEvent(org.eclipse.swt.widgets.Event event)(Code)
Creates an AWT MouseEvent from a swt event. This method helps passing SWT mouse event to awt components.
Parameters:
  event - The swt event. A AWT mouse event based on the given SWT event.



toAwtPoint
public static Point2D toAwtPoint(Point p)(Code)
Returns an AWT point with the same coordinates as the specified SWT point.
Parameters:
  p - the SWT point (null not permitted). An AWT point with the same coordinates as p.
See Also:   SWTUtils.toSwtPoint(java.awt.Point)



toAwtRectangle
public static Rectangle2D toAwtRectangle(Rectangle rect)(Code)
Transform a swt Rectangle instance into an awt one.
Parameters:
  rect - the swt Rectangle a Rectangle2D.Double instance with the eappropriate location and size.



toSwtColor
public static Color toSwtColor(Device device, java.awt.Paint paint)(Code)
Creates a swt color instance to match the rgb values of the specified awt paint. For now, this method test if the paint is a color and then return the adequate swt color. Otherwise plain black is assumed.
Parameters:
  device - The swt device to draw on (display or gc device).
Parameters:
  paint - The awt color to match. a swt color object.



toSwtColor
public static Color toSwtColor(Device device, java.awt.Color color)(Code)
Creates a swt color instance to match the rgb values of the specified awt color. alpha channel is not supported. Note that the dispose method will need to be called on the returned object.
Parameters:
  device - The swt device to draw on (display or gc device).
Parameters:
  color - The awt color to match. a swt color object.



toSwtFontData
public static FontData toSwtFontData(Device device, java.awt.Font font, boolean ensureSameSize)(Code)
Create a FontData object which encapsulate the essential data to create a swt font. The data is taken from the provided awt Font.

Generally speaking, given a font size, the returned swt font will display differently on the screen than the awt one. Because the SWT toolkit use native graphical ressources whenever it is possible, this fact is plateform dependent. To address this issue, it is possible to enforce the method to return a font with the same size (or at least as close as possible) as the awt one.

When the object is no more used, the user must explicitely call the dispose method on the returned font to free the operating system resources (the garbage collector won't do it).
Parameters:
  device - The swt device to draw on (display or gc device).
Parameters:
  font - The awt font from which to get the data.
Parameters:
  ensureSameSize - A boolean used to enforce the same size (in pixels) between the awt font and the newly created swt font. a FontData object.




toSwtPoint
public static Point toSwtPoint(java.awt.Point p)(Code)
Returns an SWT point with the same coordinates as the specified AWT point.
Parameters:
  p - the AWT point (null not permitted). An SWT point with the same coordinates as p.
See Also:   SWTUtils.toAwtPoint(Point)



toSwtPoint
public static Point toSwtPoint(java.awt.geom.Point2D p)(Code)
Returns an SWT point with the same coordinates as the specified AWT point (rounded to integer values).
Parameters:
  p - the AWT point (null not permitted). An SWT point with the same coordinates as p.
See Also:   SWTUtils.toAwtPoint(Point)



toSwtRectangle
public static Rectangle toSwtRectangle(Rectangle2D rect2d)(Code)
Transform an awt Rectangle2d instance into a swt one. The coordinates are rounded to integer for the swt object.
Parameters:
  rect2d - The awt rectangle to map. an swt Rectangle object.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.