Examples of JTextFieldResizing


Examples of lupos.gui.operatorgraph.visualeditor.util.JTextFieldResizing

            }
            } );
    term.setNameComboBox(namedConstCombo);

    // TextField Name
    final JTextFieldResizing tfName = new HintTextFieldResizing("Name", "Name", this.parent.getFONT(), this);
    tfName.addFocusListener(new FocusAdapter() {
      @Override
      public void focusLost(final FocusEvent fe) {
        term.setTfName(tfName);
        }});

    // TextField Value
    final JTextFieldResizing tfValue = new HintTextFieldResizing("Value", "Value", this.parent.getFONT(), this);

    tfValue.addFocusListener(new FocusAdapter() {
      @Override
      public void focusLost(final FocusEvent fe) {
        term.setValue(tfValue.getText());
        }});

    // Label
    final JLabel label = new JLabel("Constant:");
    label.setFont(this.parent.getFONT());
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.util.JTextFieldResizing

      }
    } );
    term.setNameComboBox(namedConstCombo);

    // TextField Name
    final JTextFieldResizing tfName = new HintTextFieldResizing("Name", "Name", this.parent.getFONT(), this);
    tfName.addFocusListener(new FocusAdapter() {
      @Override
      public void focusLost(final FocusEvent fe) {
        term.setTfName(tfName);
      }});

    // TextField Value
    final JTextFieldResizing tfValue = new HintTextFieldResizing(term.getValue(), "Value", this.parent.getFONT(), this);

    tfValue.addFocusListener(new FocusAdapter() {
      @Override
      public void focusLost(final FocusEvent fe) {
        term.setValue(tfValue.getText());
      }});

    // Label
    final JLabel label = new JLabel("Constant:");
    label.setFont(this.parent.getFONT());
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.util.JTextFieldResizing

               else if (evt.getStateChange() == ItemEvent.DESELECTED) {}
            }
            } );
    term.setNameComboBox(namedConstCombo);
    // TextField Name
    final JTextFieldResizing tfName = new HintTextFieldResizing("Name", "Name", this.parent.getFONT(), this);
    tfName.addFocusListener(new FocusAdapter() {
      @Override
      public void focusLost(final FocusEvent fe) {
        term.setTfName(tfName);
        }});

    // TextField Value
    final JTextFieldResizing tfValue = new HintTextFieldResizing("Value", "Value", this.parent.getFONT(), this);

    tfValue.addFocusListener(new FocusAdapter() {
      @Override
      public void focusLost(final FocusEvent fe) {
        term.setValue(tfValue.getText());
        }});

    // Label
    final JLabel label = new JLabel("Variable:");
    label.setFont(this.parent.getFONT());
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.util.JTextFieldResizing

            } );

    term.setNameComboBox(namedConstCombo);

    // TextField Name
    final JTextFieldResizing tfName = new HintTextFieldResizing("Name", "Name", this.parent.getFONT(), this);
    tfName.addFocusListener(new FocusAdapter() {
      @Override
      public void focusLost(final FocusEvent fe) {
        term.setTfName(tfName);
        }});

    // TextField Value
    final JTextFieldResizing tfValue = new HintTextFieldResizing(term.getValue(), "Value", this.parent.getFONT(), this);

    tfValue.addFocusListener(new FocusAdapter() {
      @Override
      public void focusLost(final FocusEvent fe) {
        term.setValue(tfValue.getText());
        }});

    // Label
    final JLabel label = new JLabel("Variable:");
    label.setFont(this.parent.getFONT());
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.util.JTextFieldResizing

  protected JPanel createPredicateElement(final int tmpIndex, String predicateString) {
    final JPanel panel = new JPanel(new GridBagLayout());
    panel.setOpaque(false);

    final JTextFieldResizing jtf = new JTextFieldResizing(predicateString, this.parent.getFONT(), this);
    jtf.addFocusListener(new FocusListener() {
      public void focusGained(FocusEvent fe) {}

      public void focusLost(FocusEvent fe) {
        String content = jtf.getText();

        if(!content.equals("")) {
          try {
            ((RDFTerm) operator).setPredicate((RDFTerm) child, content, tmpIndex);
          }
          catch(ModificationException me) {
            int n = AbstractGuiComponent.showCorrectIgnoreOptionDialog(parent, me.getMessage());

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

    if(predicateString.equals("")) {
      jtf.setPreferredSize(new Dimension(20, jtf.getPreferredSize().height));
    }

    jtf.setMinimumSize(jtf.getPreferredSize());

    this.predicateElementsList.add(jtf); // add TextField to predicates TextFields list

    final JLabel delLabel = new JLabel(this.parent.delIcon);
    delLabel.addMouseListener(new MouseAdapter() {
      public void mouseClicked(final MouseEvent me) {
        if (delLabel.isEnabled()) { // only process click if label is
          // enabled...
          final int returnValue = JOptionPane.showOptionDialog(
              parent.visualEditor,
              "Do you really want to delete this predicate?",
              "Delete predicate", JOptionPane.YES_NO_OPTION,
              JOptionPane.INFORMATION_MESSAGE, null,
              new String[] { "YES", "NO" }, 0);

          if (returnValue == 0) {
            predicateElementsList.remove(jtf);

            ((RDFTerm) operator).deletePredicate((RDFTerm) child,
                tmpIndex); // remove predicate element from
            // operator

            final JPanel parentPanel = (JPanel) panel.getParent(); // get
            // parent
            // panel
            // of
            // element
            // panel
            parentPanel.remove(panel); // remove element panel from
            // parent panel

            updateSize();
          }
        }
      }
    });

    final GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridwidth = gbc.gridheight = 1;
    gbc.gridx = gbc.gridy = 0;
    gbc.fill = GridBagConstraints.NONE;
    gbc.insets = new Insets(0, 0, 0, (int) this.parent.PADDING);

    panel.add(jtf, gbc);

    gbc.gridx++;

    panel.add(delLabel, gbc);

    panel.setPreferredSize(new Dimension(panel.getPreferredSize().width,
        jtf.getPreferredSize().height));

    return panel;
  }
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.util.JTextFieldResizing

        (int) parent.PADDING);

    this.gbc.gridx = this.gbc.gridy = 0;
    this.gbc.fill = GridBagConstraints.BOTH;

    final JTextFieldResizing textField = new JTextFieldResizing(
        "", this.parent.getFONT(), this);

    textField.setPreferredSize(new Dimension(15 , 20));

    textField.addFocusListener((new FocusAdapter() {
      @Override
      public void focusGained(final FocusEvent fe){
        VariablePanel.this.updateSize();
      }

      @Override
      public void focusLost(final FocusEvent fe) {
        VariablePanel.this.variableOperator.setVariable(textField.getText());
        VariablePanel.this.updateSize();
      }
    }));
    textField.addKeyListener( new KeyListener()
    {
      @Override
      public void keyTyped( final KeyEvent e ) {
      }
      @Override
      public void keyPressed( final KeyEvent e ) {
      }
      @Override
      public void keyReleased( final KeyEvent e ) {
        if(e.getKeyCode()==10){
          VariablePanel.this.updateSize();
        }
      }
    });

    textField.setText(this.variableOperator.getVariable());
    this.add(textField,this.gbc);

    //    LineBorder lineBorder = new LineBorder(Color.black,1);
    final Border raisedbevel = BorderFactory.createRaisedBevelBorder();
    TitledBorder titled;
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.util.JTextFieldResizing

    gbc.weightx = gbc.weighty = 1;
    gbc.gridx = gbc.gridy = 0;
    gbc.insets = new Insets((int) PADDING, (int) PADDING, (int) PADDING, (int) PADDING);
    gbc.fill = GridBagConstraints.BOTH;

    this.textField = new JTextFieldResizing(text, font, this);
    this.textField.addMouseListener(new MouseAdapter() {
      public void mouseClicked(MouseEvent me) {
        if(parent.visualEditor instanceof Suggester &&
            ((Suggester<Operator>) parent.visualEditor).isInSuggestionMode(operator)) {
          makeSuggestions();
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.util.JTextFieldResizing

    this.gbc.fill = GridBagConstraints.BOTH;

    final Border raisedbevel = BorderFactory.createRaisedBevelBorder();
    this.setBorder(raisedbevel);

    this.textField = new JTextFieldResizing(text, font, this);

    this.textField.addFocusListener(new FocusAdapter() {

      @Override
      public void focusLost(final FocusEvent fe) {
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.util.JTextFieldResizing

        final String profileString) {
 
      this.gbc.gridx = 0;
      this.gbc.gridy++;

      final JTextFieldResizing locatorTF = new JTextFieldResizing(
          locatorString, this.parent.getFONT(), this);


      final JTextFieldResizing profileTF = new JTextFieldResizing(
          profileString, this.parent.getFONT(), this);
     
      profileTF.setPreferredSize(new Dimension(locatorTF
          .getPreferredSize().width + 150, locatorTF
          .getPreferredSize().height));

     
      locatorTF.setPreferredSize(new Dimension(locatorTF
          .getPreferredSize().width + 150, locatorTF
          .getPreferredSize().height));
 
   
      if(!profileString.equals("")){
        profileTF.setFocusable(false);
        locatorTF.setFocusable(false);
      }
   
     
    locatorTF.addFocusListener(new FocusAdapter() {
      private String oldValue = locatorString;

      public void focusLost(final FocusEvent fe) {

       
     
        }});
     
     
    profileTF.addFocusListener(new FocusAdapter() {
        private String oldValue = profileString;
       
       
        public void focusGained(final FocusEvent fe){
     
        }
       

        public void focusLost(final FocusEvent fe) {
         
        }
      });

    profileTF.addKeyListener( new KeyListener()
    {
        public void keyTyped( KeyEvent e ) {

        }
        public void keyPressed( KeyEvent e ) {

        }
        public void keyReleased( KeyEvent e ) {
      
         if(e.getKeyCode()==10){
          

         int i =   checkTheCase(locatorTF.getText(),profileTF.getText());
          
         
          switch(i){
         
          case 0: break;
         
          case 1: addEntry(locatorTF.getText(),profileTF.getText());
                locatorTF.setEditable(false);
                profileTF.setEditable(false);
                profileTF.setFocusable(false);
                locatorTF.setFocusable(false);
                importOperator.setImportRowCnt(importOperator.getImportRowCnt()+1);
                break;
         
          case 2: locatorTF.selectAll();
              locatorTF.grabFocus();
                showPrefixAlreadyExistsDialog();
                break;
               
          case 3: locatorTF.selectAll();
                locatorTF.grabFocus();
                showNamespaceIsAlreadyInUseDialog();
                break;
               
          case 4: locatorTF.selectAll();
              locatorTF.grabFocus();
                showNoNamespaceDialog();
                break;
           
          default: break;
         
         
          }
         
//          System.out.println(prefix.getPrefixCount()+" "+prefix.getPrefixRowCnt());
         
         }
       
        }
      });
     
     
      final JLabel prefixLabel = new JLabel("Locator:");
      prefixLabel.setFont(parent.getFONT());
     
      final JLabel iriLabel = new JLabel("Profile:");
      iriLabel.setFont(parent.getFONT());
     
     
      // Button
      Dimension buttonDimension = new Dimension();
      buttonDimension.setSize(30d, 24d);
     
      final JIconButton deleteButton = new JIconButton("icons/001_02.png");
      deleteButton.setPreferredSize(buttonDimension);
      deleteButton.setMaximumSize(buttonDimension);
      deleteButton.setMinimumSize(buttonDimension);
      deleteButton.setFont(parent.getFONT());
      deleteButton.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e) {
          if (!profileTF.getText().equals("")) {
            final int choice = showPrefixRemovedOptionDialog();

            if (choice == JOptionPane.YES_OPTION) { // remove prefix and
              // notify
              // operators...
              importOperator.removeEntry(profileTF.getText(), true);

              removeRow(prefixLabel, locatorTF, iriLabel, profileTF, deleteButton);
            } else if (choice == JOptionPane.NO_OPTION) { // remove
              // prefix
              // but don't
              // notify
              // operators
              // ...
              importOperator.removeEntry(profileTF.getText(), false);

              removeRow(prefixLabel, locatorTF, iriLabel, profileTF, deleteButton);
            }
          } else {
            removeRow(prefixLabel, locatorTF, iriLabel, profileTF, deleteButton);
View Full Code Here
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.