Search in sources :

Example 1 with AbstractPainter

use of com.intellij.openapi.ui.AbstractPainter in project intellij-community by JetBrains.

the class IdeBackgroundUtil method initFramePainters.

public static void initFramePainters(@NotNull IdeGlassPaneImpl glassPane) {
    PaintersHelper painters = glassPane.getNamedPainters(FRAME_PROP);
    PaintersHelper.initWallpaperPainter(FRAME_PROP, painters);
    ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
    String path = /*UIUtil.isUnderDarcula()? appInfo.getEditorBackgroundImageUrl() : */
    null;
    URL url = path == null ? null : appInfo.getClass().getResource(path);
    Image centerImage = url == null ? null : ImageLoader.loadFromUrl(url);
    if (centerImage != null) {
        painters.addPainter(PaintersHelper.newImagePainter(centerImage, PaintersHelper.Fill.PLAIN, PaintersHelper.Place.TOP_CENTER, 1.0f, JBUI.insets(10, 0, 0, 0)), null);
    }
    painters.addPainter(new AbstractPainter() {

        EditorEmptyTextPainter p = ServiceManager.getService(EditorEmptyTextPainter.class);

        @Override
        public boolean needsRepaint() {
            return true;
        }

        @Override
        public void executePaint(Component component, Graphics2D g) {
            p.paintEmptyText((JComponent) component, g);
        }
    }, null);
}
Also used : ApplicationInfoEx(com.intellij.openapi.application.ex.ApplicationInfoEx) EditorEmptyTextPainter(com.intellij.openapi.fileEditor.impl.EditorEmptyTextPainter) BufferedImage(java.awt.image.BufferedImage) PropertiesComponent(com.intellij.ide.util.PropertiesComponent) URL(java.net.URL) AbstractPainter(com.intellij.openapi.ui.AbstractPainter)

Aggregations

PropertiesComponent (com.intellij.ide.util.PropertiesComponent)1 ApplicationInfoEx (com.intellij.openapi.application.ex.ApplicationInfoEx)1 EditorEmptyTextPainter (com.intellij.openapi.fileEditor.impl.EditorEmptyTextPainter)1 AbstractPainter (com.intellij.openapi.ui.AbstractPainter)1 BufferedImage (java.awt.image.BufferedImage)1 URL (java.net.URL)1