Package realcix20.classes.basic

Examples of realcix20.classes.basic.Row


    private String action;
    private RelationManager relationManager;

    public FirstTimeView() {
        family = (FamilyClass)ClassManager.createClass(110);
        currentRow = new Row(family.getRowType());
        action = "ADD";
        addWindowListener(this);
        initialHeadAndItemComponentExts();
        createRelation();
        setAllComponentValue();
View Full Code Here


    private void setAllComponentValue() {
        Iterator componentExtIter = componentExts.iterator();
        while (componentExtIter.hasNext()) {                   
            ComponentExt componentExt = (ComponentExt)componentExtIter.next();
            Column column = componentExt.getColumn();                   
            Row row = componentExt.getRow();
            JComponent component = componentExt.getComponent();
            if (action.equals("Add")) {
                Vector parameters = relationManager.getParameters_Defvalue(componentExt);
                if (parameters != null) {
                    String sql = relationManager.getSQL_Defvalue(componentExt, parameters);
View Full Code Here

            StringBuffer sb = new StringBuffer(TxtManager.getTxt("INFORMATION.CREATEFAMILY1"));                   
            sb.append(ObjectUtil.findNewCell(currentRow, "FAMILY", "FAMILY").getColumnValue().toString() + " " +
                    TxtManager.getTxt("INFORMATION.CREATEFAMILY2"));
            DialogManager.showMessageDialog(this, sb.toString());
            String lang = ObjectUtil.findNewCell(currentRow, "FAMILY", "LANG").getColumnValue().toString();
            Row superUserRow = UserClass.createSuperUser(currentRow, password, lang);
            UserClass.createMePartner(superUserRow);
            LedgerClass.updateAllLDsRUSER((String)ObjectUtil.findNewCell(currentRow, "FAMILY", "FAMILY").getColumnValue());
            sb = new StringBuffer(TxtManager.getTxt("INFORMATION.CREATESUPERUSER1"));
            sb.append(ObjectUtil.findNewCell(currentRow, "FAMILY", "FAMILY").getColumnValue().toString() + " " +
                    TxtManager.getTxt("INFORMATION.CREATESUPERUSER2"));
View Full Code Here

   
    private void analyType() {
       
            MainView container = (MainView)window;
            String type = cixFile.getData().getType();
            Row row = cixFile.getData().getRow(cixFile.getPublicKey());
            //receive other person's request
            if (type.equals("Confirm Add Account")) {
               
                JTree tree = container.getTree();
                for (int i = 1; i <= tree.getRowCount(); i++) {
View Full Code Here

                    try {
                        String type = "Confirm Add Account";
                        Iterator rowIter = getRow().getRowSet().getRows().iterator();
                        Cell pCell = findCell(getRow(), "P", "DEFPA");
                        while (rowIter.hasNext()) {
                            Row childRow = (Row)rowIter.next();                           
                            Cell cCell = findCell(childRow, "PA", "PA");
                            if ( (childRow != getRow()) && (cCell.getColumnValue().equals(pCell.getColumnValue())) ) {
                                CIXFileData data = new CIXFileData(type, getPrivateKey(), childRow);
                                CIXFile cixFile = new CIXFile(getPublicKey(), data);   
                                Random random = new Random();
                                String fileName = "confirm_add_account_" + random.nextInt(25000);
                                cixFile.exportFile(fileName);          
                                String str = TxtManager.getTxt("PARTNER.IMPORT.ADDPARTNER");
                                str = str.replaceAll("%", fileName);
                                DialogManager.showMessageDialog(getWindow(), str);
                                break;
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                   
                } else if ( (cell != null) && (cell.getColumnValue().equals("ME")) ) {
                   
                    try {
                        KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
                        keyGen.initialize(1024);
                        KeyPair key = keyGen.generateKeyPair();
                       
                        Iterator rowIter = getRow().getRowSet().getRows().iterator();
                        while (rowIter.hasNext()) {
                            Row childRow = (Row)rowIter.next();
                            if (childRow != getRow()) {
                                Cell publicKeyCell = findCell(childRow, "PA", "PUBKEY");
                                Cell privateKeyCell = findCell(childRow, "PA", "PRIKEY");
                                publicKeyCell.setColumnValue(key.getPublic());
                                privateKeyCell.setColumnValue(key.getPrivate());   
                            }
                        }                                          
                       
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                   
                }

            } else if (action.equals("Confirm Add Account Request")) {                              
               
                Cell cell = findCell(getRow(), "P", "NS");
                if ( (cell != null) && (!cell.getColumnValue().equals("ME")) ) {
                   
                    try {                       
                        Iterator rowIter = getRow().getRowSet().getRows().iterator();
                        while (rowIter.hasNext()) {
                            Row childRow = (Row)rowIter.next();
                            if (childRow != getRow()) {
                                Cell publicKeyCell = findCell(childRow, "PA", "PUBKEY");
                                publicKeyCell.setColumnValue(getCixFile().getPublicKey());
                            }
                        }
                       
                        String type = "Re Confirm Add Account";
                        rowIter = getRow().getRowSet().getRows().iterator();                                               
                        Cell pCell = findCell(getRow(), "P", "DEFPA");
                        while (rowIter.hasNext()) {
                            Row childRow = (Row)rowIter.next();                           
                            Cell cCell = findCell(childRow, "PA", "PA");
                            if ( (childRow != getRow()) && (cCell.getColumnValue().equals(pCell.getColumnValue())) ) {
                                CIXFileData data = new CIXFileData(type, getPrivateKey(), childRow);
                                CIXFile cixFile = new CIXFile(getPublicKey(), data);   
                                Random random = new Random();
                                String fileName = "re_confirm_add_account_"+ random.nextInt(25000);                               
                                cixFile.exportFile(fileName);
                                String str = TxtManager.getTxt("PARTNER.IMPORT.CONFIRMADDPARTNER");
                                str = str.replaceAll("%", fileName);
                                DialogManager.showMessageDialog(getWindow(), str);
                               
                                this.cixFile.getData().setType("Used");
                                this.cixFile.exportFile("used_" + getFile().getName().substring(0, getFile().getName().length() - 2));
                                file.delete();
                                break;
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                   
                }
               
            } else if (action.equals("Re Confirm Add Account")) {
               
                MainView container = (MainView)window;
               
                JTree tree = container.getTree();
               
                Row tRow = cixFile.getData().getRow(cixFile.getPublicKey());
                Cell cell1 = findCell(tRow, "P", "NS");
                Cell cell2 = findCell(tRow, "P", "P");
                Cell cell3 = findCell(tRow, "P", "URNS");
                Cell cell4 = findCell(tRow, "P", "URP");
               
                for (int i = 1; i <= tree.getRowCount(); i++) {
                                                        
                    DefaultMutableTreeNode node = (DefaultMutableTreeNode)tree.getPathForRow(i).getLastPathComponent();
                    if (node != null) {
                        ObjectInfo oj = (ObjectInfo)node.getUserObject();
                        //It's partner class
                        if ( (oj.flag.equals("object")) && (oj.clsId == 250) ) {                           
                            tree.setSelectionPath(tree.getPathForRow(i));
                            //This will be updated
                            Iterator rowIter = container.getCurrentObject().getRows().iterator();
                            boolean findRow = false;
                            while (rowIter.hasNext()) {
                               
                                Row cRow = (Row)rowIter.next();        
                                Cell ccell1 = findCell(cRow, "P", "NS");
                                Cell ccell2 = findCell(cRow, "P", "P");   
                               
                                if ( (ccell1.getColumnValue().equals(cell3.getColumnValue())) && (ccell2.getColumnValue().equals(cell4.getColumnValue())) ) {                                   
                                   
                                    findRow = true;
                                    Iterator childRowIter = cRow.getRowSet().getRows().iterator();
                                    while (childRowIter.hasNext()) {
                                        Row childRow = (Row)childRowIter.next();
                                        childRow.setModify(true);
                                        Cell ccell3 = findCell(childRow, "P", "URNS");
                                        Cell ccell4 = findCell(childRow, "P", "URP");
                                        Cell publicKeyCell = findCell(childRow, "PA", "PUBKEY");
                                        ccell3.setColumnValue(cell1.getColumnValue());
                                        ccell4.setColumnValue(cell2.getColumnValue());
View Full Code Here

    }

    private void addObject() {                           
                       
            //Create a newRow
            Row templateRow = container.getCurrentRow();
            Row newRow = ObjectUtil.cloneRow(container.getObject(), templateRow);           
           
            //modified, set child table's pk = main table's pk values.
            String mainTableName = container.getObject().getMainTableName();
            String childTableName = container.getObject().getChildTableName();
           
            Iterator newCellIter = newRow.getNewCells().iterator();
            Iterator oldCellIter = newRow.getOldCells().iterator();
            try {
                Cell newCell = (Cell)newCellIter.next();
                Cell oldCell = (Cell)oldCellIter.next();
                if (newCell.getTableName().equals(childTableName)) {
                    newCell.setColumnValue(null);
View Full Code Here

                ItemTableModel model = (ItemTableModel)container.getTable().getModel();
                for (int i = 0; i < selectedRows.length; i++) {
                    int selectedRowNumber = container.getTable().convertRowIndexToModel(selectedRows[i]);
                    Vector dataVector = model.getDataVector();
                    Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                    Row selectedRow = (Row)rowDatas.get(rowDatas.size() - 1);
                    selectedRowsVector.add(selectedRow);
                }
                if ( (DialogManager.showYesNoDialog(container, TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                    Iterator rowIter = selectedRowsVector.iterator();
                    while (rowIter.hasNext()) {
                        Row selectedRow = (Row)rowIter.next();
                        selectedRow.setDelete(true);
                    }
                    container.updateTable();
                }
            }
                   
View Full Code Here

            if (selectedRowNumber != -1) {
                ItemTableModel model = (ItemTableModel)container.getTable().getModel();
                selectedRowNumber = container.getTable().convertRowIndexToModel(selectedRowNumber);
                Vector dataVector = model.getDataVector();
                Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                Row selectedRow = (Row)rowDatas.get(rowDatas.size() - 1);                          
               
                Iterator pkColumnIter = container.getObject().getPkColumns().iterator();
                String mainTableName = container.getObject().getMainTableName();
                String childTableName = container.getObject().getChildTableName();
                while (pkColumnIter.hasNext()) {
                    Column pkColumn = (Column)pkColumnIter.next();
                    if (pkColumn.getTableName().equals(mainTableName)) {
                        Cell childPkOldCell = ObjectUtil.findOldCell(selectedRow, childTableName, pkColumn.getColumnName());

                        //found
                        if (childPkOldCell != null) {
                            Cell childPkNewCell = ObjectUtil.findNewCell(selectedRow, childTableName, pkColumn.getColumnName());
                            Cell mainPkNewCell = ObjectUtil.findNewCell(container.getCurrentRow(), mainTableName, pkColumn.getColumnName());
                            childPkOldCell.setColumnValue(mainPkNewCell.getColumnValue());
                            childPkNewCell.setColumnValue(mainPkNewCell.getColumnValue());
                        }
                    }
                }
               
                selectedRow.setModify(true);
                new ItemEdit(container, container.getObject(), selectedRow, "Edit");
                container.setEnabled(false);   
            }
       
    }
View Full Code Here

               
                //make selectedRow 1 as templateRow
                int selectedRowNumber = container.getTable().convertRowIndexToModel(rows[0]);              
                Vector dataVector = model.getDataVector();
                Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                Row templateRow = (Row)rowDatas.get(rowDatas.size() - 1);
               
                //Create a new row
                Row newRow = ObjectUtil.cloneRow(container.getObject(), templateRow);
                Cell oldPrimaryKeyCell = ObjectUtil.findOldCell(newRow, "RI", "RI");
                Cell newPrimaryKeyCell = ObjectUtil.findNewCell(newRow, "RI", "RI");
                oldPrimaryKeyCell.setColumnValue(null);
                newPrimaryKeyCell.setColumnValue(null);
                container.getCurrentRow().getRowSet().getRows().add(newRow);
View Full Code Here

            if (selectedRowNumber != -1) {      
                ItemTableModel model = (ItemTableModel)container.getTable().getModel();
                selectedRowNumber = container.getTable().convertRowIndexToModel(selectedRowNumber);
                Vector dataVector = model.getDataVector();
                Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                Row selectedRow = (Row)rowDatas.get(rowDatas.size() - 1);
                if (((TaxClass)container.getObject()).calculatorTax(selectedRow)) {
                    selectedRow.setModify(true);
                    container.updateTable();
                } else {
                    //DialogManager dialogManager = DialogManager.getInstance();
                    DialogManager.showMessageDialog(container, TxtManager.getTxt("VALIDATE.TAXTYPE.FORMULAERROR"));
                }
View Full Code Here

TOP

Related Classes of realcix20.classes.basic.Row

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.