EN · DE · RU · FR · ES

#326: SwingAbstractWizardWindow.kt

projectforge-application/src/main/kotlin/org/projectforge/setup/wizard/swing/SwingAbstractWizardWindow.kt Type : Kotlin · Rôle : Assistant d'installation · Source : projectforge-application/src/main/kotlin/org/projectforge/setup/wizard/swing/SwingAbstractWizardWindow.kt 97 lignes · 39 code · 35 commentaires · 23 vides
Fichier source à projectforge-application/src/main/kotlin/org/projectforge/setup/wizard/swing/SwingAbstractWizardWindow.kt contenant du code Kotlin pour la couche Assistant d'installation.

Structure du code

Classes : SwingAbstractWizardWindow

Supertype(s) : JPanel

Fonctions (6) : getButtons, getContentPanel, aboutToDisplay, displaying, aboutToHide, redraw

Propriétés (6) : mainPanel, context, contentPanel, buttonPanel, titlePanel, panel

Importations : 5 paquetages

Paquetage : org.projectforge.setup.wizard.swing

Code source (abrégé)

package org.projectforge.setup.wizard.swing

import java.awt.GridBagConstraints
import java.awt.GridBagLayout
import javax.swing.JButton
import javax.swing.JLabel
import javax.swing.JPanel

abstract class SwingAbstractWizardWindow(context: SwingGUIContext,
                                         title: String) : JPanel() {
    val mainPanel: JPanel

    protected val context: SwingGUIContext

    private val contentPanel: JPanel

    private val buttonPanel: JPanel

    init {
        this.context = context
        mainPanel = JPanel(GridBagLayout())

        val titlePanel = JPanel()
        //LayoutUtils.addEmptySpace(titlePanel)
        titlePanel.add(JLabel(title))
        //LayoutUtils.addEmptySpace(titlePanel)
        mainPanel.add(titlePanel, SwingUtils.constraints(0, 0))

        contentPanel = getContentPanel()
        //contentPanel.layoutData = GridLayout.createLayoutData(GridLayout.Alignment.FILL, GridLayout.Alignment.FILL, true, true)
        mainPanel.add(contentPanel, SwingUtils.constraints(0, 1))

        mainPanel.add(JLabel(""), SwingUtils.constraints(0, 2, fill = GridBagConstraints.BOTH, weighty = 1.0))
        buttonPanel = SwingUtils.createButtonBar(context, true, *getButtons())
        mainPanel.add(buttonPanel, SwingUtils.constraints(0, 3, fill = GridBagConstraints.HORIZONTAL))
    }

    open fun getButtons(): Array<JButton> {
        return arrayOf()
    }

    open fun getContentPanel(): JPanel {
        val panel = JPanel()
        //panel.addComponent(EmptySpace())
        return panel
    }


    fun aboutToDisplay() {

        // Placez ici le code à exécuter avant l'affichage du panneau.

    }

    fun displaying() {

        // Placez ici le code à exécuter lors de l'affichage du panneau.

    }

    fun aboutToHide() {

        // Placez ici le code à exécuter lors du masquage du panneau.

    }

    /**
     * Sera appelée si la fenêtre est réaffichée.
     */
    open fun redraw() {}
}

Historique Git

868d6abb7 2025 -> 2026
63081666f En-têtes des fichiers source : 2024 -> 2025.
b6092df09 Droits d'auteur 2023 -> 2024
ab45d51fa Droits d'auteur 2001-2022 -> 2001-2023.
5f7ef41b8 Droits d'auteur 2021 -> 2022