X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooToolbar.java;h=50aaf4dafbfae93daf83e778a0a357d9a49ebfbb;hb=d2e307b3375152f1b47c59bc05210c96dc99f679;hp=719ced80f4789b3f60ca3b6493c7acc7013be199;hpb=d50b6cfbebef6c3f620f916f0d2da838c4de3355;p=moosique.git diff --git a/MooToolbar.java b/MooToolbar.java index 719ced8..50aaf4d 100644 --- a/MooToolbar.java +++ b/MooToolbar.java @@ -24,6 +24,7 @@ public class MooToolbar extends JToolBar { */ public MooToolbar() { + setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); // setAlignmentX(LEFT_ALIGNMENT); setFloatable(false); mouseAdapter = new MAdapter(); @@ -74,6 +75,7 @@ public class MooToolbar extends JToolBar { * @param tickPosition the tick position to visualize */ public void updateProgInd(long tickPosition) { + ticksPerBeat = Moosique.getSequence().getResolution(); if (tickPosition == 0) { resetProgInd(); } else { @@ -99,7 +101,7 @@ public class MooToolbar extends JToolBar { ticksPerBeat = Moosique.getSequence().getResolution(); } - /* + /** * Creates a button with the specified image and tooltip. */ private JButton createButton(String imagelocation, String tooltip) { @@ -109,7 +111,7 @@ public class MooToolbar extends JToolBar { return button; } - /* + /** * Creates labels with the specified text and font size. */ private JLabel createLabel(String title, int fontSize){ @@ -118,7 +120,7 @@ public class MooToolbar extends JToolBar { return label; } - /* + /** * Formats the given label for the progress indicator. */ private JLabel formatProgInd(JLabel label){ @@ -148,7 +150,7 @@ public class MooToolbar extends JToolBar { Moosique.stop(); } } else if (e.getSource() instanceof JLabel) { - long position = Moosique.getPosition(); + long position = Moosique.getEditPosition(); if (e.getSource().equals(measuresValue)) { if (SwingUtilities.isRightMouseButton(e)) { position += beatsPerMeasure * ticksPerBeat; @@ -168,7 +170,7 @@ public class MooToolbar extends JToolBar { position -= 1; } } - Moosique.setPosition(position); + Moosique.setEditPosition(position); Moosique.getGUI().update(position); } } @@ -185,4 +187,4 @@ public class MooToolbar extends JToolBar { public void mouseReleased(MouseEvent e) {} } -} \ No newline at end of file +}