Logo Search packages:      
Sourcecode: fex version File versions  Download package

void fix::AppletFrame::updateFileSize ( double  size  )  [inline]

Updates the sizeLabel using the size of the chosen file.

Parameters:
size Size of the chosen file.

Definition at line 770 of file AppletFrame.java.

Referenced by actionPerformed(), and setFileText().

                                              {
            sizeUnit = " B";
            if (size > 1024 * 1024 * 2) {
                  size = size / (1024 * 1024.);
                  sizeUnit = " MB";
            } else if (size > 1024 * 2) {
                  size = size / 1024.;
                  sizeUnit = " kB";
            }
            NumberFormat n = NumberFormat.getInstance();
            n.setMaximumFractionDigits(0);
            String sizeText = "Size: " + n.format(size) + sizeUnit;
            FontMetrics fm = getFontMetrics(sizeLabel.getFont());
            sizeLabel.setText(sizeText);
            sizeLabel.setSize(fm.stringWidth(sizeText), sizeLabel.getHeight());
            RepaintManager.currentManager(dataPanel).paintDirtyRegions();
      }


Generated by  Doxygen 1.6.0   Back to index