X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;ds=sidebyside;f=MooNoteElement.java;fp=MooNoteElement.java;h=886a1111be40c3056cd2a8078e0c34b994612520;hb=570c4561b55541309efb977d0930777b8d214336;hp=67555fcf5ccc80c45c85c7512b7ae69f1928ccd3;hpb=11fcb74f0ca701b2ac9fb61ff459b19207213dbd;p=moosique.git diff --git a/MooNoteElement.java b/MooNoteElement.java index 67555fc..886a111 100644 --- a/MooNoteElement.java +++ b/MooNoteElement.java @@ -87,6 +87,15 @@ public class MooNoteElement extends JPanel { repaint(); } + /** + * Transposes the current note element the given number of halftones. + * @param halftones the number of halftones to transpose - positive for up, negative for down + */ + public void transpose(int halftones) { + note.transpose(halftones); + update(); + } + /** * Draws the string that shows the note's properties. * @param g The Graphics object used to draw the strings. @@ -155,11 +164,12 @@ public class MooNoteElement extends JPanel { } /** - * layout this changed elemnt + * Layout this changed elemnt. */ protected void newLayout(){ mtv.layoutElement(this,true); } + /** * Listener that checks the mouse actions on this element. */ @@ -232,11 +242,9 @@ public class MooNoteElement extends JPanel { } else if (source == popupRemove) { remove(); } else if (source == popupTranspOctUp) { - note.transpose(12); - update(); + transpose(12); } else if (source == popupTranspOctDown) { - note.transpose(-12); - update(); + transpose(-12); } } }