public class SSystem
extends java.lang.Object
draw() and drawWithOptions() draw the system into a canvas, the latter allowing item colouring (and requiring an additional licence)
getPartIndexForYPos(), getBarIndexForXPos() can be used to locate the bar and part under the cursor/finger
hitTest() is used to find the exact layout components (eg notehead, stem, beam) at a particular location (requiring a contents licence)
getComponentsForItem() is used to find all the layout components of a particular score item (requiring a contents licence)
Modifier and Type | Class and Description |
---|---|
static class |
SSystem.BarRange
define a range of bars which the system includes
|
Modifier and Type | Method and Description |
---|---|
Size |
bounds()
Get the bounding box of this system.
|
void |
draw(android.graphics.Canvas canvas,
android.content.res.AssetManager am,
Point tl,
float magnification)
Draw this system at the given point.
|
void |
drawWithOptions(android.graphics.Canvas canvas,
android.content.res.AssetManager am,
Point tl,
float magnification,
RenderItem[] renderItems)
Draw the system allowing optional colouring of particular items/components in the layout
|
int |
getBarIndexForXPos(float xpos)
get the bar index of the bar enclosing the given x coordinate in this system
|
SSystem.BarRange |
getBarRange()
Get the start bar index and number of bars for this system.
|
RectF |
getBoundsForItem(int item_h)
Get a bounding box which encloses all layout components for a score item in this system
|
Component[] |
getComponentsForItem(int item_h)
Get an array of layout components which belong to a particular score item in this system
|
CursorRect |
getCursorRect(android.graphics.Canvas canvas,
int barIndex)
Get the cursor rectangle for a particular system and bar
|
float |
getDefaultSpacing()
get the default vertical spacing to the next system
|
int |
getPartIndexForYPos(float ypos)
get the part index of the part enclosing the given y coordinate in this system
|
Component[] |
hitTest(Point p)
Get an array of components which intersect a given a point in this system
|
int |
index()
Get the index of this system from the top of the score.
|
public int index()
Index 0 is the topmost.
public SSystem.BarRange getBarRange()
public Size bounds()
public void draw(android.graphics.Canvas canvas, android.content.res.AssetManager am, Point tl, float magnification)
canvas
- the Canvasam
- the AssetManager for loading fonts from assetsdisplayDPI
- the dots-per-inch value for the displaytl
- the top left point to draw this system in the Canvasmagnification
- the scale to draw at. NB This is normally 1, except during active zooming.
The overall magnification is set in sscore_layoutpublic void drawWithOptions(android.graphics.Canvas canvas, android.content.res.AssetManager am, Point tl, float magnification, RenderItem[] renderItems) throws ScoreException
canvas
- the Canvasam
- the AssetManager for loading fonts from assetstl
- the top left point to draw this system in th Canvasmagnification
- the scale to draw at. NB This is normally 1, except during active zooming.
The overall magnification is set in sscore_layoutrenderItems
- each RenderItem object in the array defines special colouring of a particular score itemScoreException
public CursorRect getCursorRect(android.graphics.Canvas canvas, int barIndex)
canvas
- a canvas for measurementbarIndex
- the index of the bar in the systempublic int getPartIndexForYPos(float ypos)
ypos
- the y coordpublic int getBarIndexForXPos(float xpos)
xpos
- the x coordpublic float getDefaultSpacing()
public Component[] hitTest(Point p) throws ScoreException
contents licence is required
p
- the pointScoreException
public Component[] getComponentsForItem(int item_h) throws ScoreException
contents licence is required
item_h
- the unique identifier for an item (eg note) in the scoreScoreException
public RectF getBoundsForItem(int item_h) throws ScoreException
contents licence is required
item_h
- ScoreException