Java Doc for MultipleGradientPaintContext.java in  » XML-UI » xui32 » com » xoetrope » batik » ext » awt » 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 » XML UI » xui32 » com.xoetrope.batik.ext.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.xoetrope.batik.ext.awt.MultipleGradientPaintContext

All known Subclasses:   com.xoetrope.batik.ext.awt.RadialGradientPaintContext,  com.xoetrope.batik.ext.awt.LinearGradientPaintContext,
MultipleGradientPaintContext
abstract class MultipleGradientPaintContext implements PaintContext(Code)
This is the superclass for all PaintContexts which use a multiple color gradient to fill in their raster. It provides the actual color interpolation functionality. Subclasses only have to deal with using the gradient to fill pixels in a raster.
author:
   Nicholas Talian, Vincent Hardy, Jim Graham, Jerry Evans
author:
   Vincent Hardy
version:
   $Id: MultipleGradientPaintContext.java,v 1.2 2006/08/31 09:28:47 val Exp $


Field Summary
final protected static  booleanDEBUG
    
final protected static  intGRADIENT_SIZE
     Constant number of max colors between any 2 arbitrary colors.
final protected static  intGRADIENT_SIZE_INDEX
    
protected  floata00a01a10a11a02a12
     Elements of the inverse transform matrix.
protected static  WeakReferencecached
    
protected static  ColorModelcachedModel
    
protected  MultipleGradientPaint.ColorSpaceEnumcolorSpace
    
protected  MultipleGradientPaint.CycleMethodEnumcycleMethod
     The method to use when painting out of the gradient bounds.
protected  ColorModeldataModel
     The color model data is generated in (always un premult).
protected  intfastGradientArraySize
     Size of gradients array for scaling the 0-1 index when looking up colors the fast way.
protected  float[]fractions
    
protected  int[]gradient
     Array which contains the interpolated color values for each interval, used by calculateSingleArrayGradient().
protected  intgradientAverage
     This holds the blend of all colors in the gradient.
protected  intgradientOverflow
    
protected  intgradientUnderflow
    
protected  int[][]gradients
     Array of gradient arrays, one array for each interval.
protected  intgradientsLength
     Length of the 2D slow lookup gradients array.
protected  booleanhasDiscontinuity
     This boolean indicates if the gradient appears to have sudden discontinuities in it, this may be because of multiple stops at the same location or use of the REPEATE mode.
protected  booleanisSimpleLookup
     This boolean specifies wether we are in simple lookup mode, where an input value between 0 and 1 may be used to directly index into a single array of gradient colors.
protected  ColorModelmodel
     PaintContext's output ColorModel ARGB if colors are not all opaque, RGB otherwise.
protected  float[]normalizedIntervals
    
protected  WritableRastersaved
    

Constructor Summary
public  MultipleGradientPaintContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform t, RenderingHints hints, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethodEnum cycleMethod, MultipleGradientPaint.ColorSpaceEnum colorSpace)
     Constructor for superclass.

Method Summary
final protected  voidcalculateGradientFractions(Color[] loColors, Color[] hiColors)
     This function is the meat of this class.
final public  voiddispose()
     Release the resources allocated for the operation.
abstract protected  voidfillRaster(int pixels, int off, int adjust, int x, int y, int w, int h)
     Subclasses should implement this.
final protected static synchronized  WritableRastergetCachedRaster(ColorModel cm, int w, int h)
     Took this cacheRaster code from GradientPaint.
final public  ColorModelgetColorModel()
     Return the ColorModel of the output.
final public  RastergetRaster(int x, int y, int w, int h)
     Superclass getRaster...
final protected  intindexGradientAntiAlias(float position, float sz)
     Helper function to index into the gradients array.
final protected  intindexIntoGradientsArrays(float position)
     Helper function to index into the gradients array.
final protected static synchronized  voidputCachedRaster(ColorModel cm, WritableRaster ras)
     Took this cacheRaster code from GradientPaint.

Field Detail
DEBUG
final protected static boolean DEBUG(Code)



GRADIENT_SIZE
final protected static int GRADIENT_SIZE(Code)
Constant number of max colors between any 2 arbitrary colors. Used for creating and indexing gradients arrays.



GRADIENT_SIZE_INDEX
final protected static int GRADIENT_SIZE_INDEX(Code)



a00a01a10a11a02a12
protected float a00a01a10a11a02a12(Code)
Elements of the inverse transform matrix.



cached
protected static WeakReference cached(Code)
The cached raster, which is reusable among instances



cachedModel
protected static ColorModel cachedModel(Code)
The cached colorModel



colorSpace
protected MultipleGradientPaint.ColorSpaceEnum colorSpace(Code)
The colorSpace in which to perform the interpolation



cycleMethod
protected MultipleGradientPaint.CycleMethodEnum cycleMethod(Code)
The method to use when painting out of the gradient bounds.



dataModel
protected ColorModel dataModel(Code)
The color model data is generated in (always un premult).



fastGradientArraySize
protected int fastGradientArraySize(Code)
Size of gradients array for scaling the 0-1 index when looking up colors the fast way.



fractions
protected float[] fractions(Code)
fractions array



gradient
protected int[] gradient(Code)
Array which contains the interpolated color values for each interval, used by calculateSingleArrayGradient(). It is protected for possible direct access by subclasses.



gradientAverage
protected int gradientAverage(Code)
This holds the blend of all colors in the gradient. we use this at extreamly low resolutions to ensure we get a decent blend of the colors.



gradientOverflow
protected int gradientOverflow(Code)
This holds the color to use when we are off the top of the gradient



gradientUnderflow
protected int gradientUnderflow(Code)
This holds the color to use when we are off the bottom of the gradient



gradients
protected int[][] gradients(Code)
Array of gradient arrays, one array for each interval. Used by calculateMultipleArrayGradient().



gradientsLength
protected int gradientsLength(Code)
Length of the 2D slow lookup gradients array.



hasDiscontinuity
protected boolean hasDiscontinuity(Code)
This boolean indicates if the gradient appears to have sudden discontinuities in it, this may be because of multiple stops at the same location or use of the REPEATE mode.



isSimpleLookup
protected boolean isSimpleLookup(Code)
This boolean specifies wether we are in simple lookup mode, where an input value between 0 and 1 may be used to directly index into a single array of gradient colors. If this boolean value is false, then we have to use a 2-step process where we have to determine which gradient array we fall into, then determine the index into that array.



model
protected ColorModel model(Code)
PaintContext's output ColorModel ARGB if colors are not all opaque, RGB otherwise. Linear and premult are matched to output ColorModel.



normalizedIntervals
protected float[] normalizedIntervals(Code)
Normalized intervals array



saved
protected WritableRaster saved(Code)
Raster is reused whenever possible




Constructor Detail
MultipleGradientPaintContext
public MultipleGradientPaintContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform t, RenderingHints hints, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethodEnum cycleMethod, MultipleGradientPaint.ColorSpaceEnum colorSpace) throws NoninvertibleTransformException(Code)
Constructor for superclass. Does some initialization, but leaves most of the heavy-duty math for calculateGradient(), so the subclass may do some other manipulation beforehand if necessary. This is not possible if this computation is done in the superclass constructor which always gets called first.




Method Detail
calculateGradientFractions
final protected void calculateGradientFractions(Color[] loColors, Color[] hiColors)(Code)
This function is the meat of this class. It calculates an array of gradient colors based on an array of fractions and color values at those fractions.



dispose
final public void dispose()(Code)
Release the resources allocated for the operation.



fillRaster
abstract protected void fillRaster(int pixels, int off, int adjust, int x, int y, int w, int h)(Code)
Subclasses should implement this.



getCachedRaster
final protected static synchronized WritableRaster getCachedRaster(ColorModel cm, int w, int h)(Code)
Took this cacheRaster code from GradientPaint. It appears to recycle rasters for use by any other instance, as long as they are sufficiently large.



getColorModel
final public ColorModel getColorModel()(Code)
Return the ColorModel of the output.



getRaster
final public Raster getRaster(int x, int y, int w, int h)(Code)
Superclass getRaster...



indexGradientAntiAlias
final protected int indexGradientAntiAlias(float position, float sz)(Code)
Helper function to index into the gradients array. This is necessary because each interval has an array of colors with uniform size 255. However, the color intervals are not necessarily of uniform length, so a conversion is required. This version also does anti-aliasing by averaging the gradient over position+/-(sz/2).
Parameters:
  position - the unmanipulated position. want to map this into therange 0 to 1
Parameters:
  sz - the size in gradient space to average.



indexIntoGradientsArrays
final protected int indexIntoGradientsArrays(float position)(Code)
Helper function to index into the gradients array. This is necessary because each interval has an array of colors with uniform size 255. However, the color intervals are not necessarily of uniform length, so a conversion is required.
Parameters:
  position - the unmanipulated position. want to map this into therange 0 to 1



putCachedRaster
final protected static synchronized void putCachedRaster(ColorModel cm, WritableRaster ras)(Code)
Took this cacheRaster code from GradientPaint. It appears to recycle rasters for use by any other instance, as long as they are sufficiently large.



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.