Package fr.soleil.salsa.client.util

Examples of fr.soleil.salsa.client.util.EnergyTrajectoryLine


                int column = tme.getColumn();

                if (tme.getType() == TableModelEvent.UPDATE) {

                    ModelTableList tmpTableModel = (ModelTableList) tme.getSource();
                    EnergyTrajectoryLine energyTrajectoryLine = energyTrajectoryLines.get(row);

                    switch (column) {
                        case 1: // start energy
                            Double startEnergy = (Double) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setBeginPosition(startEnergy);
                            controller.notifyBeginPositionAfterChanged(startEnergy, row);
                            break;
                        case 2: // end energy
                            Double endEnergy = (Double) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setEndPosition(endEnergy);
                            controller.notifyEndPositionAfterChanged(endEnergy, row);
                            break;
                        case 3: // energy step
                            Double energyStep = (Double) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setDelta(energyStep);
                            controller.notifyDeltaAfterChanged(energyStep, row);
                            break;
                        case 4: // step number
                            Integer stepNumber = (Integer) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setStepNumber(stepNumber);
                            controller.notifyStepNumberAfterChanged(stepNumber, row);
                            break;
                        case 5: // integration time
                            Double integrationTime = (Double) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setIntegrationTime(integrationTime);
                            controller.notifyIntegrationTimeAfterChanged(integrationTime, row);
                            break;
                    }
                }
            }
View Full Code Here


                int column = tme.getColumn();

                if (tme.getType() == TableModelEvent.UPDATE) {

                    ModelTableList tmpTableModel = (ModelTableList) tme.getSource();
                    EnergyTrajectoryLine energyTrajectoryLine = energyTrajectoryLines.get(row);

                    switch (column) {
                        case 1: // start energy
                            Double startEnergy = (Double) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setBeginPosition(startEnergy);
                            if (controller != null) {
                                controller.notifyBeginPositionAfterChanged(startEnergy, row);
                            }
                            break;
                        case 2: // end energy
                            Double endEnergy = (Double) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setEndPosition(endEnergy);
                            if (controller != null) {
                                controller.notifyEndPositionAfterChanged(endEnergy, row);
                            }
                            break;
                        case 3: // energy step
                            Double energyStep = (Double) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setDelta(energyStep);
                            if (controller != null) {
                                controller.notifyDeltaAfterChanged(energyStep, row);
                            }
                            break;
                        case 4: // step number
                            Integer stepNumber = (Integer) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setStepNumber(stepNumber);
                            if (controller != null) {
                                controller.notifyStepNumberAfterChanged(stepNumber, row);
                            }
                            break;
                        case 5: // integration time
                            Double integrationTime = (Double) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setIntegrationTime(integrationTime);
                            if (controller != null) {
                                controller.notifyIntegrationTimeAfterChanged(integrationTime, row);
                            }
                            break;
                    }
View Full Code Here

        if (config != null) {
            List<IRangeEnergy> rangesList = config.getDimensionX().getRangesEnergyList();
            ITrajectoryEnergy trajectoryEnergy;
            energyTrajectoryLines = new ArrayList<EnergyTrajectoryLine>();
            EnergyTrajectoryLine energyTrajectoryLine;
            int row = 0;
            for (IRangeEnergy rangeEnergy : rangesList) {
                trajectoryEnergy = (ITrajectoryEnergy) rangeEnergy.getTrajectoriesList().get(0);
                energyTrajectoryLine = new EnergyTrajectoryLine();
                energyTrajectoryLine.setRange(++row);
                energyTrajectoryLine.setBeginPosition(trajectoryEnergy.getBeginPosition());
                energyTrajectoryLine.setDelta(trajectoryEnergy.getDelta());
                energyTrajectoryLine.setEndPosition(trajectoryEnergy.getEndPosition());
                energyTrajectoryLine.setIntegrationTime(rangeEnergy.getIntegrationTime());
                energyTrajectoryLine.setStepNumber(rangeEnergy.getStepsNumber());
                energyTrajectoryLines.add(energyTrajectoryLine);
            }
        }
        else {
            energyTrajectoryLines = null;
View Full Code Here

        if (config != null) {
            List<IRangeEnergy> rangesList = config.getDimensionX().getRangesEnergyList();
            ITrajectoryEnergy trajectoryEnergy;
            energyTrajectoryLines = new ArrayList<EnergyTrajectoryLine>();
            EnergyTrajectoryLine energyTrajectoryLine;
            int row = 0;
            for (IRangeEnergy rangeEnergy : rangesList) {
                trajectoryEnergy = (ITrajectoryEnergy) rangeEnergy.getTrajectoriesList().get(0);
                energyTrajectoryLine = new EnergyTrajectoryLine();
                energyTrajectoryLine.setRange(++row);
                energyTrajectoryLine.setBeginPosition(trajectoryEnergy.getBeginPosition());
                energyTrajectoryLine.setDelta(trajectoryEnergy.getDelta());
                energyTrajectoryLine.setEndPosition(trajectoryEnergy.getEndPosition());
                energyTrajectoryLine.setIntegrationTime(rangeEnergy.getIntegrationTime());
                energyTrajectoryLine.setStepNumber(rangeEnergy.getStepsNumber());
                energyTrajectoryLines.add(energyTrajectoryLine);
            }
        }
        else {
            energyTrajectoryLines = null;
View Full Code Here

            @Override
            public Object getValueAt(int row, int col) {
                // System.out.println("getValueAt=" + row + col);
                Object value = null;
                EnergyTrajectoryLine line = getEnergyTrajectoryLine(row, false);
                if (line != null) {
                    switch (col) {
                    case 0: // start energy
                        value = line.getRange().toString();
                        break;
                    case 1: // start energy
                        value = line.getBeginPosition();
                        break;
                    case 2: // end energy
                        value = line.getEndPosition();
                        break;
                    case 3: // energy step
                        value = line.getDelta();
                        break;
                    case 4: // step number
                        value = line.getStepNumber();
                        break;
                    case 5: // integration time
                        value = line.getIntegrationTime();
                        break;
                    case 6: // delta constant
                        value = line.getDeltaConstant();
                        break;
                    }
                }
                return value;
            }
View Full Code Here

    /**
     * Gets the energy trajectory lines. The view is a table, each line is a
     * trajectory.
     */
    private EnergyTrajectoryLine getEnergyTrajectoryLine(int position, boolean saved) {
        EnergyTrajectoryLine line = energyTrajectoryLines.get(position);
        if (line == null && !saved) {
            line = new EnergyTrajectoryLine();
            line.setRange(position);
            energyTrajectoryLines.put(position, line);
        }
        return line;
    }
View Full Code Here

        getDeleteButton().setEnabled(enabled);
    }

    @Override
    public void setIntegrationTime(int rangePosition, String integrationTime, boolean saved) {
        EnergyTrajectoryLine line = getEnergyTrajectoryLine(rangePosition, saved);
        if (line != null) {
            if (!saved) {
                try {
                    double value = Double.valueOf(integrationTime);
                    line.setIntegrationTime(value);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else {
                line.getIntegrationTime().setDbValue(integrationTime);
            }
        }
        refresh();
    }
View Full Code Here

        refresh();
    }

    @Override
    public void setStepNumber(int rangePosition, String stepNumber, boolean saved) {
        EnergyTrajectoryLine line = getEnergyTrajectoryLine(rangePosition, saved);
        if (line != null) {
            if (!saved) {
                try {
                    int value = Integer.valueOf(stepNumber);
                    line.setStepNumber(value);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else {
                line.getStepNumber().setDbValue(stepNumber);
            }
        }
        refresh();

    }
View Full Code Here

    }

    @Override
    public void setBeginPosition(int trajectoryPosition, int rangePosition, String beginPosition, boolean saved) {

        EnergyTrajectoryLine line = getEnergyTrajectoryLine(rangePosition, saved);
        if (line != null) {
            if (!saved) {
                try {
                    double value = Double.valueOf(beginPosition);
                    line.setBeginPosition(value);

                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else {
                line.getBeginPosition().setDbValue(beginPosition);
            }
        }
        refresh();

    }
View Full Code Here

    }

    @Override
    public void setEndPosition(int trajectoryPosition, int rangePosition, String endPosition, boolean saved) {
        EnergyTrajectoryLine line = getEnergyTrajectoryLine(rangePosition, saved);
        if (line != null) {
            if (!saved) {
                try {
                    double value = Double.valueOf(endPosition);
                    line.setEndPosition(value);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else {
                line.getEndPosition().setDbValue(endPosition);
            }
        }
        refresh();

    }
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.client.util.EnergyTrajectoryLine

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.