Package simtools.data

Examples of simtools.data.DataSource


  /** We create Ascii Collections with buffers
   *  => same behaviour when loading an ascii file and an archive
   */
  public DataSource provide(String id, String dscId, Object optionalInformation, DataSourcePool pool) {
    DataSource ret = super.provide(id, dscId, optionalInformation, pool);
    if (pool!=null) {
      DataSourceCollection dsc = null;
      int index = -1;
      Set set = pool.dataSourceCollections();
      for (Iterator it = set.iterator(); it.hasNext(); ) {
View Full Code Here


        ldynamicDsId.setPreferredSize(new Dimension(200, 20));
        ldynamicDsId.setEditable(true);
        ldynamicDsId.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                String dsId = ldynamicDsId.getText();
                DataSource ds = null;
                try {
                    ds = DataSourcePool.global.getDataSourceWithId(dsId);
                } catch (DuplicateIdException e1) {
                }
View Full Code Here

            }
            catch (UnsupportedOperation uo1) {
                if (primary) isPrimaryBounded = false;
                else isSecondaryBounded = false;
            }
            DataSource oldX;
            String label = DEFAULT_DISPLAY_DATA_SOURCE_ID? DataInfo.getAliasOrIdwithUnit(ds) : DataInfo.getAliasOrLabelwithUnit(ds);
            if (primary) {
                oldX = primaryX;
                primaryX = ds;
                axesLimitsArray[PX].label = label;
View Full Code Here

                    new Object[]{ds, this} ){

                protected void doAction() {

                    Object[] obar = (Object[])param;
                    DataSource ds = (DataSource)obar[0];
                    boolean primary = ((Boolean)obar[1]).booleanValue();

                    setX(ds, primary);
                }
            }.start(background);
View Full Code Here

    protected CurveShape createCurveShape(DataSource xds, DataSource yds){
        return new CurveShape(xds, yds);
    }

    protected CurveShape doAddYAction(Object[] obar){
        DataSource ds = (DataSource)obar[0];
        boolean primary = ((Boolean)obar[1]).booleanValue();
        boolean usePrimaryX = ((Boolean)obar[2]).booleanValue();

        Rectangle bounds = getBounds();
        CurveShape cs;
View Full Code Here

                }

                // When curve X range is included into current X axis range, we can direct get curve Y mon and max from data source
                try {
                    if (useYdataMinandMax) {
                        DataSource currentYSource = curveShape.getYSource();
                        double candidateMin = currentYSource.getDoubleMin();
                        double candidateMax = currentYSource.getDoubleMax();

                        if (candidateMin < yAxeRange.min){
                            yAxeRange.min = candidateMin;
                        }
                        if (candidateMax > yAxeRange.max){
View Full Code Here

        }

        if (o instanceof DataSource) {
            boolean res = false;

            DataSource ds = (DataSource)o;
            if (action.equals(resources.getStringValue("setX"))) {

                res =  setPrimaryX(ds, true);

            }
View Full Code Here

        // Update curves label in case display label mode has changed
        for (int i=0;i<_curves.size();i++){
            CurveShape curveShape = ((Curve)_curves.get(i)).shape;  
            try{
                DataSource ds= curveShape.getYSource();
                if (ds != null) {
                    String label = DEFAULT_DISPLAY_DATA_SOURCE_ID? DataInfo.getAliasOrIdwithUnit(ds) : DataInfo.getAliasOrLabelwithUnit(ds);
                    setCurveLabel(curveShape,label);
                }
            }catch (DataException e){}
View Full Code Here

                return _v.kind.getValueName(rowIndex);
            } else if(columnIndex ==1){
                // Use Float to reduce max number of digits
                return Float.toString((float) _v.doubleValues[rowIndex]);
            } else if(columnIndex ==2){
                DataSource d=_v.data[rowIndex];
                return Boolean.valueOf(d!=null);
            } else if(columnIndex == 3){
                DataSource d=_v.data[rowIndex];
                return (d==null) ? "" : d.getInformation().toString();
            }
            throw new RuntimeException("Invalid column index");
        }
View Full Code Here

        }
        else{
            // Use Float to reduce max number of digits
            _tfValue.setText(Float.toString((float) _v.doubleValues[0]));
        }
        DataSource d=_v.data[0];

        _cb.setSelected(d!=null);
        _tfValue.setEnabled(d==null);
        _tfName.setText((d==null) ? "" : d.getInformation().toString());
    }
View Full Code Here

TOP

Related Classes of simtools.data.DataSource

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.