Package fr.soleil.bean.samplesbean.model

Examples of fr.soleil.bean.samplesbean.model.Sample


    }

    public DefaultMutableTreeTableNode generateTreeTableModel() {
        List<Cell> cellList = rack.getCellList();

        DefaultMutableTreeTableNode aRoot = new DefaultMutableTreeTableNode(new Sample());
        for (Iterator<Cell> iterator = cellList.iterator(); iterator.hasNext();) {
            Cell cell = iterator.next();
            cell.addObserver(this);
            if (!cell.hasChildren()) {
                aRoot.add(new DefaultMutableTreeTableNode(cell));
View Full Code Here


        Object value = null;
        if (node instanceof DefaultMutableTreeTableNode) {
            DefaultMutableTreeTableNode mutableNode = (DefaultMutableTreeTableNode) node;
            if (mutableNode.getUserObject() instanceof Cell) {
                Cell cell = (Cell) mutableNode.getUserObject();
                Sample sample = cell.getSample();
                if (column < FIXED_COLUMN_NUMBER) {
                    switch (column) {
                        case CELL_NUMBER_INDEX:
                            if (cell instanceof SubCell) {
                                value = sample.getCellPosition();
                            } else {
                                value = cell.getNumberCell();
                            }
                            break;
                        case SAMPLE_NAME_INDEX:
                            value = sample;
                            break;
                        case ORDER_INDEX:
                            value = sample.getStringFormattedOrderList();
                            break;
                    }
                } else {
                    value = sample.getFormattedPositionAt(getColumnName(column));
                }
            }
        }
        return value;
    }
View Full Code Here

    public void setValueAt(Object value, Object node, int column) {
        if (node instanceof DefaultMutableTreeTableNode) {
            DefaultMutableTreeTableNode mutableNode = (DefaultMutableTreeTableNode) node;
            if (mutableNode.getUserObject() instanceof Cell) {
                Cell cell = (Cell) mutableNode.getUserObject();
                Sample sample = cell.getSample();
                if (column <= FIXED_COLUMN_NUMBER) {
                    switch (column) {
                        case SAMPLE_NAME_INDEX:
                            sample.setSampleName(value.toString());
                            break;

                        case ORDER_INDEX:
                            String order = value.toString();
                            sample.initOrderList();
                            if (!order.equals("")) {
                                String[] orderTable = order.split(",");
                                if (orderTable != null) {
                                    sample.initOrderList();
                                    for (int i = 0; i < orderTable.length; i++) {
                                        sample.addOrder(Integer.valueOf(orderTable[i]));
                                    }
                                }
                            }
                            break;
                    }
                } else {
                    // Whoohoo ColumnName is ActuatorName
                    // This is not a very strong matching
                    String actuator = getColumnName(column);
                    if (value instanceof Double){
                        Double dblValue = (Double)value;
                        sample.setPosition(actuator,dblValue);
                    }
                }
            }
        }
    }
View Full Code Here

            for (String actuator : actuators) {
                positions.put(actuator, SampleBeanController.getFacadeService().getActuatorPosition(actuator));
            }
            DefaultMutableTreeTableNode cellNode = ((DefaultMutableTreeTableNode) treePath.getLastPathComponent());
            Cell cell = (Cell) cellNode.getUserObject();
            Sample sample = cell.getSample();
            sample.setPositions(positions);
            // NOTIFY TABLE
            treeTableModel.firePathChanged(treePath);
    }
View Full Code Here

    super.actionPerformed(e);
    if (userObject instanceof SubCell) {
      SubCell subCell = (SubCell) userObject;
      if (subCell != null) {
        CellPosition oldPosition = subCell.getPosition();
        Sample sample = subCell.getSample();
        Cell parent = subCell.getParent();
        parent.removeChildrenForMove(oldPosition);
        parent.addChildren(cellPosition, sample);
      }
    } else if (userObject instanceof Cell) {
      Cell cell = (Cell) userObject;
      if (cell != null) {
        Sample sample = cell.getSample();
        cell.initSample();
        cell.addChildren(cellPosition, sample);
      }
    }
  }
View Full Code Here

      SampleBeanController.getFacadeService()
          .cleanCurrentConfiguration();

      for (Iterator<Sample> iterator = sampleSet.iterator(); iterator
          .hasNext();) {
        Sample sample = iterator.next();
        SampleBeanController.getFacadeService().addSample(sample);
      }
                      

    } catch (DevFailed df) {
View Full Code Here

    super(proxy);
  }

        public void cleanCurrentConfiguration(List<Sample> samples) throws DevFailed{
            for (Iterator<Sample> it = samples.iterator(); it.hasNext();) {
                Sample sample = it.next();
                String name = sample.getSampleName();
                DeviceData dd = new DeviceData();
                dd.insert(name);
                proxy.command_inout("RemovePositionFromList",dd);
            }
        }
View Full Code Here

                model.setActuatorsNames(actuators);

               
    List<Sample> listSampleConfiguration = facadeService.getSampleList();
    for (Iterator<Sample> iterator = listSampleConfiguration.iterator(); iterator.hasNext();) {
      Sample sample = (Sample) iterator.next();
      // We substract 1 to make the rackNumber match the rackNumber of the
      // rackTabbedPane.
      int rackNumber = sample.getRackNumber() - 1;
      Rack rack = model.get(rackNumber);
      rack.addSample(sample);
    }
   
  }
View Full Code Here

  public static boolean checkForDuplicatedSampleNames(Collection<Sample> sampleList) {
    boolean result = true;
    List<String> names = new ArrayList<String>();
    for (Iterator<Sample> iterator = sampleList.iterator(); iterator.hasNext();) {
      Sample sample = iterator.next();
      String sampleName = sample.getSampleName();
      if (!names.contains(sampleName)) {
        names.add(sampleName);
      } else {
        result = false;
        break;
View Full Code Here

  public static boolean checkForDuplicatedSampleOrders(Collection<Sample> sampleList) {
    boolean result = true;
    List<Integer> orders = new ArrayList<Integer>();
    for (Iterator<Sample> iterator = sampleList.iterator(); iterator.hasNext();) {
      Sample sample = iterator.next();
      List<Integer> sampleOrders = sample.getOrderList();
      for (Iterator<Integer> iterator2 = sampleOrders.iterator(); iterator2.hasNext();) {
        Integer sampleOrder = iterator2.next();
        if (!orders.contains(sampleOrder)) {
          orders.add(sampleOrder);
        } else {
View Full Code Here

TOP

Related Classes of fr.soleil.bean.samplesbean.model.Sample

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.