speedup SimpleColoredComponent based renderers

This commit is contained in:
Egor.Ushakov
2017-03-29 21:02:38 +03:00
parent 6a9cb12df4
commit 59048e0c4b
4 changed files with 19 additions and 4 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -101,6 +101,11 @@ public abstract class ColoredListCellRenderer<T> extends SimpleColoredComponent
}
}
@Override
void revalidateAndRepaint() {
// no need for this in a renderer
}
@Override
@NotNull
public Dimension getPreferredSize() {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -170,6 +170,11 @@ public abstract class ColoredTreeCellRenderer extends SimpleColoredComponent imp
}
}
@Override
void revalidateAndRepaint() {
// no need for this in a renderer
}
/**
* This method is invoked only for customization of component.
* All component attributes are cleared when this method is being invoked.
@@ -198,7 +198,7 @@ public class SimpleColoredComponent extends JComponent implements Accessible, Co
}
}
private void revalidateAndRepaint() {
void revalidateAndRepaint() {
if (myAutoInvalidate) {
revalidate();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,6 +31,11 @@ public class SimpleColoredRenderer extends SimpleColoredComponent {
super.append(fragment, modifyAttributes(attributes), isMainText);
}
@Override
void revalidateAndRepaint() {
// no need for this in a renderer
}
protected SimpleTextAttributes modifyAttributes(final SimpleTextAttributes attributes) {
return myCellState.modifyAttributes(attributes);
}