Search in sources :

Example 1 with DateCodec

use of delta.common.ui.swing.text.dates.DateCodec in project lotro-companion by dmorcellet.

the class LevelHistoryEditionPanelController method buildPanel.

private JPanel buildPanel() {
    JPanel panel = GuiFactory.buildPanel(new BorderLayout());
    DateCodec codec = DateFormat.getDateTimeCodec();
    for (int level = 1; level <= _maxLevel; level++) {
        DateEditionController editor = new DateEditionController(codec);
        _editors.put(Integer.valueOf(level), editor);
    }
    JTabbedPane pane = GuiFactory.buildTabbedPane();
    int nbLevels = _maxLevel;
    int nbTabs = (nbLevels / LEVELS_BY_TAB) + (((nbLevels % LEVELS_BY_TAB) == 0) ? 0 : 1);
    int currentLevel = 1;
    for (int i = 0; i < nbTabs; i++) {
        int endLevel = Math.min(nbLevels, currentLevel + LEVELS_BY_TAB - 1);
        initTab(pane, currentLevel, endLevel);
        currentLevel = endLevel + 1;
    }
    panel.add(pane, BorderLayout.CENTER);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) DateCodec(delta.common.ui.swing.text.dates.DateCodec) JTabbedPane(javax.swing.JTabbedPane) DateEditionController(delta.common.ui.swing.text.dates.DateEditionController)

Aggregations

DateCodec (delta.common.ui.swing.text.dates.DateCodec)1 DateEditionController (delta.common.ui.swing.text.dates.DateEditionController)1 BorderLayout (java.awt.BorderLayout)1 JPanel (javax.swing.JPanel)1 JTabbedPane (javax.swing.JTabbedPane)1