Package Core

Examples of Core.Data


     * @throws FileNotFoundException if the selected file deos not exist
     * @throws IOException if there is an error reading the file
     */
    public WSSReader(File inFile) throws FileNotFoundException, IOException {
        oin = new ObjectInputStream(new FileInputStream(inFile));
        data = new Data();
        result = new Result();
        try {
            data = (Data) oin.readObject();
           
        } catch (ClassNotFoundException ex) {
View Full Code Here


       }

   }
   @Override
    public Data readData() {
       Data data = new Data();
       //readFirstLine();
       Cell[] rowElement = sheet.getRow(0);
       data.setNumOfElements((int) Double.parseDouble(rowElement[0].getContents()));
       data.setPileLength(Double.parseDouble(rowElement[1].getContents()));
       data.setEI(Double.parseDouble(rowElement[2].getContents()));
       data.setPileDiameter(Double.parseDouble(rowElement[3].getContents()));
       data.setNumOfPiles((int)Double.parseDouble(rowElement[4].getContents()));
       data.setPoissonRation(Double.parseDouble(rowElement[5].getContents()));
       data.setIterationNumber(Integer.parseInt(rowElement[6].getContents()));

       int numOfPileElements = data.getNumOfElements();
       //readPileNodeCoordinates();
       rowElement = sheet.getRow(1);
       for(int cellCounter=0;cellCounter<=numOfPileElements;cellCounter++){
           double cellValue = Double.parseDouble(rowElement[cellCounter].getContents());
           data.addPileNodeCoordinate(cellValue);
       }

       //readModOfSubgradeReaction();
       rowElement = sheet.getRow(2);
       for(int cellCounter=0;cellCounter<=numOfPileElements;cellCounter++){
           double cellValue = Double.parseDouble(rowElement[cellCounter].getContents());
           data.addModOfSubgradeReaction(cellValue);
       }
       //readLateralSoilMovement();
       rowElement = sheet.getRow(3);
       for(int cellCounter=0;cellCounter<=numOfPileElements;cellCounter++){
           double cellValue = Double.parseDouble(rowElement[cellCounter].getContents());
           data.addLateralSoilMovement(cellValue);
       }

       //readLimitSoilPressure();
       rowElement = sheet.getRow(4);
       for(int cellCounter=0;cellCounter<=numOfPileElements;cellCounter++){
            double cellValue = Double.parseDouble(rowElement[cellCounter].getContents());
            data.addLimitSoilPressure(cellValue);
        }
       //readPileCoordinates();
       rowElement = sheet.getRow(1);
       int numOfPiles = data.getNumOfPiles();
       for(int i=1;i<=numOfPiles;i++){
           int xCoIndex = i*2-2;
           int yCoIndex = xCoIndex+1;
           double xCo = Double.parseDouble(rowElement[xCoIndex].getContents());
           double yCo = Double.parseDouble(rowElement[yCoIndex].getContents());
           data.addPileCoordinates(xCo, yCo);
        }

       return data;
    }
View Full Code Here

      br.close();
    }

    @Override
    public Data readData() {
        Data toBeSent=null;
        List fileLines = null;
        String[] firstLine;
        String[] pileNodeCoLine;
        String[] ModOfSubReactionLine;
        String[] lateralSoilMovementLine;
        String[] limitSoilPressureLine;
        String[] pileCoLine;
        while(true){
            try {
                 fileLines= readAll();
            } catch (IOException ex) {
                Logger.getLogger(CSVReader.class.getName()).log(Level.SEVERE, null, ex);
                toBeSent = null;
                break;
            }
            try{
                firstLine = (String[]) fileLines.get(0);
                pileNodeCoLine = (String[]) fileLines.get(1);
                ModOfSubReactionLine = (String[])fileLines.get(2);
                lateralSoilMovementLine = (String[]) fileLines.get(3);
                limitSoilPressureLine = (String[]) fileLines.get(4);
                pileCoLine = (String[])fileLines.get(5);
            }catch(IndexOutOfBoundsException ex){
                toBeSent = null;
                break;
            }

            int numOfElements = Integer.parseInt(firstLine[0]);
            double pileLength = Double.parseDouble(firstLine[1]);
            double EI = Double.parseDouble(firstLine[2]);
            double pileDiameter = Double.parseDouble(firstLine[3]);
            int noOfPiles = Integer.parseInt(firstLine[4]);
            double poissonRation = Double.parseDouble(firstLine[5]);
            int iterationNo = Integer.parseInt(firstLine[6]);

            toBeSent = new Data();

            toBeSent.setNumOfElements(numOfElements);
            toBeSent.setPileLength(pileLength);
            toBeSent.setEI(EI);
            toBeSent.setPileDiameter(pileDiameter);
            toBeSent.setNumOfPiles(noOfPiles);
            toBeSent.setPoissonRation(poissonRation);
            toBeSent.setIterationNumber(iterationNo);

            for(int elNo=0;elNo<=numOfElements;elNo++){
                double tmpPileNodeCo = 0;
                tmpPileNodeCo = Double.parseDouble(pileNodeCoLine[elNo]);
                toBeSent.addPileNodeCoordinate(tmpPileNodeCo);
            }
            for(int elNo=0;elNo<=numOfElements;elNo++){
                double tmpModOfSubReaction = 0;
                tmpModOfSubReaction = Double.parseDouble(ModOfSubReactionLine[elNo]);
                toBeSent.addModOfSubgradeReaction(tmpModOfSubReaction);
            }
            for(int elNo=0;elNo<=numOfElements;elNo++){
                double tmpLateralSoilMovement = 0;
                tmpLateralSoilMovement = Double.parseDouble(lateralSoilMovementLine[elNo]);
                toBeSent.addLateralSoilMovement(tmpLateralSoilMovement);
            }
            for(int elNo=0;elNo<=numOfElements;elNo++){
                double tmplimitSoilPressure = 0;
                tmplimitSoilPressure = Double.parseDouble(limitSoilPressureLine[elNo]);
                toBeSent.addLimitSoilPressure(tmplimitSoilPressure);
            }

            for(int elNo=0;elNo<=noOfPiles;elNo++){
                double tmpPileCo = 0;
                tmpPileCo  = Double.parseDouble(pileCoLine[elNo]);
                toBeSent.addPileNodeCoordinate(tmpPileCo);
            }
            break;
        }

View Full Code Here

    }//GEN-LAST:event_aboutBtnActionPerformed

    private void enterDataBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enterDataBtnActionPerformed
        if (data == null) {
            data = new Data();
        }
        dataInputWizard.setData(data);
        dataInputWizard.getDataTabPane().setSelectedIndex(0);
        dataInputWizard.setVisible(true);
    }//GEN-LAST:event_enterDataBtnActionPerformed
View Full Code Here

    private void pileNodesDataRdBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pileNodesDataRdBtnActionPerformed


        if (data == null) {
            data = new Data();
        }
        dataInputWizard.setData(data);
        dataPreviewTable.setModel(dataInputWizard.getPileNodesDataTable().getModel());

        dataPreviewTable.repaint();
View Full Code Here

        openStartupWizard();
    }//GEN-LAST:event_projectWizardBtnActionPerformed

    private void enterDataMenuBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enterDataMenuBtnActionPerformed
        if (data == null) {
            data = new Data();
        }
        dataInputWizard.setData(data);
        dataInputWizard.setVisible(true);

    }//GEN-LAST:event_enterDataMenuBtnActionPerformed
View Full Code Here


    }

    private void resetProgram() {
        data = new Data();
        result = new Result();
        //resultManager = new ResultManager(result);
        welcomeWizard = new SelectProjectDlg(this, true);
        dataInputWizard = new DataInputWizard(this, true);
        projectPath = new String("Untitled Project");
View Full Code Here

     * @param modal Determines the modality of the window
     */
    public SelectProjectDlg(mainForm parent, boolean modal) {
        super(parent, modal);
        initComponents();
        data = new Data();
        finishDlg = new FinishDlg(parent, true);
        saveNfinDlg = new SaveAndFinishDlg(parent, true);
        mainForm = parent;
    }
View Full Code Here

        openExistingBrowseBtn.setEnabled(false);
        openExistinLbl.setSelected(false);
    }//GEN-LAST:event_manualEntryLblActionPerformed

    private void nextBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextBtnActionPerformed
        data = new Data();
        DataManager dm = new DataManager(data);

        try {
            if (openExistinLbl.isSelected()) {
View Full Code Here

TOP

Related Classes of Core.Data

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.