All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jive3.DeviceAttributePanel Maven / Gradle / Ivy

package jive3;

import fr.esrf.tangoatk.widget.util.ATKConstant;

import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.awt.event.MouseListener;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.ActionEvent;
import java.util.Vector;

import jive.JiveUtils;

public class DeviceAttributePanel extends JPanel implements MouseListener,ActionListener {

  private JTabbedPane tabPane;
  private JTable      alarmTable;
  private DefaultTableModel alarmModel;
  private JTable      unitTable;
  private DefaultTableModel unitModel;
  private JTable      rangeTable;
  private DefaultTableModel rangeModel;
  private JTable      displayTable;
  private DefaultTableModel displayModel;
  private JTable      descriptionTable;
  private DefaultTableModel descriptionModel;
  private JTable      aliasTable;
  private DefaultTableModel aliasModel;
  private JButton     refreshButton;
  private JButton     applyButton;

  private JPopupMenu  tableMenu;
  private JMenuItem   resetMenuItem;
  private JMenuItem   resetLMenuItem;
  private JMenuItem   resetULMenuItem;
  private JMenuItem   resetCULMenuItem;
  private JMenuItem   alarmMinMenuItem;
  private JMenuItem   alarmMaxMenuItem;
  private JMenuItem   warningMinMenuItem;
  private JMenuItem   warningMaxMenuItem;
  private JMenuItem   deltaTMenuItem;
  private JMenuItem   deltaValMenuItem;
  private JMenuItem   rangeMinMenuItem;
  private JMenuItem   rangeMaxMenuItem;
  private JMenuItem   unitMenuItem;
  private JMenuItem   displayUnitMenuItem;
  private JMenuItem   standardUnitMenuItem;
  private JMenuItem   labelMenuItem;
  private JMenuItem   formatMenuItem;
  private JMenuItem   descriptionMenuItem;


  private JTable      selectedTable;
  private int[]       selectedRows;

  private TaskAttributeNode[]   source = null;

  DeviceAttributePanel()  {

    setLayout(new BorderLayout());

    // -- Alarm table -------------------------------
    alarmModel = new DefaultTableModel() {

      public Class getColumnClass(int columnIndex) {
          return String.class;
      }
      public boolean isCellEditable(int row, int column) {
          return (column!=0) && (!JiveUtils.readOnly);
      }

      public void setValueAt(Object aValue, int row, int column) {
        if(!aValue.equals(getValueAt(row,column))) {
          super.setValueAt(aValue,row,column);
          int nb = source.length;
          int k = 0;

          // Confirmation dialog
          if (source.length > 1) {

            String name = (String)alarmModel.getValueAt(row,0);
            Vector propChange = new Vector();
            switch(column) {
              case 1:
                propChange.add("min_alarm");
                break;
              case 2:
                propChange.add("max_alarm");
                break;
              case 3:
                propChange.add("min_warning");
                break;
              case 4:
                propChange.add("max_warning");
                break;
              case 5:
                propChange.add("delta_t");
                break;
              case 6:
                propChange.add("delta_val");
                break;
            }
            propChange.add((String)aValue);

            if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," for attribute " + name)) {
              refreshValue();
              return;
            }

          }

          switch(column) {
            case 1:
              if(nb>1) ProgressFrame.displayProgress("Updating alarm");
              for(int i=0;i1) ProgressFrame.displayProgress("Updating alarm");
              for(int i=0;i1) ProgressFrame.displayProgress("Updating alarm");
              for(int i=0;i1) ProgressFrame.displayProgress("Updating alarm");
              for(int i=0;i1) ProgressFrame.displayProgress("Updating alarm");
              for(int i=0;i1) ProgressFrame.displayProgress("Updating alarm");
              for(int i=0;i 1) {

            String name = (String)unitModel.getValueAt(row,0);
            Vector propChange = new Vector();
            switch(column) {
              case 1:
                propChange.add("unit");
                break;
              case 2:
                propChange.add("display_unit");
                break;
              case 3:
                propChange.add("standard_unit");
                break;
            }
            propChange.add((String)aValue);

            if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," for attribute " + name)) {
              refreshValue();
              return;
            }

          }

          switch(column) {
            case 1:
              if(nb>1) ProgressFrame.displayProgress("Updating unit");
              for(int i=0;i1) ProgressFrame.displayProgress("Updating unit");
              for(int i=0;i1) ProgressFrame.displayProgress("Updating unit");
              for(int i=0;i 1) {

            String name = (String)rangeModel.getValueAt(row,0);
            Vector propChange = new Vector();
            switch(column) {
              case 1:
                propChange.add("min");
                break;
              case 2:
                propChange.add("max");
                break;
            }
            propChange.add((String)aValue);

            if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," for attribute " + name)) {
              refreshValue();
              return;
            }

          }

          switch(column) {
            case 1:
              if(nb>1) ProgressFrame.displayProgress("Updating range");
              for(int i=0;i1) ProgressFrame.displayProgress("Updating range");
              for(int i=0;i 1) {

            String name = (String)displayModel.getValueAt(row,0);
            Vector propChange = new Vector();
            switch(column) {
              case 1:
                propChange.add("label");
                break;
              case 2:
                propChange.add("format");
                break;
            }
            propChange.add((String)aValue);

            if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," for attribute " + name)) {
              refreshValue();
              return;
            }

          }

          switch(column) {
            case 1:
              if(nb>1) ProgressFrame.displayProgress("Updating label");
              for(int i=0;i1) ProgressFrame.displayProgress("Updating format");
              for(int i=0;i 1) {

            String name = (String)descriptionModel.getValueAt(row,0);
            Vector propChange = new Vector();
            switch(column) {
              case 1:
                propChange.add("description");
                break;
            }
            propChange.add((String)aValue);

            if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," for attribute " + name)) {
              refreshValue();
              return;
            }

          }

          switch(column) {
            case 1:
              if(nb>1) ProgressFrame.displayProgress("Updating description");
              for(int i=0;i1) {
                JiveUtils.showJiveError("Cannot apply attribute alias to multiple instance");
              } else if(nb==1) {
                source[0].setAlias(row,(String)aValue);
              }
              refreshValue();
              break;
          }
        }
      }

    };
    aliasTable = new JTable(aliasModel);
    aliasTable.addMouseListener(this);
    JScrollPane aliasView = new JScrollPane(aliasTable);

    tabPane = new JTabbedPane();
    tabPane.setFont(ATKConstant.labelFont);
    tabPane.add("Display",displayView);
    tabPane.add("Unit",unitView);
    tabPane.add("Range",rangeView);
    tabPane.add("Alarms",alarmView);
    tabPane.add("Description",descriptionView);
    tabPane.add("Alias",aliasView);

    Border b = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"...");
    tabPane.setBorder(b);
    add(tabPane,BorderLayout.CENTER);

    // Bottom panel
    JPanel btnPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    refreshButton = new JButton("Refresh");
    refreshButton.addActionListener(this);
    btnPanel.add(refreshButton);
    applyButton = new JButton("Apply");
    applyButton.setEnabled(!JiveUtils.readOnly);
    applyButton.addActionListener(this);
    btnPanel.add(applyButton);
    add(btnPanel,BorderLayout.SOUTH);

    // Contextual menu
    tableMenu = new JPopupMenu();
    resetMenuItem = new JMenuItem("Reset to default value");
    resetMenuItem.addActionListener(this);
    tableMenu.add(resetMenuItem);

    resetLMenuItem = new JMenuItem("Return to lib default value");
    resetLMenuItem.addActionListener(this);
    tableMenu.add(resetLMenuItem);
    resetULMenuItem = new JMenuItem("Return to code/lib default value");
    resetULMenuItem.addActionListener(this);
    tableMenu.add(resetULMenuItem);
    resetCULMenuItem = new JMenuItem("Return to class/code/lib default value");
    resetCULMenuItem.addActionListener(this);
    tableMenu.add(resetCULMenuItem);

    alarmMinMenuItem = new JMenuItem("Set min alarm");
    alarmMinMenuItem.addActionListener(this);
    tableMenu.add(alarmMinMenuItem);
    alarmMaxMenuItem = new JMenuItem("Set max alarm");
    alarmMaxMenuItem.addActionListener(this);
    tableMenu.add(alarmMaxMenuItem);
    warningMinMenuItem = new JMenuItem("Set min warning");
    warningMinMenuItem.addActionListener(this);
    tableMenu.add(warningMinMenuItem);
    warningMaxMenuItem = new JMenuItem("Set max warning");
    warningMaxMenuItem.addActionListener(this);
    tableMenu.add(warningMaxMenuItem);
    deltaTMenuItem = new JMenuItem("Set delta time");
    deltaTMenuItem.addActionListener(this);
    tableMenu.add(deltaTMenuItem);
    deltaValMenuItem = new JMenuItem("Set delta value");
    deltaValMenuItem.addActionListener(this);
    tableMenu.add(deltaValMenuItem);
    rangeMinMenuItem = new JMenuItem("Set min");
    rangeMinMenuItem.addActionListener(this);
    tableMenu.add(rangeMinMenuItem);
    rangeMaxMenuItem = new JMenuItem("Set max");
    rangeMaxMenuItem.addActionListener(this);
    tableMenu.add(rangeMaxMenuItem);
    unitMenuItem = new JMenuItem("Set unit");
    unitMenuItem.addActionListener(this);
    tableMenu.add(unitMenuItem);
    displayUnitMenuItem = new JMenuItem("Set display unit");
    displayUnitMenuItem.addActionListener(this);
    tableMenu.add(displayUnitMenuItem);
    standardUnitMenuItem = new JMenuItem("Set standard unit");
    standardUnitMenuItem.addActionListener(this);
    tableMenu.add(standardUnitMenuItem);
    labelMenuItem = new JMenuItem("Set label");
    labelMenuItem.addActionListener(this);
    tableMenu.add(labelMenuItem);
    formatMenuItem = new JMenuItem("Set format");
    formatMenuItem.addActionListener(this);
    tableMenu.add(formatMenuItem);
    descriptionMenuItem = new JMenuItem("Set description");
    descriptionMenuItem.addActionListener(this);
    tableMenu.add(descriptionMenuItem);

  }
  // Mouse listener -------------------------------------------

  public void mousePressed(MouseEvent e) {}
  public void mouseClicked(MouseEvent e) {

    selectedTable = (JTable)e.getSource();

    if(e.getButton() == MouseEvent.BUTTON3 && e.getClickCount()==1 && !JiveUtils.readOnly) {

      int row = getRowForLocation(e.getY());
      if(row!=-1) {
        selectedTable.addRowSelectionInterval(row,row);
        selectedTable.setColumnSelectionInterval(0,selectedTable.getColumnCount()-1);
        selectedRows = selectedTable.getSelectedRows();

        alarmMinMenuItem.setVisible(false);
        alarmMaxMenuItem.setVisible(false);
        warningMinMenuItem.setVisible(false);
        warningMaxMenuItem.setVisible(false);
        deltaTMenuItem.setVisible(false);
        deltaValMenuItem.setVisible(false);
        rangeMinMenuItem.setVisible(false);
        rangeMaxMenuItem.setVisible(false);
        unitMenuItem.setVisible(false);
        displayUnitMenuItem.setVisible(false);
        standardUnitMenuItem.setVisible(false);
        labelMenuItem.setVisible(false);
        formatMenuItem.setVisible(false);
        descriptionMenuItem.setVisible(false);

        if(selectedTable == alarmTable) {

          alarmMinMenuItem.setVisible(true);
          alarmMaxMenuItem.setVisible(true);
          warningMinMenuItem.setVisible(true);
          warningMaxMenuItem.setVisible(true);
          deltaTMenuItem.setVisible(true);
          deltaValMenuItem.setVisible(true);

        } else if (selectedTable == unitTable) {

          unitMenuItem.setVisible(true);
          displayUnitMenuItem.setVisible(true);
          standardUnitMenuItem.setVisible(true);

        } else if (selectedTable == rangeTable) {

          rangeMinMenuItem.setVisible(true);
          rangeMaxMenuItem.setVisible(true);

        } else if (selectedTable == displayTable) {

          labelMenuItem.setVisible(true);
          formatMenuItem.setVisible(true);

        } else if (selectedTable == descriptionTable) {

          descriptionMenuItem.setVisible(true);

        }

        boolean isTango8 = true;
        int i = 0;
        while(isTango8 && i1 ) {
          String message = "You are going to reset alarm configuration for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting alarms");
        for(int j=0;j1 ) {
          String message = "You are going to reset unit configuration for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting units");
        for(int j=0;j1 ) {
          String message = "You are going to reset range configuration for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting ranges");
        for(int j=0;j1 ) {
          String message = "You are going to reset display configuration for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting display");
        for(int j=0;j1 ) {
          String message = "You are going to reset description for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting description");
        for(int j=0;j1 ) {
          String message = "You are going to reset alias for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting alias");
        for(int j=0;j1 ) {
          String message = "You are going to reset alarm configuration to library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting alarms");
        for(int j=0;j1 ) {
          String message = "You are going to reset unit configuration to library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting units");
        for(int j=0;j1 ) {
          String message = "You are going to reset range configuration to library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting ranges");
        for(int j=0;j1 ) {
          String message = "You are going to reset display configuration to library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting display");
        for(int j=0;j1 ) {
          String message = "You are going to reset description to library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting description");
        for(int j=0;j1 ) {
          String message = "You are going to reset alarm configuration to code/library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting alarms");
        for(int j=0;j1 ) {
          String message = "You are going to reset unit configuration to code/library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting units");
        for(int j=0;j1 ) {
          String message = "You are going to reset range configuration to code/library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting ranges");
        for(int j=0;j1 ) {
          String message = "You are going to reset display configuration to code/library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting display");
        for(int j=0;j1 ) {
          String message = "You are going to reset description to code/library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting description");
        for(int j=0;j1 ) {
          String message = "You are going to reset alarm configuration to class/code/library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting alarms");
        for(int j=0;j1 ) {
          String message = "You are going to reset unit configuration to class/code/library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting units");
        for(int j=0;j1 ) {
          String message = "You are going to reset range configuration to class/code/library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting ranges");
        for(int j=0;j1 ) {
          String message = "You are going to reset display configuration to class/code/library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting display");
        for(int j=0;j1 ) {
          String message = "You are going to reset description to class/code/library value for " + source.length + " device(s) and " + selectedRows.length + " attribute(s).\nDo you want to proceed ?";
          int result = JOptionPane.showConfirmDialog(this,message,"Confirmation",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
          if( result==JOptionPane.NO_OPTION )
            return;
        }

        if(nb>1) ProgressFrame.displayProgress("Reseting description");
        for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("label");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating label");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("format");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating format");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("unit");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating unit");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("display_unit");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating display unit");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("standard_unit");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating standard unit");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("min");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating min");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("max");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating max");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("min_alarm");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating min alarm");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("max_alarm");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating max alarm");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("min_warning");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating min warning");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("max_warning");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating max warning");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("delta_t");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating delta T");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("delta_val");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating delta value");
      for(int j=0;j 1) {
        Vector propChange = new Vector();
        propChange.add("description");
        propChange.add(val);
        if (!MultiChangeConfirmDlg.confirmChange(propChange, source.length," and " + selectedRows.length + " attribute(s)")) {
          return;
        }
      }

      if(nb>1) ProgressFrame.displayProgress("Updating description");
      for(int j=0;j=h && y<=h+selectedTable.getRowHeight(i));
      if(!found) {
        h+=selectedTable.getRowHeight(i);
        i++;
      }
    }

    if(found) {
      return i;
    } else {
      return -1;
    }

  }

  // ---------------------------------------------------------------

  private void refreshValue() {

    if (source != null) {

      //for(int i=0;i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy