Package horcher

Source Code of horcher.Window

/*
* Created on 01.02.2007
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package horcher;

import horcher.visual.Graph;
import horcher.visual.Koordinatensystem;
import horcher.visual.Panel3d;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.util.ResourceBundle;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
* @author HP_Besitzer
*
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
*/
public class Window extends JFrame {
  private static final long serialVersionUID = 1L;
  Graph<?> g1, g2;
  JPanel all, z, infos;
  Koordinatensystem signale, ffts, fftsimg, vers, versimg, auto;
  Panel3d panel3d;
  WMenuBar menu;
  public JLabel[][] info;

  protected Window(final ActionListener lissner, final ResourceBundle r) {
    super();

    this.all = new JPanel();
    this.all.setLayout(new BorderLayout());

    this.z = new JPanel();
    this.z.setLayout(new GridLayout(3, 2));

    this.signale = new Koordinatensystem("Signale", "t", "I");
    this.z.add(this.signale);
    this.ffts = new Koordinatensystem("FFT-Betrag", "F", "y");
    this.z.add(this.ffts);
    this.auto = new Koordinatensystem("Autokorrelation-Realanteil", "delta t",
        "y");
    this.z.add(this.auto);
    this.vers = new Koordinatensystem("Korrelation-Realanteil", "delta t", "y");
    this.z.add(this.vers);

    this.panel3d = Panel3d.createPanel3d();
    this.z.add(this.panel3d);

    this.infos = new JPanel();
    this.infos.setLayout(new GridLayout(4, 2));
    this.info = new JLabel[2][4];
    for (int i = 0; i < this.info[0].length; i++) {
      this.info[0][i] = new JLabel();
      if (i < 3)
        this.info[0][i].setText("P_0-P_" + (i + 1) + ":");
      else
        this.info[0][i].setText("Ort:");
      this.infos.add(this.info[0][i]);
      this.info[1][i] = new JLabel();
      this.infos.add(this.info[1][i]);
    }
    this.z.add(this.infos);

    this.all.add(this.z, BorderLayout.CENTER);

    this.menu = new WMenuBar(r, lissner);
    this.menu.mQSchliessen.setEnabled(false);
    this.menu.mBStarten.setEnabled(false);
    this.all.add(this.menu, BorderLayout.NORTH);

    this.add(this.all);

    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }

  public void clear() {
    this.menu.mQOffnen.setEnabled(true);
    this.menu.mQSchliessen.setEnabled(false);
    this.menu.mBStarten.setEnabled(false);
    this.signale.graphen.removeAllElements();
    this.recalc();
    for (int i = 0; i < this.info[0].length; i++)
      this.info[1][i].setText("");
    this.reSize();
  }

  public void recalc() {
    this.ffts.graphen.removeAllElements();
    this.auto.graphen.removeAllElements();
    this.vers.graphen.removeAllElements();
    this.reSize();
  }

  public void reSize() {
    this.signale.reSize();
    this.ffts.reSize();
    this.auto.reSize();
    this.vers.reSize();
    this.ffts.recolor(this.signale);
    this.auto.recolor(this.signale);
    this.vers.recolor(this.signale);
    this.repaint();
  }

}
TOP

Related Classes of horcher.Window

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.