Java Doc for AbstractGradientPainter.java in  » Swing-Library » swingx » org » jdesktop » swingx » painter » gradient » 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 » Swing Library » swingx » org.jdesktop.swingx.painter.gradient 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.jdesktop.swingx.painter.AbstractPainter
   org.jdesktop.swingx.painter.gradient.AbstractGradientPainter

All known Subclasses:   org.jdesktop.swingx.painter.gradient.RadialGradientPainter,  org.jdesktop.swingx.painter.gradient.LinearGradientPainter,  org.jdesktop.swingx.painter.gradient.BasicGradientPainter,
AbstractGradientPainter
abstract public class AbstractGradientPainter extends AbstractPainter (Code)

An abstract base class from which the various gradient oriented painter classes extend. Gradient based painters perform an important task beyond what a MattePainter with a GradientPaint will do -- they resize the gradient to fit the Component regardless of its dimensions.

AbstractGradientPainter has a resize property of type Resize that specifies whether the gradient should be resized horizontally, vertically, in both directions or not at all (in which case you should really probably be using MattePainter). Subclasses must implement calculateSizedPaint to return a new gradient paint instance that is resized in the proper ways. If no Paint is returned from this method call, then nothing is painted.

By default, the resize property is set to BOTH.

In order for resizing to work properly with GradientPaint, LinearGradientPaint, and RadialGradientPaint, it is necessary that the various control points used in these paints be specified in such a manner that they can be reliably resized. For example, BasicGradientPainter takes GradientPaints who's point1 and point2 properties are specified between 0 and 1, representing at what percentage of the distance from the origin the gradient begins and ends. Thus, if I created a GradientPaint like this:


 GradientPaint gp = new GradientPaint(
 new Point2D.Double(.2d, 0),
 Color.BLUE,
 new Point2D.Double(.8d, 0),
 Color.WHITE);
 
then when painted, the gradient will start with a BLUE at 20% of the width of the component, and finish with WHITE at 80% of the width of the component.

See the various subclasses for more detailed examples.


author:
   rbair



Constructor Summary
public  AbstractGradientPainter()
    

Method Summary
abstract protected  PaintcalculateSizedPaint(int width, int height)
     a calculated Paint that fits within the given width/height.
public  ResizegetResize()
     a value indicating how the paint will be resized to fit thecomponent dimensions.
protected  booleanisResizeHorizontal()
    
protected  booleanisResizeVertical()
    
public  voidpaintBackground(Graphics2D g, JComponent component)
    
public  voidsetResize(Resize resize)
     Specifies how the paint will be resized based on the component dimensions.
Parameters:
  resize - the new Resize value.


Constructor Detail
AbstractGradientPainter
public AbstractGradientPainter()(Code)
Creates a new instance of AbstractGradientPainter




Method Detail
calculateSizedPaint
abstract protected Paint calculateSizedPaint(int width, int height)(Code)
a calculated Paint that fits within the given width/height. Maybe null.
Parameters:
  width - the width used to calculate the new paint size
Parameters:
  height - the height used to calculate the new paint size



getResize
public Resize getResize()(Code)
a value indicating how the paint will be resized to fit thecomponent dimensions. Never returns null.



isResizeHorizontal
protected boolean isResizeHorizontal()(Code)
true if getResize() returns BOTH or HORIZONTAL.



isResizeVertical
protected boolean isResizeVertical()(Code)
true if getResize() returns BOTH or VERTICAL.



paintBackground
public void paintBackground(Graphics2D g, JComponent component)(Code)



setResize
public void setResize(Resize resize)(Code)
Specifies how the paint will be resized based on the component dimensions.
Parameters:
  resize - the new Resize value. May be null. If null, set to Resize.BOTH.



Methods inherited from org.jdesktop.swingx.painter.AbstractPainter
public Object getAlphaInterpolation()(Code)(Java Doc)
public Object getAntialiasing()(Code)(Java Doc)
public Shape getClip()(Code)(Java Doc)
public Object getColorRendering()(Code)(Java Doc)
public Composite getComposite()(Code)(Java Doc)
public Object getDithering()(Code)(Java Doc)
public Effect[] getEffects()(Code)(Java Doc)
public Object getFractionalMetrics()(Code)(Java Doc)
public Object getInterpolation()(Code)(Java Doc)
public Object getRendering()(Code)(Java Doc)
public Object getRenderingHint(RenderingHints.Key key)(Code)(Java Doc)
public Map<RenderingHints.Key, Object> getRenderingHints()(Code)(Java Doc)
public Resize getResizeClip()(Code)(Java Doc)
public Object getStrokeControl()(Code)(Java Doc)
public Object getTextAntialiasing()(Code)(Java Doc)
public boolean isUseCache()(Code)(Java Doc)
public void paint(Graphics2D g, T component)(Code)(Java Doc)
abstract protected void paintBackground(Graphics2D g, T component)(Code)(Java Doc)
protected void restoreState(Graphics2D g)(Code)(Java Doc)
protected void saveState(Graphics2D g)(Code)(Java Doc)
public void setAlphaInterpolation(Object alphaInterpolation)(Code)(Java Doc)
public void setAntialiasing(Object antialiasing)(Code)(Java Doc)
public void setClip(Shape clip)(Code)(Java Doc)
public void setColorRendering(Object colorRendering)(Code)(Java Doc)
public void setComposite(Composite c)(Code)(Java Doc)
public void setDithering(Object dithering)(Code)(Java Doc)
public void setEffects(Effect... effects)(Code)(Java Doc)
public void setEffects(BufferedImageOp... filters)(Code)(Java Doc)
public void setFractionalMetrics(Object fractionalMetrics)(Code)(Java Doc)
public void setInterpolation(Object interpolation)(Code)(Java Doc)
public void setRendering(Object rendering)(Code)(Java Doc)
public void setRenderingHint(RenderingHints.Key key, Object hint)(Code)(Java Doc)
public void setRenderingHints(Map<RenderingHints.Key, Object> renderingHints)(Code)(Java Doc)
public void setResizeClip(Resize r)(Code)(Java Doc)
public void setStrokeControl(Object strokeControl)(Code)(Java Doc)
public void setTextAntialiasing(Object textAntialiasing)(Code)(Java Doc)
public void setUseCache(boolean b)(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.