use GraphicsUtil

This commit is contained in:
Konstantin Bulenkov
2012-03-14 16:41:03 +01:00
parent bb1aae2b73
commit 3c944d1fac
7 changed files with 41 additions and 34 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -48,6 +48,7 @@ import com.intellij.ui.SideBorder;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.util.Consumer;
import com.intellij.util.containers.HashMap;
import com.intellij.util.ui.GraphicsUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -162,7 +163,7 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
@Override
protected void paintComponent(Graphics g) {
UISettings.setupAntialiasing(g);
GraphicsUtil.setupAntialiasing(g);
super.paintComponent(g);
}
};
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -20,7 +20,6 @@ import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupElementPresentation;
import com.intellij.codeInsight.lookup.LookupValueWithUIHint;
import com.intellij.codeInsight.lookup.RealLookupElementPresentation;
import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.colors.EditorFontType;
import com.intellij.openapi.util.TextRange;
@@ -32,6 +31,7 @@ import com.intellij.ui.SimpleColoredComponent;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.ui.speedSearch.SpeedSearchUtil;
import com.intellij.util.ui.EmptyIcon;
import com.intellij.util.ui.GraphicsUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -331,7 +331,7 @@ public class LookupCellRenderer implements ListCellRenderer {
@Override
protected void applyAdditionalHints(Graphics g) {
UISettings.setupAntialiasing(g);
GraphicsUtil.setupAntialiasing(g);
}
}
@@ -1,8 +1,22 @@
/*
* Copyright 2000-2012 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.find.editorHeaderActions;
import com.intellij.featureStatistics.FeatureUsageTracker;
import com.intellij.find.EditorSearchComponent;
import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
@@ -16,6 +30,7 @@ import com.intellij.psi.impl.cache.impl.id.IdTableBuilding;
import com.intellij.ui.components.JBList;
import com.intellij.util.ArrayUtil;
import com.intellij.util.text.Matcher;
import com.intellij.util.ui.GraphicsUtil;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
@@ -60,7 +75,7 @@ public class VariantsCompletionAction extends AnAction {
final JList list = new JBList(array) {
@Override
protected void paintComponent(final Graphics g) {
UISettings.setupAntialiasing(g);
GraphicsUtil.setupAntialiasing(g);
super.paintComponent(g);
}
};
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -22,7 +22,6 @@ import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl;
import com.intellij.find.findUsages.PsiElement2UsageTargetAdapter;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.actions.CopyReferenceAction;
import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.MnemonicHelper;
import com.intellij.openapi.actionSystem.*;
@@ -68,6 +67,7 @@ import com.intellij.util.text.Matcher;
import com.intellij.util.text.MatcherHolder;
import com.intellij.util.ui.AsyncProcessIcon;
import com.intellij.util.ui.EmptyIcon;
import com.intellij.util.ui.GraphicsUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -1301,7 +1301,7 @@ public abstract class ChooseByNameBase {
}
protected void paintComponent(final Graphics g) {
UISettings.setupAntialiasing(g);
GraphicsUtil.setupAntialiasing(g);
super.paintComponent(g);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -16,7 +16,6 @@
package com.intellij.ui.table;
import com.intellij.Patches;
import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.ui.ComponentWithExpandableItems;
@@ -192,7 +191,7 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
@Override
public void paint(Graphics g) {
if (myEnableAntialiasing) {
UISettings.setupAntialiasing(g);
GraphicsUtil.setupAntialiasing(g);
}
super.paint(g);
}
@@ -251,7 +250,7 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
@Override
protected void paintComponent(Graphics g) {
if (myEnableAntialiasing) {
UISettings.setupAntialiasing(g);
GraphicsUtil.setupAntialiasing(g);
}
super.paintComponent(g);
myEmptyText.paint(this, g);
@@ -260,7 +259,7 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
@Override
protected void paintChildren(Graphics g) {
if (myEnableAntialiasing) {
UISettings.setupAntialiasing(g);
GraphicsUtil.setupAntialiasing(g);
}
super.paintChildren(g);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -16,11 +16,13 @@
package com.intellij.help.impl;
import com.intellij.ide.BrowserUtil;
import com.intellij.util.ui.GraphicsUtil;
import javax.help.JHelpContentViewer;
import javax.help.plaf.basic.BasicContentViewerUI;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import java.awt.*;
import java.net.URL;
/**
@@ -44,8 +46,14 @@ class IdeaHelpContentViewUI extends BasicContentViewerUI{
String url=u.toExternalForm();
if(url.startsWith("http") || url.startsWith("ftp")){
BrowserUtil.launchBrowser(url);
}else{
} else{
super.linkActivated(u);
}
}
@Override
public void paint(Graphics g, JComponent c) {
GraphicsUtil.setupAntialiasing(g);
super.paint(g, c);
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2012 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.
@@ -15,14 +15,8 @@
*/
package com.intellij.help.impl;
import com.intellij.ide.ui.UISettings;
import com.intellij.util.ui.UIUtil;
import sun.swing.SwingUtilities2;
import javax.help.JHelpContentViewer;
import javax.help.TextHelpModel;
import javax.swing.*;
import java.awt.*;
/**
* It a dirty patch! Help system is so ugly that it hangs when it open some "external" links.
@@ -49,14 +43,4 @@ class IdeaJHelpContentViewer extends JHelpContentViewer{
setUI(new IdeaHelpContentViewUI(this));
invalidate();
}
@Override
public void paint(Graphics g) {
final JEditorPane editorPane = UIUtil.findComponentOfType(this, JEditorPane.class);
if (editorPane != null) {
editorPane.putClientProperty(SwingUtilities2.AA_TEXT_PROPERTY_KEY, SwingUtilities2.AATextInfo.getAATextInfo(true));
}
UISettings.setupAntialiasing(g);
super.paint(g);
}
}