]> ruin.nu Git - moosique.git/blobdiff - MooNoteElement.java
Implemented editing functions - biggie!
[moosique.git] / MooNoteElement.java
index 67555fcf5ccc80c45c85c7512b7ae69f1928ccd3..886a1111be40c3056cd2a8078e0c34b994612520 100644 (file)
@@ -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);
                        }
                }
        }