<commit_before>// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package training.ui.welcomeScreen

import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.wm.StartPagePromoter
import com.intellij.openapi.wm.impl.welcomeScreen.learnIde.HeightLimitedPane
import com.intellij.ui.JBColor
import com.intellij.ui.components.panels.NonOpaquePanel
import com.intellij.util.ui.JBUI
import com.intellij.util.ui.UIUtil
import icons.FeaturesTrainerIcons
import org.jetbrains.annotations.NonNls
import training.dsl.LessonUtil
import training.lang.LangManager
import training.learn.CourseManager
import training.learn.LearnBundle
import training.learn.OpenLessonActivities
import training.ui.UISettings
import training.util.resetPrimaryLanguage
import training.util.rigid
import java.awt.Component
import java.awt.Dimension
import java.awt.Font
import java.awt.Rectangle
import java.awt.event.ActionEvent
import javax.swing.*
import javax.swing.border.MatteBorder

open class OnboardingLessonPromoter(@NonNls private val lessonId: String) : StartPagePromoter {
  override fun needToHideSingleProject(path: String): Boolean {
    val langSupport = LangManager.getInstance().getLangSupport() ?: return false
    return LangManager.getInstance().getLearningProjectPath(langSupport) == path
  }

  override fun getPromotionForInitialState(): JPanel? {
    val rPanel: JPanel = NonOpaquePanel()
    rPanel.layout = BoxLayout(rPanel, BoxLayout.PAGE_AXIS)
    rPanel.border = JBUI.Borders.empty(10, 32)

    val vPanel: JPanel = NonOpaquePanel()
    vPanel.layout = BoxLayout(vPanel, BoxLayout.PAGE_AXIS)
    vPanel.alignmentY = Component.TOP_ALIGNMENT

    val header = JLabel(LearnBundle.message("welcome.promo.header"))
    header.font = UIUtil.getLabelFont().deriveFont(Font.BOLD).deriveFont(UIUtil.getLabelFont().size2D + 4)
    vPanel.add(header)
    vPanel.add(rigid(0, 4))<commit_msg>[IFT] Fix size scaling<commit_after>// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package training.ui.welcomeScreen

import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.wm.StartPagePromoter
import com.intellij.openapi.wm.impl.welcomeScreen.learnIde.HeightLimitedPane
import com.intellij.ui.JBColor
import com.intellij.ui.components.panels.NonOpaquePanel
import com.intellij.util.ui.JBUI
import com.intellij.util.ui.UIUtil
import icons.FeaturesTrainerIcons
import org.jetbrains.annotations.NonNls
import training.dsl.LessonUtil
import training.lang.LangManager
import training.learn.CourseManager
import training.learn.LearnBundle
import training.learn.OpenLessonActivities
import training.ui.UISettings
import training.util.resetPrimaryLanguage
import training.util.rigid
import java.awt.Component
import java.awt.Dimension
import java.awt.Font
import java.awt.Rectangle
import java.awt.event.ActionEvent
import javax.swing.*
import javax.swing.border.MatteBorder

open class OnboardingLessonPromoter(@NonNls private val lessonId: String) : StartPagePromoter {
  override fun needToHideSingleProject(path: String): Boolean {
    val langSupport = LangManager.getInstance().getLangSupport() ?: return false
    return LangManager.getInstance().getLearningProjectPath(langSupport) == path
  }

  override fun getPromotionForInitialState(): JPanel? {
    val rPanel: JPanel = NonOpaquePanel()
    rPanel.layout = BoxLayout(rPanel, BoxLayout.PAGE_AXIS)
    rPanel.border = JBUI.Borders.empty(JBUI.scale(10), JBUI.scale(32))

    val vPanel: JPanel = NonOpaquePanel()
    vPanel.layout = BoxLayout(vPanel, BoxLayout.PAGE_AXIS)
    vPanel.alignmentY = Component.TOP_ALIGNMENT

    val header = JLabel(LearnBundle.message("welcome.promo.header"))
    header.font = UIUtil.getLabelFont().deriveFont(Font.BOLD).deriveFont(UIUtil.getLabelFont().size2D + JBUI.scale(4))
    vPanel.add(header)
    vPanel.add(rigid(0, 4))
{'fraction_non_alphanumeric': 0.09308709757923633, 'fraction_numerical': 0.008984277514349888, 'mean_word_length': 5.4959481361426255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3320451', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1246, 'n_words': 258}