Package gov.nasa.arc.mct.components

Examples of gov.nasa.arc.mct.components.FeedProvider$RenderingInfo


     for (AbstractComponent[] row : matrix) {
       int numberOfItemsOnSubPlot = 0;
       for (AbstractComponent component : row) {
         if (numberOfItemsOnSubPlot < PlotConstants.MAX_NUMBER_OF_DATA_ITEMS_ON_A_PLOT) {
           // Alternate implementation is getCapabilities() from each component, then get time system ID from each of fp.
           FeedProvider fp = component.getCapability(FeedProvider.class);
           if (fp != null) {
             String[] timeSystems = fp.getTimeService().getTimeSystems();
             if (timeSystems != null) {
               for (int i=0; i<timeSystems.length; i++) {
                 choices.add(timeSystems[i]);
               }
             }
View Full Code Here


    
     for (AbstractComponent[] row : matrix) {
       int numberOfItemsOnSubPlot = 0;
       for (AbstractComponent component : row) {
         if (numberOfItemsOnSubPlot < PlotConstants.MAX_NUMBER_OF_DATA_ITEMS_ON_A_PLOT) {
           FeedProvider fp = component.getCapability(FeedProvider.class);
           if (fp != null) {
             String[] timeFormats = fp.getTimeService().getTimeFormats();
             if (timeFormats != null) {
               for (int i=0; i<timeFormats.length; i++) {
                 choices.add(timeFormats[i]);
               }
               numberOfItemsOnSubPlot++;
View Full Code Here

      Collection<FeedProvider> feedsForThisLevel = new ArrayList<FeedProvider>(); //this should be LMIT
      int numberOfItemsOnSubPlot = 0;

      for (AbstractComponent component : row) {
        if (numberOfItemsOnSubPlot < PlotConstants.MAX_NUMBER_OF_DATA_ITEMS_ON_A_PLOT) {
          FeedProvider fp = plotViewManifestation.getFeedProvider(component);
          if (fp != null) {
            if(fp.getFeedType() != FeedType.STRING){  //only add to feed providers if not a string feed
              feedProviders.add(fp);
             
              if (fp.isPrediction()) {
                predictiveFeeds.add(fp);
              }
              feedsForThisLevel.add(fp);
              components.put(fp, component);
            }
View Full Code Here

  }

  @Override
  public void updateFromFeed(Map<String, List<Map<String, String>>> data) {   
    AbstractComponent component = getManifestedComponent();
    FeedProvider provider = getFeedProvider(component);
     
    if (provider != null) {
      List<Map<String, String>> feedData = data.get(provider.getSubscriptionId());
      if (feedData != null && !feedData.isEmpty()) {
        Map<String, String> feedDataItem = feedData.get(feedData.size() - 1);

        List<RenderingInfo> riList = new ArrayList<RenderingInfo>();
        riList.add(provider.getRenderingInfo(feedDataItem));
       
        /* Get updates from the appropriate evaluator */
        if (settings.getSetting(GraphicalSettings.GRAPHICAL_EVALUATOR) instanceof AbstractComponent) {
          AbstractComponent comp = (AbstractComponent) settings.getSetting(GraphicalSettings.GRAPHICAL_EVALUATOR);
          riList.add(comp.getCapability(Evaluator.class).evaluate(data, Collections.singletonList(provider)));
View Full Code Here

  public NonTimePlotView (AbstractComponent ac, ViewInfo vi) {
    super (ac, vi);
   
    List<AbstractComponent> feedComponents = new ArrayList<AbstractComponent>();
    for (AbstractComponent child : ac.getComponents()) {
      FeedProvider fp = child.getCapability(FeedProvider.class);
      if (fp != null) {
        feedComponents.add(child);
        feedProviders.add(fp);
      }
    }
   
    LegendManager legendManager = new LegendManager(feedComponents);
   
    for (int i = 0; i < feedProviders.size(); i++) {
      FeedProvider fp = feedProviders.get(i);
      LegendEntryView v = legendManager.getLegendEntry(feedComponents.get(i));
      if (i > 0) {
        v.setPlotLine(
          plot.addDataset(key(fp.getSubscriptionId()), NonTimeColorPalette.getColor(i-1))
          );
      }
    }
   
    setLayout(new BorderLayout());
View Full Code Here

    long[] times = getTimes(feedProviders.get(0), data);
    for (long t : times) {
      if (t == Long.MIN_VALUE) continue;
      Double x = getDataAt(feedProviders.get(0), data, t);
      for (int i = 1; i < feedProviders.size(); i++) {
        FeedProvider fp = feedProviders.get(i);
        Double y = getDataAt(fp, data, t);
        if (x != null && y != null) {
          plot.addPoint(key(fp.getSubscriptionId()), x, y);
       
      }
    }
    plot.repaint();
    cycle++;
View Full Code Here

      long syncTime) {   
    if (feedProviders.size() < 2) return;
    plot.clearSyncPoints();
    Double x = getData(feedProviders.get(0), data);
    for (int i = 1; i < feedProviders.size(); i++) {
      FeedProvider fp = feedProviders.get(i);
      Double y = getData(fp, data);
      if (x != null && y != null) {
        plot.addSyncPoint(key(fp.getSubscriptionId()), x, y);
     
    } 
    plot.repaint();
  }
View Full Code Here

    label.setFont(updateBaseFont(Font.ITALIC));
    label.setForeground(Color.LIGHT_GRAY);
   
    add(label);
   
    FeedProvider fp = ac.getCapability(FeedProvider.class);
    feedProviders = fp==null ? Collections.<FeedProvider>emptyList() : Collections.singleton(fp);
   
    setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
  }
View Full Code Here

        // one
        if (activeRenderers.get() < MAX_ACTIVE_REQUESTS && activeSyncControl.get() == null) {
            Map<TimeService,Long> currentTimes = new HashMap<TimeService,Long>();
            Map<FeedProvider,Long[]> times = new TreeMap<FeedProvider,Long[]>(FEED_COMPARATOR);
            for (Entry<FeedProvider,Long> lastTimeMapping:activeFeeds.entrySet()) {
                FeedProvider feed = lastTimeMapping.getKey();
                long lastRequestTime = lastTimeMapping.getValue();
                // ensure that all values coming from the same time service reflect the same time
                Long cachedTime = currentTimes.get(feed.getTimeService());
                if (cachedTime == null) {
                    cachedTime = feed.getTimeService().getCurrentTime();
                    currentTimes.put(feed.getTimeService(), cachedTime);
                }
                long currentTime = cachedTime;
                Long[] timeRange = new Long[] {lastRequestTime, currentTime};
                if (timeRange[0] < timeRange[1]) {
                    timeRange[0]++;
View Full Code Here

      MultiCreationServiceImpl e = new MultiCreationServiceImpl();
      AbstractComponent ac = e.createMulti(MultiEvaluator.LANGUAGE_STRING, "");
    ((MultiComponent)ac).getData().setFallThroughDisplayValue("????");
    if (sourceComponents.size() == 1) {
      ((MultiComponent)ac).getData().setPassThrough(true);
      FeedProvider fp = sourceComponents.iterator().next().getCapability(FeedProvider.class);
      ((MultiComponent)ac).getData().setPassThroughParameterId(fp.getSubscriptionId());
    } else {
      ((MultiComponent)ac).getData().setPassThrough(false);
    }
      ac.addDelegateComponents(sourceComponents);
      return ac;
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.components.FeedProvider$RenderingInfo

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.