Class BeatBasedLayoutManager
java.lang.Object
org.jjazz.cl_editor.barrenderer.api.BeatBasedLayoutManager
- All Implemented Interfaces:
LayoutManager
This LayoutManager places ItemRenderers at their corresponding beat position, depending on the DisplayQuantization setting.
ItemRenderers are set to their preferredSize.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayoutComponent
(String name, Component comp) int
getBeatXPosition
(float beat, int barWidth, TimeSignature ts) Calculate the X position for a beat, in a bar who has width=barWidth.getPositionFromPoint
(BarRenderer br, int xPos) Return the Position that corresponds to the X-coordinate xPos in the BarRenderer.void
layoutContainer
(Container parent) Layout all children at their respective beat position with their preferredSize.minimumLayoutSize
(Container parent) preferredLayoutSize
(Container parent) void
void
setDisplayQuantization
(Quantization displayQuantization)
-
Constructor Details
-
BeatBasedLayoutManager
public BeatBasedLayoutManager()
-
-
Method Details
-
getPositionFromPoint
Return the Position that corresponds to the X-coordinate xPos in the BarRenderer.- Parameters:
xPos
- int The x position in the BarRenderer coordinates.- Returns:
- Position
-
getBeatXPosition
Calculate the X position for a beat, in a bar who has width=barWidth.- Parameters:
beat
- A float representing the beat position.barWidth
- An integer for the width of the bar.ts
-- Returns:
- An integer representing the X position of pos.
-
layoutContainer
Layout all children at their respective beat position with their preferredSize.- Specified by:
layoutContainer
in interfaceLayoutManager
- Parameters:
parent
- Container
-
minimumLayoutSize
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
-
preferredLayoutSize
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
-
addLayoutComponent
- Specified by:
addLayoutComponent
in interfaceLayoutManager
-
removeLayoutComponent
- Specified by:
removeLayoutComponent
in interfaceLayoutManager
-
getDisplayQuantization
-
setDisplayQuantization
-