Beispiel #1
0
  /**
   * Set the current open DarwinCSV. You should really, really, really setCurrentCSV(null) before
   * you load a new DarwinCSV.
   *
   * @param csv The new DarwinCSV object.
   */
  private void setCurrentCSV(DarwinCSV csv) {
    // Clear the old currentCSV object and matchAgainst object.
    currentCSV = null;
    matchAgainst(null);

    // Load the new currentCSV object.
    currentCSV = csv;
    table.removeAll();
    table.setDefaultRenderer(Name.class, this);

    // Set the currentCSV
    // TODO: This causes an exception occasionally, because we shouldn't
    // be calling setModel outside of the Event Queue thread; however, we're
    // currently in a worker thread, so dipping back into the Event thread
    // would just cause more problems. Sorry!
    if (csv != null) {
      table.setModel(currentCSV.getRowIndex());
    } else {
      table.setModel(blankDataModel);
    }

    columnInfoPanel.loadedFileChanged(csv);
    columnInfoPanel.columnChanged(-1);
    table.repaint();
  }
Beispiel #2
0
  public void setResultSet(DiskResultSet rset) throws Exception {
    set = rset;

    max = rset.getRowCount();

    table.setModel(model);
    table.setModel(this);

    offset = 0;
    scrollBar.setValue(0);
    scrollBar.setMaximum((max < window ? 0 : max - window));
  }
Beispiel #3
0
  private void init(final EncodeTableModel model) {
    setModal(true);
    setTitle("Encode Production Data");

    table.setAutoCreateRowSorter(true);
    table.setModel(model);
    table.setRowSorter(model.getSorter());
    try {
      rowCountLabel.setText(numberFormatter.valueToString(table.getRowCount()) + " rows");
    } catch (ParseException e) {

    }

    table.setRowSelectionAllowed(false);
    table.setColumnSelectionAllowed(false);

    filterTextField
        .getDocument()
        .addDocumentListener(
            new DocumentListener() {
              public void changedUpdate(DocumentEvent e) {
                updateFilter();
              }

              public void insertUpdate(DocumentEvent e) {
                updateFilter();
              }

              public void removeUpdate(DocumentEvent e) {
                updateFilter();
              }
            });
  }
  stab(ResultSet k) {
    super("PATIENT FOUND");
    String[] chd = {
      "Date",
      "Patient ID",
      "Name",
      "Gender",
      "Age",
      "Weight",
      "Address",
      "Contact No.",
      "Doctor Name",
      "Symptoms",
      "Dignosis",
      "Fee: Rs.",
      "Blood Group"
    };
    // DefaultTableModel dtm=new DefaultTableModel();
    // jt.setModel(new DefaultTableModel(arr,chd));
    jt = new JTable();
    jsp = new JScrollPane(jt);
    btn = new JButton("CLOSE");
    btn.addActionListener(this);
    int i = 0;

    try {
      while (k.next()) {

        arr[i][0] = k.getString(1);
        // System.out.println("ddddddddddddd"+arr[i][0]);
        arr[i][1] = "" + k.getInt(2);
        arr[i][2] = k.getString(3) + " " + k.getString(4) + " " + k.getString(5);
        arr[i][3] = k.getString(6);
        arr[i][4] = "" + k.getInt(7);
        arr[i][5] = k.getString(8);
        arr[i][6] = k.getString(9);
        arr[i][7] = k.getString(10);
        arr[i][8] = k.getString(11);
        arr[i][9] = k.getString(12);
        arr[i][10] = k.getString(13);
        arr[i][11] = "" + k.getInt(14);
        arr[i][12] = k.getString(15);
        arr[i][13] = k.getString(16);
        // dtm.insertRow(i,new Object[]{patient.rs.getString(1),
        // patient.rs.getInt(2),patient.rs.getString(3)+patient.rs.getString(4)+patient.rs.getString(5),patient.rs.getString(6),patient.rs.getInt(7),patient.rs.getString(8),patient.rs.getString(9),patient.rs.getString(10),patient.rs.getString(11),patient.rs.getString(12),patient.rs.getString(13),patient.rs.getInt(14)});
        i++;
      }
    } catch (Exception e12) {
      System.out.println("" + e12);
    }
    jt.setModel(new DefaultTableModel(arr, chd));
    Container con = getContentPane();
    con.setLayout(null);
    jsp.setBounds(20, 20, 1230, 600);
    btn.setBounds(685, 630, 100, 30);
    add(jsp);
    add(btn);
    setSize(1330, 800);
    setVisible(true);
  }
Beispiel #5
0
    public void updateActionTableFor(EditorClient client) {

      if (client == null) {
        DefaultTableModel model = new DefaultTableModel();
        tblActions.setModel(getClearTableModel());
        return;
      } else if (currClient == client) {
        DefaultTableModel model = getClearTableModel();

        Iterator i = client.getActions(self).iterator();
        while (i.hasNext()) {
          EditorAction ea = (EditorAction) i.next();
          model.addRow(ea.getTableRow());
        }
        tblActions.setModel(model);
      }
    }
  public void refresh() {
    Message message = new Message();
    try {
      message = this.trainingTeaBLService.showFrameStrategy();

    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    if (message.getMesType().equals(MessageType.traTea_showStrategy_fail)) {
      // JOptionPane.showMessageDialog(this, "整体框架策略尚未发布!");
      jl1.setVisible(true);
      jb2.setEnabled(false);
      if (jsp1 != null) {
        jsp1.setVisible(false);
      }
    } else if (message.getMesType().equals(MessageType.traTea_showStrategy_success)) {
      jl1.setVisible(false);
      ArrayList<Dean> dean = message.getDeans();
      ArrayList<String> attriOfDean = message.getAttriOfDean();
      tm1 = new StrategyTableModel(dean, attriOfDean);
      if (jsp1 != null) {
        jt1.setModel(tm1);
        jsp1.setVisible(true);
      } else {
        jt1 = new JTable();
        jt1.setModel(tm1);

        jsp1 = new JScrollPane(jt1);
        strategy.add(jsp1);
      }

      if (dean.size() >= 15) {
        jb1.setEnabled(false);
      }

      jb2.setEnabled(true);

    } else {
      JOptionPane.showMessageDialog(this, "你的网络貌似有点问题!");
    }
  }
Beispiel #7
0
  public void setTournament(File file, Tournament newTournament) {
    assert newTournament != null;

    this.currentFile = file;
    this.tournament = newTournament;

    rosterModel = new RosterModel(newTournament);
    rosterTable.setModel(rosterModel);

    refresh();
  }
  /** Initial method to populate the insuranceCompaniesTable */
  public void loadTable() {

    Map<Integer, InsuranceCompany> data = model.getInsuranceCompanies();
    tableData = new InsuranceCompanyTableModel(data);
    insuranceCompaniesTable.setModel(tableData);
    insuranceCompaniesTable.getColumnModel().getColumn(0).setMaxWidth(50);
    insuranceCompaniesTable
        .getSelectionModel()
        .setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    // Check if db is empty and proceed with selecting only if the table is populated
    if (insuranceCompaniesTable.getRowCount() > 0) {
      // Set selected company according to selected row on load
      selectRow();
      int selectedCompanyId =
          Integer.valueOf(
              (String)
                  insuranceCompaniesTable.getValueAt(insuranceCompaniesTable.getSelectedRow(), 0));
    }
  }
 private void jbInit() throws Exception {
   panel1.setLayout(borderLayout1);
   okButton.setText("OK");
   okButton.addActionListener(new MimeTypeEditor_okButton_actionAdapter(this));
   filtersTable.setRowSelectionAllowed(true);
   filtersTable.setPreferredSize(new Dimension(418, 200));
   filtersTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
   filtersTable.setCellSelectionEnabled(true);
   filtersTable.setColumnSelectionAllowed(false);
   filtersTable.setModel(m_model);
   addButton.setToolTipText(
       "Add a new " + mimeTypeEditorBuilder.getValueName() + " for a MIME type");
   addButton.setText("Add");
   addButton.addActionListener(new MimeTypeEditor_addButton_actionAdapter(this));
   cancelButton.setText("Cancel");
   cancelButton.addActionListener(new MimeTypeEditor_cancelButton_actionAdapter(this));
   deleteButton.setToolTipText("Delete the currently selected item.");
   deleteButton.setText("Delete");
   deleteButton.addActionListener(new MimeTypeEditor_deleteButton_actionAdapter(this));
   upButton.setText("Up");
   upButton.addActionListener(new MimeTypeEditor_upButton_actionAdapter(this));
   dnButton.setText("Down");
   dnButton.addActionListener(new MimeTypeEditor_dnButton_actionAdapter(this));
   panel1.setPreferredSize(new Dimension(418, 200));
   jScrollPane1.setMinimumSize(new Dimension(200, 80));
   jScrollPane1.setOpaque(true);
   buttonPanel.add(dnButton, null);
   buttonPanel.add(upButton, null);
   buttonPanel.add(addButton, null);
   buttonPanel.add(deleteButton, null);
   buttonPanel.add(okButton, null);
   buttonPanel.add(cancelButton, null);
   getContentPane().add(panel1);
   panel1.add(buttonPanel, BorderLayout.SOUTH);
   panel1.add(jScrollPane1, BorderLayout.CENTER);
   jScrollPane1.getViewport().add(filtersTable, null);
 }
  public ManageSubscriptionForm(Project project) {
    this.project = project;
    final ManageSubscriptionForm form = this;
    this.setTitle("Manage subscriptions");
    this.setModal(true);
    this.setContentPane(mainPanel);

    this.setResizable(false);
    getRootPane().setDefaultButton(okButton);

    final ReadOnlyCellTableModel model = new ReadOnlyCellTableModel();
    model.addColumn("Name");
    model.addColumn("Id");

    subscriptionTable.setModel(model);

    // initialize the popup menu for the "Add Subscription" button
    initSubscriptionMenu();

    addSubscriptionButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent actionEvent) {
            addSubscriptionMenu.pack();
            addSubscriptionMenu.setPopupSize(
                addSubscriptionButton.getWidth(),
                MENU_ITEM_HEIGHT * addSubscriptionMenu.getComponentCount());
            addSubscriptionMenu.show(addSubscriptionButton, 0, addSubscriptionButton.getHeight());
          }
        });

    removeButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent actionEvent) {
            int res =
                JOptionPane.showConfirmDialog(
                    form,
                    "Are you sure you would like to clear all subscriptions?",
                    "Clear Subscriptions",
                    JOptionPane.YES_NO_OPTION,
                    JOptionPane.INFORMATION_MESSAGE);

            if (res == JOptionPane.YES_OPTION) {
              try {
                AzureManager apiManager = AzureRestAPIManager.getManager();
                apiManager.clearAuthenticationTokens();
                apiManager.clearSubscriptions();
                apiManager.setAuthenticationMode(AzureAuthenticationMode.Unknown);
              } catch (AzureCmdException t) {
                UIHelper.showException("Error clearing user subscriptions", t);
              }

              ReadOnlyCellTableModel model = (ReadOnlyCellTableModel) subscriptionTable.getModel();
              while (model.getRowCount() > 0) {
                model.removeRow(0);
              }

              removeButton.setEnabled(false);
            }
          }
        });

    removeButton.setEnabled(false);

    okButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            onOk();
          }
        });

    cancelButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            onCancel();
          }
        });

    // call onCancel() when cross is clicked
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            onCancel();
          }
        });

    ApplicationManager.getApplication()
        .invokeLater(
            new Runnable() {
              @Override
              public void run() {
                loadList();
              }
            });
  }
Beispiel #11
0
  private <T extends Enum<T>> void createControls(JPanel panel, ZrtpConfigureTableModel<T> model) {
    ResourceManagementService resources = NeomediaActivator.getResources();

    final JButton upButton = new JButton(resources.getI18NString("impl.media.configform.UP"));
    upButton.setOpaque(false);

    final JButton downButton = new JButton(resources.getI18NString("impl.media.configform.DOWN"));
    downButton.setOpaque(false);

    Container buttonBar = new TransparentPanel(new GridLayout(0, 1));
    buttonBar.add(upButton);
    buttonBar.add(downButton);

    panel.setBorder(BorderFactory.createEmptyBorder(MARGIN, MARGIN, MARGIN, MARGIN));
    panel.setLayout(new GridBagLayout());

    final JTable table = new JTable(model.getRowCount(), 2);
    table.setShowGrid(false);
    table.setTableHeader(null);
    table.setModel(model);
    // table.setFillsViewportHeight(true); // Since 1.6 only - nicer view

    /*
     * The first column contains the check boxes which enable/disable their
     * associated encodings and it doesn't make sense to make it wider than
     * the check boxes.
     */
    TableColumnModel tableColumnModel = table.getColumnModel();
    TableColumn tableColumn = tableColumnModel.getColumn(0);
    tableColumn.setMaxWidth(tableColumn.getMinWidth() + 5);
    table.doLayout();

    GridBagConstraints constraints = new GridBagConstraints();
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.fill = GridBagConstraints.BOTH;
    constraints.gridwidth = 1;
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.weightx = 1;
    constraints.weighty = 1;
    panel.add(new JScrollPane(table), constraints);

    constraints.anchor = GridBagConstraints.NORTHEAST;
    constraints.fill = GridBagConstraints.NONE;
    constraints.gridwidth = 1;
    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    panel.add(buttonBar, constraints);

    ListSelectionListener tableSelectionListener =
        new ListSelectionListener() {
          @SuppressWarnings("unchecked")
          public void valueChanged(ListSelectionEvent event) {
            if (table.getSelectedRowCount() == 1) {
              int selectedRow = table.getSelectedRow();
              if (selectedRow > -1) {
                ZrtpConfigureTableModel<T> model = (ZrtpConfigureTableModel<T>) table.getModel();
                upButton.setEnabled(selectedRow > 0 && model.checkEnableUp(selectedRow));
                downButton.setEnabled(
                    selectedRow < (table.getRowCount() - 1) && model.checkEnableDown(selectedRow));
                return;
              }
            }
            upButton.setEnabled(false);
            downButton.setEnabled(false);
          }
        };
    table.getSelectionModel().addListSelectionListener(tableSelectionListener);

    TableModelListener tableListener =
        new TableModelListener() {
          @SuppressWarnings("unchecked")
          public void tableChanged(TableModelEvent e) {
            if (table.getSelectedRowCount() == 1) {
              int selectedRow = table.getSelectedRow();
              if (selectedRow > -1) {
                ZrtpConfigureTableModel<T> model = (ZrtpConfigureTableModel<T>) table.getModel();
                upButton.setEnabled(selectedRow > 0 && model.checkEnableUp(selectedRow));
                downButton.setEnabled(
                    selectedRow < (table.getRowCount() - 1) && model.checkEnableDown(selectedRow));
                return;
              }
            }
            upButton.setEnabled(false);
            downButton.setEnabled(false);
          }
        };
    table.getModel().addTableModelListener(tableListener);

    tableSelectionListener.valueChanged(null);

    ActionListener buttonListener =
        new ActionListener() {
          @SuppressWarnings("unchecked")
          public void actionPerformed(ActionEvent event) {
            Object source = event.getSource();
            boolean up;
            if (source == upButton) up = true;
            else if (source == downButton) up = false;
            else return;

            int index =
                ((ZrtpConfigureTableModel<T>) table.getModel())
                    .move(table.getSelectedRow(), up, up);
            table.getSelectionModel().setSelectionInterval(index, index);
          }
        };
    upButton.addActionListener(buttonListener);
    downButton.addActionListener(buttonListener);
  }
Beispiel #12
0
 public void clear() {
   table.setModel(model);
   offset = 0;
   scrollBar.setValue(0);
   scrollBar.setMaximum(0);
 }
Beispiel #13
0
  private void init() throws Exception {
    this.setResizable(true);
    String title = "Edit owners";
    if (propText.size() == 0) {
      title += " (no propositions selected)";
    } else if (propText.size() == 1) {
      title +=
          " of proposition: \""
              + DiagramBase.prepareMessageLabel(
                  (String) propText.elementAt(0), DiagramBase.MAX_MESSAGELABEL_SIZE)
              + "\"";
    } else {
      title += " (" + propText.size() + " propositions selected)";
    }
    this.setTitle(title);
    masterPanel = new SizedPanel(600, 300);
    masterPanel.setLayout(new BorderLayout());
    this.getContentPane().add(masterPanel);
    //    okButton.setActionCommand("okButton");
    okButton.setMnemonic(KeyEvent.VK_C);
    buttonPanel.add(okButton);
    okButton.addActionListener(this);
    masterPanel.add(buttonPanel, BorderLayout.SOUTH);

    TablePanel ownerSourcePanel = new TablePanel(new BorderLayout());

    JPanel topSourcePanel = new JPanel(new BorderLayout());
    topSourcePanel.add(new JLabel("Owner name:", JLabel.LEFT), BorderLayout.NORTH);
    ownerText = new JTextField();
    topSourcePanel.add(ownerText, BorderLayout.CENTER);
    JPanel buttonSourcePanel = new JPanel();
    deleteSourceButton = new JButton("Delete");
    deleteSourceButton.setMnemonic(KeyEvent.VK_D);
    deleteSourceButton.addActionListener(this);
    addOwnerButton = new JButton("Add");
    addOwnerButton.setMnemonic(KeyEvent.VK_A);
    addOwnerButton.addActionListener(this);
    buttonSourcePanel.add(addOwnerButton);
    buttonSourcePanel.add(deleteSourceButton);
    topSourcePanel.add(buttonSourcePanel, BorderLayout.SOUTH);
    ownerSourcePanel.add(topSourcePanel, BorderLayout.SOUTH);

    ownerSourceTable = new JTable();
    ownerSourceScrollPane = new JScrollPane();
    ownerSourceScrollPane.setViewportView(ownerSourceTable);
    ownerSourcePanel.add(new JLabel("Available owners", JLabel.CENTER), BorderLayout.NORTH);
    ownerSourcePanel.add(ownerSourceScrollPane, BorderLayout.CENTER);
    ownerSourceTableModel = new OwnerSourceTableModel(araucaria, ownerSourceTable, this);
    ownerSourceTable.setModel(ownerSourceTableModel);
    ownerSourceTableModel.updateTable(araucaria.getArgument().getOwnerList());
    masterPanel.add(ownerSourcePanel, BorderLayout.WEST);

    TablePanel ownerNodesPanel = new TablePanel(new BorderLayout());
    ownerNodesTable = new JTable();
    ownerNodesScrollPane = new JScrollPane();
    ownerNodesScrollPane.setViewportView(ownerNodesTable);
    ownerNodesPanel.add(
        new JLabel("Owners assigned to proposition(s)", JLabel.CENTER), BorderLayout.NORTH);
    ownerNodesPanel.add(ownerNodesScrollPane, BorderLayout.CENTER);
    ownerNodesTableModel = new OwnerNodesTableModel(araucaria, ownerNodesTable);
    ownerNodesTable.setModel(ownerNodesTableModel);
    ownerNodesTableModel.updateTable(araucaria.getArgument().getSelectedVertexOwners());
    masterPanel.add(ownerNodesPanel, BorderLayout.EAST);

    setupArrows();
    JPanel arrowBox = new JPanel(new GridLayout(3, 1, 10, 10));
    if (propText.size() > 0) {
      arrowBox.add(leftArrow);
      arrowBox.add(rightArrow);
    }
    JPanel arrowPanel = new JPanel();
    arrowPanel.add(arrowBox);
    masterPanel.add(arrowPanel, BorderLayout.CENTER);
  }
  protected void customizeDemoPanel(
      final JTable table, final TableModel tableModel, final JPanel demoPanel) {
    final QuickTableFilterField field =
        new QuickTableFilterField(tableModel) {
          @Override
          public Filter getFilter() {
            String s = getSearchingText();
            if (s != null && s.length() > 0) {
              if (isWildcardEnabled()) {
                s = s.replace("*", "%");
                s = s.replace(".", "_");
              }
              StringBuffer pattern = new StringBuffer();
              if (isFromStart()) {
                pattern.append(s).append("%");
              } else {
                pattern.append("%").append(s).append("%");
              }
              LikeFilter likeFilter = new LikeFilter(pattern.toString());
              likeFilter.setCaseSensitive(isCaseSensitive());
              return likeFilter;
            } else {
              return null;
            }
          }

          @Override
          protected IFilterableTableModel createFilterableTableModel(TableModel tableModel) {
            if (tableModel instanceof IFilterableTableModel) {
              return (IFilterableTableModel) tableModel;
            } else {
              return super.createFilterableTableModel(tableModel);
            }
          }
        };

    final FilterableTableModel filterableTableModel =
        new FilterableTableModel(field.getDisplayTableModel());
    int floatColumnIndex = -1;
    for (int i = 0; i < filterableTableModel.getColumnCount(); i++) {
      if (filterableTableModel.getColumnClass(i) == Float.class) {
        floatColumnIndex = i;
        break;
      }
    }
    final int filterColumnIndex = floatColumnIndex == -1 ? 3 : floatColumnIndex;
    JCheckBox addFilterCheckBox1 = new JCheckBox("Using local filtering");
    final JLabel filterMessage1 = new JLabel();
    addFilterCheckBox1.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
              //                        filterableTableModel.addFilter(1, new LikeFilter("%Meat%"));
              //                        filterableTableModel.addFilter(filterColumnIndex, new
              // GreaterThanFilter(1000f));
              //                        filterableTableModel.addFilter(filterColumnIndex, new
              // BetweenFilter(20f, 60f));
              filterableTableModel.addFilter(
                  filterColumnIndex, new InFilter(new Object[] {45f, 46f, 77f}));
            } else {
              filterableTableModel.clearFilters();
            }
            long start = System.nanoTime();
            filterableTableModel.setFiltersApplied(true);
            long end = System.nanoTime();
            filterMessage1.setText("Taking " + (end - start) / 1000000 + " ms");
          }
        });
    JCheckBox addFilterCheckBox2 = new JCheckBox("Using the database filtering feature");
    final JLabel filterMessage2 = new JLabel();
    addFilterCheckBox2.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            if (tableModel instanceof IFilterableTableModel) {
              if (e.getStateChange() == ItemEvent.SELECTED) {
                //                        tableModel.addFilter(1, new LikeFilter("Meat"));
                //                        tableModel.addFilter(filterColumnIndex, new
                // GreaterThanFilter(1000f));
                //                        tableModel.addFilter(filterColumnIndex, new
                // BetweenFilter(20f, 60f));
                ((IFilterableTableModel) tableModel)
                    .addFilter(filterColumnIndex, new InFilter(new Object[] {45f, 46f, 77f}));
              } else {
                ((IFilterableTableModel) tableModel).clearFilters();
              }
              long start = System.nanoTime();
              ((IFilterableTableModel) tableModel).setFiltersApplied(true);
              long end = System.nanoTime();
              filterMessage2.setText("Taking " + (end - start) / 1000000 + " ms");
            }
          }
        });

    JPanel checkBoxPanel = new JPanel(new GridLayout(2, 2, 0, 0));
    checkBoxPanel.add(addFilterCheckBox1);
    checkBoxPanel.add(addFilterCheckBox2);
    checkBoxPanel.add(filterMessage1);
    checkBoxPanel.add(filterMessage2);

    demoPanel.add(checkBoxPanel, BorderLayout.BEFORE_FIRST_LINE);

    table.setModel(filterableTableModel);
    demoPanel.add(
        JideSwingUtilities.createLabeledComponent(
            new JLabel("QuickTableFilterField (use SQL LIKE):"),
            field,
            BorderLayout.BEFORE_LINE_BEGINS),
        BorderLayout.AFTER_LAST_LINE);
    demoPanel.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder("Demo for DatabaseTableModel"),
            BorderFactory.createEmptyBorder(5, 10, 5, 10)));
  }
  @Override
  public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals("addTask")) {
      taskList.add(new Task("new Task"));
      /// @todo A new created task should be editable right away.
      table.editCellAt(taskList.getRowCount() - 1, 0);
    }
    if (e.getActionCommand().equals("deleteTask") && (table.getSelectedRow() != -1)) {
      taskList.remove(table.getSelectedRow());
    }
    if (e.getActionCommand().equals("cross") && (table.getSelectedRow() != -1)) {
      taskList.get(table.getSelectedRow()).setState(State.crossed);
    }
    if (e.getActionCommand().equals("dismiss") && (table.getSelectedRow() != -1)) {
      taskList.get(table.getSelectedRow()).setState(State.dismissed);
    }
    if (e.getActionCommand().equals("workedOn") && (table.getSelectedRow() != -1)) {
      Task task = taskList.get(table.getSelectedRow());
      task.setState(State.crossed);
      taskList.add(new Task(task.getName()));
    }

    // File handling
    File file = null;
    Writer writer = null;
    JAXBContext context;

    if (e.getActionCommand().equals("save")) {
      Marshaller m = null;
      int returnVal = fileChooser.showSaveDialog(this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        file = fileChooser.getSelectedFile();
        if (!file.getName().endsWith(".xml")) {
          /// @TODO Append automaticly .xml
        }

        try {
          context = JAXBContext.newInstance(TaskList.class);
          m = context.createMarshaller();
          m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
          writer = new FileWriter(file);
          m.marshal(taskList, writer);

        } catch (JAXBException exeption) {
          exeption.printStackTrace();
        } catch (IOException exeption) {
          exeption.printStackTrace();
        } finally {
          try {
            writer.close();
          } catch (Exception exeption) {
          }
        }
      }
    }
    if (e.getActionCommand().equals("open")) {
      Unmarshaller um = null;
      int returnVal = fileChooser.showOpenDialog(this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        file = fileChooser.getSelectedFile();
        // if(!file.getName().endsWith(".xml")){
        /// @TODO Append automaticly .xml
        // }

        try {
          context = JAXBContext.newInstance(TaskList.class);
          um = context.createUnmarshaller();
          taskList = (TaskList) um.unmarshal(file);
          table.setModel(taskList);
          table.getColumnModel().getColumn(0).setCellRenderer(new TaskRenderer());

        } catch (JAXBException exeption) {
          exeption.printStackTrace();

        } finally {
          try {
            writer.close();
          } catch (Exception exeption) {
          }
        }
      }
    }
    taskList.fireTableDataChanged();
  }
Beispiel #16
0
 void jbInit() throws Exception {
   panel1.setLayout(borderLayout1);
   jPanel1.setBorder(BorderFactory.createEtchedBorder());
   jPanel1.setPreferredSize(new Dimension(14, 100));
   jPanel1.setLayout(borderLayout2);
   jPanel2.setBorder(BorderFactory.createEtchedBorder());
   jPanel2.setPreferredSize(new Dimension(10, 40));
   jPanel2.setLayout(gridBagLayout1);
   jLabel2.setText("Oznaka banke:");
   bPronadji.setPreferredSize(new java.awt.Dimension(80, 27));
   bPronadji.setText("Pronadji ");
   bPronadji.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           bPronadji_actionPerformed(e);
         }
       });
   bIzlaz.setPreferredSize(new Dimension(80, 27));
   bIzlaz.setText("Izlaz");
   bIzlaz.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           bIzlaz_actionPerformed(e);
         }
       });
   txtOznakaBanke.setPreferredSize(new Dimension(120, 21));
   getContentPane().add(panel1);
   panel1.add(jPanel1, BorderLayout.NORTH);
   {
     jLabel1 = new JLabel();
     jPanel1.add(jLabel1, BorderLayout.CENTER);
     jLabel1.setText("PREGLED FILIJALA BANKE");
     jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 18));
     jLabel1.setPreferredSize(new java.awt.Dimension(588, 96));
     jLabel1.setHorizontalTextPosition(SwingConstants.CENTER);
     jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
     jLabel1.setVerticalAlignment(SwingConstants.TOP);
     {
       jLabel3 = new JLabel();
       jLabel1.add(jLabel3);
       jLabel3.setText("NAZIV:");
       jLabel3.setBounds(7, 49, 42, 28);
       jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 12));
     }
     {
       jLabel4 = new JLabel();
       jLabel1.add(jLabel4);
       jLabel4.setText("ADRESA:");
       jLabel4.setBounds(280, 49, 63, 28);
       jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 12));
     }
     {
       jLnazivBanke = new JLabel();
       jLabel1.add(jLnazivBanke);
       jLnazivBanke.setBounds(56, 49, 203, 28);
     }
     {
       jLadresaBanke = new JLabel();
       jLabel1.add(jLadresaBanke);
       jLadresaBanke.setBounds(336, 49, 238, 28);
     }
   }
   panel1.add(jPanel2, BorderLayout.SOUTH);
   jPanel2.add(
       jLabel2,
       new GridBagConstraints(
           0,
           0,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.NONE,
           new Insets(0, 0, 0, 0),
           0,
           0));
   jPanel2.add(
       txtOznakaBanke,
       new GridBagConstraints(
           1,
           0,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.WEST,
           GridBagConstraints.NONE,
           new Insets(0, 10, 0, 0),
           0,
           0));
   jPanel2.add(
       bPronadji,
       new GridBagConstraints(
           5,
           0,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.NONE,
           new Insets(0, 10, 0, 0),
           0,
           0));
   jPanel2.add(
       bIzlaz,
       new GridBagConstraints(
           5,
           0,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.NONE,
           new Insets(0, 200, 0, 0),
           0,
           0));
   panel1.add(jScrollPane1, BorderLayout.CENTER);
   jScrollPane1.getViewport().add(tabBanke, null);
   TModelPrijave tMP = new TModelPrijave(tabBanke);
   tabBanke.setModel(tMP);
   ((TModelPrijave) tabBanke.getModel()).initColumns();
 }
  /**
   * Creates, binds and configures the UI components.
   *
   * <p>If possible, the components are created using the BasicComponentFactory, or the Bindings
   * class.
   */
  private void initComponents() {
    // Text Components
    textField =
        BasicComponentFactory.createTextField(
            presentationModel.getModel(ExampleBean.PROPERTYNAME_TEXT));
    textArea =
        BasicComponentFactory.createTextArea(
            presentationModel.getModel(ExampleBean.PROPERTYNAME_TEXT));
    passwordField =
        BasicComponentFactory.createPasswordField(
            presentationModel.getModel(ExampleBean.PROPERTYNAME_TEXT));
    textLabel =
        BasicComponentFactory.createLabel(
            presentationModel.getModel(ExampleBean.PROPERTYNAME_TEXT));

    // Formatted Input
    dateField =
        BasicComponentFactory.createDateField(
            presentationModel.getModel(ExampleBean.PROPERTYNAME_DATE));
    integerField =
        BasicComponentFactory.createIntegerField(
            presentationModel.getModel(ExampleBean.PROPERTYNAME_INT_VALUE));
    longField =
        BasicComponentFactory.createLongField(
            presentationModel.getModel(ExampleBean.PROPERTYNAME_LONG_VALUE));

    // Choice
    ValueModel intChoiceModel = presentationModel.getModel(ExampleBean.PROPERTYNAME_INT_CHOICE);
    leftIntRadio =
        BasicComponentFactory.createRadioButton(intChoiceModel, ExampleBean.LEFT_INTEGER, "Left");
    centerIntRadio =
        BasicComponentFactory.createRadioButton(
            intChoiceModel, ExampleBean.CENTER_INTEGER, "Center");
    rightIntRadio =
        BasicComponentFactory.createRadioButton(intChoiceModel, ExampleBean.RIGHT_INTEGER, "Right");
    alignmentIntCombo =
        BasicComponentFactory.createComboBox(
            new SelectionInList(ExampleBean.INTEGER_CHOICES, intChoiceModel));

    ValueModel objectChoiceModel =
        presentationModel.getModel(ExampleBean.PROPERTYNAME_OBJECT_CHOICE);
    leftObjectRadio =
        BasicComponentFactory.createRadioButton(objectChoiceModel, ExampleBean.LEFT, "Left");
    centerObjectRadio =
        BasicComponentFactory.createRadioButton(objectChoiceModel, ExampleBean.CENTER, "Center");
    rightObjectRadio =
        BasicComponentFactory.createRadioButton(objectChoiceModel, ExampleBean.RIGHT, "Right");
    alignmentObjectCombo =
        BasicComponentFactory.createComboBox(
            new SelectionInList(ExampleBean.OBJECT_CHOICES, objectChoiceModel));

    // Lists
    comboBox =
        BasicComponentFactory.createComboBox(
            presentationModel.getSelectionInList(), TutorialUtils.createAlbumListCellRenderer());

    list =
        BasicComponentFactory.createList(
            presentationModel.getSelectionInList(), TutorialUtils.createAlbumListCellRenderer());

    table = new JTable();
    table.setModel(TutorialUtils.createAlbumTableModel(presentationModel.getSelectionInList()));
    table.setSelectionModel(
        new SingleListSelectionAdapter(
            presentationModel.getSelectionInList().getSelectionIndexHolder()));

    // Misc
    checkBox =
        BasicComponentFactory.createCheckBox(
            presentationModel.getModel(ExampleBean.PROPERTYNAME_BOOLEAN_VALUE), "available");
    colorPreview = new JPanel();
    colorPreview.setBorder(new LineBorder(Color.GRAY));
    updatePreviewPanel();

    ValueModel floatModel = presentationModel.getModel(ExampleBean.PROPERTYNAME_FLOAT_VALUE);
    slider = new JSlider();
    slider.setModel(
        new BoundedRangeAdapter(
            ConverterFactory.createFloatToIntegerConverter(floatModel, 100), 0, 0, 100));
    floatLabel =
        BasicComponentFactory.createLabel(
            ConverterFactory.createStringConverter(floatModel, NumberFormat.getPercentInstance()));
    spinner = new JSpinner();
    spinner.setModel(
        SpinnerAdapterFactory.createNumberAdapter(
            presentationModel.getModel(ExampleBean.PROPERTYNAME_INT_LIMITED),
            0, // defaultValue
            0, // minValue
            100, // maxValue
            5)); // step
  }
  public UnitPersonnelPanel(Unit u) {
    _Unit = u;
    _Model = new PersonnelTableModel(_Unit);
    _Sorter.setTableModel(_Model);
    _PersonnelTable.setModel(_Sorter);
    _Sorter.setTableHeader(_PersonnelTable.getTableHeader());
    _PersonnelTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    _PersonnelTable.setPreferredSize(new Dimension(1000, 600));
    _PersonnelTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    _PersonnelTable.addMouseListener(this);
    _ScrollPane =
        new JScrollPane(
            _PersonnelTable,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    _EditPanel.setBorder(BorderFactory.createEtchedBorder());
    _EditPanel.setLayout(new BoxLayout(_EditPanel, BoxLayout.Y_AXIS));
    _EditPanel.add(
        SwingHelper.GetTextFieldWithAction(
            _NameTextField,
            "Name",
            "Name of the Unit member",
            true,
            "RandomName",
            "Generate a Random Name",
            this));
    _EditPanel.add(
        SwingHelper.GetTextField(_CallsignTextField, "Callsign", "The Person's callsign", true));
    _EditPanel.add(SwingHelper.GetComboBox(_RankCombo, "Rank", "The persons Rank", true));
    _EditPanel.add(
        SwingHelper.GetComboBox(_HomePlanetCombo, "Home Planet", "The persons Home Planet", true));
    _EditPanel.add(
        SwingHelper.GetComboBox(_RatingCombo, "Rating", "The persons experience rating", true));
    _EditPanel.add(
        SwingHelper.GetComboBox(
            _JobTypeCombo, "Job Type", "The job type this person is used for", true));
    _EditPanel.add(
        SwingHelper.GetTextFieldWithAction(
            _AssetAssignmentTextField,
            "Asset Assignment",
            "The Asset this person is assigned to",
            true,
            "AssetAssignment",
            "Set asset assignment for this person",
            this));
    _EditPanel.add(
        SwingHelper.GetTextArea(_NotesTextArea, "Notes", "Notes for this Personnel record", true));

    _AddPersonnelButton.setActionCommand("AddPersonnel");
    _AddPersonnelButton.addActionListener(this);
    _RemovePersonnelButton.setActionCommand("RemovePersonnel");
    _RemovePersonnelButton.addActionListener(this);

    _AssetAssignmentTextField.setEditable(false);

    _ButtonPanel.setLayout(new BorderLayout());
    _ButtonPanel.add(_AddPersonnelButton, BorderLayout.WEST);
    _ButtonPanel.add(_RemovePersonnelButton, BorderLayout.EAST);

    setLayout(new BorderLayout());
    add(_EditPanel, BorderLayout.NORTH);
    add(_ScrollPane, BorderLayout.CENTER);
    add(_ButtonPanel, BorderLayout.SOUTH);

    FillCombos();

    _CurrentPersonnel = null;
    _PreviousPersonnel = null;

    setVisible(true);
  }
Beispiel #19
0
  /**
   * Create a new, empty, not-visible TaxRef window. Really just activates the setup frame and setup
   * memory monitor components, then starts things off.
   */
  public MainFrame() {
    setupMemoryMonitor();

    // Set up the main frame.
    mainFrame = new JFrame(basicTitle);
    mainFrame.setJMenuBar(setupMenuBar());
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    // Set up the JTable.
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.setSelectionBackground(COLOR_SELECTION_BACKGROUND);
    table.setShowGrid(true);

    // Add a blank table model so that the component renders properly on
    // startup.
    table.setModel(blankDataModel);

    // Add a list selection listener so we can tell the matchInfoPanel
    // that a new name was selected.
    table
        .getSelectionModel()
        .addListSelectionListener(
            new ListSelectionListener() {
              @Override
              public void valueChanged(ListSelectionEvent e) {
                if (currentCSV == null) return;

                int row = table.getSelectedRow();
                int column = table.getSelectedColumn();

                columnInfoPanel.columnChanged(column);

                Object o = table.getModel().getValueAt(row, column);
                if (Name.class.isAssignableFrom(o.getClass())) {
                  matchInfoPanel.nameSelected(currentCSV.getRowIndex(), (Name) o, row, column);
                } else {
                  matchInfoPanel.nameSelected(currentCSV.getRowIndex(), null, -1, -1);
                }
              }
            });

    // Set up the left panel (table + matchInfoPanel)
    JPanel leftPanel = new JPanel();

    matchInfoPanel = new MatchInformationPanel(this);
    leftPanel.setLayout(new BorderLayout());
    leftPanel.add(matchInfoPanel, BorderLayout.SOUTH);
    leftPanel.add(new JScrollPane(table));

    // Set up the right panel (columnInfoPanel)
    JPanel rightPanel = new JPanel();

    columnInfoPanel = new ColumnInformationPanel(this);

    progressBar.setStringPainted(true);

    rightPanel.setLayout(new BorderLayout());
    rightPanel.add(columnInfoPanel);
    rightPanel.add(progressBar, BorderLayout.SOUTH);

    // Set up a JSplitPane to split the panels up.
    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, false, leftPanel, rightPanel);
    split.setResizeWeight(1);
    mainFrame.add(split);
    mainFrame.pack();

    // Set up a drop target so we can pick up files
    mainFrame.setDropTarget(
        new DropTarget(
            mainFrame,
            new DropTargetAdapter() {
              @Override
              public void dragEnter(DropTargetDragEvent dtde) {
                // Accept any drags.
                dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
              }

              @Override
              public void dragOver(DropTargetDragEvent dtde) {}

              @Override
              public void dropActionChanged(DropTargetDragEvent dtde) {}

              @Override
              public void dragExit(DropTargetEvent dte) {}

              @Override
              public void drop(DropTargetDropEvent dtde) {
                // Accept a drop as long as its File List.

                if (dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
                  dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);

                  Transferable t = dtde.getTransferable();

                  try {
                    java.util.List<File> files =
                        (java.util.List<File>) t.getTransferData(DataFlavor.javaFileListFlavor);

                    // If we're given multiple files, pick up only the last file and load that.
                    File f = files.get(files.size() - 1);
                    loadFile(f, DarwinCSV.FILE_CSV_DELIMITED);

                  } catch (UnsupportedFlavorException ex) {
                    dtde.dropComplete(false);

                  } catch (IOException ex) {
                    dtde.dropComplete(false);
                  }
                }
              }
            }));
  }
  // ambil data dari database untuk tabel
  public void setDataTabel() {
    // combobox jenis
    JComboBox cbJenis = new JComboBox();
    cbJenis.setModel(new DefaultComboBoxModel(dataJenis.toArray()));

    dataProduk = new ArrayList<Produk>();
    try {
      String qry =
          "SELECT * FROM produk,suplier,jenis,stok_produk WHERE produk.id_jenis = jenis.id_jenis AND produk.id_suplier = suplier.id_suplier AND produk.id_produk=stok_produk.id_produk";
      ResultSet rs = stm.executeQuery(qry);
      while (rs.next()) {
        Produk p = new Produk();
        p.setIdProduk(rs.getInt("id_produk"));
        p.setNamaProduk(rs.getString("nama_produk"));
        p.setJenis(rs.getString("nama_jenis"));
        p.setHarga(rs.getInt("harga"));
        p.setStok(rs.getInt("stok"));
        p.setNamaSuplier(rs.getString("nama_suplier"));

        p.setComboJenis(cbJenis);

        dataProduk.add(p);
      }
    } catch (Exception err) {
      err.printStackTrace();
    }

    model = new TableModelProduk(dataProduk);
    tabel.setModel(model);
    tabel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    class EditProdukListener implements TableModelListener {
      public void tableChanged(TableModelEvent tme) {
        int baris = tme.getFirstRow();
        int kolom = tme.getColumn();

        TableModel model = (TableModel) tme.getSource();
        int id = (Integer) model.getValueAt(baris, 0);

        String query = "";
        switch (kolom) {
          case 1:
            String nama = (String) model.getValueAt(baris, kolom);
            query = "UPDATE produk SET nama_produk='" + nama + "' WHERE id_produk=" + id;
            prosesEdit(query);
            break;
          case 2:
            String jenis = (String) model.getValueAt(baris, kolom);
            try {
              query = "select * from jenis where nama_jenis='" + jenis + "'";
              ResultSet rs = stm.executeQuery(query);
              if (rs.next()) {
                int idJenis = rs.getInt("id_jenis");
                query = "UPDATE produk SET id_jenis=" + idJenis + " WHERE id_produk=" + id;
                prosesEdit(query);
              } else {
                setDataTabel();
                JOptionPane.showMessageDialog(null, "gagal,jenis tidak ada");
              }
            } catch (SQLException SQLerr) {
              SQLerr.printStackTrace();
            }
            break;
          case 3:
            int stok = (Integer) model.getValueAt(baris, kolom);
            query = "UPDATE `stok_produk` SET stok=" + stok + " WHERE id_produk=" + id;
            prosesEdit(query);
            break;
          case 4:
            int harga = (Integer) model.getValueAt(baris, kolom);
            query = "UPDATE produk SET harga=" + harga + " WHERE id_produk=" + id;
            prosesEdit(query);
            break;
          case 5:
            String suplier = (String) model.getValueAt(baris, kolom);
            try {
              query = "SELECT * FROM suplier WHERE nama_suplier='" + suplier + "'";
              ResultSet rs = stm.executeQuery(query);
              if (rs.next()) {
                int idSuplier = rs.getInt("id_suplier");
                query = "UPDATE produk SET id_suplier=" + idSuplier + " WHERE id_produk=" + id;
                prosesEdit(query);
              } else {
                setDataTabel();
                JOptionPane.showMessageDialog(null, "gagal,suplier belum terdaftar");
              }
            } catch (SQLException SQLerr) {
              SQLerr.printStackTrace();
            }
            break;
          default:
            break;
        }
      }

      private void prosesEdit(String query) {
        try {
          int hasil = stm.executeUpdate(query);
          if (hasil == 1) {
            setDataTabel();
            JOptionPane.showMessageDialog(null, "edit berhasil");
          } else {
            JOptionPane.showMessageDialog(null, "gagal");
          }
        } catch (SQLException SQLerr) {
          SQLerr.printStackTrace();
        }
      }
    }
    model.addTableModelListener(new EditProdukListener());
  }
  private void setupTables() throws Exception {

    templateTableModel =
        new ListTableModel<InFacilityLaboItem>(
            TEMPLATE_COL_NAME, START_NUM_ROW, TEMPLATE_COL_METHOD, null) {

          @Override
          public boolean isCellEditable(int row, int column) {
            return false;
          }
        };

    setTableModel =
        new ListTableModel<InFacilityLaboItem>(SET_COL_NAME, START_NUM_ROW, SET_COL_METHOD, null) {
          @Override
          public boolean isCellEditable(int row, int column) {
            if (column == VALUE_COL || column == NORMAL_COL || column == UNIT_COL) {
              return true;
            }
            return false;
          }

          @Override
          public void setValueAt(Object obj, int row, int column) {

            if (column != VALUE_COL && column != NORMAL_COL && column != UNIT_COL) {
              return;
            }
            InFacilityLaboItem item = (InFacilityLaboItem) setTableModel.getObject(row);
            String value = (String) obj;
            value = toHalfNumber(value).trim();
            switch (column) {
              case VALUE_COL:
                item.setItemValue(value);
                break;
              case NORMAL_COL:
                item.setNormalValue(value);
                break;
              case UNIT_COL:
                item.setUnit(value);
                break;
            }
            item.setAbnormalFlg(getAbnormalFlg(item));
          }
        };

    List<InFacilityLaboItem> defaultList = InFacilityLaboTable.createLaboItemList();
    templateTableModel.setDataProvider(defaultList);
    templateTable.setModel(templateTableModel);
    StripeTableCellRenderer renderer = new StripeTableCellRenderer(templateTable);
    renderer.setDefaultRenderer();
    templateTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    templateTable.getTableHeader().setReorderingAllowed(false);
    // 列幅を設定する
    int len = TEMPLATE_COL_NAME.length;
    TableColumn column;
    for (int i = 0; i < len; i++) {
      column = templateTable.getColumnModel().getColumn(i);
      column.setPreferredWidth(TEMPLATE_COL_WIDTH[i]);
    }
    templateTable.setDragEnabled(true);
    InFacilityLaboTransferHandler tHandler = new InFacilityLaboTransferHandler();
    tHandler.setEditable(false);
    templateTable.setTransferHandler(tHandler);

    MasudaDelegater del = MasudaDelegater.getInstance();
    List<InFacilityLaboItem> facilityList = del.getInFacilityLaboItemList();
    setTableModel.setDataProvider(facilityList);
    setTable.setModel(setTableModel);
    renderer = new StripeTableCellRenderer(setTable);
    renderer.setDefaultRenderer();
    setTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    setTable.getTableHeader().setReorderingAllowed(false);
    // 列幅を設定する
    len = SET_COL_NAME.length;
    for (int i = 0; i < len; i++) {
      column = setTable.getColumnModel().getColumn(i);
      column.setPreferredWidth(SET_COL_WIDTH[i]);
    }
    setTable.setDragEnabled(true);
    setTable.setDropMode(DropMode.INSERT_ROWS);
    setTable.setColumnSelectionAllowed(false);
    setTable.setCellSelectionEnabled(true);
    InFacilityLaboTransferHandler sHandler = new InFacilityLaboTransferHandler();
    sHandler.setEditable(true);
    setTable.setTransferHandler(sHandler);
    setTable.addMouseMotionListener(new SetTableMouseMotionListener());
  }