| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,7 +50,7 @@ public void hyperlinkUpdate(HyperlinkEvent e) { } | |||
| 50 | 50 | ||
| 51 | 51 | private ContributionPanel selectedPanel; | |
| 52 | 52 | // protected JPanel statusPlaceholder; | |
| 53 | - private StatusPanel status; | ||
| 53 | + // private StatusPanel status; | ||
| 54 | 54 | private ContributionFilter filter; | |
| 55 | 55 | // private ContributionListing contribListing; | |
| 56 | 56 | private ContributionListing contribListing = ContributionListing.getInstance(); | |
@@ -81,7 +81,7 @@ public ContributionListPanel(ContributionTab contributionTab, | |||
| 81 | 81 | ||
| 82 | 82 | // statusPlaceholder = new JPanel(); | |
| 83 | 83 | // statusPlaceholder.setVisible(false); | |
| 84 | - status = new StatusPanel(); | ||
| 84 | + // status = new StatusPanel(null); | ||
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | 87 | ||
@@ -97,15 +97,15 @@ private void updatePanelOrdering() { | |||
| 97 | 97 | ||
| 98 | 98 | add(entry.getValue(), c); | |
| 99 | 99 | } | |
| 100 | - | ||
| 100 | + /* | ||
| 101 | 101 | GridBagConstraints c = new GridBagConstraints(); | |
| 102 | 102 | c.fill = GridBagConstraints.BOTH; | |
| 103 | 103 | c.weightx = 1; | |
| 104 | 104 | c.weighty = 1; | |
| 105 | 105 | c.gridx = 0; | |
| 106 | 106 | c.gridy = row++; | |
| 107 | 107 | c.anchor = GridBagConstraints.NORTH; | |
| 108 | - add(status, c); | ||
| 108 | + add(status, c);*/ | ||
| 109 | 109 | } | |
| 110 | 110 | ||
| 111 | 111 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -287,10 +287,10 @@ public void itemStateChanged(ItemEvent arg0) { | |||
| 287 | 287 | pane.add(Box.createHorizontalStrut(10), BorderLayout.WEST); | |
| 288 | 288 | pane.add(Box.createHorizontalStrut(10), BorderLayout.EAST); | |
| 289 | 289 | ||
| 290 | - status = new StatusPanel(); | ||
| 290 | + status = new StatusPanel(450); | ||
| 291 | 291 | // status.setBorder(new EmptyBorder(7, 7, 7, 7)); | |
| 292 | 292 | ||
| 293 | - JPanel statusRestartPane = new JPanel(); | ||
| 293 | + /*JPanel statusRestartPane = new JPanel(); | ||
| 294 | 294 | statusRestartPane.setLayout(new BorderLayout()); | |
| 295 | 295 | ||
| 296 | 296 | statusRestartPane.setBorder(new EmptyBorder(7, 7, 7, 7)); | |
@@ -302,9 +302,9 @@ public void itemStateChanged(ItemEvent arg0) { | |||
| 302 | 302 | // Adding both of these to EAST shouldn't pose too much of a problem, | |
| 303 | 303 | // since they can never get added together. | |
| 304 | 304 | statusRestartPane.add(restartButton, BorderLayout.EAST); | |
| 305 | - statusRestartPane.add(retryConnectingButton, BorderLayout.EAST); | ||
| 305 | + statusRestartPane.add(retryConnectingButton, BorderLayout.EAST);*/ | ||
| 306 | 306 | ||
| 307 | - pane.add(statusRestartPane, BorderLayout.SOUTH); | ||
| 307 | + pane.add(status, BorderLayout.SOUTH); | ||
| 308 | 308 | ||
| 309 | 309 | ||
| 310 | 310 | // status = new StatusPanel(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,27 +28,34 @@ | |||
| 28 | 28 | import javax.swing.JLabel; | |
| 29 | 29 | import javax.swing.JPanel; | |
| 30 | 30 | import javax.swing.JProgressBar; | |
| 31 | + import javax.swing.LayoutStyle; | ||
| 31 | 32 | import javax.swing.SwingConstants; | |
| 32 | 33 | ||
| 33 | 34 | ||
| 34 | 35 | class StatusPanel extends JPanel { | |
| 35 | 36 | ||
| 37 | + final int BUTTON_WIDTH = 20; | ||
| 38 | + | ||
| 36 | 39 | JLabel label; | |
| 37 | 40 | JButton installButton; | |
| 38 | 41 | JProgressBar installProgressBar; | |
| 39 | 42 | JLabel upadteLabel; | |
| 40 | 43 | JButton upadteButton; | |
| 41 | 44 | JButton removeButton; | |
| 42 | 45 | ||
| 43 | - public StatusPanel() { | ||
| 46 | + public StatusPanel(int width) { | ||
| 47 | + | ||
| 48 | + final int BUTTON_WIDTH = 20; | ||
| 44 | 49 | ||
| 45 | 50 | label = new JLabel(""); | |
| 46 | 51 | installButton = new JButton("Install"); | |
| 47 | 52 | installProgressBar = new JProgressBar(); | |
| 48 | 53 | upadteLabel = new JLabel("Update to Infinite 1.1"); | |
| 49 | 54 | upadteButton = new JButton("Update"); | |
| 50 | 55 | removeButton = new JButton("Remove"); | |
| 51 | - | ||
| 56 | + | ||
| 57 | + int labelWidth = width != 0 ? width * 2 / 3 : GroupLayout.PREFERRED_SIZE; | ||
| 58 | + this.setSize(450, 200); | ||
| 52 | 59 | GroupLayout layout = new GroupLayout(this); | |
| 53 | 60 | this.setLayout(layout); | |
| 54 | 61 | ||
@@ -57,29 +64,32 @@ public StatusPanel() { | |||
| 57 | 64 | ||
| 58 | 65 | layout.setHorizontalGroup(layout | |
| 59 | 66 | .createSequentialGroup() | |
| 60 | - .addComponent(label) | ||
| 61 | - .addGroup(layout.createParallelGroup() | ||
| 62 | - .addComponent(installButton, GroupLayout.Alignment.CENTER) | ||
| 63 | - .addComponent(installProgressBar, GroupLayout.Alignment.CENTER) | ||
| 64 | - .addComponent(upadteLabel, GroupLayout.Alignment.CENTER) | ||
| 65 | - .addComponent(upadteButton, GroupLayout.Alignment.CENTER) | ||
| 66 | - .addComponent(removeButton, GroupLayout.Alignment.CENTER))); | ||
| 67 | + .addComponent(label, labelWidth, labelWidth, labelWidth) | ||
| 68 | + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, | ||
| 69 | + GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE) | ||
| 70 | + .addGroup(layout | ||
| 71 | + .createParallelGroup(GroupLayout.Alignment.CENTER) | ||
| 72 | + .addComponent(installButton, BUTTON_WIDTH, BUTTON_WIDTH, | ||
| 73 | + BUTTON_WIDTH).addComponent(installProgressBar) | ||
| 74 | + .addComponent(upadteLabel).addComponent(upadteButton) | ||
| 75 | + .addComponent(removeButton))); | ||
| 67 | 76 | ||
| 68 | 77 | layout.setVerticalGroup(layout | |
| 69 | 78 | .createParallelGroup() | |
| 70 | 79 | .addComponent(label) | |
| 71 | - .addGroup(layout.createSequentialGroup() | ||
| 80 | + .addGroup(layout | ||
| 81 | + .createSequentialGroup() | ||
| 72 | 82 | .addComponent(installButton) | |
| 73 | 83 | .addGroup(layout.createParallelGroup() | |
| 74 | 84 | .addComponent(installProgressBar) | |
| 75 | 85 | .addComponent(upadteLabel)) | |
| 76 | 86 | .addComponent(upadteButton).addComponent(removeButton))); | |
| 77 | - | ||
| 78 | - layout.linkSize(SwingConstants.HORIZONTAL, installButton, | ||
| 79 | - installProgressBar, upadteLabel, upadteButton, removeButton); | ||
| 87 | + | ||
| 88 | + layout | ||
| 89 | + .linkSize(SwingConstants.HORIZONTAL, installButton, installProgressBar, | ||
| 90 | + upadteLabel, upadteButton, removeButton); | ||
| 80 | 91 | ||
| 81 | 92 | installProgressBar.setVisible(false); | |
| 82 | - | ||
| 83 | 93 | } | |
| 84 | 94 | ||
| 85 | 95 | void setMessage(String message) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments