Package fr.soleil.salsa.client.util

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


    /**
     * 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

    }

    @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

        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

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.