Package fr.soleil.salsa.client.util

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


    }

    @Override
    public void setDelta(int trajectoryPosition, int rangePosition, String delta, boolean saved) {
        EnergyTrajectoryLine line = getEnergyTrajectoryLine(rangePosition, saved);
        if (line != null) {
            if (!saved) {
                try {
                    double value = Double.valueOf(delta);
                    line.setDelta(value);

                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else {
                line.getDelta().setDbValue(delta);
            }
        }
        refresh();

    }
View Full Code Here


    }

    @Override
    public void setDeltaconstant(int trajectoryPosition, int rangePosition, Boolean deltaConstant) {
        // new Exception("setDeltaconstant=" + deltaConstant).printStackTrace();
        EnergyTrajectoryLine line = getEnergyTrajectoryLine(rangePosition, false);
        if (line != null) {
            line.setDeltaConstant(deltaConstant);
        }
        refresh();
    }
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;
                        case 6: // integration time
                            Boolean deltaConstant = (Boolean) tmpTableModel.getValueAt(row, column);
                            energyTrajectoryLine.setDeltaConstant(deltaConstant);
                            if (controller != null) {
                                controller.notifyDeltaConstant(deltaConstant, 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());
                energyTrajectoryLine.setDeltaConstant(trajectoryEnergy.isDeltaConstant());
                energyTrajectoryLines.add(energyTrajectoryLine);
            }
        }
        else {
            energyTrajectoryLines = null;
View Full Code Here

        if (config != null) {
            List<IRangeEnergy> rangesList = config.getDimensionEnergy().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

                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

            @Override
            public Object getValueAt(int row, int col) {
                // System.out.println("getValueAt=" + row + col);
                Object value = null;
                EnergyTrajectoryLine line = getEnergyTrajectoryLine(row);
                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) {
        EnergyTrajectoryLine line = energyTrajectoryLines.get(position);
        if (line == null) {
            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);
        if (line != null) {
            if (!saved) {
                try {
                    double value = Double.valueOf(integrationTime);
                    line.setIntegrationTime(value);
                }
                catch (Exception e) {
                }
            }
            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);
        if (line != null) {
            if (!saved) {
                try {
                    int value = Integer.valueOf(stepNumber);
                    line.setStepNumber(value);
                }
                catch (Exception e) {
                }
            }
            else {
                line.getStepNumber().setDbValue(stepNumber);
            }
        }
        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.