SpectrumViewerVisualSettings.xaml.cs 15 KB

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