public abstract class BackgroundAlgorithm extends Object implements BackgroundComponent
BackgroundPaint
, BackgroundComponent
and PaintableComponent
at the same time.KIND
Constructor and Description |
---|
BackgroundAlgorithm(Path kind,
String id)
Creates a new algorithm.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(BackgroundAlgorithmListener listener)
Adds an observer to this algorithm.
|
BackgroundPaint |
getPaint()
Gets the
BackgroundPaint of this UIValue . |
Transparency |
getTransparency()
Tells whether this component is transparent or not.
|
void |
paint(PaintableComponent component,
Graphics g)
Paints
component using the graphics context g . |
void |
removeListener(BackgroundAlgorithmListener listener)
Removes the observer
listener from this algorithm. |
void |
repaint()
Informs this component that it should be repainted.
|
void |
set(BackgroundPaint value)
Called when the underlying resource of this
UIValue changes. |
void |
setController(DockController controller)
Sets the source of the
BackgroundPaint . |
void |
setTransparency(Transparency transparency)
Informs this component whether it should be transparent or not.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getComponent
public void addListener(BackgroundAlgorithmListener listener)
listener
- the new observer, not null
public void removeListener(BackgroundAlgorithmListener listener)
listener
from this algorithm.listener
- the listener to removepublic void setController(DockController controller)
BackgroundPaint
.controller
- the new controller, can be null
public void repaint()
BackgroundComponent
repaint
in interface BackgroundComponent
public void set(BackgroundPaint value)
UIValue
UIValue
changes.set
in interface UIValue<BackgroundPaint>
value
- the new valuepublic void setTransparency(Transparency transparency)
BackgroundComponent
ScreenDockWindow
usually do not support any transparency at all.DockTitle
or a Tab
, usually paint some parts of their background even if transparent.BackgroundPaint
, any component can be made to look as if transparent.setTransparency
in interface BackgroundComponent
transparency
- whether to paint a background or notpublic Transparency getTransparency()
BackgroundComponent
getTransparency
in interface BackgroundComponent
BackgroundComponent.setTransparency(Transparency)
public BackgroundPaint getPaint()
BackgroundPaint
of this UIValue
.null
public void paint(PaintableComponent component, Graphics g)
component
using the graphics context g
. This method
ensures that PaintableComponent.paintBackground(Graphics)
and
PaintableComponent.paintForeground(Graphics)
are not called with a null
argument.
component
does not need to track how often its paint-methods are called, that is done
by this method.component
- the component to paintg
- the graphics context to use