|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
org.jdesktop.jxlayer.plaf.LayerUI<V>
org.jdesktop.jxlayer.plaf.AbstractLayerUI<V>
org.jdesktop.jxlayer.plaf.AbstractBufferedLayerUI<V>
org.jdesktop.jxlayer.plaf.BufferedLayerUI<V>
public class BufferedLayerUI<V extends javax.swing.JComponent>
BufferedLayerUI is the mutable implementation of
the AbstractBufferedLayerUI class.
LayerEffects, etc.
It also notifies its LayerItemListeners
when any of its properties or properties of its Effects
are changed, this leads to the automatic repainting
of the JXLayer, this object is set to.
Note: The BufferedLayerUI is not shareable and
can be set to single JXLayer instance.
The current JXLayer can be obtained with AbstractBufferedLayerUI.getLayer() method
setComposite(java.awt.Composite),
setAlpha(float),
setClip(java.awt.Shape),
setLayerEffects(org.jdesktop.jxlayer.plaf.effect.LayerEffect[]),
setRenderingHints(java.util.Map),
setTransform(java.awt.geom.AffineTransform),
Serialized Form| Constructor Summary | |
|---|---|
BufferedLayerUI()
|
|
| Method Summary | |
|---|---|
float |
getAlpha()
If getComposite() returns an instanse of AlphaComposite
then this method returns the value of AlphaComposite.getAlpha(),
otherwise it returns 1. |
java.awt.Shape |
getClip()
Returns the Shape to be applied to the Graphics2D
during painting of this BufferedLayerUI. |
protected java.awt.Shape |
getClip(JXLayer<? extends V> l)
Returns the Shape to be used as the clip during painting of this JXLayer,
the default implementation returns null.
This implementation returns the Shape
set using setClip(Shape)}
If a BufferedLayerUI provides more extensive API
to support different clipping shapes depending on its state
or on the state of the passed JXLayer,
this method should be overridden. |
java.awt.Composite |
getComposite()
Returns the Composite to be applied to the Graphics2D
during painting of this BufferedLayerUI. |
protected java.awt.Composite |
getComposite(JXLayer<? extends V> l)
Returns the Composite to be used during painting of this JXLayer,
the default implementation returns null.
This implementation returns the Composite
set using setComposite(Composite)
If a BufferedLayerUI provides more extensive API
to support different Composites depending on its state
or on the state of the passed JXLayer,
this method should be overridden. |
LayerEffect[] |
getLayerEffects()
Returns the array of the LayerEffects
to be applied to the buffer of this BufferedLayerUI |
protected LayerEffect[] |
getLayerEffects(JXLayer<? extends V> l)
Returns the array of LayerEffect to be used during painting of this JXLayer,
the default implementation returns constant empty array.
This implementation returns the array of Effects
set using setLayerEffects(LayerEffect[])
If a BufferedLayerUI provides more extensive API
to support different Effects depending on its state
or on the state of the passed JXLayer,
this method should be overridden. |
java.util.Map<java.awt.RenderingHints.Key,java.lang.Object> |
getRenderingHints()
Returns the map of rendering hints to be applied to the Graphics2D
during painting of this BufferedLayerUI. |
protected java.util.Map<java.awt.RenderingHints.Key,java.lang.Object> |
getRenderingHints(JXLayer<? extends V> l)
Returns the map of rendering hints to be used during painting of this JXLayer,
the default implementation returns the empty unmodifiable map.
This implementation returns the map of rendreing hints
set using setRenderingHints(java.util.Map)
If a BufferedLayerUI provides more extensive API
to support different rendering hints depending on its state
or on the state of the passed JXLayer,
this method should be overridden. |
java.awt.geom.AffineTransform |
getTransform()
Returns the AffineTransform to be applied to the Graphics2D
during painting of this BufferedLayerUI. |
protected java.awt.geom.AffineTransform |
getTransform(JXLayer<? extends V> l)
Returns the AffineTransform to be used during painting of this JXLayer,
the default implementation returns null.
This implementation returns the AffineTransform
set using setTransform(AffineTransform)
If a BufferedLayerUI provides more extensive API
to support different AffineTransform depending on its state
or on the state of the passed JXLayer,
this method should be overridden. |
boolean |
isIncrementalUpdate()
Returns true if incremental update is enabled for this BufferedLayerUI
and its cache image is updated on every repainting, otherwise returns false. |
protected boolean |
isIncrementalUpdate(JXLayer<? extends V> l)
If this method returns false and AbstractLayerUI.isDirty returns false
and the cached image exists and matches the size of painted JXLayer
then the existing image will be used during the painting.
This implementation returns the incremental update flag
set using setIncrementalUpdate(boolean)
If a BufferedLayerUI provides more extensive API
to support incremental updated depending on its state
or on the state of the passed JXLayer,
this method should be overridden. |
void |
setAlpha(float alpha)
Sets the AlphaComposite with the specified alpha value
as the Composite for this BufferedLayerUI. |
void |
setClip(java.awt.Shape clip)
Sets the clipping Shape to be applied to the Graphics2D
during painting of this BufferedLayerUI. |
void |
setComposite(java.awt.Composite composite)
Sets the Composite to be applied to the Graphics2D
during painting of this BufferedLayerUI. |
void |
setIncrementalUpdate(boolean incrementalUpdate)
Sets the incremental update flag for this BufferedLayerUI. |
void |
setLayerEffects(LayerEffect... effects)
Sets the array of the Effects to be applied to the Graphics2D
during painting of this BufferedLayerUI
This BufferedLayerUI is set to every Effect
in this array as a PropertyChangeListener to mark itself
as dirty when any of those Effects changes its state. |
void |
setRenderingHints(java.util.Map<java.awt.RenderingHints.Key,java.lang.Object> renderingHints)
Sets the map of rendering hints to be applied to the Graphics2D
during painting of this BufferedLayerUI. |
void |
setTransform(java.awt.geom.AffineTransform transform)
Sets the AffineTransform to be applied to the Graphics2D
during painting of this BufferedLayerUI. |
| Methods inherited from class org.jdesktop.jxlayer.plaf.AbstractBufferedLayerUI |
|---|
applyLayerEffects, createBuffer, getBuffer, getLayer, installUI, isBufferContentValid, isBufferFormatValid, paint, propertyChange, setBuffer, uninstallUI, updateUI |
| Methods inherited from class org.jdesktop.jxlayer.plaf.AbstractLayerUI |
|---|
configureGraphics, eventDispatched, getLayerEventMask, handlePropertyChangeEvent, isDirty, paintLayer, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, setDirty |
| Methods inherited from class javax.swing.plaf.ComponentUI |
|---|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferedLayerUI()
| Method Detail |
|---|
public LayerEffect[] getLayerEffects()
LayerEffects
to be applied to the buffer of this BufferedLayerUI
Effects
to be applied to the buffer of this paintersetLayerEffects(LayerEffect[]),
getLayerEffects(JXLayer)protected LayerEffect[] getLayerEffects(JXLayer<? extends V> l)
LayerEffect to be used during painting of this JXLayer,
the default implementation returns constant empty array.
This implementation returns the array of Effects
set using setLayerEffects(LayerEffect[])
If a BufferedLayerUI provides more extensive API
to support different Effects depending on its state
or on the state of the passed JXLayer,
this method should be overridden.
getLayerEffects in class AbstractBufferedLayerUI<V extends javax.swing.JComponent>l - the JXLayer being painted
LayerEffect to be used during painting of the JXLayersetLayerEffects(LayerEffect[]),
getLayerEffects()public void setLayerEffects(LayerEffect... effects)
Effects to be applied to the Graphics2D
during painting of this BufferedLayerUI
This BufferedLayerUI is set to every Effect
in this array as a PropertyChangeListener to mark itself
as dirty when any of those Effects changes its state.
This method marks BufferedLayerUI as dirty
which causes repainting of its JXLayer.
effects - the array of the Effects
to be applied to the buffer of this BufferedLayerUIgetLayerEffects(),
getLayerEffects(JXLayer),
AbstractLayerUI.setDirty(boolean)public java.awt.Shape getClip()
Shape to be applied to the Graphics2D
during painting of this BufferedLayerUI.
Shape to be applied to the Graphics2D
during painting of this BufferedLayerUIsetClip(Shape),
getClip(JXLayer)protected java.awt.Shape getClip(JXLayer<? extends V> l)
Shape to be used as the clip during painting of this JXLayer,
the default implementation returns null.
This implementation returns the Shape
set using setClip(Shape)}
If a BufferedLayerUI provides more extensive API
to support different clipping shapes depending on its state
or on the state of the passed JXLayer,
this method should be overridden.
getClip in class AbstractLayerUI<V extends javax.swing.JComponent>l - the JXLayer being painted
Shape to be used as the clip during painting of the JXLayergetClip(),
setClip(Shape)public void setClip(java.awt.Shape clip)
Shape to be applied to the Graphics2D
during painting of this BufferedLayerUI.
This method marks BufferedLayerUI as dirty
which causes repainting of its JXLayer.
clip - the Shape to be used as the clip during
painting of this BufferedLayerUIgetClip(),
getClip(JXLayer),
AbstractLayerUI.setDirty(boolean)public java.awt.Composite getComposite()
Composite to be applied to the Graphics2D
during painting of this BufferedLayerUI.
Composite to be applied to the Graphics2D
during painting of this BufferedLayerUIsetComposite(Composite),
getComposite(JXLayer)protected java.awt.Composite getComposite(JXLayer<? extends V> l)
Composite to be used during painting of this JXLayer,
the default implementation returns null.
This implementation returns the Composite
set using setComposite(Composite)
If a BufferedLayerUI provides more extensive API
to support different Composites depending on its state
or on the state of the passed JXLayer,
this method should be overridden.
getComposite in class AbstractLayerUI<V extends javax.swing.JComponent>l - the JXLayer being painted
Composite to be used during painting for the JXLayersetComposite(Composite),
getComposite()public void setComposite(java.awt.Composite composite)
Composite to be applied to the Graphics2D
during painting of this BufferedLayerUI.
This method marks BufferedLayerUI as dirty
which causes repainting of its JXLayer.
composite - the Composite to be applied to the Graphics2D
during painting of this BufferedLayerUI.getComposite(),
getComposite(JXLayer),
AbstractLayerUI.setDirty(boolean)public float getAlpha()
getComposite() returns an instanse of AlphaComposite
then this method returns the value of AlphaComposite.getAlpha(),
otherwise it returns 1.
getComposite() returns an instanse of AlphaComposite
returns the value of AlphaComposite.getAlpha(),
otherwise it returns 1setAlpha(float),
setComposite(Composite),
getComposite()public void setAlpha(float alpha)
AlphaComposite with the specified alpha value
as the Composite for this BufferedLayerUI.
alpha - the constant alpha to be multiplied with the alpha of
the source. alpha must be a floating point number in the
inclusive range [0.0, 1.0].
java.lang.IllegalArgumentException - if
alpha is less than 0.0 or greater than 1.0,getAlpha(),
setComposite(Composite)public java.util.Map<java.awt.RenderingHints.Key,java.lang.Object> getRenderingHints()
Graphics2D
during painting of this BufferedLayerUI.
Graphics2D
during painting of this BufferedLayerUIsetRenderingHints(Map),
getRenderingHints(JXLayer)protected java.util.Map<java.awt.RenderingHints.Key,java.lang.Object> getRenderingHints(JXLayer<? extends V> l)
JXLayer,
the default implementation returns the empty unmodifiable map.
This implementation returns the map of rendreing hints
set using setRenderingHints(java.util.Map)
If a BufferedLayerUI provides more extensive API
to support different rendering hints depending on its state
or on the state of the passed JXLayer,
this method should be overridden.
getRenderingHints in class AbstractLayerUI<V extends javax.swing.JComponent>l - the JXLayer being painted
JXLayersetRenderingHints(java.util.Map),
getRenderingHints()public void setRenderingHints(java.util.Map<java.awt.RenderingHints.Key,java.lang.Object> renderingHints)
Graphics2D
during painting of this BufferedLayerUI.
This method marks BufferedLayerUI as dirty
which causes repainting of its JXLayer.
renderingHints - the map of rendering hints to be applied to the Graphics2D
during painting of this BufferedLayerUIgetRenderingHints(),
getRenderingHints(JXLayer),
AbstractLayerUI.setDirty(boolean)public java.awt.geom.AffineTransform getTransform()
AffineTransform to be applied to the Graphics2D
during painting of this BufferedLayerUI.
AffineTransform to be applied to the Graphics2D
during painting of this BufferedLayerUIsetTransform(AffineTransform),
getTransform(JXLayer)protected java.awt.geom.AffineTransform getTransform(JXLayer<? extends V> l)
AffineTransform to be used during painting of this JXLayer,
the default implementation returns null.
This implementation returns the AffineTransform
set using setTransform(AffineTransform)
If a BufferedLayerUI provides more extensive API
to support different AffineTransform depending on its state
or on the state of the passed JXLayer,
this method should be overridden.
getTransform in class AbstractLayerUI<V extends javax.swing.JComponent>l - the JXLayer being painted
AffineTransform to be used during painting of the JXLayersetTransform(AffineTransform),
getTransform()public void setTransform(java.awt.geom.AffineTransform transform)
AffineTransform to be applied to the Graphics2D
during painting of this BufferedLayerUI.
This method marks BufferedLayerUI as dirty
which causes repainting of its JXLayer.
transform - the AffineTransform to be applied to the Graphics2D
during painting of this BufferedLayerUIgetTransform(),
getTransform(JXLayer),
AbstractLayerUI.setDirty(boolean)public boolean isIncrementalUpdate()
true if incremental update is enabled for this BufferedLayerUI
and its cache image is updated on every repainting, otherwise returns false.
true if incremental update is enabled for this BufferedLayerUI
and its cache image is updated on every repainting, otherwise returns falsesetIncrementalUpdate(boolean),
isIncrementalUpdate(JXLayer)protected boolean isIncrementalUpdate(JXLayer<? extends V> l)
false and AbstractLayerUI.isDirty returns false
and the cached image exists and matches the size of painted JXLayer
then the existing image will be used during the painting.
It helps to skip unnecessary painting and save a lot of time,
especially if BufferedImageOpEffects are used.
true the cache image will be updated on every painting.
The default implementation returns true
This implementation returns the incremental update flag
set using setIncrementalUpdate(boolean)
If a BufferedLayerUI provides more extensive API
to support incremental updated depending on its state
or on the state of the passed JXLayer,
this method should be overridden.
isIncrementalUpdate in class AbstractBufferedLayerUI<V extends javax.swing.JComponent>l - the JXLayer being painted
true if the cache image should be updated on every painting,
otherwise returns falsesetIncrementalUpdate(boolean),
isIncrementalUpdate()public void setIncrementalUpdate(boolean incrementalUpdate)
BufferedLayerUI.
If it is true the cache image will be updated on every repainting,
otherwise the existing image will be painted.
This method marks BufferedLayerUI as dirty
which causes repainting of its JXLayer.
incrementalUpdate - true if incremental update is enabled
and cache image will be updated on every repainting, otherwise falseisIncrementalUpdate(),
isIncrementalUpdate(JXLayer),
AbstractLayerUI.setDirty(boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||