mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
speedup SimpleColoredComponent based renderers
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user