* If there is no song, do not bother with the other steps.
*/
private void loadSong()
{
String sName = ch.getSongName();
SQLite sqlite = ch.getSQLite();
int measures = 0;
if (sName == null)
{
mNeww.setEnabled(false);
ch.setMeasures(measures);
}
else
{
isSaved = true;
mSave.setEnabled(false);
mNeww.setEnabled(true);
measures = sqlite.getMeasuresByName(sName);
ch.setMeasures(measures);
int col = ch.getStyle().getColumns();
mcp.setColumns(col);
mcp.setMeasures(measures);
int nX = ARROW_SIZE * (col + 2);
int nY = ARROW_SIZE / 2;
final Dimension d = new Dimension(nX, nY);
Map<Double, Double> b = sqlite.getBPMsBySong(sName);
for (Map.Entry<Double, Double> c : b.entrySet())
{
double be = c.getKey();
BPMComponent bc = new BPMComponent(col, c.getValue());
int sY = (int)(ARROW_SIZE - 7 + be * ARROW_SIZE);
bc.setBounds(ARROW_SIZE * 6, sY, nX, nY);
bc.setPreferredSize(d);
bc.setSize(d);
bc.setMaximumSize(d);
bc.setMinimumSize(d);
bpms.put(be, bc);
stepChart.add(bc);
stepChart.setLayer(bc, 2000);
}
b = sqlite.getStopsBySong(sName);
for (Map.Entry<Double, Double> c : b.entrySet())
{
double be = c.getKey();
STPComponent bc = new STPComponent(col, c.getValue());
int sY = (int)(ARROW_SIZE - 7 + be * ARROW_SIZE);