Package fr.soleil.comete.target.redirect

Examples of fr.soleil.comete.target.redirect.TextTargetRedirector


    public AuthentificationLightBean() {
        super();
        displayMessageOnConnectionError = true;
        state = null;

        stateRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                state = data;
            }
        };
View Full Code Here


        super(parent, title, modal);
    }

    @Override
    protected void initPanelComponents() {
        valueRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                currentValue = data;
                onValueChange(data);
            }
View Full Code Here

                }
            }
        };
        configurationComboBox.addItemListener(configComboListener);

        currentConfigRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                configurationComboBox.removeItemListener(configComboListener);
                configurationComboBox.setSelectedValue(data);
                updateTables();
View Full Code Here

     * Initialize all {@link TextTargetRedirector}, used to refresh attributes that needed to be
     * updated with new values.
     */
    private void initTargetRedirector() {

        stateRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                boolean stateChanged = updateState(data);
                if (stateChanged) {
                    computeDetailsAvailabilities();
                }
            }
        };

        warningLevelRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                updateWarningLevel(data);
            }
        };
View Full Code Here

        toolBar.setFloatable(false);
        toolBar.add(dataBrowserButton);
        toolBar.addSeparator(new Dimension(5, 0));
        toolBar.add(technicalDataButton);

        stateRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                boolean deviceDead = data.equalsIgnoreCase(UNKNOWN_DEVICE_STATE);
                technicalDataButton.setEnabled(!deviceDead);
            }
View Full Code Here

  return nxEntryNameModel;
    }

    public void initRedirectors() {
  // Experiment Name
  experimentNameRedirector = new TextTargetRedirector() {

      @Override
      public void methodToRedirect(String data) {
    experimentName = data;
      }
  };
  // Acquisition Name
  acquisitionNameRedirector = new TextTargetRedirector() {

      @Override
      public void methodToRedirect(String data) {
    acquisitionName = data;
      }
  };

  // hidden components
  nxEntryNameRedirector = new TextTargetRedirector() {
      @Override
      public void methodToRedirect(String data) {
    nxEntryName = data;
      }
  };
  defaultValueRedirector = new TextTargetRedirector() {
      @Override
      public void methodToRedirect(String data) {
    defaultValue = data;
      }
  };
View Full Code Here

    @Override
    protected void initAndAddOtherComponentsInMainPanel() {
        super.initAndAddOtherComponentsInMainPanel();
        mainPanel.setLayout(new GridBagLayout());

        writeValueRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(final String data) {
                canSetData = false;
                SwingUtilities.invokeLater(new Runnable() {
                    @Override
View Full Code Here

    public AuthentificationLightBean() {
        super();
        displayMessageOnConnectionError = true;
        state = null;

        stateRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                state = data;
            }
        };
View Full Code Here

    @Override
    protected void initPanelComponents() {
        nameModelEditDialog = new NxEntryNameModelEditDialog(this, "Edit nxEntryName Model", true);

        // Experiment Name
        experimentNameRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                experimentName = data;
            }
        };

        experimentNameTitle = new JLabel("Experiment Name:");
        experimentNameEditor = new TextFieldButton();
        experimentNameEditor.setTextButton("Apply");
        experimentNameEditor.setTextFieldColumns(30);
        experimentNameEditor.addTextFieldListener(new ITextFieldListener() {
            @Override
            public void textChanged(EventObject event) {
                if (!experimentNameEditor.getText().equalsIgnoreCase(experimentName)) {
                    updateExperimentEditor(true);
                }
            }
            @Override
            public void actionPerformed(EventObject event) {
                // nothing to do
            }
        });

        experimentNameEditor.addButtonListener(new IButtonListener() {
            @Override
            public void actionPerformed(EventObject event) {
                updateExperimentEditor(false);
            }
        });

        experimentNameRevertButton = new JButton("Revert");
        experimentNameRevertButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (!experimentName.trim().isEmpty()) {
                    experimentNameEditor.setText(experimentName);
                }
            }
        });
        stringBox.setColorEnabled(experimentNameEditor, false);

        // Acquisition Name
        acquisitionNameRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                acquisitionName = data;
            }
        };
View Full Code Here

        stringBox.setErrorText(projectValueTextfield, PROJECT_ERROR_TEXT);
        stringBox.setErrorText(expirationValueLabel, EXPIRATION_ERROR_TEXT);
        stringBox.setErrorText(statusValueLabel, STATUS_ERROR_TEXT);
        stringBox.setErrorText(typeValueLabel, TYPE_ERROR_TEXT);

        projectRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                if (stringBox.isOnError(projectRedirector)) {
                    projectValueTextfield.setForeground(RED);

                    // disable project button as well
                    // set the icon to keep it colored
                    projectButton.setIcon(DEVICE_KO_ICON);
                    projectButton.setEnabled(false);

                } else {
                    projectValueTextfield.setForeground(GREEN);

                    projectButton.setIcon(DEVICE_OK_ICON);
                    projectButton.setEnabled(true);
                }
            }
        };
        statusRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                if (STATUS_RED_VALUE.equalsIgnoreCase(data)) {
                    statusValueLabel.setForeground(RED);
                } else {
                    statusValueLabel.setForeground(GREEN);
                }
            }
        };
        typeRedirector = new TextTargetRedirector() {
            @Override
            public void methodToRedirect(String data) {
                if (TYPE_RED_VALUE.equalsIgnoreCase(data)) {
                    typeValueLabel.setForeground(RED);
                } else {
View Full Code Here

TOP

Related Classes of fr.soleil.comete.target.redirect.TextTargetRedirector

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.