//***************************************************************************** // FloatEm.java: Applet // //***************************************************************************** import java.applet.*; import java.awt.*; //============================================================================= // Main Class for applet FloatEm // //============================================================================= public class FloatEm extends Applet { private int m_NumBits = 8; private final String PARAM_NumBits = "NumBits"; private Dimension m_MySize = new Dimension(0,0); // size of each square private int m_SqSize = 0 ; // border around each square private int m_SqBord = 0 ; // width of square plus border private int m_SqOfft = 0 ; // the fraction private boolean m_BitFract [] ; private double m_FloatFract ; // position of the lower "scale" private int m_BarOff = 0 ; private int m_BarHgt = 0 ; private int m_BarWid = 0 ; // FloatEm Class Constructor public FloatEm() { // TODO: Add constructor code here } public String getAppletInfo() { return "Name: FloatEm\r\n" + "Author: Dean Brock\r\n" + "Created with Microsoft Visual J++ Version 1.0 for UNCA CSCI 274"; } public String[][] getParameterInfo() { String[][] info = { { PARAM_NumBits, "int", "Width of fraction field" }, }; return info; } public void init() { String param; int i; // NumBits: Width of fraction field param = getParameter(PARAM_NumBits); if (param != null) m_NumBits = Integer.parseInt(param); m_BitFract = new boolean [m_NumBits] ; // I bet there's a better way to do this for (i=0; i