]> ruin.nu Git - moosique.git/blobdiff - MooTrackView.java
*** empty log message ***
[moosique.git] / MooTrackView.java
index c058cc5e01ec881e0922a5b67c951dcc47967683..f8fe20c4b7400ade41c0b8ea990957d27290b59e 100644 (file)
@@ -15,6 +15,7 @@ public class MooTrackView extends JPanel {
 
        private Track track;
        private Rectangle box;
+
        private JPopupMenu popup;
        private JMenuItem menuItem;
        private ArrayList rects;
@@ -77,6 +78,14 @@ public class MooTrackView extends JPanel {
                return track;
        }
 
+
+       /** 
+        * Updates the track view.
+        */
+       public void update(long tickPosition) {
+               repaint();
+       }
+
        private boolean isOccupied(Rectangle r) {
                Iterator it = rects.iterator();
                while (it.hasNext()) {
@@ -87,7 +96,9 @@ public class MooTrackView extends JPanel {
        
        public void remove(MooNoteElement elem) {
                remove((Component)elem);
+               elem.getNote().removeFrom(track);
                validate();
+               repaint();
        }
 
        public void paintComponent(Graphics g) {
@@ -102,13 +113,6 @@ public class MooTrackView extends JPanel {
                }
        }
 
-       /** 
-        * Updates the track view.
-        */
-       public void update(long tickPosition) {
-               repaint();
-       }
-
        class PopupListener extends MouseAdapter {
                public void mousePressed(MouseEvent e) {
                        if (e.isPopupTrigger()) {
@@ -116,4 +120,4 @@ public class MooTrackView extends JPanel {
                        }
                }
        }
-}
\ No newline at end of file
+}