|
|||||||||
| 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>
public class AbstractLayerUI<V extends javax.swing.JComponent>
The AbstractLayerUI provided default implementation for most
of the abstract methods in the LayerUI class.
It takes care of the management of LayerItemListeners and
defines the hook method to configure the Graphics2D instance
specified in the paint(Graphics,JComponent) method.
It also provides convenient methods named
process<eventType>Event to process the given class of event.
AbstractLayerUI is changed, call setDirty(boolean)
with true as the parameter, it will repaint all JXLayers
connected with this AbstractLayerUI
JXLayer.setUI(LayerUI),
Serialized Form| Constructor Summary | |
|---|---|
AbstractLayerUI()
|
|
| Method Summary | |
|---|---|
protected void |
configureGraphics(java.awt.Graphics2D g2,
JXLayer<? extends V> l)
This method is called by the paint(java.awt.Graphics, javax.swing.JComponent) method prior to
any drawing operations to configure the Graphics2D object. |
void |
eventDispatched(java.awt.AWTEvent e,
JXLayer<? extends V> l)
Dispatches AWTEvents for JXLayer
and all it subcomponents to this LayerUI.
This method calls the appropriate
process<eventType>Event
method for the given class of event. |
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. |
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. |
long |
getLayerEventMask()
By default only mouse, mouse motion, mouse wheel, keyboard and focus events are supported, if you need to catch any other type of events, override this method to return the different mask |
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. |
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. |
void |
handlePropertyChangeEvent(java.beans.PropertyChangeEvent evt,
JXLayer<? extends V> l)
Notifies the LayerUI when any of its property is changed
and allows to update every JXLayer this LayerUI is set to. |
void |
installUI(javax.swing.JComponent c)
Configures the JXLayer this LayerUI is set to. |
protected boolean |
isDirty()
Returns the "dirty bit". |
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
Paints the specified component. Note: It is rarely necessary to override this method, for custom painting override paintLayer(Graphics2D,JXLayer) instead
This method configures the passed Graphics with help of the
configureGraphics(Graphics2D,JXLayer) method,
then calls paintLayer(Graphics2D,JXLayer)
and resets the "dirty bit" at the end. |
protected void |
paintLayer(java.awt.Graphics2D g2,
JXLayer<? extends V> l)
Subclasses should implement this method and perform custom painting operations here. |
protected void |
processFocusEvent(java.awt.event.FocusEvent e,
JXLayer<? extends V> l)
Processes FocusEvent occurring on the JXLayer
or any of its subcomponents. |
protected void |
processKeyEvent(java.awt.event.KeyEvent e,
JXLayer<? extends V> l)
Processes KeyEvent occurring on the JXLayer
or any of its subcomponents. |
protected void |
processMouseEvent(java.awt.event.MouseEvent e,
JXLayer<? extends V> l)
Processes MouseEvent occurring on the JXLayer
or any of its subcomponents. |
protected void |
processMouseMotionEvent(java.awt.event.MouseEvent e,
JXLayer<? extends V> l)
Processes mouse motion events occurring on the JXLayer
or any of its subcomponents. |
protected void |
processMouseWheelEvent(java.awt.event.MouseWheelEvent e,
JXLayer<? extends V> l)
Processes MouseWheelEvent occurring on the JXLayer
or any of its subcomponents. |
protected void |
setDirty(boolean isDirty)
Sets the "dirty bit". |
void |
uninstallUI(javax.swing.JComponent c)
|
| 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 AbstractLayerUI()
| Method Detail |
|---|
public void installUI(javax.swing.JComponent c)
LayerUIJXLayer this LayerUI is set to.
The default implementation registers the LayerUI
as a property change listener for the passed JXLayer
installUI in class LayerUI<V extends javax.swing.JComponent>c - the JXLayer where this UI delegate is being installedpublic void uninstallUI(javax.swing.JComponent c)
LayerUI
uninstallUI in class LayerUI<V extends javax.swing.JComponent>
public void handlePropertyChangeEvent(java.beans.PropertyChangeEvent evt,
JXLayer<? extends V> l)
LayerUI when any of its property is changed
and allows to update every JXLayer this LayerUI is set to.
handlePropertyChangeEvent in class LayerUI<V extends javax.swing.JComponent>evt - the PropertyChangeEvent generated by this LayerUIl - the JXLayer this LayerUI is set toprotected boolean isDirty()
true, then the AbstractLayerUI is considered dirty
and in need of being repainted.
true if the AbstractLayerUI state has changed
and the JXLayers it is set to need to be repainted.protected void setDirty(boolean isDirty)
isDirty is true, then the AbstractLayerUI
is considered dirty and it triggers the repainting
of the JXLayers this AbstractLayerUI it is set to.
isDirty - whether this AbstractLayerUI is dirty or not.
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 paintLayer(Graphics2D,JXLayer) instead
This method configures the passed Graphics with help of the
configureGraphics(Graphics2D,JXLayer) method,
then calls paintLayer(Graphics2D,JXLayer)
and resets the "dirty bit" at the end.
paint in class LayerUI<V extends 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>configureGraphics(Graphics2D,JXLayer),
paintLayer(Graphics2D,JXLayer),
setDirty(boolean)
protected void paintLayer(java.awt.Graphics2D g2,
JXLayer<? extends V> l)
JXLayer as is.
g2 - the Graphics2D context in which to paintl - the JXLayer being painted
protected void configureGraphics(java.awt.Graphics2D g2,
JXLayer<? extends V> l)
paint(java.awt.Graphics, javax.swing.JComponent) method prior to
any drawing operations to configure the Graphics2D object.
The default implementation sets the Composite, the clip,
AffineTransform and rendering hints
obtained from the corresponding hook methods.
g2 - the Graphics2D object to configurel - the JXLayer being paintedgetComposite(JXLayer),
getClip(JXLayer),
getTransform(JXLayer),
getRenderingHints(JXLayer)protected java.awt.Composite getComposite(JXLayer<? extends V> l)
Composite to be used during painting of this JXLayer,
the default implementation returns null.
l - the JXLayer being painted
Composite to be used during painting for the JXLayerprotected java.awt.geom.AffineTransform getTransform(JXLayer<? extends V> l)
AffineTransform to be used during painting of this JXLayer,
the default implementation returns null.
l - the JXLayer being painted
AffineTransform to be used during painting of the JXLayerprotected 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.
l - the JXLayer being painted
Shape to be used as the clip during painting of the JXLayerprotected java.util.Map<java.awt.RenderingHints.Key,java.lang.Object> getRenderingHints(JXLayer<? extends V> l)
JXLayer,
the default implementation returns the empty unmodifiable map.
l - the JXLayer being painted
JXLayerpublic long getLayerEventMask()
JXLayer.setLayerEventMask(long)
public void eventDispatched(java.awt.AWTEvent e,
JXLayer<? extends V> l)
AWTEvents for JXLayer
and all it subcomponents to this LayerUI.
To enable the AWTEvent of particular type,
you should call JXLayer.setLayerEventMask(long)
in LayerUI.installUI(javax.swing.JComponent)
and set the layer event mask to 0
in LayerUI.uninstallUI(javax.swing.JComponent) after that
process<eventType>Event
method for the given class of event.
eventDispatched in class LayerUI<V extends javax.swing.JComponent>e - the event to be dispatchedl - the layer this LayerUI is set toJXLayer.setLayerEventMask(long),
JXLayer.getLayerEventMask()
protected void processFocusEvent(java.awt.event.FocusEvent e,
JXLayer<? extends V> l)
FocusEvent occurring on the JXLayer
or any of its subcomponents.
e - the FocusEvent to be processedl - the layer this LayerUI is set to
protected void processMouseEvent(java.awt.event.MouseEvent e,
JXLayer<? extends V> l)
MouseEvent occurring on the JXLayer
or any of its subcomponents.
e - the MouseEvent to be processedl - the layer this LayerUI is set to
protected void processMouseMotionEvent(java.awt.event.MouseEvent e,
JXLayer<? extends V> l)
JXLayer
or any of its subcomponents.
e - the MouseEvent to be processedl - the layer this LayerUI is set to
protected void processMouseWheelEvent(java.awt.event.MouseWheelEvent e,
JXLayer<? extends V> l)
MouseWheelEvent occurring on the JXLayer
or any of its subcomponents.
e - the MouseWheelEvent to be processedl - the layer this LayerUI is set to
protected void processKeyEvent(java.awt.event.KeyEvent e,
JXLayer<? extends V> l)
KeyEvent occurring on the JXLayer
or any of its subcomponents.
e - the KeyEvent to be processedl - the layer this LayerUI is set to
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||