mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
some painting wrapper methods in SimpleColoredComponent
This commit is contained in:
@@ -383,7 +383,7 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
|
||||
g.fillRect(0, 0, icon.getIconWidth() + myIpad.left + myIconTextGap, getHeight());
|
||||
}
|
||||
|
||||
icon.paintIcon(this, g, myIpad.left, (getHeight() - icon.getIconHeight()) / 2);
|
||||
paintIcon(g, icon);
|
||||
|
||||
xOffset += myIpad.left + icon.getIconWidth() + myIconTextGap;
|
||||
}
|
||||
@@ -405,6 +405,7 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
|
||||
final List<Object[]> searchMatches = new ArrayList<Object[]>();
|
||||
|
||||
// Paint text
|
||||
applyAdditionalHints(g);
|
||||
UIUtil.applyRenderingHints(g);
|
||||
for (int i = 0; i < myFragments.size(); i++) {
|
||||
final SimpleTextAttributes attributes = myAttributes.get(i);
|
||||
@@ -497,6 +498,13 @@ public class SimpleColoredComponent extends JComponent implements Accessible {
|
||||
}
|
||||
}
|
||||
|
||||
protected void paintIcon(Graphics g, Icon icon) {
|
||||
icon.paintIcon(this, g, myIpad.left, (getHeight() - icon.getIconHeight()) / 2);
|
||||
}
|
||||
|
||||
protected void applyAdditionalHints(final Graphics g) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBaseline(int width, int height) {
|
||||
super.getBaseline(width, height);
|
||||
|
||||
Reference in New Issue
Block a user