package sim.lib.memory;

import java.awt.*;
import java.awt.event.*;
import sim.util.*;
import sim.*;
import java.io.*;

public class RamProperties extends Container implements ActionListener, FocusListener {

	private DialogButton browse = new DialogButton("Browse...");
	private TextField editComponentName = new TextField();
	private TextField editFileName = new TextField();
	private TextField editBusSize = new TextField(5);
	private TextField editAddressSize = new TextField(5);
	private TextField editAA = new TextField(5);
	private TextField editACS = new TextField(5);
	private TextField editCLZ = new TextField(5);
	private TextField editOE = new TextField(5);
	private TextField editOLZ = new TextField(5);
	private TextField editCHZ = new TextField(5);
	private TextField editOHZ = new TextField(5);
	private TextField editOH = new TextField(5);
	private TextField editAW = new TextField(5);
	private TextField editAS = new TextField(5);
	private TextField editWP = new TextField(5);
	private TextField editWR = new TextField(5);
	private TextField editWHZ = new TextField(5);
	private TextField editDW = new TextField(5);
	private TextField editDH = new TextField(5);
	private TextField editOW = new TextField(5);
	private Label componentName = new Label("Name");
	private Label content = new Label("Memory Content");
	private Label busSize = new Label("Bus Sizes");
	private Label delays = new Label("Propagation Delays");
	private String oldComponentName;
	private String oldName;
	private int oldBusSize;
	private int oldAddressSize;
	private double oldAA;
	private double oldACS;
	private double oldCLZ;
	private double oldOE;
	private double oldOLZ;
	private double oldCHZ;
	private double oldOHZ;
	private double oldOH;
	private double oldAW;
	private double oldAS;
	private double oldWP;
	private double oldWR;
	private double oldWHZ;
	private double oldDW;
	private double oldDH;
	private double oldOW;
	private ScrollPane scroller = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED);

	public RamProperties(String file, String compName, int bus, int address, double aa, double acs, double clz, double oe, double olz, double chz, double ohz, double oh, double aw, double as, double wp, double wr, double whz, double dw, double dh, double ow) {
		super();
		this.setLayout(new GridBagLayout());

		if (MainWindow.MASTER != null) {
			this.editFileName.setEnabled(false);
			this.browse.setEnabled(false);
		}

		this.oldComponentName = compName;
		this.oldName = file;
		this.oldBusSize = bus;
		this.oldAddressSize = address;
		this.oldAA = aa;
		this.oldACS = acs;
		this.oldCLZ = clz;
		this.oldOE = oe;
		this.oldOLZ = olz;
		this.oldCHZ = chz;
		this.oldOHZ = ohz;
		this.oldOH = oh;
		this.oldAW = aw;
		this.oldAS = as;
		this.oldWP = wp;
		this.oldWR = wr;
		this.oldWHZ = whz;
		this.oldDW = dw;
		this.oldDH = dh;
		this.oldOW = ow;

		this.editComponentName.setText(this.oldComponentName);
		this.editFileName.setText(this.oldName);
		this.editBusSize.setText(Integer.toString(this.oldBusSize));
		this.editAddressSize.setText(Integer.toString(this.oldAddressSize));
		this.editAA.setText(Double.toString(this.oldAA));
		this.editACS.setText(Double.toString(this.oldACS));
		this.editCLZ.setText(Double.toString(this.oldCLZ));
		this.editOE.setText(Double.toString(this.oldOE));
		this.editOLZ.setText(Double.toString(this.oldOLZ));
		this.editCHZ.setText(Double.toString(this.oldCHZ));
		this.editOHZ.setText(Double.toString(this.oldOHZ));
		this.editOH.setText(Double.toString(this.oldOH));
		this.editAW.setText(Double.toString(this.oldAW));
		this.editAS.setText(Double.toString(this.oldAS));
		this.editWP.setText(Double.toString(this.oldWP));
		this.editWR.setText(Double.toString(this.oldWR));
		this.editWHZ.setText(Double.toString(this.oldWHZ));
		this.editDW.setText(Double.toString(this.oldDW));
		this.editDH.setText(Double.toString(this.oldDH));
		this.editOW.setText(Double.toString(this.oldOW));

		this.editComponentName.addActionListener(this);
		this.browse.addActionListener(this);
		this.editFileName.addActionListener(this);
		this.editBusSize.addActionListener(this);
		this.editAddressSize.addActionListener(this);
		this.editAA.addActionListener(this);
		this.editACS.addActionListener(this);
		this.editCLZ.addActionListener(this);
		this.editOE.addActionListener(this);
		this.editOLZ.addActionListener(this);
		this.editCHZ.addActionListener(this);
		this.editOHZ.addActionListener(this);
		this.editOH.addActionListener(this);
		this.editAW.addActionListener(this);
		this.editAS.addActionListener(this);
		this.editWP.addActionListener(this);
		this.editWR.addActionListener(this);
		this.editWHZ.addActionListener(this);
		this.editDW.addActionListener(this);
		this.editDH.addActionListener(this);
		this.editOW.addActionListener(this);

		this.editComponentName.addFocusListener(this);
		this.editFileName.addFocusListener(this);
		this.editBusSize.addFocusListener(this);
		this.editAddressSize.addFocusListener(this);
		this.editAA.addFocusListener(this);
		this.editACS.addFocusListener(this);
		this.editCLZ.addFocusListener(this);
		this.editOE.addFocusListener(this);
		this.editOLZ.addFocusListener(this);
		this.editCHZ.addFocusListener(this);
		this.editOHZ.addFocusListener(this);
		this.editOH.addFocusListener(this);
		this.editAW.addFocusListener(this);
		this.editAS.addFocusListener(this);
		this.editWP.addFocusListener(this);
		this.editWR.addFocusListener(this);
		this.editWHZ.addFocusListener(this);
		this.editDW.addFocusListener(this);
		this.editDH.addFocusListener(this);
		this.editOW.addFocusListener(this);

		// component name
		Panel big = new Panel(new BorderLayout(0, 15));
		Panel p = new Panel(new BorderLayout());
		GridBagConstraints c = new GridBagConstraints();

		p.add(this.componentName, BorderLayout.WEST);
		p.add(new SimSeparator(), BorderLayout.CENTER);
		big.add(p, BorderLayout.NORTH);

		p = new Panel(new GridBagLayout());

		c.gridx = 0;
		c.gridy = 0;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 1;
		c.weighty = 0;
		c.anchor = GridBagConstraints.WEST;
		c.fill = GridBagConstraints.HORIZONTAL;

		p.add(this.editComponentName, c);
		big.add(p, BorderLayout.CENTER);

		c.gridx = 0;
		c.gridy = 0;
		c.weightx = 1;
		c.insets = new Insets(0, 0, 15, 0);
		c.fill = GridBagConstraints.HORIZONTAL;

		this.add(big, c);

		// content
		big = new Panel(new BorderLayout(0, 15));
		p = new Panel(new BorderLayout());

		p.add(this.content, BorderLayout.WEST);
		p.add(new SimSeparator(), BorderLayout.CENTER);
		big.add(p, BorderLayout.NORTH);

//		p = new Panel(new GridBagLayout());
//		c = new GridBagConstraints();
//
//		c.gridx = 0;
//		c.gridy = 1;
//		c.gridwidth = 1;
//		c.gridheight = 1;
//		c.weightx = 1;
//		c.weighty = 0;
//		c.anchor = GridBagConstraints.WEST;
//		c.fill = GridBagConstraints.HORIZONTAL;
//		p.add(this.editFileName, c);
//
//		c.gridx = 1;
//		c.weightx = 0;
//		c.fill = GridBagConstraints.NONE;
//		c.insets = new Insets(0, 10, 0, 0);
//		p.add(this.browse, c);
//		big.add(p, BorderLayout.CENTER);

		Label memPath = new Label(this.oldName);
		big.add(memPath, BorderLayout.CENTER);

		c.gridx = 0;
		c.gridy = 1;
		c.weightx = 1;
		c.insets = new Insets(0, 0, 15, 0);
		c.fill = GridBagConstraints.HORIZONTAL;

		this.add(big, c);


		// bus size
		big = new Panel(new BorderLayout(0, 15));
		p = new Panel(new BorderLayout());

		p.add(this.busSize, BorderLayout.WEST);
		p.add(new SimSeparator(), BorderLayout.CENTER);
		big.add(p, BorderLayout.NORTH);
		p = new Panel(new GridBagLayout());
		Panel p2 = new Panel(new FlowLayout(FlowLayout.LEFT, 0, 0));

		p2.add(new Label("Data"));
		p2.add(this.editBusSize);

		c.fill = GridBagConstraints.NONE;
		c.insets = new Insets(0, 0, 0, 0);

		p.add(p2, c);
		p2 = new Panel(new FlowLayout(FlowLayout.RIGHT, 0, 0));

		p2.add(new Label("Address"));
		p2.add(this.editAddressSize);

		c.anchor = GridBagConstraints.EAST;
		c.gridx = 1;
		p.add(p2, c);

		big.add(p, BorderLayout.CENTER);

		c.gridx = 0;
		c.gridy = 2;
		c.insets = new Insets(0, 0, 15, 0);
		c.fill = GridBagConstraints.HORIZONTAL;
		this.add(big, c);

		// simulaion
		big = new Panel(new BorderLayout(0, 15));
		p = new Panel(new BorderLayout());

		p.add(this.delays, BorderLayout.WEST);
		p.add(new SimSeparator(), BorderLayout.CENTER);
		big.add(p, BorderLayout.NORTH);

		p = new Panel(new GridBagLayout());
		c.insets = new Insets(2, 5, 2, 0);

		c.gridy = 0;
		p.add(new Label("address access"), c);
		c.gridx = 1;
		p.add(this.editAA, c);

		c.gridy = 1;
		c.gridx = 0;
		p.add(new Label("chip select access"), c);
		c.gridx = 1;
		p.add(this.editACS, c);

		c.gridy = 2;
		c.gridx = 0;
		p.add(new Label("chip select to output"), c);
		c.gridx = 1;
		p.add(this.editCLZ, c);

		c.gridy = 3;
		c.gridx = 0;
		p.add(new Label("output ebable to output valid"), c);
		c.gridx = 1;
		p.add(this.editOE, c);

		c.gridy = 4;
		c.gridx = 0;
		p.add(new Label("output enable to output"), c);
		c.gridx = 1;
		p.add(this.editOLZ, c);

		c.gridy = 5;
		c.gridx = 0;
		p.add(new Label("chip deselection to output"), c);
		c.gridx = 1;
		p.add(this.editCHZ, c);

		c.gridy = 6;
		c.gridx = 0;
		p.add(new Label("chip disable to output"), c);
		c.gridx = 1;
		p.add(this.editOHZ, c);

		c.gridy = 7;
		c.gridx = 0;
		p.add(new Label("output hold from output change"), c);
		c.gridx = 1;
		p.add(this.editOH, c);

		c.gridy = 8;
		c.gridx = 0;
		p.add(new Label("address valid to end of write"), c);
		c.gridx = 1;
		p.add(this.editAW, c);

		c.gridy = 9;
		c.gridx = 0;
		p.add(new Label("address set up"), c);
		c.gridx = 1;
		p.add(this.editAS, c);

		c.gridy = 10;
		c.gridx = 0;
		p.add(new Label("write pulse width"), c);
		c.gridx = 1;
		p.add(this.editWP, c);

		c.gridy = 11;
		c.gridx = 0;
		p.add(new Label("write recovery"), c);
		c.gridx = 1;
		p.add(this.editWR, c);

		c.gridy = 12;
		c.gridx = 0;
		p.add(new Label("write to output"), c);
		c.gridx = 1;
		p.add(this.editWHZ, c);

		c.gridy = 13;
		c.gridx = 0;
		p.add(new Label("data to write pulse overlap"), c);
		c.gridx = 1;
		p.add(this.editDW, c);

		c.gridy = 14;
		c.gridx = 0;
		p.add(new Label("data hold from write"), c);
		c.gridx = 1;
		p.add(this.editDH, c);

		c.gridy = 15;
		c.gridx = 0;
		p.add(new Label("output active from end of write"), c);
		c.gridx = 1;
		p.add(this.editOW, c);

		this.scroller.getVAdjustable().setBlockIncrement(50);
		this.scroller.getVAdjustable().setUnitIncrement(25);
		this.scroller.add(p);

		big.add(this.scroller, BorderLayout.CENTER);

		c.gridx = 0;
		c.gridy = 3;
		c.insets = new Insets(0, 0, 0, 0);
		this.add(big, c);
	}

	public void addNotify() {
		super.addNotify();
		this.setSize(290, this.editBusSize.getPreferredSize().height * 5 + this.delays.getPreferredSize().height * 3 + 200);

		this.scroller.validate();
	}

	public void actionPerformed(ActionEvent e) {
		Component source = (Component) e.getSource();

		if (source == this.editFileName) {
			this.getFileName();
		} else if (source == this.editBusSize) {
			this.getBusSize();
		} else if (source == this.editAddressSize) {
			this.getAddressSize();
		} else if (source == this.editAA) {
			this.getAA();
		} else if (source == this.editACS) {
			this.getACS();
		} else if (source == this.editCLZ) {
			this.getCLZ();
		} else if (source == this.editOE) {
			this.getOE();
		} else if (source == this.editOLZ) {
			this.getOLZ();
		} else if (source == this.editCHZ) {
			this.getCHZ();
		} else if (source == this.editOHZ) {
			this.getOHZ();
		} else if (source == this.editOH) {
			this.getOH();
		} else if (source == this.editAW) {
			this.getAW();
		} else if (source == this.editAS) {
			this.getAS();
		} else if (source == this.editWP) {
			this.getWP();
		} else if (source == this.editWR) {
			this.getWR();
		} else if (source == this.editWHZ) {
			this.getWHZ();
		} else if (source == this.editDW) {
			this.getDH();
		} else if (source == this.editDH) {
			this.getDH();
		} else if (source == this.editOW) {
			this.getOW();
		} else if (source == this.browse) {
			SaveLoadShortcut.FILEDIALOG.setTitle("Open");
			//SaveLoadShortcut.FILEDIALOG.setMode(FileDialog.LOAD);
			SaveLoadShortcut.FILEDIALOG.setFile("*.mem");
			SaveLoadShortcut.FILEDIALOG.setVisible(true);

			String inFile = SaveLoadShortcut.FILEDIALOG.getFile();

			if (inFile != null) {
				this.oldName = SaveLoadShortcut.FILEDIALOG.getDirectory() + inFile;
				this.editFileName.setText(this.oldName);
			}
		}
	}

	public void focusGained(FocusEvent e) {
	}

	public void focusLost(FocusEvent e) {
		TextField source = (TextField) e.getSource();

		if (source == this.editFileName) {
			this.getFileName();
		} else if (source == this.editBusSize) {
			this.getBusSize();
		} else if (source == this.editAddressSize) {
			this.getAddressSize();
		} else if (source == this.editAA) {
			this.getAA();
		} else if (source == this.editACS) {
			this.getACS();
		} else if (source == this.editCLZ) {
			this.getCLZ();
		} else if (source == this.editOE) {
			this.getOE();
		} else if (source == this.editOLZ) {
			this.getOLZ();
		} else if (source == this.editCHZ) {
			this.getCHZ();
		} else if (source == this.editOHZ) {
			this.getOHZ();
		} else if (source == this.editOH) {
			this.getOH();
		} else if (source == this.editAW) {
			this.getAW();
		} else if (source == this.editAS) {
			this.getAS();
		} else if (source == this.editWP) {
			this.getWP();
		} else if (source == this.editWR) {
			this.getWR();
		} else if (source == this.editWHZ) {
			this.getWHZ();
		} else if (source == this.editDW) {
			this.getDH();
		} else if (source == this.editDH) {
			this.getDH();
		} else if (source == this.editOW) {
			this.getOW();
		}

		source.setText(source.getText());
	}

	public int getBusSize() {
		int newBus;

		try {
			newBus = Integer.valueOf(this.editBusSize.getText()).intValue();

			if ((newBus > 1) && (newBus <= 32)) {
				this.oldBusSize = newBus;
			} else {
				this.editBusSize.setText(Integer.toString(this.oldBusSize));
			}
		} catch (NumberFormatException nfe) {
			this.editBusSize.setText(Integer.toString(this.oldBusSize));
		}

		return this.oldBusSize;
	}

	public int getAddressSize() {
		int newAddress;

		try {
			newAddress = Integer.valueOf(this.editAddressSize.getText()).intValue();

			if ((newAddress > 1) && (newAddress <= 8)) {
				this.oldAddressSize = newAddress;
			} else {
				this.editAddressSize.setText(Integer.toString(this.oldAddressSize));
			}
		} catch (NumberFormatException nfe) {
			this.editAddressSize.setText(Integer.toString(this.oldAddressSize));
		}

		return this.oldAddressSize;
	}

	public String getFileName() {
		String newName = this.editFileName.getText();

		if (this.browse.isEnabled()) {
			try {
				FileWriter f = new FileWriter(newName, true);
				f.close();

				this.oldName = newName;
			} catch (IOException ex) {
				this.editFileName.setText(this.oldName);
			}
		}

		return this.oldName;
	}

	public double getAA() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editAA.getText()).doubleValue();

			if (newValue >= 0) {
				this.oldAA = newValue;
			} else {
				this.editAA.setText(Double.toString(this.oldAA));
			}
		} catch (NumberFormatException nfe) {
			this.editAA.setText(Double.toString(this.oldAA));
		}

		return this.oldAA;
	}

	public double getACS() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editACS.getText()).doubleValue();

			if ((newValue >= 0) && (newValue >= this.oldCLZ)) {
				this.oldACS = newValue;
			} else {
				this.editACS.setText(Double.toString(this.oldACS));
			}
		} catch (NumberFormatException nfe) {
			this.editACS.setText(Double.toString(this.oldACS));
		}

		return this.oldACS;
	}

	public double getCLZ() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editCLZ.getText()).doubleValue();

			if ((newValue >= 0) && (newValue <= this.oldACS)) {
				this.oldCLZ = newValue;
			} else {
				this.editCLZ.setText(Double.toString(this.oldCLZ));
			}
		} catch (NumberFormatException nfe) {
			this.editCLZ.setText(Double.toString(this.oldCLZ));
		}

		return this.oldCLZ;
	}

	public double getOE() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editOE.getText()).doubleValue();

			if ((newValue >= 0) && (newValue >= this.oldOLZ)) {
				this.oldOE = newValue;
			} else {
				this.editOE.setText(Double.toString(this.oldOE));
			}
		} catch (NumberFormatException nfe) {
			this.editOE.setText(Double.toString(this.oldOE));
		}

		return this.oldOE;
	}

	public double getOLZ() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editOLZ.getText()).doubleValue();

			if ((newValue >= 0) && (newValue <= this.oldOE)) {
				this.oldOLZ = newValue;
			} else {
				this.editOLZ.setText(Double.toString(this.oldOLZ));
			}
		} catch (NumberFormatException nfe) {
			this.editOLZ.setText(Double.toString(this.oldOLZ));
		}

		return this.oldOLZ;
	}

	public double getCHZ() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editCHZ.getText()).doubleValue();

			if (newValue >= 0) {
				this.oldCHZ = newValue;
			} else {
				this.editCHZ.setText(Double.toString(this.oldCHZ));
			}
		} catch (NumberFormatException nfe) {
			this.editCHZ.setText(Double.toString(this.oldCHZ));
		}

		return this.oldCHZ;
	}

	public double getOHZ() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editOHZ.getText()).doubleValue();

			if (newValue >= 0) {
				this.oldOHZ = newValue;
			} else {
				this.editOHZ.setText(Double.toString(this.oldOHZ));
			}
		} catch (NumberFormatException nfe) {
			this.editOHZ.setText(Double.toString(this.oldOHZ));
		}

		return this.oldOHZ;
	}

	public double getOH() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editOH.getText()).doubleValue();

			if (newValue >= 0) {
				this.oldOH = newValue;
			} else {
				this.editOH.setText(Double.toString(this.oldOH));
			}
		} catch (NumberFormatException nfe) {
			this.editOH.setText(Double.toString(this.oldOH));
		}

		return this.oldOH;
	}

	public double getAW() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editAW.getText()).doubleValue();

			if ((newValue >= 0) && (newValue <= this.oldAS + this.oldWP) && (newValue >= this.oldAS)) {
				this.oldAW = newValue;
			} else {
				this.editAW.setText(Double.toString(this.oldAW));
			}
		} catch (NumberFormatException nfe) {
			this.editAW.setText(Double.toString(this.oldAW));
		}

		return this.oldAW;
	}

	public double getAS() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editAS.getText()).doubleValue();

			if ((newValue >= 0) && (newValue <= this.oldAW) && (newValue <= this.oldAW - this.oldWP)) {
				this.oldAS = newValue;
			} else {
				this.editAS.setText(Double.toString(this.oldAS));
			}
		} catch (NumberFormatException nfe) {
			this.editAS.setText(Double.toString(this.oldAS));
		}

		return this.oldAS;
	}

	public double getWP() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editWP.getText()).doubleValue();

			if ((newValue >= 0) && (newValue >= this.oldAW - this.oldAS) && (newValue >= this.oldWHZ + this.oldDW)) {
				this.oldWP = newValue;
			} else {
				this.editWP.setText(Double.toString(this.oldWP));
			}
		} catch (NumberFormatException nfe) {
			this.editWP.setText(Double.toString(this.oldWP));
		}

		return this.oldWP;
	}

	public double getWR() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editWR.getText()).doubleValue();

			if ((newValue >= 0) && (newValue <= this.oldOW) && (newValue >= this.oldDH)) {
				this.oldWR = newValue;
			} else {
				this.editWR.setText(Double.toString(this.oldWR));
			}
		} catch (NumberFormatException nfe) {
			this.editWR.setText(Double.toString(this.oldWR));
		}

		return this.oldWR;
	}

	public double getWHZ() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editWHZ.getText()).doubleValue();

			if ((newValue >= 0) && (newValue <= this.oldWP - this.oldDW)) {
				this.oldWHZ = newValue;
			} else {
				this.editWHZ.setText(Double.toString(this.oldWHZ));
			}
		} catch (NumberFormatException nfe) {
			this.editWHZ.setText(Double.toString(this.oldWHZ));
		}

		return this.oldWHZ;
	}

	public double getDW() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editDW.getText()).doubleValue();

			if ((newValue >= 0) && (newValue <= this.oldWP - this.oldWHZ)) {
				this.oldDW = newValue;
			} else {
				this.editDW.setText(Double.toString(this.oldDW));
			}
		} catch (NumberFormatException nfe) {
			this.editDW.setText(Double.toString(this.oldDW));
		}

		return this.oldDW;
	}

	public double getDH() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editDH.getText()).doubleValue();

			if ((newValue >= 0) && (newValue < this.oldWR)) {
				this.oldDH = newValue;
			} else {
				this.editDH.setText(Double.toString(this.oldDH));
			}
		} catch (NumberFormatException nfe) {
			this.editDH.setText(Double.toString(this.oldDH));
		}

		return this.oldDH;
	}

	public double getOW() {
		double newValue;

		try {
			newValue = Double.valueOf(this.editOW.getText()).doubleValue();

			if ((newValue >= 0) && (newValue >= this.oldWR)) {
				this.oldOW = newValue;
			} else {
				this.editOW.setText(Double.toString(this.oldOW));
			}
		} catch (NumberFormatException nfe) {
			this.editOW.setText(Double.toString(this.oldOW));
		}

		return this.oldOW;
	}

	public String getComponentName() {
		String newName;

		try {
			newName = this.editComponentName.getText();

			if (newName.length() > 0) {
				this.oldName = newName;
			}
		} catch (NumberFormatException nfe) {
		}

		this.editComponentName.setText(this.oldName);

		return this.oldName;
	}

	public Dimension getPreferredSize() {
		return this.getSize();
	}

	public Dimension getMinimumSize() {
		return this.getSize();
	}

	public Dimension getMaximumSize() {
		return this.getSize();
	}
}
