Package KFramework30.Widgets

Examples of KFramework30.Widgets.KDropDownFillerClass


                //DATE -->>
               
               
               
                // OK box
                setColumnRenderer("OK", new CheckBoxCellRendererClass(tableModel, log) );
                setColumnEditor("OK", new CheckBoxCellEditorClass(tableModel, log) );               
                adjustColumnWidth( "OK", 30 );           
               
              
               
View Full Code Here


                query.prepare( " select FACSTATUS_STATUS from SAMPLE_FACTURA_STATUS " );
                query.executeQuery( 0 , 999 );                 
                Vector< String > options = new Vector< String >();
                while( query.fetch() ) options.add( (String )query.getField( "FACSTATUS_STATUS" ) );               
               
                setColumnEditor("STATUS", new ComboCellEditorClass( options,  tableModel, log, true ) );
                setColumnRenderer("STATUS", new ComboCellRendererClass( options, tableModel, log) );
                  
                // TOTAL
                // for the total, leave the default text editor assigned when set to editable
               
View Full Code Here

                query.executeQuery( 0 , 999 );                 
                Vector< String > options = new Vector< String >();
                while( query.fetch() ) options.add( (String )query.getField( "FACSTATUS_STATUS" ) );               
               
                setColumnEditor("STATUS", new ComboCellEditorClass( options,  tableModel, log, true ) );
                setColumnRenderer("STATUS", new ComboCellRendererClass( options, tableModel, log) );
                  
                // TOTAL
                // for the total, leave the default text editor assigned when set to editable
               
            }
View Full Code Here

            adjustColumnType( "Cost", BROWSER_COLUMN_TYPE_CURRENCY );           
            adjustColumnFont"Cost"new Font( "arial", Font.BOLD, 10  ) );            
            adjustColumnForegroundColor( "Cost", Color.BLUE  );
           
            adjustColumnWidth( "Picture", 210 )
            setColumnRenderer( "Picture", new ImageCellRendererClass( tableModel, log, 120, 150 ) );
           
    }       
View Full Code Here

            // ---------------------------------
            // set order dialog
           
            log.log( this, "Openning setOrderScreen..." );         
         
            setOrderDialogClass setOrderScreen =
                    new setOrderDialogClass( configuration, log, desktopAccess.getDesktopsWindow(), this );                                                 
           
            log.log( this, "Openning setOrderScreen completed." );                                 
           
            setOrderScreen.setVisible( true );
                       
            // set order dialog
            // --------------------------------------------------------

        }
View Full Code Here

    java.util.List rows = browser.getAllTableData();
   
    Iterator iterador = rows.iterator();
    while( iterador.hasNext()){
               
        recordClass dataRow = (recordClass) iterador.next();
       
        for( int index = 0; index < dataRow.getRecordLength(); index++ ){
           
            log.log( this, (String)dataRow.getValueAt(index) );
        }
       
    }
   
}//GEN-LAST:event_jButton1ActionPerformed
View Full Code Here

                                                   
                // for you to see
                Iterator dataRowChanged = data.iterator();
                while( dataRowChanged.hasNext() ){
                   
                    recordClass currentRow = (recordClass) dataRowChanged.next();

                    // materialize object
                    sample_facturaClass factura = new sample_facturaClass();

                    persistentObjectManagerClass pom = new persistentObjectManagerClass(configuration, log) ;
                    factura = (sample_facturaClass) pom.copy4( KMetaUtilsClass.getIntegralNumericValueFromString(  (String) currentRow.getValueAt(6) ), factura.getClass()  );
                                      
                    // update it
                   
                    // OK box
                   
                        String OKbox = (String) currentRow.getValueAt(0);
                        // will return ture or false for the checkbox
                        // not used in this example. This is a sample on how to read it
                   
                    // DATE
                        factura.setFacDate(                                
                                KMetaUtilsClass.stringToDate(
                                    KMetaUtilsClass.KDEFAULT_LONG_DATE_TIME_FORMAT, (String) currentRow.getValueAt(3)  ) );

                    // STATUS
                        factura.setFacstatusId( KMetaUtilsClass.getIntegralNumericValueFromString( invoiceStatusProp.getProperty( (String) currentRow.getValueAt(4) ) ) );
                       
                    // TOTAL
                        factura.setFacTotal( KMetaUtilsClass.getCurrencyNumericValueFromString( (String)currentRow.getValueAt(5) ) );

                    // save it
                    factura = (sample_facturaClass) pom.update4( KMetaUtilsClass.getIntegralNumericValueFromString( (String)currentRow.getValueAt(6) ), factura);

                }
               
            } catch (KExceptionClass error) {
               
View Full Code Here

            setDefaultOrder( "ref.DATE_DATE DESC " );
           
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++           
                                                                    
            // date column header           
            tableHeaderRendererClass dateRenderer = new tableHeaderRendererClass( 4, "DATE" );
            dateRenderer.setLabelAt( "", 0 );
            dateRenderer.setLabelAt( "Client", 1 );
            dateRenderer.setLabelAt( "Description", 2 );
            dateRenderer.setLabelAt( "Analysis", 3 );                               
            adjustHeaderRenderer( dateRenderer );                                       
           
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++           
// set display name for columns
           
            serial = 0;
            selectedFieldDataIterator = selectedFields.iterator();                 
            while( selectedFieldDataIterator.hasNext() ) {

                serial++;               
               
                //=====================================================================               
                // get data
                AbstractMap selectedFieldData = selectedFieldDataIterator.next().rawData;                                   
               
                // figure name
                String fieldName = ((String) selectedFieldData.get( "ANALYSIS_NAME" )).toUpperCase();               
                fieldName = makeDatabaseColumnName( fieldName ) + serial;
                String fakeName = ((String) selectedFieldData.get( "ANALYSIS_NAME" )).toUpperCase() + " :" + serial;
                //=====================================================================
               
               
                // set column name
                setColumnNames( "col" + serial, fieldName , fakeName  );                                           
               
                // date column header      
                tableHeaderRendererClass headerRenderer = new tableHeaderRendererClass( 4, fakeName ); // fake name
                headerRenderer.setLabelAt( "", 0 );
                headerRenderer.setLabelAt( ((String) selectedFieldData.get( "CLIENT_NAME" )), 1 );
                headerRenderer.setLabelAt( ((String) selectedFieldData.get( "SAMPLE_CLIENT_ID" )), 2 );
                headerRenderer.setLabelAt( ((String) selectedFieldData.get( "ANALYSIS_NAME" )), 3 );                               
                adjustHeaderRenderer( headerRenderer );                                       

                String currentHeader =
                    ((String) selectedFieldData.get( "CLIENT_NAME" )) + " " +
                    ((String) selectedFieldData.get( "SAMPLE_CLIENT_ID" )) + " " +
View Full Code Here

       
        if( selectedFieldsData.size() > 0 )
        {

            // load data from multi browser
            tableModelClass tableDataModel = dataBrowser.tableModel;
            int rowCount = tableDataModel.getRowCount();           

            // formatter
            SimpleDateFormat dateFormatter = null;           

            if( configuration.getField( "databaseType" ).equals( "oracle" ) ){ 
               
                dateFormatter = new SimpleDateFormat ("MM/dd/yyyy");            
               
            }else if(configuration.getField( "databaseType" ).equals( "mssql" ) ){  
               
                dateFormatter = new SimpleDateFormat ("yyyy-MM-dd");                                
               
            }else{
                throw new KExceptionClass( "databaseType not recognized " + configuration.getField( "databaseType" ), null );
            }                   

    

// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++           
// JFREE stuff begins here           
           
           
    // ++++++++++++++++++++++++++++++++++++++++++++++++
    // Make a vector with date units for the date axis
           
            log.log( this, "Figure dates" );
           
            Vector< Day > dateColumn = new Vector< Day >();                                   
            for( int rowIndex = 0; rowIndex < rowCount; rowIndex++ ){

                try{
                                      
                    String dateString = (String) tableDataModel.getValueAt( rowIndex, 0 );               
                    Date rowDate = dateFormatter.parse( dateString );                                                                              
                   
                    dateColumn.add( new Day( rowDate ) );                   
                    log.log( this, "Adding " + dateString );
                   
                }catch( ParseException parseError ){                 
                    throw new KExceptionClass( parseError.toString() , null );
                }                   
            }

                                             
        // +++++++++++++++++++++++++++++           
        //  create a data set, keeps the series 
           
            TimeSeriesCollection mainDataset = new TimeSeriesCollection();
           
        // +++++++++++++++++++++++++++++           
        // make data series                   
                       
            // read data, a serie per column
            log.log( this, "Adding data" );
            for( int columnIndex = 1; columnIndex < tableDataModel.getColumnCount(); columnIndex++ ){
                    
                // make a serie
                TimeSeries dataByDateSerie = new TimeSeries( tableDataModel.getColumnName(columnIndex), Day.class );
               
                // read data
                for( int rowIndex = 0; rowIndex < tableDataModel.getRowCount(); rowIndex++ ){

                    try{

                        // read value
                        String rowValue = (String) tableDataModel.getValueAt( rowIndex, columnIndex );
                       
                        //  parse value string
                        StringTokenizer tokenizer = new StringTokenizer( rowValue );
                       
                        String decodedValue = new String();
                        if( tokenizer.hasMoreTokens() ){
                            decodedValue = tokenizer.nextToken();
                        
                            if( decodedValue.equals( "<" ) && tokenizer.hasMoreTokens() ){   
                               
                                String valueToken = tokenizer.nextToken();
                               
                                try{                                   
                                   
                                    decodedValue = "" + ( KMetaUtilsClass.getDecimalNumericValueFromString( valueToken ) / 2 );                                                                   
                                   
                                }catch( Exception error ){                                   
                                   
                                    decodedValue = valueToken;                                                                   
                                }
                            }
                        }
                       
                        // data raw
                        double currentRecordValue = KMetaUtilsClass.getDecimalNumericValueFromString( decodedValue );
                       
                        // make serie
                        dataByDateSerie.add( dateColumn.get(rowIndex), currentRecordValue );
                       
                        log.log( this, "Adding " + currentRecordValue );
                       
                        log.log( this, tableDataModel.getColumnName( columnIndex ) + " --> " + ((String) tableDataModel.getValueAt( rowIndex, columnIndex )).trim() );
                       
                    }catch( Exception parseError ){                               
                       
                        log.log( this, parseError.toString() + "|" + tableDataModel.getColumnName( columnIndex ) + " !!!!!! --> " + ((String) tableDataModel.getValueAt( rowIndex, columnIndex )).trim() );                       
                    }

               
                }
View Full Code Here

        // uses
        configuration = configurationParam;
        log = logParam;

        // has - defaulted    
        KDialogController = new KDialogControllerClass(                
                configurationParam, logParam,
                sample_facturaClass.class, this, getContentPane() );       
                                                                                                         
    }
View Full Code Here

TOP

Related Classes of KFramework30.Widgets.KDropDownFillerClass

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.