/*
 * Copyright 2000-2014 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.openapi.editor.impl;

import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.ui.JBColor;
import com.intellij.ui.border.CustomLineBorder;
import javax.annotation.Nonnull;

import javax.swing.*;
import java.awt.*;

/**
 * @author gregsh
 */
public class EditorHeaderComponent extends JPanel {
  public EditorHeaderComponent() {
    super(new BorderLayout(0, 0));
    boolean topBorderRequired = !SystemInfo.isMac && UISettings.getInstance().EDITOR_TAB_PLACEMENT != UISettings.PLACEMENT_EDITOR_TAB_TOP &&
                                !(UISettings.getInstance().SHOW_MAIN_TOOLBAR && UISettings.getInstance().SHOW_NAVIGATION_BAR);
    setBorder(new CustomLineBorder(JBColor.border(), topBorderRequired ? 1 : 0, 0, 1, 0));
  }

  @Override
  public void paint(@Nonnull Graphics g) {
    Graphics2D g2 = (Graphics2D)g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    super.paint(g);
  }
}

@@ -680,53 +680,8 @@
 gs;%0A
-import com.intellij.openapi.util.SystemInfo;%0A
 impo
@@ -756,16 +756,17 @@
 Border;%0A
+%0A
 import j
@@ -790,17 +790,16 @@
 onnull;%0A
-%0A
 import j
@@ -984,276 +984,8 @@
 ));%0A
-    boolean topBorderRequired = !SystemInfo.isMac && UISettings.getInstance().EDITOR_TAB_PLACEMENT != UISettings.PLACEMENT_EDITOR_TAB_TOP &&%0A                                !(UISettings.getInstance().SHOW_MAIN_TOOLBAR && UISettings.getInstance().SHOW_NAVIGATION_BAR);%0A
     
@@ -1036,32 +1036,8 @@
 r(),
- topBorderRequired ? 1 :
  0, 
@@ -1115,232 +1115,38 @@
     
-Graphics2D g2 = (Graphics2D)g;%0A    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);%0A    g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON
+UISettings.setupAntialiasing(g
 );%0A 

fix double border with hide tabs + search session