1. import javax.swing.JApplet;
  2. import javax.swing.JPanel;
  3. import javax.swing.JTabbedPane;
  4. import javax.swing.JLabel;
  5. import javax.swing.JFormattedTextField;
  6. import javax.swing.border.Border;
  7. import javax.swing.BorderFactory;
  8. import javax.swing.JTextArea;
  9. import javax.swing.JCheckBox;
  10.  
  11. import java.awt.Dimension;
  12. import java.awt.GridLayout;
  13. import java.awt.Color;
  14. import java.awt.GridBagLayout;
  15. import java.awt.GridBagConstraints;
  16. import java.awt.event.ItemListener;
  17. import java.awt.event.ItemEvent;
  18. //import java.awt.Insets;
  19.  
  20. import java.beans.PropertyChangeListener;
  21. import java.beans.PropertyChangeEvent;
  22. import java.text.NumberFormat;
  23.  
  24. import org.jfree.chart.JFreeChart;
  25. import org.jfree.chart.ChartFactory;
  26. import org.jfree.chart.ChartPanel;
  27. import org.jfree.chart.axis.NumberAxis;
  28. import org.jfree.chart.plot.PlotOrientation;
  29. import org.jfree.chart.plot.XYPlot;
  30. import org.jfree.data.xy.XYDataset;
  31. import org.jfree.data.xy.XYSeries;
  32. import org.jfree.data.xy.XYSeriesCollection;
  33. import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
  34.  
  35. public class RshamSpamModel extends JApplet implements PropertyChangeListener, ItemListener
  36. {
  37. public static double intellect = 1489; //base intellect
  38. public static double spellpower = 3301;
  39. public static double critrating = 689;
  40. public static double hasterating = 1269;
  41. public static double stacks = 0;
  42. public static final double classcrit = 5 + 4 + 2.2; //percent chance to get crits from class and global crit talents (
  43.  
  44. static boolean Kings = true; //10% to all stats
  45. static boolean WrathOfAir = true; //5% spell haste
  46. static boolean MoonkinAura = true; //3% haste, 5% crit
  47. static boolean Berserking = false; //Troll racial, 20% haste
  48. static boolean Bloodlust = false; //30% haste, but does not affect GCD
  49. static boolean TreeOfLife = true; //6% additional healing done
  50. static boolean ICCBuff = true; //25% additional healing done
  51. static boolean MOTW = true; //Increases all atributes by 37
  52. static boolean ForKings = false; //8% to all stats
  53.  
  54. static XYSeries RHHCHHseries;
  55. static XYSeries RHHHHseries;
  56. static XYSeries RHHHLseries;
  57. static XYSeries HHHHHseries;
  58. static XYSeries RCCCseries;
  59. static XYSeries RCCCCseries;
  60. static XYSeries CCCCCseries;
  61.  
  62.  
  63. static JFormattedTextField intellectField;
  64. static JFormattedTextField spellpowerField;
  65. static JFormattedTextField critratingField;
  66. static JFormattedTextField hasteratingField;
  67. static JFormattedTextField stacksField;
  68.  
  69. static JCheckBox KingsBox;
  70. static JCheckBox WrathOfAirBox;
  71. static JCheckBox MoonkinAuraBox;
  72. static JCheckBox BerserkingBox;
  73. static JCheckBox BloodlustBox;
  74. static JCheckBox TreeOfLifeBox;
  75. static JCheckBox ICCBuffBox;
  76. static JCheckBox MOTWBox;
  77. static JCheckBox ForKingsBox;
  78.  
  79. static JTextArea textArea;
  80.  
  81.  
  82. //Called when this applet is loaded into the browser
  83. public void init()
  84. {
  85. setSize(new Dimension(800,600));
  86. XYDataset dataset = createDataset();
  87. JFreeChart hpsChart = createChart(dataset);
  88. ChartPanel chartPanel = new ChartPanel(hpsChart);
  89.  
  90. JPanel statsPanel = createStatsPanel();
  91.  
  92. JTabbedPane tabs = new JTabbedPane();
  93. //tabs.addTab("Graph", chartPanel);
  94. tabs.addTab("Stats", statsPanel);
  95.  
  96. tabs.setPreferredSize(new Dimension(1920, 1200));
  97. setContentPane(tabs);
  98. simulate();
  99. }
  100.  
  101. public void simulate()
  102. {
  103. /* base healing amounts (non-crit) before non-character buffs */
  104. double LHWbase = 1.2 * 1.1 * (1720 + spellpower * 0.9057); //I assume if you are going to use LHW you better have ES on the target and ES glyph
  105. double HWbase = 1.25 * 1.1 * (3250 + spellpower * 1.8114);
  106. double CHbase = 1.2 * 1.1 * (1130 + spellpower * 1.3428);
  107. double RTbase = 1.1 * (1670 + spellpower * 0.402);
  108. double RThot = 1.1 * (334 + spellpower * 0.188);
  109. double ELhot = 1.1 * (652 + spellpower * 12/15 * 1.88 * 5/11) / 4;
  110.  
  111. double critchance = (critrating / 45.91 + classcrit + intellect / 166.6667) / 100;
  112. double hastemultiplier = 1 / (1 + hasterating / 3279);
  113. double AAcoeff = 0.297;
  114. double GCD = 1.5;
  115. double intellect = this.intellect;
  116.  
  117. /* various buffs (comment out the line if you don't want those buffs calculated; bloodlust is located after GCD calculation) */
  118. if (MOTW) { intellect += 37; } //MOTW
  119. if (Kings) { critchance += 0.1 * intellect / 166.6667 / 100; } //Kings
  120. if (ForKings) { critchance += 0.08 * intellect / 166.6667 / 100; } //Blessing of Forgotten Kings
  121. if (WrathOfAir) { hastemultiplier *= 1 / (1 + 5.0/100); } //WoA
  122. if (MoonkinAura) { hastemultiplier *= 1 / (1 + 3.0/100); critchance += 0.05; } //Moonkin aura
  123. if (Berserking) { hastemultiplier *= 1 / (1 + 20.0/100); } //Berserking
  124. if (TreeOfLife) { LHWbase *= 1.06; HWbase *= 1.06; CHbase *= 1.06; RTbase *= 1.06; RThot *= 1.06; ELhot *= 1.06; AAcoeff *= 1.06; } //Tree of Life/Imp Devo
  125. if (ICCBuff) { LHWbase *= 1.25; HWbase *= 1.25; CHbase *= 1.25; RTbase *= 1.25; RThot *= 1.25; ELhot *= 1.25; AAcoeff *= 1.25; } //ICC 25% buff
  126.  
  127. GCD = GCD * hastemultiplier >= 1 ? GCD * hastemultiplier : 1.0;
  128. if (Bloodlust) { hastemultiplier *= 1 / (1 + 30.0/100); } // bloodlust; doesn't affect GCD but can be modeled as effective haste, so it is added in after GCD is calculated
  129.  
  130. textArea.setText("LHW base heal (w/ ES on the target):\t" + LHWbase);
  131. textArea.append("\nHW base heal:\t\t\t" + HWbase);
  132. textArea.append("\nCH base heal:\t\t\t" + CHbase);
  133. textArea.append("\nRT base heal:\t\t\t" + RTbase);
  134. textArea.append("\nRT tick:\t\t\t" + RThot);
  135. textArea.append("\nEL tick:\t\t\t" + ELhot);
  136.  
  137. textArea.append("\n\nCrit chance:\t\t\t" + critchance * 100 + "%");
  138. textArea.append("\nHaste multiplier:\t\t" + hastemultiplier);
  139.  
  140. double RTtime = 1.5 * hastemultiplier >= GCD ? 1.5 * hastemultiplier : GCD; //checks to see if spells are at or under the GCD, assigns 1 sec if they are
  141. double LHWtime = 1.5 * hastemultiplier >= GCD ? 1.5 * hastemultiplier : GCD;
  142. double CHtime = 2.5 * hastemultiplier >= GCD ? 2.5 * hastemultiplier : GCD;
  143. double CH2pctime = CHtime * 1 / (1 + 20.0/100) >= 1 ? CHtime * 1 / (1 + 20.0/100) : 1;
  144. double HWtime = 2.5 * hastemultiplier >= GCD ? 2.5 * hastemultiplier : GCD;
  145. double HWTWtime = 2.5 * .7 * hastemultiplier >= 1 ? 2.5 * .7 * hastemultiplier : 1;
  146. double HWTW2pctime = HWTWtime * 1 / (1 + 20.0/100) >= 1 ? HWTWtime * 1 / (1 + 20.0/100) : 1;
  147.  
  148. System.out.println("RT cast time:\t\t\t" + RTtime);
  149. System.out.println("LHW cast time:\t\t\t" + LHWtime);
  150. System.out.println("CH time:\t\t\t" + CHtime);
  151. System.out.println("CH + 2pcT10:\t\t\t" + CH2pctime);
  152. System.out.println("HW cast time:\t\t\t" + HWtime);
  153. System.out.println("HW w/ Tidal Waves cast time:\t" + HWTWtime);
  154. System.out.println("HW w/ Tidal Waves + 2pcT10:\t" + HWTW2pctime);
  155. System.out.println();
  156.  
  157. /*double RHHCHHtime = RTtime + //RT
  158. HWTW2pctime + //the HW after the RT due to 2pcT10
  159. HWTWtime * 3 + //the other 3 HW
  160. CHtime; //CH
  161. if (RHHCHHtime < 6) RHHCHHtime = 6;
  162.  
  163. double RHHHHtime = RTtime +
  164. HWTW2pctime +
  165. HWTWtime + //the next HW
  166. HWtime * 2; //the next 2 HW
  167. if (RHHHHtime < 6) RHHHHtime = 6;
  168.  
  169. double RHHHLtime = RTtime +
  170. HWTW2pctime +
  171. HWTWtime + //the next HW
  172. HWtime + //the next HW
  173. LHWtime;
  174. if (RHHHLtime < 6) RHHHLtime = 6;
  175.  
  176. double RHHHHHtime = RTtime +
  177. HWTW2pctime +
  178. HWTWtime + //the next HW
  179. HWtime * 3; //the next 3 HW
  180. if (RHHHHHtime < 6) RHHHHHtime = 6;
  181.  
  182. double HHHHHtime = HWtime * 5; //5 HW*/
  183.  
  184. double RCCCtime = RTtime +
  185. CH2pctime +
  186. CHtime * 2;
  187. if (RCCCtime < 6) RCCCtime = 6;
  188.  
  189. double RCCCCtime = RTtime +
  190. CH2pctime +
  191. CHtime * 3;
  192. if (RCCCCtime < 6) RCCCCtime = 6;
  193.  
  194. double CCCCCtime = CHtime * 5;
  195. if (CCCCCtime < 6) CCCCCtime = 6;
  196.  
  197. //textArea.append("\n\nRHHCHH rotation time:\t\t" + RHHCHHtime);
  198. //textArea.append("\nRHHHH rotation time:\t\t" + RHHHHtime);
  199. //System.out.println("RHHHHH rotation time:\t\t" + RHHHHHtime);
  200. //textArea.append("\nRHHHL rotation time:\t\t" + RHHHLtime);
  201. //textArea.append("\nHHHHH rotation time:\t\t" + HHHHHtime);
  202. textArea.append("\nRCCC rotation time:\t\t" + RCCCtime);
  203. textArea.append("\nRCCCC rotation time:\t\t" + RCCCCtime);
  204. textArea.append("\nCCCCC rotation time:\t\t" + CCCCCtime);
  205.  
  206. //System.out.println();
  207.  
  208. long crossoverStacks = 0;
  209.  
  210. /*RHHCHHseries.clear();
  211. RHHHHseries.clear();
  212. RHHHLseries.clear();
  213. HHHHHseries.clear();*/
  214. RCCCseries.clear();
  215. RCCCCseries.clear();
  216. CCCCCseries.clear();
  217.  
  218. /*double RHHCHHavg = 0;
  219. double RHHHHavg = 0;
  220. double RHHHLavg = 0;
  221. double RHHHHHavg = 0;
  222. double HHHHHavg = 0;*/
  223. double RCCCavg = 0;
  224. double RCCCCavg = 0;
  225. double CCCCCavg = 0;
  226.  
  227. for (int i = 0; i <= stacks; i++)
  228. {
  229. double stacksMultiplier = 1 + 0.1 * i;
  230. double HWavg = stacksMultiplier * (HWbase * (1 - critchance) + HWbase * critchance * 1.5 + HWbase * critchance * 1.5 * AAcoeff * stacksMultiplier);
  231. double LHWavg = stacksMultiplier * (LHWbase * (1 - critchance) + LHWbase * critchance * 1.5 + LHWbase * critchance * 1.5 * AAcoeff * stacksMultiplier);
  232. double CHavg = stacksMultiplier * (CHbase * (1 - critchance) + CHbase * critchance * 1.5 + CHbase * 1.5 * critchance * .25); //4 pc T10 Rsham
  233. double RTavg = stacksMultiplier * (RTbase * (1 - critchance) + RTbase * critchance * 1.5 + RTbase * critchance * 1.5 * AAcoeff);
  234. double RTtickavg = stacksMultiplier * RThot;
  235. double ELhotavg = stacksMultiplier * ELhot;
  236.  
  237. /*RHHCHHavg = RTavg + RTtickavg * Math.floor((RTtime + HWTW2pctime + HWTWtime) / 3) + HWavg * 4 + 1.25 * CHavg;
  238. RHHHHavg = RTavg + RTtickavg * Math.floor((RHHHHtime) / 3) + HWavg * 2 + HWavg * 2;
  239. RHHHLavg = RTavg + RTtickavg * Math.floor((RHHHLtime) / 3) + HWavg * 2 + HWavg + LHWavg;
  240. RHHHHHavg = RTavg + RTtickavg * Math.floor((RHHHHHtime) / 3) + HWavg * 2 + HWavg * 3;
  241. HHHHHavg = HWavg * 5;*/
  242. RCCCavg = RTavg + RTtickavg * 4 + CHavg * 3 * 2.176;
  243. RCCCCavg = RTavg + RTtickavg * 4 + CHavg * 4 * 2.176;
  244. CCCCCavg = CHavg * 5 * 2.176;
  245.  
  246. /*RHHCHHseries.add(i, RHHCHHavg/RHHCHHtime);
  247. RHHHHseries.add(i, RHHHHavg/RHHHHtime);
  248. RHHHLseries.add(i, RHHHLavg/RHHHLtime);
  249. HHHHHseries.add(i, HHHHHavg/HHHHHtime);*/
  250. RCCCseries.add(i, RCCCavg/RCCCtime);
  251. RCCCCseries.add(i, RCCCCavg/RCCCCtime);
  252. CCCCCseries.add(i, CCCCCavg/CCCCCtime);
  253.  
  254. /*System.out.println();
  255. System.out.println("Stacks:\t" + i);
  256. System.out.println("RHHCHH HPS:\t" + RHHCHHavg/RHHCHHtime);
  257. System.out.println("RHHHH HPS:\t" + RHHHHavg/RHHHHtime);*/
  258. //System.out.println("RHHHL HPS:\t" + RHHHLavg/RHHHLtime);
  259. //System.out.println("RHHHHH HPS:\t" + RHHHHHavg/RHHHHHtime);
  260. //System.out.println("HHHHH HPS:\t" + HHHHHavg/HHHHHtime);
  261. textArea.append("\n\nRCCC HPS:\t" + RCCCavg/RCCCtime);
  262. textArea.append("\nRCCCC HPS:\t" + RCCCCavg/RCCCCtime);
  263. textArea.append("\nCCCCC HPS:\t" + CCCCCavg/CCCCCtime);
  264. //System.out.println("% difference:\t" + (RHHHHavg/RHHHHtime - RHHCHHavg/RHHCHHtime) / (RHHCHHavg/RHHCHHtime) * 100 + "%");
  265.  
  266. /*if (RHHHHavg/RHHHHtime > RHHCHHavg/RHHCHHtime && crossoverStacks == 0)
  267. crossoverStacks = i;*/
  268. }
  269.  
  270. /*if (RHHHHavg/RHHHHtime > RHHCHHavg/RHHCHHtime)
  271. textArea.append("\n\nRHHHH overtakes RHHCHH at " + crossoverStacks + " stacks");
  272. else
  273. textArea.append("\n\nRHHHH never overtakes RHHCHH, please extend simulated stacks");*/
  274. }
  275.  
  276. public XYDataset createDataset()
  277. {
  278.  
  279. /*RHHCHHseries = new XYSeries("RHHCHH");
  280. RHHHHseries = new XYSeries("RHHHH");
  281. RHHHLseries = new XYSeries("RHHHL");
  282. HHHHHseries = new XYSeries("Healing Wave Spam");*/
  283. RCCCseries = new XYSeries("RCCCseries");
  284. RCCCCseries = new XYSeries("RCCCCseries");
  285. CCCCCseries = new XYSeries("CCCCCseries");
  286. XYSeriesCollection dataset = new XYSeriesCollection();
  287. /*dataset.addSeries(RHHCHHseries);
  288. dataset.addSeries(RHHHHseries);
  289. dataset.addSeries(RHHHLseries);
  290. dataset.addSeries(HHHHHseries);*/
  291. dataset.addSeries(RCCCseries);
  292. dataset.addSeries(RCCCCseries);
  293. dataset.addSeries(CCCCCseries);
  294.  
  295. return dataset;
  296.  
  297. }
  298.  
  299. public JFreeChart createChart(XYDataset dataset)
  300. {
  301. JFreeChart chart = ChartFactory.createXYLineChart(
  302. "HPS vs Stacks", // chart title
  303. "Stacks", // x axis label
  304. "HPS", // y axis label
  305. dataset, // data
  306. PlotOrientation.VERTICAL,
  307. true, // include legend
  308. true, // tooltips
  309. false // urls
  310. );
  311.  
  312. // get a reference to the plot for further customisation...
  313. XYPlot plot = (XYPlot) chart.getPlot();
  314.  
  315. XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
  316. renderer.setBaseShapesVisible(false);
  317. renderer.setBaseShapesFilled(false);
  318.  
  319. // change the auto tick unit selection to integer units only...
  320. NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
  321. NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
  322. domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
  323. rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
  324.  
  325. return chart;
  326. }
  327.  
  328. public JPanel createStatsPanel()
  329. {
  330. //create new labels
  331. JLabel intellectLabel = new JLabel("Intellect");
  332. JLabel spellpowerLabel = new JLabel("Spellpower");
  333. JLabel critratingLabel = new JLabel("Crit Rating");
  334. JLabel hasteratingLabel = new JLabel("Haste Rating");
  335. JLabel stacksLabel = new JLabel("Number of stacks to simulate");
  336.  
  337. //create new fields
  338. intellectField = new JFormattedTextField(NumberFormat.getNumberInstance());
  339. intellectField.setValue(intellect);
  340. intellectField.setColumns(10);
  341. intellectField.addPropertyChangeListener("value", this);
  342.  
  343. spellpowerField = new JFormattedTextField(NumberFormat.getNumberInstance());
  344. spellpowerField.setValue(spellpower);
  345. spellpowerField.setColumns(10);
  346. spellpowerField.addPropertyChangeListener("value", this);
  347.  
  348. critratingField = new JFormattedTextField(NumberFormat.getNumberInstance());
  349. critratingField.setValue(critrating);
  350. critratingField.setColumns(10);
  351. critratingField.addPropertyChangeListener("value", this);
  352.  
  353. hasteratingField = new JFormattedTextField(NumberFormat.getNumberInstance());
  354. hasteratingField.setValue(hasterating);
  355. hasteratingField.setColumns(10);
  356. hasteratingField.addPropertyChangeListener("value", this);
  357.  
  358. stacksField = new JFormattedTextField(NumberFormat.getNumberInstance());
  359. stacksField.setValue(stacks);
  360. stacksField.setColumns(10);
  361. stacksField.addPropertyChangeListener("value", this);
  362.  
  363. intellectLabel.setLabelFor(intellectField);
  364. spellpowerLabel.setLabelFor(spellpowerField);
  365. critratingLabel.setLabelFor(critratingField);
  366. hasteratingLabel.setLabelFor(hasteratingField);
  367. stacksLabel.setLabelFor(stacksField);
  368.  
  369. //create new checkboxes
  370. KingsBox = new JCheckBox("Kings", Kings);
  371. ForKingsBox = new JCheckBox("Blessing of Forgotten Kings", ForKings);
  372. WrathOfAirBox = new JCheckBox("Wrath Of Air", WrathOfAir);
  373. MoonkinAuraBox = new JCheckBox("Moonkin Aura", MoonkinAura);
  374. BerserkingBox = new JCheckBox("Berserking", Berserking);
  375. BloodlustBox = new JCheckBox("Bloodlust", Bloodlust);
  376. TreeOfLifeBox = new JCheckBox("Tree Of Life/Improved Devotion Aura", TreeOfLife);
  377. ICCBuffBox = new JCheckBox("ICC Buff (25%)", ICCBuff);
  378. MOTWBox = new JCheckBox("Mark Of The Wild", MOTW);
  379.  
  380. KingsBox.addItemListener(this);
  381. ForKingsBox.addItemListener(this);
  382. WrathOfAirBox.addItemListener(this);
  383. MoonkinAuraBox.addItemListener(this);
  384. BerserkingBox.addItemListener(this);
  385. BloodlustBox.addItemListener(this);
  386. TreeOfLifeBox.addItemListener(this);
  387. ICCBuffBox.addItemListener(this);
  388.  
  389. JPanel labelPane = new JPanel(new GridLayout(0,1));
  390. labelPane.add(intellectLabel);
  391. labelPane.add(spellpowerLabel);
  392. labelPane.add(critratingLabel);
  393. labelPane.add(hasteratingLabel);
  394. labelPane.add(stacksLabel);
  395.  
  396. JPanel fieldPane = new JPanel(new GridLayout(0,1));
  397. fieldPane.add(intellectField);
  398. fieldPane.add(spellpowerField);
  399. fieldPane.add(critratingField);
  400. fieldPane.add(hasteratingField);
  401. fieldPane.add(stacksField);
  402.  
  403. JPanel statsPanel = new JPanel(new GridBagLayout());
  404. textArea = new JTextArea(3,50);
  405. textArea.setEditable(false);
  406.  
  407. JPanel buffPanel = new JPanel(new GridLayout(0,1));
  408. buffPanel.add(KingsBox);
  409. buffPanel.add(ForKingsBox);
  410. buffPanel.add(MOTWBox);
  411. buffPanel.add(WrathOfAirBox);
  412. buffPanel.add(MoonkinAuraBox);
  413. buffPanel.add(TreeOfLifeBox);
  414. buffPanel.add(ICCBuffBox);
  415. buffPanel.add(BerserkingBox);
  416. buffPanel.add(BloodlustBox);
  417.  
  418.  
  419.  
  420. Border blackline = BorderFactory.createLineBorder(Color.black);
  421.  
  422. labelPane.setBorder(blackline);
  423.  
  424. GridBagConstraints c = new GridBagConstraints();
  425. c.fill = GridBagConstraints.BOTH;
  426. c.gridx = 0;
  427. c.gridy = 0;
  428. c.weightx = 1;
  429. c.weighty = 1;
  430. //c.insets = new Insets(0,0,300,0);
  431. //c.anchor = GridBagConstraints.FIRST_LINE_END;
  432. statsPanel.add(labelPane, c);
  433.  
  434. c = new GridBagConstraints();
  435. c.fill = GridBagConstraints.VERTICAL;
  436. c.gridx = 1;
  437. c.gridy = 0;
  438. c.weightx = 1;
  439. c.weighty = 1;
  440. //c.insets = new Insets(0,0,300,0);
  441. c.anchor = GridBagConstraints.FIRST_LINE_START;
  442. statsPanel.add(fieldPane, c);
  443.  
  444. c = new GridBagConstraints();
  445. c.fill = GridBagConstraints.VERTICAL;
  446. c.gridx = 2;
  447. c.gridy = 0;
  448. c.weightx = 1;
  449. c.weighty = 1;
  450. //c.insets = new Insets(0,0,300,0);
  451. c.anchor = GridBagConstraints.FIRST_LINE_START;
  452. statsPanel.add(buffPanel, c);
  453.  
  454. c = new GridBagConstraints();
  455. c.gridx = 0;
  456. c.gridy = 1;
  457. c.gridwidth = 2;
  458. c.weightx = 1;
  459. c.weighty = 3;
  460. c.anchor = GridBagConstraints.FIRST_LINE_START;
  461. statsPanel.add(textArea, c);
  462.  
  463. return statsPanel;
  464. }
  465.  
  466. public void propertyChange(PropertyChangeEvent e)
  467. {
  468. Object source = e.getSource();
  469. if (source == intellectField)
  470. intellect = ((Number)intellectField.getValue()).doubleValue();
  471. else if (source == spellpowerField)
  472. spellpower = ((Number)spellpowerField.getValue()).doubleValue();
  473. else if (source == critratingField)
  474. critrating = ((Number)critratingField.getValue()).doubleValue();
  475. else if (source == hasteratingField)
  476. hasterating = ((Number)hasteratingField.getValue()).doubleValue();
  477. else if (source == stacksField)
  478. stacks = ((Number)stacksField.getValue()).doubleValue();
  479.  
  480. simulate();
  481. }
  482.  
  483. public void itemStateChanged (ItemEvent e)
  484. {
  485. Object source = e.getItemSelectable();
  486.  
  487. if (source == KingsBox)
  488. Kings = !Kings;
  489. else if (source == ForKingsBox)
  490. ForKings = !ForKings;
  491. else if (source == WrathOfAirBox)
  492. WrathOfAir = !WrathOfAir;
  493. else if (source == MoonkinAuraBox)
  494. MoonkinAura = !MoonkinAura;
  495. else if (source == BloodlustBox)
  496. Bloodlust = !Bloodlust;
  497. else if (source == BerserkingBox)
  498. Berserking = !Berserking;
  499. else if (source == TreeOfLifeBox)
  500. TreeOfLife = !TreeOfLife;
  501. else if (source == ICCBuffBox)
  502. ICCBuff = !ICCBuff;
  503. else if (source == MOTWBox)
  504. MOTW = !MOTW;
  505.  
  506.  
  507. simulate();
  508. }
  509. }