Package easysm.boundaries.components.utils

Examples of easysm.boundaries.components.utils.BooleanTableCellRender


              TableColumnModel colModel = jtable_attributes.getColumnModel();
              TableColumn col = colModel.getColumn(1);
              col.setMinWidth(50);
              col.setMaxWidth(60);
              BooleanTableCellRender booleanTableCellRender = new BooleanTableCellRender();

              booleanTableCellRender.addActionListener(new ActionListener()
              {

                @Override
                public void actionPerformed(ActionEvent e)
                {
                  BooleanTableCellRender source = (BooleanTableCellRender) e.getSource();

                  if (source.isSelected()) {
                    updateInputCD.validate(attributes[source.getRow()]);
                    jtable_attributesModel.setValueAt(!attributes[source.getRow()].isInvalid(),
                            source.getRow(), 1);
                  }
                  refreshColWidth();
                }
              });

              col.setCellEditor(booleanTableCellRender);
              col.setCellRenderer(booleanTableCellRender);

              jtable_attributes.setPreferredScrollableViewportSize(jtable_attributes.getPreferredSize());
              jtable_attributes.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

              ListSelectionModel rowSelectionModel = jtable_attributes.getSelectionModel();

              rowSelectionModel.addListSelectionListener(new ListSelectionListener()
              {
                @Override
                public void valueChanged(ListSelectionEvent e)
                {
                  if (jtable_attributes.getSelectedRow() == -1) {
                    if (jbutton_editAttribute.isEnabled()) {
                      jbutton_editAttribute.setEnabled(false);
                      jbutton_removeAttribute.setEnabled(false);
                    }
                  } else {
                    if (jbutton_editAttribute.isEnabled() == false) {
                      jbutton_editAttribute.setEnabled(true);
                      jbutton_removeAttribute.setEnabled(true);
                    }
                  }
                }
              });
            }
          }
        }
        {
          jPanel_Operations = new JPanel();
          BorderLayout jPanel_OperationsLayout = new BorderLayout();
          jPanel_Operations.setLayout(jPanel_OperationsLayout);
          jTabbedPane1.addTab("Operations", null, jPanel_Operations, "Add/Edit operations to/of a class");
          jTabbedPane1.setMnemonicAt(jTabbedPane1.getComponentCount() - 1, KeyEvent.VK_P);
          {
            jpanel_buttonsOperations = new JPanel();
            jPanel_Operations.add(jpanel_buttonsOperations, BorderLayout.EAST);
            FlowLayout jPanel3Layout = new FlowLayout();
            jpanel_buttonsOperations.setLayout(jPanel3Layout);
            jpanel_buttonsOperations.setPreferredSize(new java.awt.Dimension(116, 173));
            jpanel_buttonsOperations.setSize(109, 205);
            {
              jbutton_addOperation = new JButton();
              jpanel_buttonsOperations.add(jbutton_addOperation);
              jbutton_addOperation.setText("<html><u>A</u>dd<br/>operation</html>");
              jbutton_addOperation.setPreferredSize(new java.awt.Dimension(111, 35));
              jbutton_addOperation.setIcon(new ImageIcon(getClass().getClassLoader().getResource(
                      "easysm/icons/x16/list-add.png")));
              jbutton_addOperation.setHorizontalAlignment(SwingConstants.LEADING);
              jbutton_addOperation.setMnemonic(java.awt.event.KeyEvent.VK_A);
              jbutton_addOperation.addActionListener(new ActionListener()
              {
                @Override
                public void actionPerformed(ActionEvent evt)
                {
                  jbutton_addOperationActionPerformed(evt);
                }
              });
            }
            {
              jbutton_editOperation = new JButton();
              jpanel_buttonsOperations.add(jbutton_editOperation);
              jbutton_editOperation.setText("<html><u>E</u>dit<br/>operation</html>");
              jbutton_editOperation.setPreferredSize(new java.awt.Dimension(111, 35));
              jbutton_editOperation.setIcon(new ImageIcon(getClass().getClassLoader().getResource(
                      "easysm/icons/x16/edit-rename.png")));
              jbutton_editOperation.setHorizontalAlignment(SwingConstants.LEADING);
              jbutton_editOperation.setMnemonic(java.awt.event.KeyEvent.VK_E);
              jbutton_editOperation.setEnabled(false);
              jbutton_editOperation.addActionListener(new ActionListener()
              {
                @Override
                public void actionPerformed(ActionEvent evt)
                {
                  jbutton_editOperationActionPerformed(evt);
                }
              });
            }
            {
              jbutton_removeOperation = new JButton();
              jpanel_buttonsOperations.add(jbutton_removeOperation);
              jbutton_removeOperation.setText("<html><u>R</u>emove<br/>operation</html>");
              jbutton_removeOperation.setPreferredSize(new java.awt.Dimension(111, 35));
              jbutton_removeOperation.setIcon(new ImageIcon(getClass().getClassLoader().getResource(
                      "easysm/icons/x16/list-remove.png")));
              jbutton_removeOperation.setHorizontalAlignment(SwingConstants.LEADING);
              jbutton_removeOperation.setMnemonic(java.awt.event.KeyEvent.VK_R);
              jbutton_removeOperation.setEnabled(false);
              jbutton_removeOperation.addActionListener(new ActionListener()
              {
                @Override
                public void actionPerformed(ActionEvent evt)
                {
                  jbutton_removeOperationActionPerformed(evt);
                }
              });
            }
          }
          {
            jscrollpane_operations = new JScrollPane();
            jPanel_Operations.add(jscrollpane_operations, BorderLayout.CENTER);
            {
              String[] columnNames = new String[] { "Operation Name and Signature", "Is Valid" };
              jtable_operations = new JTable();
              jtable_operationsModel = new DefaultTableModel(null, columnNames);

              jscrollpane_operations.setViewportView(jtable_operations);
              jtable_operations.setModel(jtable_operationsModel);

              TableColumnModel colModel = jtable_operations.getColumnModel();
              TableColumn col = colModel.getColumn(1);
              col.setMinWidth(50);
              col.setMaxWidth(60);
              BooleanTableCellRender booleanTableCellRender = new BooleanTableCellRender();

              booleanTableCellRender.addActionListener(new ActionListener()
              {

                @Override
                public void actionPerformed(ActionEvent e)
                {
                  BooleanTableCellRender source = (BooleanTableCellRender) e.getSource();

                  if (source.isSelected()) {
                    updateInputCD.validate(operations[source.getRow()]);
                    jtable_attributesModel.setValueAt(!operations[source.getRow()].isInvalid(),
                            source.getRow(), 1);
                  }
                  refreshColWidth();
                }
              });
View Full Code Here


         
          col = colModel.getColumn(2);
          col.setMinWidth(50);
          col.setMaxWidth(60);
         
          BooleanTableCellRender booleanTableCellRender = new BooleanTableCellRender();
          booleanTableCellRender.addActionListener(new ActionListener()
          {
            @Override
            public void actionPerformed(ActionEvent e)
            {
              BooleanTableCellRender source = (BooleanTableCellRender)e.getSource();
             
              if (source.isSelected()){
                updateStateObservers.validate(stateObservers[source.getRow()].stateObserver());
                table_model.setValueAt(!stateObservers[source.getRow()].stateObserver().isInvalid(), source.getRow(), 2);           
              }
             
              refreshColWidth();             
            }
          });
View Full Code Here

          col1.setCellEditor(new CellRender());

          col = colModel.getColumn(3);
          col.setMinWidth(50);
          col.setMaxWidth(60);
          BooleanTableCellRender booleanTableCellRender = new BooleanTableCellRender();

          booleanTableCellRender.addActionListener(new ActionListener()
          {

            @Override
            public void actionPerformed(ActionEvent e)
            {
              BooleanTableCellRender source = (BooleanTableCellRender) e.getSource();

              Pair p = getSelectedEvent(source.getRow());

              if (source.isSelected()) {
                updateEvents.validate(events.elementAt(p.first));
                table_contentModel.setValueAt(!events.elementAt(p.first).isInvalid(), source.getRow(),
                        3);
              }

              refreshColWidth();
            }
View Full Code Here

            table_content.setRowHeight(80);

            col = colModel.getColumn(2);
            col.setMinWidth(50);
            col.setMaxWidth(60);
            BooleanTableCellRender booleanTableCellRender = new BooleanTableCellRender();
            booleanTableCellRender.addActionListener(new ActionListener()
            {

              @Override
              public void actionPerformed(ActionEvent e)
              {
                BooleanTableCellRender source = (BooleanTableCellRender) e.getSource();

                if (source.isSelected()) {
                  if (source.getRow() >= classesCount && enumsCount > 0) {
                    updateInputCD.validate(enums[source.getRow() - classesCount]);
                    table_contentModel.setValueAt(!enums[source.getRow() - classesCount].isInvalid(), source.getRow(), 2);
                  } else {
                    updateInputCD.validate(classes[source.getRow()]);
                    table_contentModel.setValueAt(!classes[source.getRow()].isInvalid(), source.getRow(), 2);
                  }
                }
               
                refreshColWidth();
              }
View Full Code Here

TOP

Related Classes of easysm.boundaries.components.utils.BooleanTableCellRender

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.