diff options
author | Deepak Bhole <[email protected]> | 2010-12-06 15:34:01 -0500 |
---|---|---|
committer | Deepak Bhole <[email protected]> | 2010-12-06 15:34:01 -0500 |
commit | 6ca1a9a369b10703da9af8f8a1ced0f3b02ae5c2 (patch) | |
tree | 568f8e454db94fa8abc896b46ce8cac7a9f3b74d /netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java | |
parent | 0d66adf24179c33bbdccaacc10d4c8a5f5e2cd54 (diff) |
Fixed indentation and spacing for all .java files.
Added a new .settings directory which contains Eclipse
preferences for code style.
Diffstat (limited to 'netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java index f7c382e..7472307 100644 --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java @@ -14,7 +14,6 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - package net.sourceforge.jnlp.cache; import static net.sourceforge.jnlp.runtime.Translator.R; @@ -100,12 +99,12 @@ public class DefaultDownloadIndicator implements DownloadIndicator { DownloadPanel result = new DownloadPanel(downloadName); if (frame == null) { - frame = new JFrame(downloading+"..."); + frame = new JFrame(downloading + "..."); frame.getContentPane().setLayout(new GridBagLayout()); } if (resources != null) - for (int i=0; i < resources.length; i++) + for (int i = 0; i < resources.length; i++) result.addProgressPanel(resources[i], null); frame.getContentPane().add(result, vertical); @@ -114,10 +113,10 @@ public class DefaultDownloadIndicator implements DownloadIndicator { if (!frame.isVisible()) { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration()); - Dimension screen = new Dimension(screenSize.width - insets.left , + Dimension screen = new Dimension(screenSize.width - insets.left, screenSize.height - insets.top); - frame.setLocation(screen.width-frame.getWidth(), - screen.height-frame.getHeight()); + frame.setLocation(screen.width - frame.getWidth(), + screen.height - frame.getHeight()); } frame.setVisible(true); @@ -149,8 +148,6 @@ public class DefaultDownloadIndicator implements DownloadIndicator { timer.start(); } - - /** * Groups the url progress in a panel. */ @@ -168,7 +165,6 @@ public class DefaultDownloadIndicator implements DownloadIndicator { /** list of ProgressPanels */ private List<ProgressPanel> panels = new ArrayList<ProgressPanel>(); - /** * Create a new download panel for with the specified download * name. @@ -226,7 +222,7 @@ public class DefaultDownloadIndicator implements DownloadIndicator { // don't get whole string from resource and sub in // values because it'll be doing a MessageFormat for // each update. - header.setText(downloading+" "+downloadName+": "+percent+"% "+complete+"."); + header.setText(downloading + " " + downloadName + ": " + percent + "% " + complete + "."); } /** @@ -259,8 +255,6 @@ public class DefaultDownloadIndicator implements DownloadIndicator { }; - - /** * A progress bar with the URL next to it. */ @@ -271,10 +265,10 @@ public class DefaultDownloadIndicator implements DownloadIndicator { private long readSoFar; ProgressPanel(URL url, String version) { - JLabel location = new JLabel(" "+url.getHost()+"/"+url.getFile()); + JLabel location = new JLabel(" " + url.getHost() + "/" + url.getFile()); - bar.setMinimumSize(new Dimension(80,15)); - bar.setPreferredSize(new Dimension(80,15)); + bar.setMinimumSize(new Dimension(80, 15)); + bar.setPreferredSize(new Dimension(80, 15)); bar.setOpaque(false); setLayout(new GridBagLayout()); @@ -308,15 +302,14 @@ public class DefaultDownloadIndicator implements DownloadIndicator { if (readSoFar <= 0 || total <= 0) { // make barber pole - } - else { - double progress = (double)readSoFar / (double)total; - int divide = (int)(w * progress); + } else { + double progress = (double) readSoFar / (double) total; + int divide = (int) (w * progress); g.setColor(Color.white); g.fillRect(x, y, w, h); g.setColor(Color.blue); - g.fillRect(x+1, y+1, divide-1, h-1); + g.fillRect(x + 1, y + 1, divide - 1, h - 1); } } }; |