Пример #1
0
  // masuda$
  // ChartEventListener
  @Override
  public void propertyChange(PropertyChangeEvent pce) {

    if (tableModel == null) {
      return;
    }

    ChartEventModel evt = (ChartEventModel) pce.getNewValue();

    int sRow = -1;
    long ptPk = evt.getPtPk();
    List<PatientModel> list = tableModel.getDataProvider();

    // minagawa^
    // ChartEventModel.EVENT eventType = evt.getEventType();
    int eventType = evt.getEventType();
    // minagawa$

    switch (eventType) {
      case ChartEventModel.PVT_STATE:
        for (int row = 0; row < list.size(); ++row) {
          PatientModel pm = list.get(row);
          if (ptPk == pm.getId()) {
            sRow = row;
            pm.setOwnerUUID(evt.getOwnerUUID());
            break;
          }
        }
        break;
      case ChartEventModel.PM_MERGE:
        for (int row = 0; row < list.size(); ++row) {
          PatientModel pm = list.get(row);
          if (ptPk == pm.getId()) {
            sRow = row;
            // pm = msg.getPatientModel();
            list.set(row, evt.getPatientModel());
            break;
          }
        }
        break;
      case ChartEventModel.PVT_MERGE:
        for (int row = 0; row < list.size(); ++row) {
          PatientModel pm = list.get(row);
          if (ptPk == pm.getId()) {
            sRow = row;
            // pm = msg.getPatientVisitModel().getPatientModel();
            list.set(row, evt.getPatientVisitModel().getPatientModel());
            break;
          }
        }
        break;
      default:
        break;
    }

    if (sRow != -1) {
      tableModel.fireTableRowsUpdated(sRow, sRow);
    }
  }
Пример #2
0
 private void hideNestedTable(int level) {
   int n = nestedTableList.size();
   for (int i = n - 1; i >= level; i--) {
     NestedTable ntable = nestedTableList.get(i);
     ntable.hide();
   }
 }
 private static AttachingConnector getAttachingConnectorFor(String transport) {
   List acs = Bootstrap.virtualMachineManager().attachingConnectors();
   AttachingConnector ac;
   int i, k = acs.size();
   for (i = 0; i < k; i++)
     if ((ac = (AttachingConnector) acs.get(i)).transport().name().equals(transport)) return ac;
   return null;
 }
Пример #4
0
  protected void control(List nodes) {
    if (nodes.size() <= 1) return;

    Collections.sort(nodes, new YComparator());

    //		double d = Y_max - Y_min;
    //		d = d / (nodes.size() - 1);

    // Note: X, Y are at node centers
    for (int i = 1; i < nodes.size(); i++) {
      ((NodeView) nodes.get(i))
          .setYPosition(
              ((NodeView) nodes.get(i - 1)).getYPosition()
                  + ((NodeView) nodes.get(i - 1)).getHeight() * 0.5
                  + ((NodeView) nodes.get(i)).getHeight() * 0.5);
      ((NodeView) nodes.get(i)).setXPosition(((NodeView) nodes.get(i - 1)).getXPosition());
    }
  }
Пример #5
0
  public void showColorButtons() {

    Color colors[] = {Color.RED, Color.BLACK, Color.WHITE, Color.GREEN, Color.YELLOW, Color.BLUE};
    Insets in = this.getInsets();

    this.input = new JTextField();
    this.add(this.input);
    this.input.setBounds(100 + in.left, 36 + in.top, 200, 30);

    int arrayAmount = numberOfPlayersButtons.size();

    for (int i = 0; i < numberOfPlayersButtons.size(); i++) {

      this.remove(numberOfPlayersButtons.get(i));
    }

    numberOfPlayersButtons = null;

    arrayAmount = this.maxPlayersAmount;

    for (int i = 0; i < arrayAmount; i++) {

      JButton tempButton = new JButton();
      colorButtons.add(tempButton);

      tempButton.setBackground(colors[i]);
      tempButton.setBorderPainted(false);
      tempButton.setOpaque(true);
      tempButton.setBounds(65 + i * 45 + in.left, 81 + in.top, 25, 25);
      tempButton.addActionListener(this.listener);

      this.add(tempButton);
    }

    Dimension size;

    size = label.getPreferredSize();
    label.setBounds(65, 5 + in.top, size.width + 48, size.height);

    label.setText("Jogador 1, informe a sua cor e o seu nome:");
    this.repaint();
  }
 @Override
 protected void doOKAction() {
   final String errorString = myComponent.canCreateAllFilesForAllLocales();
   if (errorString != null) {
     Messages.showErrorDialog(getContentPanel(), errorString);
   } else {
     final List<PsiFile> createFiles = myComponent.createPropertiesFiles();
     myCreatedFiles = createFiles.toArray(new PsiElement[createFiles.size()]);
     super.doOKAction();
   }
 }
Пример #7
0
  private NestedTable setNestedTable(int level, Structure s) {
    NestedTable ntable;
    if (nestedTableList.size() < level + 1) {
      ntable = new NestedTable(level);
      nestedTableList.add(ntable);

    } else {
      ntable = nestedTableList.get(level);
    }

    if (s != null) // variables inside of records
    ntable.table.setBeans(getStructureVariables(s));

    ntable.show();
    return ntable;
  }
Пример #8
0
  private void setSelected(Variable v) {
    eventsOK = false;

    List<Variable> vchain = new ArrayList<Variable>();
    vchain.add(v);

    Variable vp = v;
    while (vp.isMemberOfStructure()) {
      vp = vp.getParentStructure();
      vchain.add(0, vp); // reverse
    }

    for (int i = 0; i < vchain.size(); i++) {
      vp = vchain.get(i);
      NestedTable ntable = setNestedTable(i, vp.getParentStructure());
      ntable.setSelected(vp);
    }

    eventsOK = true;
  }
Пример #9
0
  /** 年齢表示をオンオフする。 */
  public void switchAgeDisplay() {
    // masuda^
    if (view.getTable() == null) {
      return;
    }

    ageDisplay = !ageDisplay;
    Project.setBoolean(KEY_AGE_DISPLAY, ageDisplay);
    String method = ageDisplay ? AGE_METHOD[0] : AGE_METHOD[1];
    ListTableModel tModel = getTableModel();
    tModel.setProperty(method, ageColumn);

    List<ColumnSpec> columnSpecs = columnHelper.getColumnSpecs();
    for (int i = 0; i < columnSpecs.size(); i++) {
      ColumnSpec cs = columnSpecs.get(i);
      String test = cs.getMethod();
      if (test.toLowerCase().endsWith("birthday")) {
        cs.setMethod(method);
        break;
      }
    }
    // masuda$
  }
Пример #10
0
  /** GUI コンポーネントを初期化する。 */
  private void initComponents() {

    // View
    view = new PatientSearchView();
    setUI(view);

    // ColumnSpecHelperにテーブルを設定する
    columnHelper.setTable(view.getTable());

    // ------------------------------------------
    // View のテーブルモデルを置き換える
    // ------------------------------------------
    String[] columnNames = columnHelper.getTableModelColumnNames();
    String[] methods = columnHelper.getTableModelColumnMethods();
    Class[] cls = columnHelper.getTableModelColumnClasses();

    tableModel =
        new ListTableModel<PatientModel>(columnNames, 0, methods, cls) {

          @Override
          public Object getValueAt(int row, int col) {

            Object ret = null;

            if (col == ageColumn && ageDisplay) {

              PatientModel p = getObject(row);

              if (p != null) {
                int showMonth = Project.getInt("ageToNeedMonth", 6);
                ret = AgeCalculater.getAgeAndBirthday(p.getBirthday(), showMonth);
              }
            } else {

              ret = super.getValueAt(row, col);
            }

            return ret;
          }
        };
    view.getTable().setModel(tableModel);

    // masuda^   table sorter 組み込み
    sorter = new ListTableSorter(tableModel);
    view.getTable().setModel(sorter);
    sorter.setTableHeader(view.getTable().getTableHeader());
    // masuda$
    // カラム幅更新
    columnHelper.updateColumnWidth();
    // minagawa^ lsctest
    view.getTable().getColumnModel().getColumn(stateColumn).setIdentifier(COLUMN_IDENTIFIER_STATE);
    // minagawa$

    // masuda^
    // レンダラを設定する
    // view.getTable().setDefaultRenderer(Object.class, new OddEvenRowRenderer());
    // 連ドラ、梅ちゃん先生
    PatientListTableRenderer renderer = new PatientListTableRenderer();
    renderer.setTable(view.getTable());
    renderer.setDefaultRenderer();
    // masuda$

    // ソートアイテム
    sortItem = Project.getInt("sortItem", 0);
    // s.oh^ 2014/08/13 コントロールサイズ調整
    String nimbus = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
    String laf = UIManager.getLookAndFeel().getClass().getName();
    if (!laf.equals(nimbus)) {
      view.getSortItem().setPreferredSize(new Dimension(90, 20));
    }
    // s.oh$
    view.getSortItem().setSelectedIndex(sortItem);

    // Auto IME Windows の時のみ
    if (!ClientContext.isMac()) {
      // デフォルトは true
      boolean autoIme = Project.getBoolean("autoIme", true);
      view.getAutoIme().setSelected(autoIme);
    } else {
      // MAC は disabled
      // view.getAutoIme().setEnabled(false);
      view.getAutoIme().setVisible(false);
    }

    // 行高
    if (ClientContext.isWin()) {
      view.getTable().setRowHeight(ClientContext.getMoreHigherRowHeight());
    } else {
      view.getTable().setRowHeight(ClientContext.getHigherRowHeight());
    }

    String method = ageDisplay ? AGE_METHOD[0] : AGE_METHOD[1];
    ListTableModel tModel = getTableModel();
    tModel.setProperty(method, ageColumn);
    List<ColumnSpec> columnSpecs = columnHelper.getColumnSpecs();
    for (int i = 0; i < columnSpecs.size(); i++) {
      ColumnSpec cs = columnSpecs.get(i);
      String test = cs.getMethod();
      if (test.toLowerCase().endsWith("birthday")) {
        cs.setMethod(method);
        break;
      }
    }

    //// s.oh^ 2014/10/22 Icon表示
    //        view.getSearchLabel().setIcon(ClientContext.getImageIconArias("icon_search_large"));
    //// s.oh$

    // s.oh^ 2014/04/16 メニュー制御
    view.getTable().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    // s.oh$
  }
 @Override
 public int getRowCount() {
   return journals.size();
 }
 @Override
 public int getSize() {
   return myLocales.size();
 }