Package lupos.gui.operatorgraph.visualeditor.ruleeditor.util

Examples of lupos.gui.operatorgraph.visualeditor.ruleeditor.util.RuleMouseListener


    // build drop down menu for class names...
    this.enumCoBo = new JComboBox(RuleEnum.class.getEnumConstants());
    this.enumCoBo.setSelectedIndex(classType.ordinal());
    this.enumCoBo.setFont(parent.getFONT());
    this.enumCoBo.addMouseListener(new RuleMouseListener(this, this.enumCoBo));
    this.enumCoBo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        operator.setClassType((RuleEnum) that.enumCoBo.getSelectedItem());
      }
    });


    // build label for name...
    JLabel nameLabel = new JLabel("Name:");
    nameLabel.setFont(this.parent.getFONT());


    // build text field for object name...
    this.textField = new JTextField(name);
    this.textField.setFont(parent.getFONT());
    this.textField.setPreferredSize(new Dimension(this.textField.getPreferredSize().width + 100, this.textField.getPreferredSize().height));
    this.textField.addMouseListener(new RuleMouseListener(this, this.textField));
    this.textField.addFocusListener(new FocusListener() {
      public void focusGained(FocusEvent fe) {}

      public void focusLost(FocusEvent fe) {
        try {
          operator.applyChange(that.textField.getText());
        }
        catch(ModificationException me) {
          int n = AbstractGuiComponent.showCorrectIgnoreOptionDialog(parent, me.getMessage());

          if(n == JOptionPane.YES_OPTION) {
            (new FocusThread(that.textField)).start();
          }
        }
      }
    });


    // arrange elements...
    this.setLayout(new GridBagLayout());

    this.gbc = new GridBagConstraints();
    this.gbc.anchor = GridBagConstraints.NORTHWEST;
    this.gbc.gridwidth = 2;
    this.gbc.gridheight = 1;
    this.gbc.weightx = this.gbc.weighty = 1;
    this.gbc.gridx = this.gbc.gridy = 0;
    this.gbc.insets = new Insets((int) parent.PADDING, (int) parent.PADDING, (int) parent.PADDING, (int) parent.PADDING);
    this.gbc.fill = GridBagConstraints.BOTH;

    this.add(this.enumCoBo, this.gbc);
    this.gbc.gridx += 2;
    this.gbc.gridwidth = 1;

    this.add(nameLabel, this.gbc);
    this.gbc.gridx++;

    this.add(this.textField, this.gbc);
    this.gbc.gridy++;
    this.gbc.gridx = 0;

    if(this.getParentQG() == ((RuleEditorPane) this.getParentQG().visualEditor).getVisualGraphs().get(0)) {
      this.cB_subClasses = new JCheckBoxOwnIcon("also Subclasses", alsoSubClasses, this.parent.getFONT());
      this.cB_subClasses.addMouseListener(new RuleMouseListener(this, this.cB_subClasses));
      this.cB_subClasses.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent ie) {
          // get new state...
          boolean selected = (ie.getStateChange() == ItemEvent.SELECTED);
View Full Code Here

TOP

Related Classes of lupos.gui.operatorgraph.visualeditor.ruleeditor.util.RuleMouseListener

Copyright © 2018 www.massapicom. 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.