Search in sources :

Example 96 with GridBagConstraints

use of java.awt.GridBagConstraints in project pcgen by PCGen.

the class CharacterStatsPanel method initComponents.

/**
	 * Build and initialise the user interface.
	 */
private void initComponents() {
    GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    JLabel label;
    ButtonGroup exclusiveGroup;
    Border etched = null;
    TitledBorder title1 = BorderFactory.createTitledBorder(etched, in_abilities);
    title1.setTitleJustification(TitledBorder.LEFT);
    this.setBorder(title1);
    this.setLayout(gridbag);
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new Insets(2, 2, 2, 2);
    final GameMode gameMode = SettingsHandler.getGame();
    int row = 0;
    exclusiveGroup = new ButtonGroup();
    Utility.buildConstraints(c, 0, row++, 3, 1, 0, 0);
    label = new JLabel(LanguageBundle.getFormattedString("in_Prefs_abilitiesGenLabel", //$NON-NLS-1$
    gameMode.getDisplayName()));
    gridbag.setConstraints(label, c);
    this.add(label);
    Utility.buildConstraints(c, 0, row, 1, 1, 0, 0);
    label = new JLabel("  ");
    gridbag.setConstraints(label, c);
    this.add(label);
    Utility.buildConstraints(c, 1, row++, 2, 1, 0, 0);
    abilitiesUserRolledButton = new JRadioButton(LanguageBundle.getString("in_Prefs_abilitiesUserRolled"));
    gridbag.setConstraints(abilitiesUserRolledButton, c);
    this.add(abilitiesUserRolledButton);
    exclusiveGroup.add(abilitiesUserRolledButton);
    Utility.buildConstraints(c, 1, row++, 2, 1, 0, 0);
    abilitiesAllSameButton = new JRadioButton(LanguageBundle.getString("in_Prefs_abilitiesAllSame") + ": ");
    gridbag.setConstraints(abilitiesAllSameButton, c);
    this.add(abilitiesAllSameButton);
    exclusiveGroup.add(abilitiesAllSameButton);
    Utility.buildConstraints(c, 1, row, 1, 1, 0, 0);
    label = new JLabel("  ");
    gridbag.setConstraints(label, c);
    this.add(label);
    Utility.buildConstraints(c, 2, row++, 2, 1, 0, 0);
    abilityScoreCombo = new JComboBoxEx();
    for (int i = gameMode.getStatMin(); i <= gameMode.getStatMax(); ++i) {
        abilityScoreCombo.addItem(String.valueOf(i));
    }
    gridbag.setConstraints(abilityScoreCombo, c);
    this.add(abilityScoreCombo);
    ReferenceManufacturer<RollMethod> mfg = gameMode.getModeContext().getReferenceContext().getManufacturer(RollMethod.class);
    List<RollMethod> rollMethods = mfg.getOrderSortedObjects();
    if (!rollMethods.isEmpty()) {
        Utility.buildConstraints(c, 1, row++, 2, 1, 0, 0);
        abilitiesRolledButton = new JRadioButton("Rolled:");
        gridbag.setConstraints(abilitiesRolledButton, c);
        this.add(abilitiesRolledButton);
        exclusiveGroup.add(abilitiesRolledButton);
        Utility.buildConstraints(c, 2, row++, 2, 1, 0, 0);
        abilityRolledModeCombo = new JComboBoxEx();
        for (RollMethod rm : rollMethods) {
            abilityRolledModeCombo.addItem(rm.getDisplayName());
        }
        gridbag.setConstraints(abilityRolledModeCombo, c);
        this.add(abilityRolledModeCombo);
    }
    Collection<PointBuyMethod> methods = SettingsHandler.getGame().getModeContext().getReferenceContext().getConstructedCDOMObjects(PointBuyMethod.class);
    final int purchaseMethodCount = methods.size();
    Utility.buildConstraints(c, 1, row++, 2, 1, 0, 0);
    abilitiesPurchasedButton = new JRadioButton(LanguageBundle.getString("in_Prefs_abilitiesPurchased") + ": ");
    gridbag.setConstraints(abilitiesPurchasedButton, c);
    this.add(abilitiesPurchasedButton);
    exclusiveGroup.add(abilitiesPurchasedButton);
    Utility.buildConstraints(c, 2, row++, 2, 1, 0, 0);
    pMode = new String[purchaseMethodCount];
    pModeMethodName = new String[purchaseMethodCount];
    int i = 0;
    for (PointBuyMethod pbm : methods) {
        pMode[i] = pbm.getDescription();
        pModeMethodName[i] = pbm.getDisplayName();
        i++;
    }
    abilityPurchaseModeCombo = new JComboBoxEx(pMode);
    gridbag.setConstraints(abilityPurchaseModeCombo, c);
    this.add(abilityPurchaseModeCombo);
    //
    if (purchaseMethodCount == 0) {
        abilityPurchaseModeCombo.setVisible(false);
        abilitiesPurchasedButton.setVisible(false);
    }
    Utility.buildConstraints(c, 1, row++, 1, 1, 0, 0);
    label = new JLabel(" ");
    gridbag.setConstraints(label, c);
    this.add(label);
    Utility.buildConstraints(c, 1, row++, 3, 1, 0, 0);
    JButton purchaseModeButton = new JButton(LanguageBundle.getString("in_Prefs_purchaseModeConfig"));
    gridbag.setConstraints(purchaseModeButton, c);
    this.add(purchaseModeButton);
    purchaseModeButton.addActionListener(new PurchaseModeButtonListener());
    Utility.buildConstraints(c, 5, 20, 1, 1, 1, 1);
    c.fill = GridBagConstraints.BOTH;
    label = new JLabel(" ");
    gridbag.setConstraints(label, c);
    this.add(label);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) JRadioButton(javax.swing.JRadioButton) RollMethod(pcgen.cdom.content.RollMethod) GridBagLayout(java.awt.GridBagLayout) PointBuyMethod(pcgen.core.PointBuyMethod) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) TitledBorder(javax.swing.border.TitledBorder) GameMode(pcgen.core.GameMode) ButtonGroup(javax.swing.ButtonGroup) JComboBoxEx(pcgen.gui2.util.JComboBoxEx) Border(javax.swing.border.Border) TitledBorder(javax.swing.border.TitledBorder)

Example 97 with GridBagConstraints

use of java.awt.GridBagConstraints in project pcgen by PCGen.

the class ExperienceAdjusterView method initComponents.

/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;
    jPanel5 = new javax.swing.JPanel();
    panelChar = new javax.swing.JPanel();
    characterList = new javax.swing.JList();
    spCharLabel = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();
    enemyList = new javax.swing.JList();
    jPanel6 = new javax.swing.JPanel();
    jPanel7 = new javax.swing.JPanel();
    jLabel7 = new javax.swing.JLabel();
    experienceToAdd = new javax.swing.JTextField(6);
    addExperienceToCharButton = new javax.swing.JButton();
    jPanel8 = new javax.swing.JPanel();
    jLabel5 = new javax.swing.JLabel();
    experienceFromCombat = new javax.swing.JLabel();
    experienceMultNameLabel = new javax.swing.JLabel();
    experienceMultSlider = new javax.swing.JSlider();
    addExperienceToPartyButton = new javax.swing.JButton();
    experienceMultLabel = new javax.swing.JLabel();
    adjustCRButton = new javax.swing.JButton();
    addEnemyButton = new javax.swing.JButton();
    removeEnemyButton = new javax.swing.JButton();
    scrollPaneChar = new JScrollPane(characterList);
    scrollPaneEnemy = new JScrollPane(enemyList);
    setLayout(new GridLayout(0, 1));
    //$NON-NLS-1$
    jPanel5.setBorder(new TitledBorder(LanguageBundle.getString("in_plugin_xp_char")));
    jPanel5.setLayout(new java.awt.GridLayout(1, 0));
    panelChar.setLayout(new java.awt.BorderLayout());
    //$NON-NLS-1$
    spCharLabel.setText(LanguageBundle.getString("in_plugin_xp_nameLvlXp"));
    panelChar.add(spCharLabel, BorderLayout.NORTH);
    panelChar.add(scrollPaneChar, java.awt.BorderLayout.CENTER);
    jPanel5.add(panelChar);
    jPanel1.setLayout(new java.awt.BorderLayout());
    //$NON-NLS-1$
    jLabel4.setText(LanguageBundle.getString("in_plugin_xp_nameCr"));
    jPanel1.add(jLabel4, java.awt.BorderLayout.NORTH);
    jPanel1.add(scrollPaneEnemy, java.awt.BorderLayout.CENTER);
    add(jPanel5);
    jPanel6.setLayout(new java.awt.GridLayout(1, 0));
    //$NON-NLS-1$
    jPanel6.setBorder(new TitledBorder(LanguageBundle.getString("in_plugin_xp_enemies")));
    jPanel6.add(jPanel1);
    jPanel7.setLayout(new java.awt.GridBagLayout());
    // the button is after to allow the use of Tab after entering a value then pressing the button
    //$NON-NLS-1$
    jLabel7.setText(LanguageBundle.getString("in_plugin_xp_xpTo"));
    //$NON-NLS-1$
    addExperienceToCharButton.setText(LanguageBundle.getString("in_plugin_xp_selectedChar"));
    addExperienceToCharButton.setEnabled(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    //$NON-NLS-1$
    jPanel7.add(new JLabel(LanguageBundle.getString("in_plugin_xp_add")), gridBagConstraints);
    jPanel7.add(experienceToAdd, gridBagConstraints);
    jPanel7.add(jLabel7, gridBagConstraints);
    jPanel7.add(addExperienceToCharButton, gridBagConstraints);
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    // add an empty horizontal glue like panel
    jPanel7.add(new JPanel(), gridBagConstraints);
    // Updates the button if there is a selected character
    characterList.addListSelectionListener(new ListSelectionListener() {

        @Override
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                addExperienceToCharButton.setEnabled(!characterList.isSelectionEmpty());
            }
        }
    });
    jPanel7.setBorder(BorderFactory.createEmptyBorder(0, BORDER_SIZE, 0, 0));
    jPanel5.add(jPanel7);
    jPanel8.setLayout(new java.awt.GridBagLayout());
    //$NON-NLS-1$
    jLabel5.setText(LanguageBundle.getString("in_plugin_xp_xpFromCombat"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = 2;
    jPanel8.add(jLabel5, gridBagConstraints);
    experienceFromCombat.setText(Integer.toString(0));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    jPanel8.add(experienceFromCombat, gridBagConstraints);
    //$NON-NLS-1$
    experienceMultNameLabel.setText(LanguageBundle.getString("in_plugin_xp_normal"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    jPanel8.add(experienceMultNameLabel, gridBagConstraints);
    experienceMultSlider.setMaximum(10);
    experienceMultSlider.setMinimum(-5);
    experienceMultSlider.setValue(0);
    // TODO the false value (the slider's) should not be visible, only the real one should
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    jPanel8.add(experienceMultSlider, gridBagConstraints);
    experienceMultSlider.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            double realValue = getSliderRealValue();
            if (CoreUtility.doublesEqual(realValue, 0.5)) {
                getExperienceMultNameLabel().setText(//$NON-NLS-1$
                LanguageBundle.getString("in_plugin_xp_half"));
            } else if (realValue <= 0.7) {
                getExperienceMultNameLabel().setText(//$NON-NLS-1$
                LanguageBundle.getString("in_plugin_xp_easier"));
            } else if ((realValue > 0.7) && (realValue < 1.5)) {
                getExperienceMultNameLabel().setText(//$NON-NLS-1$
                LanguageBundle.getString("in_plugin_xp_normal"));
            } else if (realValue >= 1.5) {
                getExperienceMultNameLabel().setText(//$NON-NLS-1$
                LanguageBundle.getString("in_plugin_xp_harder"));
            }
            if (CoreUtility.doublesEqual(realValue, 2)) {
                getExperienceMultNameLabel().setText(//$NON-NLS-1$
                LanguageBundle.getString("in_plugin_xp_twice"));
            }
            getExperienceMultLabel().setText(LanguageBundle.getPrettyMultiplier(realValue));
            model.setMultiplier(realValue);
        }
    });
    //$NON-NLS-1$
    addExperienceToPartyButton.setText(LanguageBundle.getString("in_plugin_xp_addXpToParty"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    jPanel8.add(addExperienceToPartyButton, gridBagConstraints);
    experienceMultLabel.setText(LanguageBundle.getPrettyMultiplier(1.0d));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    jPanel8.add(experienceMultLabel, gridBagConstraints);
    //$NON-NLS-1$
    adjustCRButton.setText(LanguageBundle.getString("in_plugin_xp_adjustCr"));
    adjustCRButton.setEnabled(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    jPanel8.add(adjustCRButton, gridBagConstraints);
    //$NON-NLS-1$
    addEnemyButton.setText(LanguageBundle.getString("in_plugin_xp_addEnemy"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    jPanel8.add(addEnemyButton, gridBagConstraints);
    //$NON-NLS-1$
    removeEnemyButton.setText(LanguageBundle.getString("in_plugin_xp_removeEnemy"));
    removeEnemyButton.setEnabled(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.insets = new java.awt.Insets(12, BORDER_SIZE, 0, 0);
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    jPanel8.add(removeEnemyButton, gridBagConstraints);
    // Update buttons on selection change
    enemyList.addListSelectionListener(new ListSelectionListener() {

        @Override
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                adjustCRButton.setEnabled(!enemyList.isSelectionEmpty());
                removeEnemyButton.setEnabled(!enemyList.isSelectionEmpty());
            }
        }
    });
    jPanel8.setBorder(BorderFactory.createEmptyBorder(0, BORDER_SIZE, 0, 0));
    jPanel6.add(jPanel8);
    add(jPanel6);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) JButton(javax.swing.JButton) JTextField(javax.swing.JTextField) JList(javax.swing.JList) ListSelectionEvent(javax.swing.event.ListSelectionEvent) JLabel(javax.swing.JLabel) GridBagConstraints(java.awt.GridBagConstraints) TitledBorder(javax.swing.border.TitledBorder) ListSelectionListener(javax.swing.event.ListSelectionListener) GridLayout(java.awt.GridLayout) GridLayout(java.awt.GridLayout) ChangeEvent(javax.swing.event.ChangeEvent) JLabel(javax.swing.JLabel) ChangeListener(javax.swing.event.ChangeListener) BorderLayout(java.awt.BorderLayout) JPanel(javax.swing.JPanel)

Example 98 with GridBagConstraints

use of java.awt.GridBagConstraints in project pcgen by PCGen.

the class CastSpell method addDescriptionPanel.

private void addDescriptionPanel() {
    GridBagConstraints gridBagConstraints = null;
    descPanel = new JPanel(new BorderLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = gridBagRow;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.gridheight = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.insets = new Insets(3, 3, 3, 3);
    mainPanel.add(descPanel, gridBagConstraints);
    gridBagRow++;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) GridBagConstraints(java.awt.GridBagConstraints)

Example 99 with GridBagConstraints

use of java.awt.GridBagConstraints in project pcgen by PCGen.

the class OverPanel method initComponents.

/**
	 * This method is called from within the constructor to
	 * initialize the form.
	 */
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;
    panelScaleConv = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    textScale = new JFormattedTextField(nf);
    textScale.setColumns(3);
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    textReal = new JFormattedTextField(nf);
    textMap = new JFormattedTextField(nf);
    butToMap = new javax.swing.JButton();
    butToReal = new javax.swing.JButton();
    panelTravelTime = new javax.swing.JPanel();
    imperialSpeedLabel = new javax.swing.JLabel();
    metricSpeedLabel = new JLabel();
    cmbFile = new javax.swing.JComboBox();
    txtDist = new JFormattedTextField(nf);
    txtDist.setColumns(4);
    txtDistMetric = new JFormattedTextField(nf);
    jLabel11 = new javax.swing.JLabel();
    txtTime = new JFormattedTextField(nf);
    txtTime.setColumns(4);
    butToTime = new javax.swing.JButton();
    butToTime2 = new JButton();
    butToDist = new javax.swing.JButton();
    lblSpeed = new JLabel();
    panelRoomBoard = new javax.swing.JPanel();
    jLabel15 = new javax.swing.JLabel();
    jLabel16 = new javax.swing.JLabel();
    jLabel17 = new javax.swing.JLabel();
    jLabel18 = new javax.swing.JLabel();
    jLabel20 = new javax.swing.JLabel();
    jLabel21 = new javax.swing.JLabel();
    jLabel22 = new javax.swing.JLabel();
    txtDayFood = new JFormattedTextField(gp);
    txtDayInn = new JFormattedTextField(gp);
    txtDayAnimal = new JFormattedTextField(gp);
    txtWeekFood = new JLabel();
    txtWeekInn = new JLabel();
    txtWeekAnimal = new JLabel();
    txtDays = new JFormattedTextField(nf);
    txtTotal = new JLabel();
    cmbFood = new javax.swing.JComboBox();
    cmbInn = new javax.swing.JComboBox();
    cmbAnimal = new javax.swing.JComboBox();
    jSeparator1 = new javax.swing.JSeparator();
    jLabel23 = new javax.swing.JLabel();
    jLabel24 = new javax.swing.JLabel();
    txtPeop = new JFormattedTextField(nf);
    txtAnim = new JFormattedTextField(nf);
    txtDayTotal = new JFormattedTextField(nf);
    txtWeekTotal = new JLabel();
    jLabel25 = new javax.swing.JLabel();
    JPanel panel = new JPanel(new java.awt.GridBagLayout());
    int gap = 3;
    Insets stdInsets = new Insets(gap, gap, gap, gap);
    panelScaleConv.setLayout(new java.awt.GridBagLayout());
    //$NON-NLS-1$
    panelScaleConv.setBorder(BorderFactory.createTitledBorder(LanguageBundle.getString("in_plugin_overland_scaleConverter")));
    //$NON-NLS-1$
    jLabel2.setText(LanguageBundle.getString("in_plugin_overland_realUnits"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = stdInsets;
    panelScaleConv.add(jLabel2, gridBagConstraints);
    //$NON-NLS-1$
    jLabel3.setText("1");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.insets = stdInsets;
    panelScaleConv.add(jLabel3, gridBagConstraints);
    textScale.setHorizontalAlignment(SwingConstants.CENTER);
    textScale.setValue(1);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = stdInsets;
    panelScaleConv.add(textScale, gridBagConstraints);
    //$NON-NLS-1$
    jLabel4.setText("=");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.insets = stdInsets;
    panelScaleConv.add(jLabel4, gridBagConstraints);
    //$NON-NLS-1$
    jLabel5.setText(LanguageBundle.getString("in_plugin_overland_mapUnits"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = stdInsets;
    panelScaleConv.add(jLabel5, gridBagConstraints);
    textReal.addKeyListener(new KeyListenerImplementation(butToMap));
    textReal.setHorizontalAlignment(SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = stdInsets;
    panelScaleConv.add(textReal, gridBagConstraints);
    textMap.addKeyListener(new KeyListenerImplementation(butToReal));
    textMap.setHorizontalAlignment(SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = stdInsets;
    panelScaleConv.add(textMap, gridBagConstraints);
    //$NON-NLS-1$
    butToMap.setText(LanguageBundle.getString("in_plugin_overland_leftArrow"));
    butToMap.addActionListener(this::butToMapActionPerformed);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    panelScaleConv.add(butToMap, gridBagConstraints);
    //$NON-NLS-1$
    butToReal.setText(LanguageBundle.getString("in_plugin_overland_rightArrow"));
    butToReal.addActionListener(this::butToRealActionPerformed);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    panelScaleConv.add(butToReal, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
    panel.add(panelScaleConv, gridBagConstraints);
    // Travel time panel
    panelTravelTime.setLayout(new java.awt.GridBagLayout());
    //$NON-NLS-1$
    panelTravelTime.setBorder(BorderFactory.createTitledBorder(LanguageBundle.getString("in_plugin_overland_travelTime")));
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
    gridBagConstraints.insets = new Insets(0, 2 * gap, 2 * gap, 2 * gap);
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    panelTravelTime.add(cmbFile, gridBagConstraints);
    method = new JComboBox();
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.insets = stdInsets;
    gridBagConstraints.gridwidth = 2;
    panelTravelTime.add(method, gridBagConstraints);
    JPanel terrainRoute = new JPanel(new GridBagLayout());
    terrain = new JComboBox();
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.insets = stdInsets;
    terrainRoute.add(terrain, gridBagConstraints);
    route = new JComboBox();
    terrainRoute.add(route, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = 2;
    panelTravelTime.add(terrainRoute, gridBagConstraints);
    percent = new JLabel();
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.insets = stdInsets;
    panelTravelTime.add(percent, gridBagConstraints);
    JPanel paceChoice = new JPanel(new GridBagLayout());
    pace = new JComboBox();
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.insets = stdInsets;
    paceChoice.add(pace, gridBagConstraints);
    choice = new JComboBox();
    paceChoice.add(choice, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = GridBagConstraints.LINE_START;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.gridheight = 2;
    panelTravelTime.add(paceChoice, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.insets = stdInsets;
    panelTravelTime.add(imperialSpeedLabel, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.insets = stdInsets;
    panelTravelTime.add(metricSpeedLabel, gridBagConstraints);
    // "Special rules stuff will go there. This is used as default column name."
    ruleComment = new JTextArea();
    ruleComment.setRows(3);
    ruleComment.setEditable(false);
    ruleComment.setFocusable(false);
    ruleComment.setLineWrap(true);
    // TODO i18n this. this is not correct in non spaced language like Japanese, unless it is done correctly by Java?
    ruleComment.setWrapStyleWord(true);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    panelTravelTime.add(new JScrollPane(ruleComment), gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    // XXX use a line or a component that make more sense than this menu component
    panelTravelTime.add(new JSeparator(), gridBagConstraints);
    imperialSpeed = new JLabel();
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 7;
    panelTravelTime.add(imperialSpeed, gridBagConstraints);
    metricSpeed = new JLabel();
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 8;
    panelTravelTime.add(metricSpeed, gridBagConstraints);
    JPanel conversion = new JPanel(new GridBagLayout());
    txtDist.addKeyListener(new KeyListenerImplementation(butToTime));
    txtDist.setHorizontalAlignment(SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = stdInsets;
    conversion.add(txtDist, gridBagConstraints);
    //$NON-NLS-1$
    JLabel miles = new JLabel(LanguageBundle.getString("in_plugin_overland_fieldMiles"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = new java.awt.Insets(gap, 0, gap, gap);
    conversion.add(miles, gridBagConstraints);
    //$NON-NLS-1$
    butToTime.setText(LanguageBundle.getString("in_plugin_overland_rightArrow"));
    butToTime.setEnabled(false);
    butToTime.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            butImperialToTimeActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 0;
    conversion.add(butToTime, gridBagConstraints);
    txtDistMetric.addKeyListener(new KeyListenerImplementation(butToTime2));
    txtDistMetric.setHorizontalAlignment(SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = stdInsets;
    conversion.add(txtDistMetric, gridBagConstraints);
    //$NON-NLS-1$
    lblSpeed.setText(LanguageBundle.getString("in_plugin_overland_fieldKm"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
    gridBagConstraints.insets = new java.awt.Insets(gap, gap, gap, gap);
    conversion.add(lblSpeed, gridBagConstraints);
    //$NON-NLS-1$
    butToTime2.setText(LanguageBundle.getString("in_plugin_overland_rightArrow"));
    butToTime2.setEnabled(false);
    butToTime.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            butMetricToTimeActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 1;
    conversion.add(butToTime2, gridBagConstraints);
    txtTime.addKeyListener(new KeyListenerImplementation(butToDist));
    txtTime.setHorizontalAlignment(SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(gap, gap, gap, 0);
    conversion.add(txtTime, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 5;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.insets = stdInsets;
    conversion.add(jLabel11, gridBagConstraints);
    //$NON-NLS-1$
    butToDist.setText(LanguageBundle.getString("in_plugin_overland_leftArrow"));
    butToDist.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            butToDistActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    conversion.add(butToDist, gridBagConstraints);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 8;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.gridheight = 4;
    panelTravelTime.add(conversion, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    panel.add(panelTravelTime, gridBagConstraints);
    // Room and board
    panelRoomBoard.setLayout(new java.awt.GridBagLayout());
    //$NON-NLS-1$
    panelRoomBoard.setBorder(BorderFactory.createTitledBorder(LanguageBundle.getString("in_plugin_overland_roomAndBoard")));
    //$NON-NLS-1$
    jLabel15.setText(LanguageBundle.getString("in_plugin_overland_perDay"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(jLabel15, gridBagConstraints);
    //$NON-NLS-1$
    jLabel16.setText(LanguageBundle.getString("in_plugin_overland_food"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(jLabel16, gridBagConstraints);
    //$NON-NLS-1$
    jLabel17.setText(LanguageBundle.getString("in_plugin_overland_perWeek"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(jLabel17, gridBagConstraints);
    //$NON-NLS-1$
    jLabel18.setText(LanguageBundle.getString("in_plugin_overland_lodging"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(jLabel18, gridBagConstraints);
    // some space between top and middle
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(new JPanel(), gridBagConstraints);
    //$NON-NLS-1$
    jLabel20.setText(LanguageBundle.getString("in_plugin_overland_animals"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(jLabel20, gridBagConstraints);
    //$NON-NLS-1$
    jLabel21.setText(LanguageBundle.getString("in_plugin_overland_days"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 10;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(jLabel21, gridBagConstraints);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    panelRoomBoard.add(new JSeparator(), gridBagConstraints);
    //$NON-NLS-1$
    jLabel22.setText(LanguageBundle.getString("in_plugin_overland_total"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 12;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(jLabel22, gridBagConstraints);
    txtDayFood.setHorizontalAlignment(SwingConstants.CENTER);
    txtDayFood.addPropertyChangeListener(VALUE_PROPERTY, new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            txtDayFoodActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtDayFood, gridBagConstraints);
    txtDayInn.setHorizontalAlignment(SwingConstants.CENTER);
    txtDayInn.addPropertyChangeListener(VALUE_PROPERTY, new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            txtDayFoodActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtDayInn, gridBagConstraints);
    txtDayAnimal.setHorizontalAlignment(SwingConstants.CENTER);
    txtDayAnimal.addPropertyChangeListener(VALUE_PROPERTY, new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            txtDayFoodActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtDayAnimal, gridBagConstraints);
    txtWeekFood.setHorizontalAlignment(SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtWeekFood, gridBagConstraints);
    txtWeekInn.setHorizontalAlignment(SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtWeekInn, gridBagConstraints);
    txtWeekAnimal.setHorizontalAlignment(SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtWeekAnimal, gridBagConstraints);
    txtDays.setHorizontalAlignment(SwingConstants.CENTER);
    txtDays.addPropertyChangeListener(VALUE_PROPERTY, new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            txtDaysActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 10;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtDays, gridBagConstraints);
    txtTotal.setHorizontalAlignment(SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 12;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtTotal, gridBagConstraints);
    cmbFood.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            txtPeopActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(cmbFood, gridBagConstraints);
    cmbInn.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            txtPeopActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(cmbInn, gridBagConstraints);
    cmbAnimal.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            txtPeopActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(cmbAnimal, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 8;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    panelRoomBoard.add(jSeparator1, gridBagConstraints);
    //$NON-NLS-1$
    jLabel23.setText(LanguageBundle.getString("in_plugin_overland_people"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = GridBagConstraints.LINE_START;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(jLabel23, gridBagConstraints);
    //$NON-NLS-1$
    jLabel24.setText(LanguageBundle.getString("in_plugin_overland_animals"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = GridBagConstraints.LINE_START;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(jLabel24, gridBagConstraints);
    txtPeop.setHorizontalAlignment(SwingConstants.CENTER);
    txtPeop.setColumns(3);
    txtPeop.addPropertyChangeListener(VALUE_PROPERTY, new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            txtPeopActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = GridBagConstraints.LINE_START;
    gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtPeop, gridBagConstraints);
    txtAnim.setHorizontalAlignment(SwingConstants.CENTER);
    txtAnim.setColumns(3);
    txtAnim.addPropertyChangeListener(VALUE_PROPERTY, new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            txtPeopActionPerformed();
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = GridBagConstraints.LINE_START;
    gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtAnim, gridBagConstraints);
    txtDayTotal.setHorizontalAlignment(SwingConstants.CENTER);
    txtDayTotal.addPropertyChangeListener(VALUE_PROPERTY, new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            txtDaysActionPerformed();
        }
    });
    txtDayTotal.setEditable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 9;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtDayTotal, gridBagConstraints);
    txtWeekTotal.setHorizontalAlignment(SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 9;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(txtWeekTotal, gridBagConstraints);
    //$NON-NLS-1$
    jLabel25.setText(LanguageBundle.getString("in_plugin_overland_total"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 9;
    gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = stdInsets;
    panelRoomBoard.add(jLabel25, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    panel.add(panelRoomBoard, gridBagConstraints);
    setLayout(new BorderLayout());
    add(new JScrollPane(panel), BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) Insets(java.awt.Insets) JTextArea(javax.swing.JTextArea) GridBagLayout(java.awt.GridBagLayout) PropertyChangeListener(java.beans.PropertyChangeListener) JButton(javax.swing.JButton) JSeparator(javax.swing.JSeparator) BorderLayout(java.awt.BorderLayout) JComboBox(javax.swing.JComboBox) JScrollPane(javax.swing.JScrollPane) PropertyChangeEvent(java.beans.PropertyChangeEvent) JButton(javax.swing.JButton) JComboBox(javax.swing.JComboBox) JFormattedTextField(javax.swing.JFormattedTextField) JLabel(javax.swing.JLabel) GridBagConstraints(java.awt.GridBagConstraints) JLabel(javax.swing.JLabel) JSeparator(javax.swing.JSeparator) GridBagLayout(java.awt.GridBagLayout) JPanel(javax.swing.JPanel)

Example 100 with GridBagConstraints

use of java.awt.GridBagConstraints in project voltdb by VoltDB.

the class ZaurusEditor method initGUI.

private void initGUI() {
    // without connection there are no tables
    // vAllTables is a local variable with all table names in the database
    // vHoldTableNames holds the table names which have a ZaurusTableForm
    Vector vAllTables = getAllTables();
    if (vAllTables == null) {
        return;
    }
    // initialize a new list for the table names which have a form in pForm
    vHoldTableNames = new Vector(20);
    vHoldForms = new Vector(20);
    // this holds the card panel pForm for the forms in the top
    // a card panel pButton below
    // the both card panels form a panel which is centered in this
    // and a status line in the south
    this.setLayout(new BorderLayout(3, 3));
    // >>> the top of this: the entry forms in pForm
    // pFormButs holds in the center the forms card panel pForm and
    // in the south the button card panel pButton
    Panel pFormButs = new Panel();
    pFormButs.setLayout(new BorderLayout(3, 3));
    pForm = new Panel();
    lForm = new CardLayout(2, 2);
    pForm.setLayout(lForm);
    // the search panel containing the list of all tables and
    // the entry fields for search words in the Center
    Panel pEntry = new Panel();
    pEntry.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(3, 3, 3, 3);
    c.gridwidth = 1;
    c.gridheight = 1;
    c.weightx = c.weighty = 1;
    c.anchor = GridBagConstraints.WEST;
    c.gridy = 0;
    c.gridx = 0;
    pEntry.add(new Label("Search table"), c);
    c.gridx = 1;
    // get all table names and show a drop down list of them in cTables
    cTables = new Choice();
    for (Enumeration e = vAllTables.elements(); e.hasMoreElements(); ) {
        cTables.addItem((String) e.nextElement());
    }
    c.gridwidth = 2;
    pEntry.add(cTables, c);
    c.gridy = 1;
    c.gridx = 0;
    c.gridwidth = 1;
    pEntry.add(new Label("Search words"), c);
    c.gridx = 1;
    c.gridwidth = 2;
    fSearchWords = new TextField(8);
    pEntry.add(fSearchWords, c);
    // use search words
    c.gridwidth = 1;
    c.gridy = 2;
    c.gridx = 0;
    pEntry.add(new Label("Use search words"), c);
    gAllWords = new CheckboxGroup();
    Checkbox[] checkboxes = new Checkbox[2];
    checkboxes[0] = new Checkbox("all", gAllWords, true);
    c.gridx = 1;
    pEntry.add(checkboxes[0], c);
    checkboxes[1] = new Checkbox("any ", gAllWords, false);
    c.gridx = 2;
    pEntry.add(checkboxes[1], c);
    // ignore case
    c.gridy = 3;
    c.gridx = 0;
    pEntry.add(new Label("Ignore case"), c);
    gIgnoreCase = new CheckboxGroup();
    Checkbox[] checkboxes1 = new Checkbox[2];
    checkboxes1[0] = new Checkbox("yes", gIgnoreCase, true);
    c.gridx = 1;
    pEntry.add(checkboxes1[0], c);
    checkboxes1[1] = new Checkbox("no", gIgnoreCase, false);
    c.gridx = 2;
    pEntry.add(checkboxes1[1], c);
    // Match column exactly
    c.gridy = 4;
    c.gridx = 0;
    pEntry.add(new Label("Match whole col"), c);
    gNoMatchWhole = new CheckboxGroup();
    Checkbox[] checkboxes2 = new Checkbox[2];
    checkboxes2[0] = new Checkbox("no", gNoMatchWhole, true);
    c.gridx = 1;
    pEntry.add(checkboxes2[0], c);
    checkboxes2[1] = new Checkbox("yes ", gNoMatchWhole, false);
    c.gridx = 2;
    pEntry.add(checkboxes2[1], c);
    pForm.add("search", pEntry);
    pFormButs.add("Center", pForm);
    // the buttons
    this.initButtons();
    pButton = new Panel();
    lButton = new CardLayout(2, 2);
    pButton.setLayout(lButton);
    pButton.add("search", pSearchButs);
    pButton.add("edit", pEditButs);
    pButton.add("insert", pInsertButs);
    pFormButs.add("South", pButton);
    this.add("Center", pFormButs);
    // >>> the South: status line at the bottom
    Font fFont = new Font("Dialog", Font.PLAIN, 10);
    ZaurusEditor.tStatus = new TextField("");
    ZaurusEditor.tStatus.setEditable(false);
    this.add("South", ZaurusEditor.tStatus);
}
Also used : CardLayout(java.awt.CardLayout) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) Choice(java.awt.Choice) Enumeration(java.util.Enumeration) GridBagLayout(java.awt.GridBagLayout) CheckboxGroup(java.awt.CheckboxGroup) Label(java.awt.Label) Font(java.awt.Font) Panel(java.awt.Panel) BorderLayout(java.awt.BorderLayout) Checkbox(java.awt.Checkbox) TextField(java.awt.TextField) Vector(java.util.Vector)

Aggregations

GridBagConstraints (java.awt.GridBagConstraints)447 GridBagLayout (java.awt.GridBagLayout)283 Insets (java.awt.Insets)247 JPanel (javax.swing.JPanel)211 JLabel (javax.swing.JLabel)206 Dimension (java.awt.Dimension)97 JButton (javax.swing.JButton)96 ActionEvent (java.awt.event.ActionEvent)72 ActionListener (java.awt.event.ActionListener)68 JScrollPane (javax.swing.JScrollPane)65 BorderLayout (java.awt.BorderLayout)58 JCheckBox (javax.swing.JCheckBox)46 JTextField (javax.swing.JTextField)41 TitledBorder (javax.swing.border.TitledBorder)28 FlowLayout (java.awt.FlowLayout)27 Color (java.awt.Color)24 CPanel (org.compiere.swing.CPanel)24 BoxLayout (javax.swing.BoxLayout)23 ButtonGroup (javax.swing.ButtonGroup)23 JComboBox (javax.swing.JComboBox)23