Package org.jjazz.ss_editor.rpviewer.api
Class StringRpRenderer
java.lang.Object
org.jjazz.ss_editor.rpviewer.api.StringRpRenderer
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,RpViewerRenderer
A simple editor: just display RP value as a string.
-
Constructor Summary
ConstructorDescriptionStringRpRenderer
(Song song, SongPart spt, Supplier<String> stringSupplier, StringRpRendererSettings settings) -
Method Summary
Modifier and TypeMethodDescriptionvoid
A change event is fired when this RpRenderer configuration has changed for some reason (e.g. user has changed some settings).void
Preferred size depends on displayed string's size and zoomVFactor for height.The target RpViewer for which we perform the rendering.getSong()
The Song context.The SongPart context.void
Paint the RP value as a string centered.void
void
void
setRpViewer
(RpViewer rpViewer) Set the target RpViewer for which we perform the rendering.
-
Constructor Details
-
StringRpRenderer
public StringRpRenderer(Song song, SongPart spt, Supplier<String> stringSupplier, StringRpRendererSettings settings)
-
-
Method Details
-
getSongPart
Description copied from interface:RpViewerRenderer
The SongPart context.- Specified by:
getSongPart
in interfaceRpViewerRenderer
- Returns:
- Might be null.
-
getSong
Description copied from interface:RpViewerRenderer
The Song context.- Specified by:
getSong
in interfaceRpViewerRenderer
- Returns:
- Might be null.
-
setRpViewer
Description copied from interface:RpViewerRenderer
Set the target RpViewer for which we perform the rendering.- Specified by:
setRpViewer
in interfaceRpViewerRenderer
-
getRpViewer
Description copied from interface:RpViewerRenderer
The target RpViewer for which we perform the rendering.- Specified by:
getRpViewer
in interfaceRpViewerRenderer
- Returns:
-
getPreferredSize
Preferred size depends on displayed string's size and zoomVFactor for height.- Specified by:
getPreferredSize
in interfaceRpViewerRenderer
- Returns:
-
paintComponent
Paint the RP value as a string centered.- Specified by:
paintComponent
in interfaceRpViewerRenderer
- Parameters:
g
-
-
addChangeListener
Description copied from interface:RpViewerRenderer
A change event is fired when this RpRenderer configuration has changed for some reason (e.g. user has changed some settings).A change event means the preferredSize() and/or the paintComponent() behavior might have changed.
- Specified by:
addChangeListener
in interfaceRpViewerRenderer
-
removeChangeListener
- Specified by:
removeChangeListener
in interfaceRpViewerRenderer
-
fireChanged
public void fireChanged() -
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-