Deferred mote height calculation until components are initialized

This commit is contained in:
Niclas Finne 2012-03-06 12:47:53 +01:00
parent 99f3d5ada2
commit 5288ac12b5

View File

@ -229,12 +229,6 @@ public class TimeLine extends VisPlugin {
});
eventCheckboxes.add(eventCheckBox);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
recalculateMoteHeight();
}
});
/* Panel: timeline canvas w. scroll pane and add mote button */
timeline = new Timeline();
timelineScrollPane = new JScrollPane(
@ -268,6 +262,7 @@ public class TimeLine extends VisPlugin {
getContentPane().add(splitPane);
recalculateMoteHeight();
pack();
setSize(gui.getDesktopPane().getWidth(), 150);
setLocation(0, gui.getDesktopPane().getHeight() - 150);
@ -1198,9 +1193,11 @@ public class TimeLine extends VisPlugin {
if (showWatchpoints) {
h += EVENT_PIXEL_HEIGHT;
}
paintedMoteHeight = h;
timelineMoteRuler.repaint();
timeline.repaint();
if (h != paintedMoteHeight) {
paintedMoteHeight = h;
timelineMoteRuler.repaint();
timeline.repaint();
}
}
public void closePlugin() {