IDEA-142875 Antialiasing setting

This commit is contained in:
Denis Fokin
2015-09-16 15:25:55 +03:00
parent b44563aa36
commit ed22f40342
9 changed files with 211 additions and 153 deletions
@@ -0,0 +1,91 @@
/*
* Copyright 2000-2015 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.ide.ui;
import sun.swing.SwingUtilities2;
import java.awt.*;
public enum AntialiasingType {
SUBPIXEL,
GREYSCALE,
OFF;
private static final SwingUtilities2.AATextInfo aaEnabled =
new SwingUtilities2.AATextInfo(RenderingHints.VALUE_TEXT_ANTIALIAS_ON, 140);
private static final SwingUtilities2.AATextInfo lcdEnabled =
new SwingUtilities2.AATextInfo(RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB, 140);
private static final SwingUtilities2.AATextInfo aaDisabled = null;
public static Object getAAHintForSwingComponent() {
UISettings uiSettings = UISettings.getInstance();
if (uiSettings == null) return aaEnabled;
switch (uiSettings.IDE_AA_TYPE) {
case SUBPIXEL:
return lcdEnabled;
case GREYSCALE:
return aaEnabled;
case OFF:
return aaDisabled;
}
return aaEnabled;
}
public Object getRenderingHintValue () {
Object value = RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB;
switch (this) {
case SUBPIXEL:
break;
case GREYSCALE:
value = RenderingHints.VALUE_TEXT_ANTIALIAS_ON;
break;
case OFF:
value = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
break;
}
return value;
}
public static Object getKeyForCurrentScope(boolean inEditor) {
UISettings uiSettings = UISettings.getInstance();
if (uiSettings == null) return RenderingHints.VALUE_TEXT_ANTIALIAS_ON;
return inEditor ? uiSettings.EDITOR_AA_TYPE.getRenderingHintValue() : uiSettings.IDE_AA_TYPE.getRenderingHintValue();
}
@Override
public String toString() {
String description ;
switch (this) {
case SUBPIXEL:
description = "Subpixel";
break;
case GREYSCALE:
description = "Greyscale";
break;
case OFF:
description = "No antialiasing";
break;
default:
description = "Subpixel";
}
return description;
}
}
@@ -15,87 +15,13 @@
*/
package com.intellij.ide.ui;
import sun.swing.SwingUtilities2;
import java.awt.*;
// Use AntialiasingType instead
@Deprecated
public enum LCDRenderingScope {
@Deprecated
IDE,
@Deprecated
EXCLUDING_EDITOR,
OFF;
public static LCDRenderingScope getWithLongestName() {
return IDE;
}
private static final SwingUtilities2.AATextInfo aaEnabled =
new SwingUtilities2.AATextInfo(RenderingHints.VALUE_TEXT_ANTIALIAS_ON, 140);
private static final SwingUtilities2.AATextInfo lcdEnabled =
new SwingUtilities2.AATextInfo(RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB, 140);
private static final SwingUtilities2.AATextInfo aaDisabled = null;
public static Object getAAHintForSwingComponent() {
UISettings uiSettings = UISettings.getInstance();
if (uiSettings.ANTIALIASING_IN_IDE) {
if (uiSettings.LCD_RENDERING_SCOPE == OFF) {
return aaEnabled;
}
return lcdEnabled;
}
return aaDisabled;
}
public static Object getKeyForCurrentScope(boolean inEditor) {
Object renderingHint = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
UISettings uiSettings = UISettings.getInstance();
if (uiSettings != null && uiSettings.ANTIALIASING_IN_IDE) {
switch (uiSettings.LCD_RENDERING_SCOPE) {
case IDE:
renderingHint = RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB;
break;
case EXCLUDING_EDITOR:
if (!inEditor) {
renderingHint = RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB;
break;
}
case OFF:
renderingHint = RenderingHints.VALUE_TEXT_ANTIALIAS_ON;
break;
}
}
return renderingHint;
}
@Override
public String toString() {
String description ;
switch (this) {
case IDE:
description = "LCD Rendering in IDE and Editor";
break;
case EXCLUDING_EDITOR:
description = "LCD Rendering in IDE";
break;
case OFF:
description = "Without LCD rendering";
break;
default:
description = "LCD Rendering in IDE";
}
return description;
}
public static boolean shouldRenderEditor(LCDRenderingScope scope) {
if (!UISettings.getInstance().ANTIALIASING_IN_IDE) return false;
switch (scope) {
case IDE:
return true;
default:
return false;
}
}
@Deprecated
OFF
}
@@ -97,10 +97,8 @@ public class UISettings extends SimpleModificationTracker implements PersistentS
public boolean CLOSE_NON_MODIFIED_FILES_FIRST = false;
public boolean ACTIVATE_MRU_EDITOR_ON_CLOSE = false;
public boolean ACTIVATE_RIGHT_EDITOR_ON_CLOSE = false;
@Deprecated
public boolean ANTIALIASING_IN_EDITOR = true;
public boolean ANTIALIASING_IN_IDE = ANTIALIASING_IN_EDITOR;
public LCDRenderingScope LCD_RENDERING_SCOPE = UIUtil.isRetina() ? LCDRenderingScope.OFF : LCDRenderingScope.IDE;
public AntialiasingType IDE_AA_TYPE = AntialiasingType.SUBPIXEL;
public AntialiasingType EDITOR_AA_TYPE = AntialiasingType.SUBPIXEL;
public ColorBlindness COLOR_BLINDNESS;
public boolean USE_LCD_RENDERING_IN_EDITOR = true;
public boolean MOVE_MOUSE_ON_DEFAULT_BUTTON = false;
@@ -286,10 +284,8 @@ public class UISettings extends SimpleModificationTracker implements PersistentS
Graphics2D g2d = (Graphics2D)g;
UISettings uiSettings = getInstance();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
if (uiSettings != null) {
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, LCDRenderingScope.getKeyForCurrentScope(false));
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, AntialiasingType.getKeyForCurrentScope(false));
} else {
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
}
@@ -32,6 +32,7 @@ import com.intellij.ui.components.JBCheckBox;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import com.intellij.openapi.diagnostic.Logger;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
@@ -45,6 +46,9 @@ import java.util.Hashtable;
* @author Eugene Belyaev
*/
public class AppearanceConfigurable extends BaseConfigurable implements SearchableConfigurable {
private static final Logger LOG = Logger.getInstance("#com.intellij.ide.ui.AppearanceConfigurable");
private MyComponent myComponent;
public String getDisplayName() {
@@ -63,6 +67,9 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
}
public JComponent createComponent() {
UISettings settings = UISettings.getInstance();
initComponent();
DefaultComboBoxModel aModel = new DefaultComboBoxModel(UIUtil.getValidFontNames(Registry.is("ide.settings.appearance.font.family.only")));
myComponent.myFontCombo.setModel(aModel);
@@ -74,18 +81,11 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
myComponent.myLafComboBox.setModel(new DefaultComboBoxModel(LafManager.getInstance().getInstalledLookAndFeels()));
myComponent.myLafComboBox.setRenderer(new LafComboBoxRenderer());
myComponent.myAntialiasingCheckBox.setSelected(UISettings.getInstance().ANTIALIASING_IN_IDE);
myComponent.myLCDRenderingScopeCombo.setEnabled(UISettings.getInstance().ANTIALIASING_IN_IDE);
myComponent.myAntialiasingInIDE.setModel(new DefaultComboBoxModel(AntialiasingType.values()));
myComponent.myAntialiasingInEditor.setModel(new DefaultComboBoxModel(AntialiasingType.values()));
myComponent.myAntialiasingCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
myComponent.myLCDRenderingScopeCombo.setEnabled(myComponent.myAntialiasingCheckBox.isSelected());
}
});
myComponent.myLCDRenderingScopeCombo.setModel(new DefaultComboBoxModel(LCDRenderingScope.values()));
myComponent.myLCDRenderingScopeCombo.setSelectedItem(UISettings.getInstance().LCD_RENDERING_SCOPE);
myComponent.myAntialiasingInIDE.setSelectedItem(settings.IDE_AA_TYPE);
myComponent.myAntialiasingInEditor.setSelectedItem(settings.EDITOR_AA_TYPE);
Dictionary<Integer, JComponent> delayDictionary = new Hashtable<Integer, JComponent>();
delayDictionary.put(new Integer(0), new JLabel("0"));
@@ -152,13 +152,13 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
shouldUpdateUI = true;
}
if (myComponent.myAntialiasingCheckBox.isSelected() != settings.ANTIALIASING_IN_IDE) {
settings.ANTIALIASING_IN_IDE = myComponent.myAntialiasingCheckBox.isSelected();
if (!myComponent.myAntialiasingInIDE.getSelectedItem().equals(settings.IDE_AA_TYPE)) {
settings.IDE_AA_TYPE = (AntialiasingType)myComponent.myAntialiasingInIDE.getSelectedItem();
shouldUpdateUI = true;
}
if (!myComponent.myLCDRenderingScopeCombo.getSelectedItem().equals(settings.LCD_RENDERING_SCOPE)) {
settings.LCD_RENDERING_SCOPE = (LCDRenderingScope)myComponent.myLCDRenderingScopeCombo.getSelectedItem();
if (!myComponent.myAntialiasingInEditor.getSelectedItem().equals(settings.EDITOR_AA_TYPE)) {
settings.EDITOR_AA_TYPE = (AntialiasingType)myComponent.myAntialiasingInEditor.getSelectedItem();
shouldUpdateUI = true;
}
@@ -298,8 +298,14 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
UISettings settings = UISettings.getInstance();
myComponent.myFontCombo.setSelectedItem(settings.FONT_FACE);
myComponent.myAntialiasingCheckBox.setSelected(settings.ANTIALIASING_IN_IDE);
myComponent.myLCDRenderingScopeCombo.setSelectedItem(settings.LCD_RENDERING_SCOPE);
// todo migrate
//myComponent.myAntialiasingCheckBox.setSelected(settings.ANTIALIASING_IN_IDE);
//myComponent.myLCDRenderingScopeCombo.setSelectedItem(settings.LCD_RENDERING_SCOPE);
myComponent.myAntialiasingInIDE.setSelectedItem(settings.IDE_AA_TYPE);
myComponent.myAntialiasingInEditor.setSelectedItem(settings.EDITOR_AA_TYPE);
myComponent.myFontSizeCombo.setSelectedItem(Integer.toString(settings.FONT_SIZE));
myComponent.myPresentationModeFontSize.setSelectedItem(Integer.toString(settings.PRESENTATION_MODE_FONT_SIZE));
myComponent.myAnimateWindowsCheckBox.setSelected(settings.ANIMATE_WINDOWS);
@@ -344,6 +350,19 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
myComponent.updateCombo();
}
public static String antialiasingTypeInEditorAsString (boolean antialiased, LCDRenderingScope scope) {
if (!antialiased) return "No antialiasing";
switch (scope) {
case IDE:
return "Subpixel";
case OFF:
case EXCLUDING_EDITOR:
return "Greyscale";
}
LOG.info("Wrong antialiasing state");
return "No antialiasing";
}
public boolean isModified() {
initComponent();
UISettings settings = UISettings.getInstance();
@@ -351,8 +370,10 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
boolean isModified = false;
isModified |= !Comparing.equal(myComponent.myFontCombo.getSelectedItem(), settings.FONT_FACE);
isModified |= !Comparing.equal(myComponent.myFontSizeCombo.getEditor().getItem(), Integer.toString(settings.FONT_SIZE));
isModified |= myComponent.myAntialiasingCheckBox.isSelected() != settings.ANTIALIASING_IN_IDE;
isModified |= !myComponent.myLCDRenderingScopeCombo.getSelectedItem().equals(settings.LCD_RENDERING_SCOPE);
isModified |= !myComponent.myAntialiasingInIDE.getSelectedItem().equals(settings.IDE_AA_TYPE);
isModified |= !myComponent.myAntialiasingInEditor.getSelectedItem().equals(settings.EDITOR_AA_TYPE);
isModified |= myComponent.myAnimateWindowsCheckBox.isSelected() != settings.ANIMATE_WINDOWS;
isModified |= myComponent.myWindowShortcutsCheckBox.isSelected() != settings.SHOW_TOOL_WINDOW_NUMBERS;
isModified |= myComponent.myShowToolStripesCheckBox.isSelected() == settings.HIDE_TOOL_STRIPES;
@@ -420,8 +441,6 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
private JCheckBox myShowMemoryIndicatorCheckBox;
private JComboBox myLafComboBox;
private JCheckBox myCycleScrollingCheckBox;
private JBCheckBox myAntialiasingCheckBox;
private ComboBox myLCDRenderingScopeCombo;
private JCheckBox myMoveMouseOnDefaultButtonCheckBox;
private JCheckBox myEnableAlphaModeCheckBox;
@@ -447,6 +466,8 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
private ComboBox myPresentationModeFontSize;
private JCheckBox myNavigateToPreviewCheckBox;
private ColorBlindnessPanel myColorBlindnessPanel;
private JComboBox myAntialiasingInIDE;
private JComboBox myAntialiasingInEditor;
public MyComponent() {
myOverrideLAFFonts.addActionListener( new ActionListener() {
@@ -8,7 +8,7 @@
<properties/>
<border type="none"/>
<children>
<grid id="10130" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="10130" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
@@ -16,7 +16,7 @@
<properties/>
<border type="none"/>
<children>
<grid id="d992b" layout-manager="GridLayoutManager" row-count="11" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="d992b" layout-manager="GridLayoutManager" row-count="10" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="3" indent="0" use-parent-layout="false"/>
@@ -29,7 +29,7 @@
<children>
<component id="33d7c" class="javax.swing.JCheckBox" binding="myMoveMouseOnDefaultButtonCheckBox">
<constraints>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<margin top="2" left="0" bottom="2" right="2"/>
@@ -38,7 +38,7 @@
</component>
<component id="665b2" class="javax.swing.JCheckBox" binding="myCycleScrollingCheckBox">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<margin top="2" left="0" bottom="2" right="2"/>
@@ -77,7 +77,7 @@
<grid id="d9fb" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -129,7 +129,7 @@
<grid id="ce348" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -147,7 +147,7 @@
</grid>
<component id="a3b32" class="javax.swing.JCheckBox" binding="myHideIconsInQuickNavigation">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<margin top="2" left="0" bottom="2" right="2"/>
@@ -156,7 +156,7 @@
</component>
<component id="9327f" class="javax.swing.JCheckBox" binding="myHideNavigationPopupsCheckBox">
<constraints>
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="271" height="29"/>
</grid>
</constraints>
@@ -168,7 +168,7 @@
<grid id="372a6" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="10" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -194,38 +194,12 @@
</grid>
<component id="2124a" class="javax.swing.JCheckBox" binding="myAltDNDCheckBox">
<constraints>
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Drag-n-Drop with ALT pressed only"/>
</properties>
</component>
<grid id="46b20" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="e6a03" class="com.intellij.ui.components.JBCheckBox" binding="myAntialiasingCheckBox">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Antialiasing"/>
</properties>
</component>
<component id="3d30f" class="com.intellij.openapi.ui.ComboBox" binding="myLCDRenderingScopeCombo">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<maximumRowCount value="8"/>
</properties>
</component>
</children>
</grid>
<component id="d7d6e" class="com.intellij.ide.ui.ColorBlindnessPanel" binding="myColorBlindnessPanel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
@@ -293,7 +267,7 @@
<grid id="937be" layout-manager="GridLayoutManager" row-count="7" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="3" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<clientProperties>
@@ -431,7 +405,7 @@
<grid id="e3cc0" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<clientProperties>
@@ -465,6 +439,50 @@
</component>
</children>
</grid>
<grid id="a629a" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<clientProperties>
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
<html.disable class="java.lang.Boolean" value="false"/>
</clientProperties>
<border type="etched" title-resource-bundle="messages/IdeBundle" title-key="group.antialiasing.mode"/>
<children>
<component id="a2bca" class="javax.swing.JComboBox" binding="myAntialiasingInIDE" default-binding="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="2d169" class="javax.swing.JComboBox" binding="myAntialiasingInEditor" default-binding="true">
<constraints>
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="1f4db" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<labelFor value="a2bca"/>
<text resource-bundle="messages/IdeBundle" key="label.text.antialiasing.scope.ide"/>
</properties>
</component>
<component id="55f93" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<labelFor value="2d169"/>
<text resource-bundle="messages/IdeBundle" key="label.text.antialiasing.scope.editor"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</children>
@@ -15,7 +15,7 @@
*/
package com.intellij.openapi.editor.ex.util;
import com.intellij.ide.ui.LCDRenderingScope;
import com.intellij.ide.ui.AntialiasingType;
import com.intellij.ide.ui.UISettings;
import java.awt.*;
@@ -32,7 +32,7 @@ public class EditorUIUtil {
Graphics2D g2d = (Graphics2D)g;
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, LCDRenderingScope.getKeyForCurrentScope(true));
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, AntialiasingType.getKeyForCurrentScope(true));
UISettings.setupFractionalMetrics(g2d);
}
@@ -15,6 +15,7 @@
*/
package com.intellij.openapi.editor.impl;
import com.intellij.ide.ui.AntialiasingType;
import com.intellij.ide.ui.UISettings;
import com.intellij.ide.ui.UISettingsListener;
import com.intellij.openapi.application.ApplicationManager;
@@ -52,15 +53,15 @@ public class ComplementaryFontsRegistry {
static {
final UISettings settings = UISettings.getInstance();
ourOldUseAntialiasing = settings.ANTIALIASING_IN_EDITOR;
ourOldUseAntialiasing = !AntialiasingType.OFF.equals(settings.EDITOR_AA_TYPE);
// Reset font info on 'use antialiasing' setting change.
// Assuming that the listener is notified from the EDT only.
settings.addUISettingsListener(new UISettingsListener() {
@Override
public void uiSettingsChanged(UISettings source) {
if (ourOldUseAntialiasing ^ source.ANTIALIASING_IN_EDITOR) {
ourOldUseAntialiasing = source.ANTIALIASING_IN_EDITOR;
if (ourOldUseAntialiasing ^ !AntialiasingType.OFF.equals(settings.EDITOR_AA_TYPE)) {
ourOldUseAntialiasing = !AntialiasingType.OFF.equals(settings.EDITOR_AA_TYPE);
for (FontInfo fontInfo : ourUsedFonts.values()) {
fontInfo.reset();
}
@@ -15,7 +15,7 @@
*/
package com.intellij.openapi.wm.impl.content;
import com.intellij.ide.ui.LCDRenderingScope;
import com.intellij.ide.ui.AntialiasingType;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.ui.EngravedTextGraphics;
import com.intellij.ui.Gray;
@@ -75,7 +75,7 @@ public class BaseLabel extends JLabel {
protected void paintComponent(final Graphics g) {
final Color fore = myUi.myWindow.isActive() ? myActiveFg : myPassiveFg;
setForeground(fore);
putClientProperty(SwingUtilities2.AA_TEXT_PROPERTY_KEY, LCDRenderingScope.getAAHintForSwingComponent());
putClientProperty(SwingUtilities2.AA_TEXT_PROPERTY_KEY, AntialiasingType.getAAHintForSwingComponent());
super.paintComponent(_getGraphics((Graphics2D)g));
}
@@ -1163,6 +1163,11 @@ goto.custom.region.message.dumb.mode=Custom folding navigation is not available
goto.custom.region.message.unavailable=There are no custom foldings in the current file.
alphabetical.mode.is.on.warning=Alphabetical order for tabs is ON. Switch it OFF?
group.antialiasing.mode=Antialiasing
label.text.antialiasing.scope.ide=IDE:
label.text.antialiasing.scope.editor=Editor:
file.changed.externally.message=File was changed on disk.
file.changed.externally.reload=Reload
group.presentation.mode=Presentation Mode