Package simtools.data

Examples of simtools.data.DataSource


      int n = dst.getItemCount();
      double factor = 1.0 / plot.getRadius() - 1.0; // may be null
      // Now initialize entries
      for (int i=0; i<n; ++i) {
        DataSource ds = (DataSource)mapperSources.get(i);
        if (ds==null) ds = dst.getSource(i); // take the datasource associated with this series by default
        pcbxcurves.addItem(new CbxEntry(
                i,
                dst.getName(i),
                (Color)plot.getSectionPaint(i),
View Full Code Here


        // Start from the end, to remove the entries and keep the index OK
        for (int i=n-1; i>=0; i--) {
          if (!toKeep[i]) {
            GenericMapper mapper = (GenericMapper)mappers.remove(i);
            if (mapper!=null) mapper.removeListener(PieChartShape.this);
            DataSource source = (DataSource)mapperSources.remove(i);
            if (source!=null) source.removeListener(PieChartShape.this);
            dst.removeSource(i);
          }
        }
      }
     
      // Now we match the data set and the list
      int len = pcbxcurves.getItemCount();
     
      // first compute max ratio => define JFreeChart 100% and compute 1.0 equivalent
      double maxratio = Double.NEGATIVE_INFINITY;
      for (int i=0; i<len; ++i) {
        CbxEntry e = (CbxEntry)pcbxcurves.getItemAt(i);
        maxratio = Math.max(e.ratio, maxratio);
      }
      double delta = maxratio - 1.0;
     
      // now apply changes
      for (int i=0; i<len; ++i) {
        CbxEntry e = (CbxEntry)pcbxcurves.getItemAt(i);
        dst.setName(i,e.name);
        DataSource ds = (DataSource)mapperSources.get(i);
        if ((e.source==null) && (ds!=null)) {
            ds.removeListener(PieChartShape.this);
            ds.removeEndNotificationListener(PieChartShape.this);
        }
        mapperSources.set(i,e.source);
        if (e.source!=null) {
            e.source.addListener(PieChartShape.this);
            e.source.addEndNotificationListener(PieChartShape.this);
View Full Code Here

        // the pool
        // if pool is null don't know what to do => will try to parse the
        // expression nonetheless
        if (pool != null) {
            for (int i = 0; i < numvar; ++i) {
                DataSource ds;
                try {
                    ds = pool.getDataSourceWithId((String) info.get(i * 2 + 3));
                } catch (DuplicateIdException e) {
                    ds = null;
                }
View Full Code Here

      );
      for(int i=0; i<information.mergedData.size();i++){
          try{

              SynchronousMergeDataSourceInformation dataInfo = (SynchronousMergeDataSourceInformation)information.mergedData.get(i);
              DataSource ds = dataInfo.data;

              if (!dataInfo.mergeAllRelatedCollection){     // Merge just a data source
                  if (ds instanceof TimeStampedDataSource)
                      add((TimeStampedDataSource)ds,  dataInfo.offset, dataInfo.initialDate);
                  else{
View Full Code Here

                    dialog.setVisible(true);

                    if (dialog.isOk()){
                        baseColor = dialog.getColor();
                        bBaseColor.setBackground(baseColor);
                        DataSource baseColorTempDataSource = dialog.getSource();
                        baseColorMapper = dialog.getMapper();

                        if  (baseColorTempDataSource!=null){

                            if (baseColorMapperSource!=null)
                                baseColorMapperSource.removeEndNotificationListener(ShapeNode.this);

                            baseColorMapperSource  = baseColorTempDataSource;
                            baseColorMapperSource.addEndNotificationListener(ShapeNode.this);  
                        }

                    }
                }
      });
           
           
            bHighlightColor.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
         
                    DynamicColorChooser dialog = new DynamicColorChooser(
                            new JDialog(),
                            NodeResourcesManager.resources.getString("SelectAColor"),
                            null,highlightColor,highlightColorMapperSource,highlightColorMapper);
                   

                    if (dialog.isOk()){
            highlightColor = dialog.getColor();
            bHighlightColor.setBackground(highlightColor);
           
              DataSource highlightColorTempDataSource = dialog.getSource();
                        highlightColorMapper = dialog.getMapper();

                        if  (highlightColorTempDataSource!=null){
                           
                            if (highlightColorMapperSource!=null)
View Full Code Here

   */
  public DataSource provide(String id, String dscId, Object optionalInformation, DataSourcePool pool){
    if ((id==null) || (dscId==null) || !(dscId.startsWith(JSAsynchronousMergeDSCollection.ID_MARKER) || dscId.startsWith(JSSynchronousMergeDSCollection.ID_MARKER)))
      return null;

    DataSource foundDS = null;
    DataSourceCollection adsc = null;
   
    MergeDataException.mergeDataErrors.clear();   // clear merge errors list
    try {
     
View Full Code Here

      // Merge data
      for(int i=0; i<information.mergedData.size();i++){
          try {
              AsynchronousMergeDataSourceInformation dataInfo = (AsynchronousMergeDataSourceInformation)information.mergedData.get(i);

              DataSource ds = dataInfo.data;

              if (!dataInfo.mergeAllRelatedCollection){     // Merge just a data source
                  if (ds instanceof TimeStampedDataSource)
                      add((TimeStampedDataSource)ds,  dataInfo.offset, dataInfo.initialDate);
                  else{
View Full Code Here

      pcurvecolor.setFocusPainted(false);
      SourceXYDataset dst = (SourceXYDataset)plot.getDataset();
      int n = dst.getSeriesCount();
      JSynopticXYItemRenderer renderer = (JSynopticXYItemRenderer)plot.getRenderer();
      for (int i=0; i<n; ++i) {
        DataSource ds = renderer.getDataSource(i);
        if (ds==null) {
          ds = dst.getYSource(i); // take the datasource associated with this curve by default
          DataSource linked = DataInfo.getLinkedSource(ds); // and follow link if necessary
          if (linked!=null) ds = linked;
        }
        pcbxcurves.addItem(new CbxEntry(i,dst.getSeriesName(i),(Color)renderer.getSeriesPaint(i),ds,renderer.getColorMapper(i)));
      }
      pcbxeditortf = (JTextField)pcbxcurves.getEditor().getEditorComponent();
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

        } else {
            cp.side=Gate.WEST;
        }

        DataSource ds = (DataSource) emitterPanel.getPropertyValue(DynamicColorPanel.DYNAMIC_COLOR_SOURCE);
        ColorMapper cm = (ColorMapper) emitterPanel.getPropertyValue(DynamicColorPanel.DYNAMIC_COLOR_MAPPER);
        cp.isInput = ds==null && cm == null;
       
        cp.ds = ds;
        cp.cm = cm;
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.