SpectrumViewerVisualSettings.xaml.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. namespace OINA.Extender.WPF.Testharness
  2. {
  3. using System.Windows;
  4. using System.Windows.Media;
  5. using OINA.Extender.Controls;
  6. using OINA.Extender.Controls.Styles;
  7. /// <summary>
  8. /// Interaction logic for SpectrumViewerVisualSettings.xaml
  9. /// </summary>
  10. public partial class SpectrumViewerVisualSettings : Window
  11. {
  12. /// <summary>
  13. /// Gets or sets the color of the included element.
  14. /// </summary>
  15. /// <value>
  16. /// The color of the included element.
  17. /// </value>
  18. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  19. public Color SpectrumBackgroundColor
  20. {
  21. get
  22. {
  23. return SpectrumViewerStyle.SpectrumBackgroundColor;
  24. }
  25. set
  26. {
  27. SpectrumViewerStyle.SpectrumBackgroundColor = value;
  28. }
  29. }
  30. /// <summary>
  31. /// Gets or sets the color of Spectrum Foreground Color.
  32. /// </summary>
  33. /// <value>
  34. /// The color of the included element.
  35. /// </value>
  36. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  37. public Color SpectrumLabelTextColor
  38. {
  39. get
  40. {
  41. return SpectrumViewerStyle.SpectrumLabelTextColor;
  42. }
  43. set
  44. {
  45. SpectrumViewerStyle.SpectrumLabelTextColor = value;
  46. }
  47. }
  48. /// <summary>
  49. /// Gets or sets the color of Axis Foreground Color.
  50. /// </summary>
  51. /// <value>
  52. /// The color of the included element.
  53. /// </value>
  54. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  55. public Color AxisTextColor
  56. {
  57. get
  58. {
  59. return SpectrumViewerStyle.AxisTextColor;
  60. }
  61. set
  62. {
  63. SpectrumViewerStyle.AxisTextColor = value;
  64. }
  65. }
  66. /// <summary>
  67. /// Gets or sets a value indicating whether the axis lines are visible.
  68. /// </summary>
  69. /// <value>
  70. /// <c>true</c> if the axis lines are visible; otherwise, <c>false</c>.
  71. /// </value>
  72. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  73. public bool IsAxisLinesVisible
  74. {
  75. get
  76. {
  77. return SpectrumViewerStyle.IsAxisLineVisible;
  78. }
  79. set
  80. {
  81. SpectrumViewerStyle.IsAxisLineVisible = value;
  82. }
  83. }
  84. /// <summary>
  85. /// Gets or sets the color of Axis Tick Brush Color.
  86. /// </summary>
  87. /// <value>
  88. /// The color of the included element.
  89. /// </value>
  90. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  91. public Color AxisColor
  92. {
  93. get
  94. {
  95. return SpectrumViewerStyle.AxisColor;
  96. }
  97. set
  98. {
  99. SpectrumViewerStyle.AxisColor = value;
  100. }
  101. }
  102. /// <summary>
  103. /// Gets or sets the color of Spectrum Visual Fill Color.
  104. /// </summary>
  105. /// <value>
  106. /// The color of the included element.
  107. /// </value>
  108. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  109. public Color SpectrumVisualFillColor
  110. {
  111. get
  112. {
  113. return SpectrumViewerStyle.SpectrumVisualFillColor;
  114. }
  115. set
  116. {
  117. SpectrumViewerStyle.SpectrumVisualFillColor = value;
  118. }
  119. }
  120. /// <summary>
  121. /// Gets or sets the color of Spectrum Label Chrome Border Brush Color.
  122. /// </summary>
  123. /// <value>
  124. /// The color of the included element.
  125. /// </value>
  126. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  127. public Color SpectrumPeakLabelBorderColor
  128. {
  129. get
  130. {
  131. return SpectrumViewerStyle.SpectrumPeakLabelBorderColor;
  132. }
  133. set
  134. {
  135. SpectrumViewerStyle.SpectrumPeakLabelBorderColor = value;
  136. }
  137. }
  138. /// <summary>
  139. /// Gets or sets the color of Spectrum Label Chrome Background Color.
  140. /// </summary>
  141. /// <value>
  142. /// The color of the included element.
  143. /// </value>
  144. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  145. public Color SpectrumPeakLabelBackgroundColor
  146. {
  147. get
  148. {
  149. return SpectrumViewerStyle.SpectrumPeakLabelBackgroundColor;
  150. }
  151. set
  152. {
  153. SpectrumViewerStyle.SpectrumPeakLabelBackgroundColor = value;
  154. }
  155. }
  156. /// <summary>
  157. /// Gets or sets the color of Spectrum Label View Foreground Color.
  158. /// </summary>
  159. /// <value>
  160. /// The color of the included element.
  161. /// </value>
  162. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  163. public Color SpectrumPeakLabelTextColor
  164. {
  165. get
  166. {
  167. return SpectrumViewerStyle.SpectrumPeakLabelTextColor;
  168. }
  169. set
  170. {
  171. SpectrumViewerStyle.SpectrumPeakLabelTextColor = value;
  172. }
  173. }
  174. /// <summary>
  175. /// Gets or sets the color of Main Spectrum Label BackgroundColor.
  176. /// </summary>
  177. /// <value>
  178. /// The color of the included element.
  179. /// </value>
  180. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  181. public Color AlternatePeakLabelBackgroundColor
  182. {
  183. get
  184. {
  185. return SpectrumViewerStyle.AlternatePeakLabelBackground;
  186. }
  187. set
  188. {
  189. SpectrumViewerStyle.AlternatePeakLabelBackground = value;
  190. }
  191. }
  192. /// <summary>
  193. /// Gets or sets the color of Main Spectrum Label ForegroundColor.
  194. /// </summary>
  195. /// <value>
  196. /// The color of the included element.
  197. /// </value>
  198. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Ingore")]
  199. public Color AlternatePeakLabelTextColor
  200. {
  201. get
  202. {
  203. return SpectrumViewerStyle.AlternatePeakLabelTextColor;
  204. }
  205. set
  206. {
  207. SpectrumViewerStyle.AlternatePeakLabelTextColor = value;
  208. }
  209. }
  210. /// <summary>
  211. /// Gets or sets the FontSizes of Axis.
  212. /// </summary>
  213. /// <value>
  214. /// The FontSize of Axis.
  215. /// </value>
  216. public double AxisFontSizes
  217. {
  218. get
  219. {
  220. return SpectrumViewerStyle.AxisFontSize;
  221. }
  222. set
  223. {
  224. SpectrumViewerStyle.AxisFontSize = value;
  225. }
  226. }
  227. /// <summary>
  228. /// Gets or sets the Label Margin of Axis.
  229. /// </summary>
  230. /// <value>
  231. /// The Label Margin of Axis.
  232. /// </value>
  233. public Thickness AxisLabelMargin
  234. {
  235. get
  236. {
  237. return SpectrumViewerStyle.AxisLabelMargin;
  238. }
  239. set
  240. {
  241. SpectrumViewerStyle.AxisLabelMargin = value;
  242. }
  243. }
  244. /// <summary>
  245. /// Gets or sets the Major Tick Length of Axis.
  246. /// </summary>
  247. /// <value>
  248. /// The Major Tick Length of Axis.
  249. /// </value>
  250. public double AxisMajorTickLength
  251. {
  252. get
  253. {
  254. return SpectrumViewerStyle.AxisMajorTickLength;
  255. }
  256. set
  257. {
  258. SpectrumViewerStyle.AxisMajorTickLength = value;
  259. }
  260. }
  261. /// <summary>
  262. /// Gets or sets the Minor Tick Length of Axis.
  263. /// </summary>
  264. /// <value>
  265. /// The Minor Tick Length of Axis.
  266. /// </value>
  267. public double AxisMinorTickLength
  268. {
  269. get
  270. {
  271. return SpectrumViewerStyle.AxisMinorTickLength;
  272. }
  273. set
  274. {
  275. SpectrumViewerStyle.AxisMinorTickLength = value;
  276. }
  277. }
  278. /// <summary>
  279. /// Gets or sets the SubMinor Tick Length of Axis.
  280. /// </summary>
  281. /// <value>
  282. /// The SubMinor Tick Length of Axis.
  283. /// </value>
  284. public double AxisSubMinorTickLength
  285. {
  286. get
  287. {
  288. return SpectrumViewerStyle.AxisSubMinorTickLength;
  289. }
  290. set
  291. {
  292. SpectrumViewerStyle.AxisSubMinorTickLength = value;
  293. }
  294. }
  295. /// <summary>
  296. /// Gets or sets the line thickness of Axis.
  297. /// </summary>
  298. /// <value>
  299. /// The line thickness of Axis.
  300. /// </value>
  301. public double AxisLineThickness
  302. {
  303. get
  304. {
  305. return SpectrumViewerStyle.AxisLineThickness;
  306. }
  307. set
  308. {
  309. SpectrumViewerStyle.AxisLineThickness = value;
  310. }
  311. }
  312. /// <summary>
  313. /// Gets or sets the color of the quant results background.
  314. /// </summary>
  315. /// <value>
  316. /// The color of the quant results background.
  317. /// </value>
  318. public Color QuantResultsBackgroundColor
  319. {
  320. get
  321. {
  322. return SpectrumViewerStyle.QuantResultsBackgroundColor;
  323. }
  324. set
  325. {
  326. SpectrumViewerStyle.QuantResultsBackgroundColor = value;
  327. }
  328. }
  329. /// <summary>
  330. /// Gets or sets the quant results background opacity.
  331. /// </summary>
  332. /// <value>
  333. /// The quant results background opacity.
  334. /// </value>
  335. public double QuantResultsBackgroundOpacity
  336. {
  337. get
  338. {
  339. return SpectrumViewerStyle.QuantResultsBackgroundOpacity;
  340. }
  341. set
  342. {
  343. SpectrumViewerStyle.QuantResultsBackgroundOpacity = value;
  344. }
  345. }
  346. /// <summary>
  347. /// Gets or sets a value indicating whether to show the quant results.
  348. /// </summary>
  349. /// <value>
  350. /// <c>true</c> if showing the quant results; otherwise, <c>false</c>.
  351. /// </value>
  352. public bool ShowQuantResults
  353. {
  354. get
  355. {
  356. return SpectrumViewerStyle.ShowQuantResults;
  357. }
  358. set
  359. {
  360. SpectrumViewerStyle.ShowQuantResults = value;
  361. }
  362. }
  363. /// <summary>
  364. /// Gets or sets the quant results format.
  365. /// </summary>
  366. /// <value>
  367. /// The quant results format.
  368. /// </value>
  369. public QuantResultFormat QuantResultsFormat
  370. {
  371. get
  372. {
  373. return SpectrumViewerStyle.QuantResultsFormat;
  374. }
  375. set
  376. {
  377. SpectrumViewerStyle.QuantResultsFormat = value;
  378. }
  379. }
  380. /// <summary>
  381. /// Gets or sets the quant results category.
  382. /// </summary>
  383. /// <value>
  384. /// The quant results category.
  385. /// </value>
  386. public QuantResultCategory QuantResultsCategory
  387. {
  388. get
  389. {
  390. return SpectrumViewerStyle.QuantResultsCategory;
  391. }
  392. set
  393. {
  394. SpectrumViewerStyle.QuantResultsCategory = value;
  395. }
  396. }
  397. /// <summary>
  398. /// SpectrumViewerVisualSettings
  399. /// </summary>
  400. public SpectrumViewerVisualSettings()
  401. {
  402. this.InitializeComponent();
  403. this.DataContext = this;
  404. this.UpdateComboBoxes();
  405. }
  406. /// <summary>
  407. /// Handles the Click event of the ResetStyle Button.
  408. /// </summary>
  409. /// <param name="sender">The source of the event.</param>
  410. /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
  411. private void ResetStyle_click(object sender, RoutedEventArgs e)
  412. {
  413. SpectrumViewerStyle.ResetStyles();
  414. this.UpdateComboBoxes();
  415. }
  416. /// <summary>
  417. /// UpdateComboBoxes
  418. /// </summary>
  419. private void UpdateComboBoxes()
  420. {
  421. this.cbSpectrumBackgroundColor.SelectedColor = SpectrumViewerStyle.SpectrumBackgroundColor;
  422. this.cbSpectrumForegroundColor.SelectedColor = SpectrumViewerStyle.SpectrumLabelTextColor;
  423. this.cbAxisTextColor.SelectedColor = SpectrumViewerStyle.AxisTextColor;
  424. this.cbAxisLinesVisible.IsChecked = SpectrumViewerStyle.IsAxisLineVisible;
  425. this.cbAxisColor.SelectedColor = SpectrumViewerStyle.AxisColor;
  426. this.cbSpectrumVisualFillColor.SelectedColor = SpectrumViewerStyle.SpectrumVisualFillColor;
  427. this.cbSpectrumLabelChromeBorderBrushColor.SelectedColor = SpectrumViewerStyle.SpectrumPeakLabelBorderColor;
  428. this.cbSpectrumLabelChromeBackgroundColor.SelectedColor = SpectrumViewerStyle.SpectrumPeakLabelBackgroundColor;
  429. this.cbSpectrumLabelViewForegroundColor.SelectedColor = SpectrumViewerStyle.SpectrumPeakLabelTextColor;
  430. this.cbMainSpectrumLabelBackgroundColor.SelectedColor = SpectrumViewerStyle.AlternatePeakLabelBackground;
  431. this.cbMainSpectrumLabelForegroundColor.SelectedColor = SpectrumViewerStyle.AlternatePeakLabelTextColor;
  432. this.cbAxisFontSize.SelectedValue = SpectrumViewerStyle.AxisFontSize;
  433. this.cbAxisLabelMargin.SelectedValue = SpectrumViewerStyle.AxisLabelMargin;
  434. this.cbAxisMajorTickLength.SelectedValue = SpectrumViewerStyle.AxisMajorTickLength;
  435. this.cbAxisMinorTickLength.SelectedValue = SpectrumViewerStyle.AxisMinorTickLength;
  436. this.cbAxisSubMinorTickLength.SelectedValue = SpectrumViewerStyle.AxisSubMinorTickLength;
  437. this.cbAxisLineThickness.SelectedValue = SpectrumViewerStyle.AxisLineThickness;
  438. this.cbQuantResultsBackgroundColor.SelectedColor = SpectrumViewerStyle.QuantResultsBackgroundColor;
  439. this.cbQuantResultsBackgroundOpacity.SelectedValue = SpectrumViewerStyle.QuantResultsBackgroundOpacity;
  440. this.cbQuantResultsFormat.SelectedValue = SpectrumViewerStyle.QuantResultsFormat;
  441. this.cbQuantResultsCategory.SelectedValue = SpectrumViewerStyle.QuantResultsCategory;
  442. this.cbQuantResultsVisible.IsChecked = SpectrumViewerStyle.ShowQuantResults;
  443. }
  444. }
  445. }