Package de.FeatureModellingTool.Pattern.UI

Source Code of de.FeatureModellingTool.Pattern.UI.ParameterEditor

package de.FeatureModellingTool.Pattern.UI;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.Box;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.text.PlainDocument;

public class ParameterEditor extends JPanel {

  private static final long serialVersionUID = 0L;
 
  public ParameterEditor() {
    this.edtParameter = new JTextField(20);
    this.edtParameter.setDocument(new PlainDocument());

        GridBagLayout gbl = new GridBagLayout();
        GridBagConstraints gbc = new GridBagConstraints();
        this.setLayout(gbl);
       
        gbc.anchor = GridBagConstraints.NORTHWEST;
       
        gbc.gridwidth = 1;
        this.add(Box.createHorizontalStrut(10), gbc);
        this.add(new JLabel("��������"), gbc);
        this.add(Box.createHorizontalStrut(15), gbc);
        this.add(this.edtParameter, gbc);
        gbc.gridwidth = GridBagConstraints.REMAINDER;
        this.add(Box.createHorizontalStrut(15), gbc);
  }
 
  protected JTextField edtParameter = null;
  public void setParameter(String parameter) {
    if ("0".equals(parameter)) {
      parameter = "n";
    }
    this.edtParameter.setText(parameter);
  }
  public String getParameter() {
    return this.edtParameter.getText();
  }

}
TOP

Related Classes of de.FeatureModellingTool.Pattern.UI.ParameterEditor

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.