| 1 | |
package org.jtheque.core.managers.view.impl.components.panel; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
import org.jtheque.core.managers.Managers; |
| 20 | |
import org.jtheque.core.managers.update.IUpdateManager; |
| 21 | |
import org.jtheque.core.managers.view.impl.actions.module.UpdateKernelAction; |
| 22 | |
import org.jtheque.core.utils.ui.PanelBuilder; |
| 23 | |
import org.jtheque.utils.ui.GridBagUtils; |
| 24 | |
|
| 25 | |
import javax.swing.JPanel; |
| 26 | |
import java.awt.Component; |
| 27 | |
import java.awt.Font; |
| 28 | |
import java.awt.Insets; |
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
public final class KernelInfoPanel extends JPanel { |
| 36 | |
private static final int TITLE_FONT_SIZE = 16; |
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
public KernelInfoPanel() { |
| 42 | 0 | super(); |
| 43 | |
|
| 44 | 0 | build(); |
| 45 | 0 | } |
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
private void build() { |
| 51 | 0 | PanelBuilder builder = new PanelBuilder(this); |
| 52 | |
|
| 53 | 0 | builder.setDefaultInsets(new Insets(4, 4, 4, 4)); |
| 54 | |
|
| 55 | 0 | Component kernelLabel = builder.addI18nLabel("modules.view.label.kernel", builder.gbcSet(0, 0, GridBagUtils.NONE, GridBagUtils.LINE_START, 1, 3)); |
| 56 | 0 | kernelLabel.setFont(kernelLabel.getFont().deriveFont(Font.BOLD, TITLE_FONT_SIZE)); |
| 57 | |
|
| 58 | 0 | builder.addI18nLabel("modules.view.label.versions.current", builder.gbcSet(1, 0)); |
| 59 | |
|
| 60 | 0 | builder.addLabel(Managers.getCore().getCoreCurrentVersion().getVersion(), builder.gbcSet(1, 1)); |
| 61 | |
|
| 62 | 0 | builder.addI18nLabel("modules.view.label.versions.online", builder.gbcSet(2, 0)); |
| 63 | |
|
| 64 | 0 | builder.addLabel(Managers.getManager(IUpdateManager.class).getMostRecentVersion(Managers.getCore()).getVersion(), getForeground(), |
| 65 | |
builder.gbcSet(2, 1)); |
| 66 | |
|
| 67 | 0 | builder.addButton(new UpdateKernelAction(), builder.gbcSet(4, 0, GridBagUtils.NONE, GridBagUtils.LINE_START, 1, 3)); |
| 68 | 0 | } |
| 69 | |
} |