FileDocCategorySizeDatePackage
ModePanel2.javaAPI DocExample4163Sun Mar 28 19:09:06 BST 1999None

ModePanel2

public class ModePanel2 extends JPanel

Fields Summary
JCheckBox
bigEndian
JCheckBox
deflated
JCheckBox
gzipped
ButtonGroup
dataTypes
JRadioButton
asciiRadio
JRadioButton
decimalRadio
JRadioButton
hexRadio
JRadioButton
shortRadio
JRadioButton
intRadio
JRadioButton
longRadio
JRadioButton
floatRadio
JRadioButton
doubleRadio
JTextField
password
static final String[]
encodings
JList
theEncoding
Constructors Summary
public ModePanel2()

  
    
  
    this.setLayout(new GridLayout(1, 2));
    
    JPanel left = new JPanel();
    JScrollPane right = new JScrollPane(theEncoding);
    left.setLayout(new GridLayout(13, 1));
    left.add(bigEndian);
    left.add(deflated);
    left.add(gzipped);
    
    left.add(asciiRadio);
    asciiRadio.setSelected(true);
    left.add(decimalRadio);
    left.add(hexRadio);
    left.add(shortRadio);
    left.add(intRadio);
    left.add(longRadio);
    left.add(floatRadio);
    left.add(doubleRadio);
    
    
    dataTypes.add(asciiRadio);
    dataTypes.add(decimalRadio);
    dataTypes.add(hexRadio);
    dataTypes.add(shortRadio);
    dataTypes.add(intRadio);
    dataTypes.add(longRadio);
    dataTypes.add(floatRadio);
    dataTypes.add(doubleRadio);
    
    left.add(password);
    this.add(left);
    this.add(right);
    
  
Methods Summary
public java.lang.StringgetEncoding()

    return (String) theEncoding.getSelectedValue();
  
public intgetMode()


    if (asciiRadio.isSelected()) return FileDumper6.ASC;
    else if (decimalRadio.isSelected()) return FileDumper6.DEC;
    else if (hexRadio.isSelected()) return FileDumper6.HEX;
    else if (shortRadio.isSelected()) return FileDumper6.SHORT;
    else if (intRadio.isSelected()) return FileDumper6.INT;
    else if (longRadio.isSelected()) return FileDumper6.LONG;
    else if (floatRadio.isSelected()) return FileDumper6.FLOAT;
    else if (doubleRadio.isSelected()) return FileDumper6.DOUBLE;
    else return FileDumper6.ASC;
    
  
public java.lang.StringgetPassword()

    return password.getText();
  
public booleanisBigEndian()

    return bigEndian.isSelected();
  
public booleanisDeflated()

    return deflated.isSelected();
  
public booleanisGZipped()

    return gzipped.isSelected();
  
public booleanisText()

    if (this.getMode() == FileDumper6.ASC) return true;
    return false;
  
public static voidmain(java.lang.String[] args)

  
    JFrame jf = new JFrame("Test Mode Panel");
    ModePanel2 mp2 = new ModePanel2();
    jf.getContentPane().add(mp2);
    jf.pack();
    jf.show();
    System.out.println("done");