X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooTrackView.java;h=f8fe20c4b7400ade41c0b8ea990957d27290b59e;hb=ae0197ccdf09df4717b40380eba22b9cafbad206;hp=c058cc5e01ec881e0922a5b67c951dcc47967683;hpb=b5028dc9c03585cdf231a37d8996a7e836932c3e;p=moosique.git diff --git a/MooTrackView.java b/MooTrackView.java index c058cc5..f8fe20c 100644 --- a/MooTrackView.java +++ b/MooTrackView.java @@ -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 +}