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

jvergara
04.12.2007 eb8146cebbb1425f75f33c70a2a5eca7fa2eae5d
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
52 ■■■■■ changed files
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/UpgraderReviewPanel.java 52 ●●●●● patch | view | raw | blame | history
opendj-sdk/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.gridx = 1;
    gbc.gridy = 0;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    p.add(tcServerLocation, gbc);
    LabelFieldDescriptor[] descs = {serverDescriptor, oldVersionDescriptor,
        newVersionDescriptor};
    JLabel[] labels = {tcServerLocation, tcOldBuild, tcNewBuild};
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.fill = GridBagConstraints.NONE;
    p.add(UIFactory.makeJLabel(oldVersionDescriptor), gbc);
    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.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.weightx = 1.0;
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      p.add(labels[i], gbc);
    }
    return p;
  }