@Override
public void dispose() {
+ if (fBottomContext != null) {
+ fBottomContext.dispose();
+ }
PlatformUI.getWorkbench().getThemeManager().removePropertyChangeListener(this);
super.dispose();
}
/**
* Initialize the colors.
- * @since 1.0
+ * @since 1.1
*/
protected void initializeColors() {
ColorRegistry colorRegistry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
if (fLines.size() == 0) {
setTopRank(0);
} else if (fLines.size() < fNumVisibleLines) {
- fBottomContext = null;
+ if (fBottomContext != null) {
+ fBottomContext.dispose();
+ fBottomContext = null;
+ }
loadLineData();
fillTextArea();
//fSlider.setSelection((int) (SLIDER_MAX * ((double) fLines.get(fTopLineIndex).rank / fTrace.getNbEvents())));
fSlider.setSelection((int) (SLIDER_MAX * fTrace.getLocationRatio(fLines.get(fTopLineIndex).location)));
}
} else {
- fBottomContext = null;
+ if (fBottomContext != null) {
+ fBottomContext.dispose();
+ fBottomContext = null;
+ }
fillTextArea();
fSlider.setThumb(SLIDER_MAX);
fSlider.setSelection(0);
}
private void setTopRank(long rank) {
+ if (fBottomContext != null) {
+ fBottomContext.dispose();
+ }
fBottomContext = fTrace.seekEvent(rank);
if (fBottomContext == null) {
return;
}
private void setTopPosition(double ratio) {
+ if (fBottomContext != null) {
+ fBottomContext.dispose();
+ }
fBottomContext = fTrace.seekEvent(ratio);
if (fBottomContext == null) {
return;
}
rank++;
}
+ context.dispose();
long rankOffset = fLines.get(index).rank - rank;
for (int i = 0; i < index; i++) {
fLines.get(i).rank += rankOffset;
for (int i = MAX_LINE_DATA_SIZE; i < fLines.size(); i++) {
if (fLines.get(i).rank > rank) {
fLines.subList(i, fLines.size()).clear();
- fBottomContext = null;
+ if (fBottomContext != null) {
+ fBottomContext.dispose();
+ fBottomContext = null;
+ }
break;
}
}
// ------------------------------------------------------------------------
/**
- * @since 1.0
+ * @since 1.1
*/
@Override
public void mouseDown(MouseEvent e) {
}
/**
- * @since 1.0
+ * @since 1.1
*/
@Override
public void mouseUp(MouseEvent e) {
}
/**
- * @since 1.0
+ * @since 1.1
*/
@Override
public void mouseDoubleClick(MouseEvent e) {