|
|||||||||
| 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<javax.swing.JComponent>
org.jdesktop.jxlayer.plaf.ext.SpotLightUI
public class SpotLightUI
SpotLightUI paints the layer as is and then it paints translucent mask on the top.
Here you can see the example of overriddencontains() method,
which implements a custom mouseEvent filter;paintLayer();setDirty(true) is called)
paint(Graphics,JComponent),
contains(JComponent,int,int),
Serialized Form| Constructor Summary | |
|---|---|
SpotLightUI()
Creates an instance of SpotLightUI |
|
SpotLightUI(java.awt.Color overlayColor,
int softClipWidth)
Creates an instance of SpotLightUI with the specified width of the "soft border" and overlay color, which is usually translucent. |
|
SpotLightUI(int softClipWidth)
Creates an instance of SpotLightUI with the specified width of the "soft border" |
|
| Method Summary | |
|---|---|
void |
addShape(java.awt.Shape shape)
Adds the specified shape to the slip list. |
boolean |
contains(javax.swing.JComponent c,
int x,
int y)
|
long |
getLayerEventMask()
This UI delegate does not listen for any events |
java.awt.Color |
getOverlayColor()
Returns the overlay color used for spotlight effect |
int |
getSoftClipWidth()
Gets the width for the "soft border" |
protected boolean |
isIncrementalUpdate(JXLayer<? extends javax.swing.JComponent> l)
We don't want to update the buffer of this painter for every component's repainting, so this method returns false
and it makes the painting much faster |
boolean |
isShadowEnabled()
|
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
Paints the specified component. Subclasses should override this method and use the specified Graphics object to
render the content of the component.
Note: It is rarely necessary to override this method, for
custom painting override AbstractLayerUI.paintLayer(Graphics2D,JXLayer) instead
This method configures the passed Graphics with help of the
AbstractLayerUI.configureGraphics(Graphics2D,JXLayer) method,
then calls paintLayer(Graphics2D,JXLayer)
and resets the "dirty bit" at the end.
This method paints the paitns the JXLayer to the BufferedImage
and then paints this image to the passed Graphics. |
protected void |
paintLayer(java.awt.Graphics2D g2,
JXLayer<? extends javax.swing.JComponent> l)
Subclasses should implement this method and perform custom painting operations here. |
void |
reset()
Resets this SpotLightUI. |
void |
setOverlayColor(java.awt.Color overlayColor)
Sets the overlay color used for spotlight effect |
void |
setShadowEnabled(boolean enabled)
|
void |
setSoftClipWidth(int softClipWidth)
Sets the width for the "soft border" |
| Methods inherited from class org.jdesktop.jxlayer.plaf.AbstractBufferedLayerUI |
|---|
applyLayerEffects, createBuffer, getBuffer, getLayer, getLayerEffects, installUI, isBufferContentValid, isBufferFormatValid, propertyChange, setBuffer, uninstallUI, updateUI |
| Methods inherited from class org.jdesktop.jxlayer.plaf.AbstractLayerUI |
|---|
configureGraphics, eventDispatched, getClip, getComposite, getRenderingHints, getTransform, handlePropertyChangeEvent, isDirty, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, setDirty |
| Methods inherited from class javax.swing.plaf.ComponentUI |
|---|
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 SpotLightUI()
public SpotLightUI(int softClipWidth)
softClipWidth - the width of the "soft border"
public SpotLightUI(java.awt.Color overlayColor,
int softClipWidth)
overlayColor - the overlay colorsoftClipWidth - the width of the "soft border"| Method Detail |
|---|
public long getLayerEventMask()
getLayerEventMask in class AbstractLayerUI<javax.swing.JComponent>0JXLayer.setLayerEventMask(long)public boolean isShadowEnabled()
public void setShadowEnabled(boolean enabled)
public java.awt.Color getOverlayColor()
public void setOverlayColor(java.awt.Color overlayColor)
overlayColor - the overlay color used for spotlight effectpublic int getSoftClipWidth()
public void setSoftClipWidth(int softClipWidth)
softClipWidth - the width for the "soft border"public void reset()
public void addShape(java.awt.Shape shape)
shape - Shape to add to the clip list.protected boolean isIncrementalUpdate(JXLayer<? extends javax.swing.JComponent> l)
false
and it makes the painting much faster
isIncrementalUpdate in class AbstractBufferedLayerUI<javax.swing.JComponent>l - the JXLayer being painted
false to disable the incremental update modeAbstractBufferedLayerUI.getBuffer()
public void paint(java.awt.Graphics g,
javax.swing.JComponent c)
Graphics object to
render the content of the component.
Note: It is rarely necessary to override this method, for
custom painting override AbstractLayerUI.paintLayer(Graphics2D,JXLayer) instead
This method configures the passed Graphics with help of the
AbstractLayerUI.configureGraphics(Graphics2D,JXLayer) method,
then calls paintLayer(Graphics2D,JXLayer)
and resets the "dirty bit" at the end.
This method paints the paitns the JXLayer to the BufferedImage
and then paints this image to the passed Graphics.
It also manages the state of the existing cached image
and applies the existing LayerEffects to the image.
paint in class AbstractBufferedLayerUI<javax.swing.JComponent>g - the Graphics context in which to paint;c - the component being painted;
it can be safely cast to the JXLayer<V>AbstractLayerUI.paintLayer(Graphics2D,JXLayer),
AbstractBufferedLayerUI.isBufferFormatValid(JXLayer),
AbstractBufferedLayerUI.isBufferContentValid(JXLayer,Shape),
AbstractBufferedLayerUI.getLayerEffects(JXLayer)
protected void paintLayer(java.awt.Graphics2D g2,
JXLayer<? extends javax.swing.JComponent> l)
JXLayer as is.
paintLayer in class AbstractLayerUI<javax.swing.JComponent>g2 - the Graphics2D context in which to paintl - the JXLayer being painted
public boolean contains(javax.swing.JComponent c,
int x,
int y)
contains in class javax.swing.plaf.ComponentUI
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||