mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
04.12.2007 2a44c925d2ad0ed19dc72d8c9246612536388742
Modify the layout of the upgrader review panel to be consistent with the rest of the review panels.  Before the fix when we resized the dialog the labels went to the center of the screen instead of staying anchored in the top-left and the insets between labels were too big.
1 files modified
54 ■■■■■ changed files
opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/UpgraderReviewPanel.java 54 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/UpgraderReviewPanel.java
@@ -159,40 +159,32 @@
    p.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.insets.top = UIFactory.TOP_INSET_PRIMARY_FIELD;
    gbc.insets.left = UIFactory.LEFT_INSET_PRIMARY_FIELD;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.NONE;
    p.add(UIFactory.makeJLabel(serverDescriptor), gbc);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    LabelFieldDescriptor[] descs = {serverDescriptor, oldVersionDescriptor,
        newVersionDescriptor};
    JLabel[] labels = {tcServerLocation, tcOldBuild, tcNewBuild};
    gbc.gridx = 1;
    gbc.gridy = 0;
    for (int i=0; i<descs.length; i++)
    {
      gbc.gridwidth = GridBagConstraints.RELATIVE;
      gbc.weightx = 0.0;
      if (i > 0)
      {
        gbc.insets.top = UIFactory.TOP_INSET_PRIMARY_FIELD;
      } else
      {
        gbc.insets.top = 0;
      }
      gbc.insets.left = 0;
      gbc.anchor = GridBagConstraints.NORTHWEST;
      p.add(UIFactory.makeJLabel(descs[i]), gbc);
      gbc.insets.left = UIFactory.LEFT_INSET_PRIMARY_FIELD;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    p.add(tcServerLocation, gbc);
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.fill = GridBagConstraints.NONE;
    p.add(UIFactory.makeJLabel(oldVersionDescriptor), gbc);
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    p.add(tcOldBuild, gbc);
    gbc.gridx = 0;
    gbc.gridy = 2;
    gbc.fill = GridBagConstraints.NONE;
    p.add(UIFactory.makeJLabel(newVersionDescriptor), gbc);
    gbc.gridx = 1;
    gbc.gridy = 2;
    gbc.weighty = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    p.add(tcNewBuild, gbc);
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      p.add(labels[i], gbc);
    }
    return p;
  }