EvernoteUpdater extends AbstractUpdater implements SettingsAwareUpdater, SharedConnectorSettingsAwareUpdater { void addStyleParts(final List<NotebookConfig> notebookConfigs, final BodyTrackHelper.ChannelStyle channelStyle) { int nNotebooks = getNumberOfVisibleNotebooks(notebookConfigs); double rowHeight = 1.f/(nNotebooks*2+1); int i=0; for (NotebookConfig config: notebookConfigs) { if (config.hidden) continue; BodyTrackHelper.TimespanStyle stylePart = new BodyTrackHelper.TimespanStyle(); final int rowsFromTop = (i+1) * 2 - 1; stylePart.top = (double)rowsFromTop*rowHeight-(rowHeight*0.25); stylePart.bottom = stylePart.top+rowHeight+(rowHeight*0.25); stylePart.fillColor = config.backgroundColor; stylePart.borderColor = config.backgroundColor; channelStyle.timespanStyles.values.put(config.guid, stylePart); i++; } }  @Override void connectorSettingsChanged(final long apiKeyId, final Object settings); @Override Object syncConnectorSettings(final UpdateInfo updateInfo, Object s); @Override void syncSharedConnectorSettings(final long apiKeyId, final SharedConnector sharedConnector); @Override void setDefaultChannelStyles(ApiKey apiKey); static File getResourceFile(final long guestId, final long apiKeyId,
                                       final String guid, final String appendix,
                                       final String mimeType, final String devKvsLocation); static final String MAIN_APPENDIX; static final String RECOGNITION_APPENDIX; static final String ALTERNATE_APPENDIX; static final String EVERNOTE_DEFAULT_BGCOLOR; }
@Test public void testAddStyleParts() throws Exception { EvernoteUpdater eut = new EvernoteUpdater(); List<NotebookConfig> notebookConfigs = new ArrayList<NotebookConfig>(); addNotebookConfig(notebookConfigs, "red", "1"); addNotebookConfig(notebookConfigs, "green", "2"); addNotebookConfig(notebookConfigs, "blue", "3"); addNotebookConfig(notebookConfigs, "orange", "4"); addNotebookConfig(notebookConfigs, "yellow", "5"); addNotebookConfig(notebookConfigs, "magenta", "6"); addNotebookConfig(notebookConfigs, "cyan", "7"); BodyTrackHelper.ChannelStyle channelStyle = new BodyTrackHelper.ChannelStyle(); channelStyle.timespanStyles = new BodyTrackHelper.MainTimespanStyle(); channelStyle.timespanStyles.defaultStyle = new BodyTrackHelper.TimespanStyle(); channelStyle.timespanStyles.defaultStyle.fillColor = "green"; channelStyle.timespanStyles.defaultStyle.borderColor = "green"; channelStyle.timespanStyles.defaultStyle.borderWidth = 2; channelStyle.timespanStyles.defaultStyle.top = 0.0; channelStyle.timespanStyles.defaultStyle.bottom = 1.0; channelStyle.timespanStyles.values = new HashMap(); eut.addStyleParts(notebookConfigs, channelStyle); ObjectMapper mapper = new ObjectMapper(); System.out.println(mapper.writeValueAsString(channelStyle)); }