Example #1
0
  protected void setupGUI() {
    controls = new Controls(this);

    sourcePanel = new SourcePanel(this, controls);

    JPanel myPanel = new JPanel();
    GridBagLayout layout = new GridBagLayout();
    myPanel.setLayout(layout);
    myPanel.add(
        controls,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            1,
            0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 0),
            0,
            0));
    myPanel.add(
        sourcePanel,
        new GridBagConstraints(
            0,
            1,
            1,
            1,
            1,
            0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 0),
            0,
            0));
    addToConsole(myPanel);

    // set up the toolbar
    ToolBar toolbar = getToolBar();
    toolbar.addBrowserButton("Directions", "/org/webtop/html/twomedia/directions.html");
    toolbar.addBrowserButton("Theory", "/org/webtop/html/twomedia/theory.html");
    toolbar.addBrowserButton("Examples", "/org/webtop/html/twomedia/examples.html");
    toolbar.addBrowserButton("Exercises", "/org/webtop/html/twomedia/exercises.html");
    toolbar.addBrowserButton("Images", "/org/webtop/html/twomedia/images.html");
    toolBar.addBrowserButton("About", "/org/webtop/html/license.html");
  }
Example #2
0
  public ResolutionDialog(Waves wave, Engine e) {
    setLayout(new BorderLayout());
    setResizable(false);
    setBounds(200, 200, 200, 140);
    setTitle("Preferences");
    engine = e;

    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            setVisible(false);
          }
        });

    panel = new JPanel();
    panel.setBackground(Color.darkGray.darker());
    panel.setForeground(Color.white);
    add(panel);

    label = new JLabel("Resolution:", Label.RIGHT);
    label.setBounds(10, 10, 60, 20);
    panel.add(label);

    resolution = new IntBox(0, 800, 200, 3);
    panel.add(resolution);

    /*gouraud = new JCheckBox("Gouraud Shading", true);
    gouraud.setBounds(10, 40, 120, 20);
    panel.add(gouraud);*/
    panel.add(new JLabel("Maximum Resolution: 800"));

    ok = new JButton("    Ok    ");
    panel.add(ok);
    ok.addActionListener(this);

    cancel = new JButton("Cancel");
    panel.add(cancel);
    cancel.addActionListener(this);

    // implement WSL Items
    okScripter = new ButtonScripter(ok, wave.getWSLPlayer(), null, "ok");
    cancelScripter = new ButtonScripter(cancel, wave.getWSLPlayer(), null, "cancel");
  }