LegendEntryView extends FeedView implements AbstractLegendEntry { @Override public void updateFromFeed(Map<String, List<Map<String, String>>> data) { for (FeedProvider fp : feedProviders) { if (data.containsKey(fp.getSubscriptionId())) { List<Map<String, String>> series = data.get(fp.getSubscriptionId()); if (!series.isEmpty()){ String display = getManifestedComponent().getDisplayName(); RenderingInfo ri = fp.getRenderingInfo(series.get(series.size() - 1)); String status = ri.getStatusText(); if (!status.trim().isEmpty()) display = "(" + status + ") " + display; label.setText(display); label.setFont(ri.isPlottable() ? baseFont : strikeThroughFont); } } } } LegendEntryView(AbstractComponent ac, ViewInfo vi); void setAppearance(Color c, Icon i); @Override void updateFromFeed(Map<String, List<Map<String, String>>> data); @Override void synchronizeTime(Map<String, List<Map<String, String>>> data,
			long syncTime); @Override Collection<FeedProvider> getVisibleFeedProviders(); @Override void attachPlotLine(AbstractPlotLine plotLine); @Override String getDisplayedName(); @Override void setBaseDisplayName(String displayName); static final ViewInfo VIEW_INFO; }
@Test public void testShowsStatus() { List<BufferedImage> images = new ArrayList<BufferedImage>(); Map<String, List<Map<String,String>>> data = new HashMap<String,List<Map<String,String>>>(); List<Map<String,String>> points = new ArrayList<Map<String,String>>(); points.add(new HashMap<String,String>()); data.put(TEST_ID, points); for (boolean plottable : new boolean[]{true,false}) { for (String status : new String[]{"", "A", "B"}) { Mockito.when(ri.isPlottable()).thenReturn(plottable); Mockito.when(ri.getStatusText()).thenReturn(status); view.updateFromFeed(data); images.add(drawComponent(view)); } } for (int i = 0; i < images.size(); i++) { for (int j = i + 1; j < images.size(); j++) { Assert.assertFalse(imagesEqual(images.get(i), images.get(j))); } } Assert.assertTrue(imagesEqual(images.get(0), images.get(0))); }