Package fr.soleil.bean.samplesbean.model

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


    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));
            }
            else {
                DefaultMutableTreeTableNode currentNode = new DefaultMutableTreeTableNode(cell);
                aRoot.add(currentNode);

                Map<CellPosition, SubCell> positionChildrenMap = cell.getChildrenMap();
                Set<CellPosition> positions = positionChildrenMap.keySet();
                List<CellPosition> orderedPositions = new ArrayList<CellPosition>(positions);
                Collections.sort(orderedPositions);

                for (Iterator<CellPosition> iterator2 = orderedPositions.iterator(); iterator2
View Full Code Here


    public Object getValueAt(Object node, int column) {
        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;
View Full Code Here

    @Override
    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;
View Full Code Here

  @Override
  public void actionPerformed(ActionEvent e) {
    super.actionPerformed(e);
    if (userObject instanceof Cell) {
      Cell cell = (Cell) userObject;
      if (cell != null) {
        cell.addChildren(cellPosition, cell.getSample());
        cell.initSample();
      }
    }

  }
View Full Code Here

    super.isEnabled();
    result = false;
    if (userObject instanceof SubCell) {
      // DO NOTHING
    } else if (userObject instanceof Cell) {
      Cell cell = (Cell) userObject;
      if (cell != null) {
        result = !cell.hasChildrenAt(cellPosition);
      }
    }
    return result;
  }
View Full Code Here

  @Override
  public void actionPerformed(ActionEvent e) {
    super.actionPerformed(e);
    if (userObject instanceof Cell) {
      Cell cell = (Cell) userObject;
      if (!cell.hasChildren()) {
        cell.initSample();
        treeTableModel.firePathChanged(treePath);
      }
    }
    if (userObject instanceof SubCell) {
      SubCell subCell = (SubCell) userObject;
View Full Code Here

  @Override
  public boolean isEnabled() {
    super.isEnabled();
    result = true;
    if (userObject instanceof Cell) {
      Cell cell = (Cell) userObject;
      if (cell.hasChildren() || cell.getSample().getSampleName() == null) {
        result = false;
      }
    }
    if (userObject instanceof SubCell) {
      SubCell subCell = (SubCell) userObject;
View Full Code Here

            Map<String, Double> positions = new HashMap<String, Double>();
            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

    public boolean isEnabled() {
        super.isEnabled();
        result = true;
        if (userObject instanceof Cell) {
            Cell cell = (Cell) userObject;
            if (cell.hasChildren()) {
                result = false;
            }
        }
        return result;
    }
View Full Code Here

    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

TOP

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

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.