Package org.jdesktop.swingx.painter
Class AlphaPainter<T>
java.lang.Object
org.jdesktop.beans.AbstractBean
org.jdesktop.swingx.painter.AbstractPainter<T>
org.jdesktop.swingx.painter.CompoundPainter<T>
org.jdesktop.swingx.painter.AlphaPainter<T>
- All Implemented Interfaces:
Painter<T>
Applies an alpha value to an entire stack of painters.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jdesktop.swingx.painter.AbstractPainter
AbstractPainter.Interpolation
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doPaint
(Graphics2D g, T component, int width, int height) Subclasses must implement this method and perform custom painting operations here.float
getAlpha()
Returns the current alpha value for this painter.void
setAlpha
(float alpha) Sets the current alpha value for this painter.Methods inherited from class org.jdesktop.swingx.painter.CompoundPainter
clearCache, clearLocalCache, configureGraphics, getPainters, getTransform, isCheckingDirtyChildPainters, isClipPreserved, isDirty, setCheckingDirtyChildPainters, setClipPreserved, setDirty, setPainters, setTransform, shouldUseCache, validate
Methods inherited from class org.jdesktop.swingx.painter.AbstractPainter
getFilters, getInterpolation, isAntialiasing, isCacheable, isCacheCleared, isInPaintContext, isVisible, paint, setAntialiasing, setCacheable, setFilters, setInPaintContext, setInterpolation, setVisible
Methods inherited from class org.jdesktop.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
Field Details
-
alpha
private float alpha
-
-
Constructor Details
-
AlphaPainter
public AlphaPainter()
-
-
Method Details
-
doPaint
Subclasses must implement this method and perform custom painting operations here.- Overrides:
doPaint
in classCompoundPainter<T>
- Parameters:
g
- The Graphics2D object in which to paintcomponent
-width
-height
-
-
getAlpha
public float getAlpha()Returns the current alpha value for this painter. This is the alpha value that will be applied to all painters set inside this painter. Alpha values will be multiplied. This means if you set an alpha of 0.5 on this painter and you nest a painter inside which uses an alpha of 0.5 then the final pixels drawn will have an alpha of 0.25.- Returns:
- the current value of alpha property
-
setAlpha
public void setAlpha(float alpha) Sets the current alpha value for this painter. This is the alpha value that will be applied to all painters set inside this painter. Alpha values will be multiplied. This means if you set an alpha of 0.5 on this painter and you nest a painter inside which uses an alpha of 0.5 then the final pixels drawn will have an alpha of 0.25.- Parameters:
alpha
- the new value of the alpha property
-