Advertisement
bbbbas

GrafOb.java

May 28th, 2014
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.76 KB | None | 0 0
  1. package calculator;
  2.  
  3. import java.util.Stack;
  4. import javax.swing.JButton;
  5.  
  6. /**
  7. *
  8. * @author bas
  9. */
  10. public class GrafOb extends javax.swing.JFrame {
  11.  
  12. /**
  13. *
  14. */
  15. private static final long serialVersionUID = 1L;
  16. /**
  17. * Creates new form GrafOb
  18. */
  19. public GrafOb() {
  20. initComponents();
  21. jPanel3.setVisible(false);
  22. }
  23.  
  24. private void initComponents() {
  25.  
  26. jPanel1 = new javax.swing.JPanel();
  27. jTextField1 = new javax.swing.JTextField();
  28. jButtonPlusMin = new javax.swing.JButton();
  29. jButtonC = new javax.swing.JButton();
  30. jButtonRound = new javax.swing.JButton();
  31. jButtonExit = new javax.swing.JButton();
  32. jButtonPlus = new javax.swing.JButton();
  33. jButtonSqrt = new javax.swing.JButton();
  34. jButtonQuadr = new javax.swing.JButton();
  35. jButtonMin = new javax.swing.JButton();
  36. jButton7 = new javax.swing.JButton();
  37. jButton8 = new javax.swing.JButton();
  38. jButton9 = new javax.swing.JButton();
  39. jButtonMult = new javax.swing.JButton();
  40. jButtonDiv = new javax.swing.JButton();
  41. jButton4 = new javax.swing.JButton();
  42. jButton5 = new javax.swing.JButton();
  43. jButtonMod = new javax.swing.JButton();
  44. jButton1getX = new javax.swing.JButton();
  45. jButton6 = new javax.swing.JButton();
  46. jButton1 = new javax.swing.JButton();
  47. jButtonDot = new javax.swing.JButton();
  48. jButton3 = new javax.swing.JButton();
  49. jButton2 = new javax.swing.JButton();
  50. jButtonEquals = new javax.swing.JButton();
  51. jButton0 = new javax.swing.JButton();
  52. jTextFieldNachkst = new javax.swing.JTextField();
  53. jLabel1 = new javax.swing.JLabel();
  54. jPanel3 = new javax.swing.JPanel();
  55. jLabel6 = new javax.swing.JLabel();
  56. jLabel7 = new javax.swing.JLabel();
  57. jLabel8 = new javax.swing.JLabel();
  58. jButtonConvert = new javax.swing.JButton();
  59. jLabel9 = new javax.swing.JLabel();
  60. jTextFieldNumToConv = new javax.swing.JTextField();
  61. jTextFieldFromBase = new javax.swing.JTextField();
  62. jTextFieldToBase = new javax.swing.JTextField();
  63. jTextFieldResult = new javax.swing.JTextField();
  64. jMenuBar2 = new javax.swing.JMenuBar();
  65. jMenu1 = new javax.swing.JMenu();
  66. jMenuItem1 = new javax.swing.JMenuItem();
  67. jMenuItem2 = new javax.swing.JMenuItem();
  68.  
  69. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  70. setBackground(new java.awt.Color(204, 255, 204));
  71.  
  72. jPanel1.setBackground(new java.awt.Color(0, 255, 153));
  73.  
  74. jTextField1.setBackground(new java.awt.Color(204, 255, 204));
  75. jTextField1.setForeground(new java.awt.Color(0, 153, 51));
  76. jTextField1.addActionListener(new java.awt.event.ActionListener() {
  77. public void actionPerformed(java.awt.event.ActionEvent evt) {
  78. jTextField1ActionPerformed(evt);
  79. }
  80. });
  81.  
  82. jButtonPlusMin.setBackground(new java.awt.Color(204, 255, 204));
  83. jButtonPlusMin.setForeground(new java.awt.Color(0, 153, 0));
  84. jButtonPlusMin.setText("±");
  85. jButtonPlusMin.setActionCommand("jButtonPlusMin\n");
  86. jButtonPlusMin.addActionListener(new java.awt.event.ActionListener() {
  87. public void actionPerformed(java.awt.event.ActionEvent evt) {
  88. jButtonPlusMinActionPerformed(evt);
  89. }
  90. });
  91.  
  92. jButtonC.setBackground(new java.awt.Color(255, 255, 204));
  93. jButtonC.setForeground(new java.awt.Color(51, 153, 0));
  94. jButtonC.setText("C");
  95. jButtonC.setActionCommand("jButtonC");
  96. jButtonC.addActionListener(new java.awt.event.ActionListener() {
  97. public void actionPerformed(java.awt.event.ActionEvent evt) {
  98. jButtonCActionPerformed(evt);
  99. }
  100. });
  101.  
  102. jButtonRound.setBackground(new java.awt.Color(255, 255, 204));
  103. jButtonRound.setForeground(new java.awt.Color(51, 153, 0));
  104. jButtonRound.setText("round");
  105. jButtonRound.setActionCommand("jButtonRound");
  106. jButtonRound.addActionListener(new java.awt.event.ActionListener() {
  107. public void actionPerformed(java.awt.event.ActionEvent evt) {
  108. jButtonRoundActionPerformed(evt);
  109. }
  110. });
  111.  
  112. jButtonExit.setBackground(new java.awt.Color(255, 255, 204));
  113. jButtonExit.setForeground(new java.awt.Color(51, 153, 0));
  114. jButtonExit.setText("exit");
  115. jButtonExit.addActionListener(new java.awt.event.ActionListener() {
  116. public void actionPerformed(java.awt.event.ActionEvent evt) {
  117. jButtonExitActionPerformed(evt);
  118. }
  119. });
  120.  
  121. jButtonPlus.setBackground(new java.awt.Color(204, 255, 204));
  122. jButtonPlus.setForeground(new java.awt.Color(0, 153, 0));
  123. jButtonPlus.setText("+");
  124. jButtonPlus.setActionCommand("jButtonPlus\n");
  125. jButtonPlus.addActionListener(new java.awt.event.ActionListener() {
  126. public void actionPerformed(java.awt.event.ActionEvent evt) {
  127. jButtonPlusActionPerformed(evt);
  128. }
  129. });
  130.  
  131. jButtonSqrt.setBackground(new java.awt.Color(204, 255, 204));
  132. jButtonSqrt.setForeground(new java.awt.Color(0, 153, 0));
  133. jButtonSqrt.setText("√");
  134. jButtonSqrt.setActionCommand("jButtonSqrt");
  135. jButtonSqrt.addActionListener(new java.awt.event.ActionListener() {
  136. public void actionPerformed(java.awt.event.ActionEvent evt) {
  137. jButtonSqrtActionPerformed(evt);
  138. }
  139. });
  140.  
  141. jButtonQuadr.setBackground(new java.awt.Color(204, 255, 204));
  142. jButtonQuadr.setForeground(new java.awt.Color(0, 153, 0));
  143. jButtonQuadr.setText("x²");
  144. jButtonQuadr.setActionCommand("jButtonQuadr\n");
  145. jButtonQuadr.addActionListener(new java.awt.event.ActionListener() {
  146. public void actionPerformed(java.awt.event.ActionEvent evt) {
  147. jButtonQuadrActionPerformed(evt);
  148. }
  149. });
  150.  
  151. jButtonMin.setBackground(new java.awt.Color(204, 255, 204));
  152. jButtonMin.setForeground(new java.awt.Color(0, 153, 0));
  153. jButtonMin.setText("-");
  154. jButtonMin.setActionCommand("jButtonMin");
  155. jButtonMin.addActionListener(new java.awt.event.ActionListener() {
  156. public void actionPerformed(java.awt.event.ActionEvent evt) {
  157. jButtonMinActionPerformed(evt);
  158. }
  159. });
  160.  
  161. jButton7.setBackground(new java.awt.Color(255, 255, 204));
  162. jButton7.setForeground(new java.awt.Color(0, 153, 0));
  163. jButton7.setText("7");
  164. jButton7.setActionCommand("jButton7");
  165. jButton7.addActionListener(new java.awt.event.ActionListener() {
  166. public void actionPerformed(java.awt.event.ActionEvent evt) {
  167. jButton7ActionPerformed(evt);
  168. }
  169. });
  170.  
  171. jButton8.setBackground(new java.awt.Color(255, 255, 204));
  172. jButton8.setForeground(new java.awt.Color(0, 153, 0));
  173. jButton8.setText("8");
  174. jButton8.setActionCommand("jButton8");
  175. jButton8.addActionListener(new java.awt.event.ActionListener() {
  176. public void actionPerformed(java.awt.event.ActionEvent evt) {
  177. jButton8ActionPerformed(evt);
  178. }
  179. });
  180.  
  181. jButton9.setBackground(new java.awt.Color(255, 255, 204));
  182. jButton9.setForeground(new java.awt.Color(0, 153, 0));
  183. jButton9.setText("9");
  184. jButton9.setActionCommand("jButton9");
  185. jButton9.addActionListener(new java.awt.event.ActionListener() {
  186. public void actionPerformed(java.awt.event.ActionEvent evt) {
  187. jButton9ActionPerformed(evt);
  188. }
  189. });
  190.  
  191. jButtonMult.setBackground(new java.awt.Color(204, 255, 204));
  192. jButtonMult.setForeground(new java.awt.Color(0, 153, 0));
  193. jButtonMult.setText("*");
  194. jButtonMult.setActionCommand("jButtonMult");
  195. jButtonMult.addActionListener(new java.awt.event.ActionListener() {
  196. public void actionPerformed(java.awt.event.ActionEvent evt) {
  197. jButtonMultActionPerformed(evt);
  198. }
  199. });
  200.  
  201. jButtonDiv.setBackground(new java.awt.Color(204, 255, 204));
  202. jButtonDiv.setForeground(new java.awt.Color(0, 153, 0));
  203. jButtonDiv.setText("/");
  204. jButtonDiv.setActionCommand("jButtonDiv");
  205. jButtonDiv.addActionListener(new java.awt.event.ActionListener() {
  206. public void actionPerformed(java.awt.event.ActionEvent evt) {
  207. jButtonDivActionPerformed(evt);
  208. }
  209. });
  210.  
  211. jButton4.setBackground(new java.awt.Color(255, 255, 204));
  212. jButton4.setForeground(new java.awt.Color(0, 153, 0));
  213. jButton4.setText("4");
  214. jButton4.setActionCommand("jButton4");
  215. jButton4.addActionListener(new java.awt.event.ActionListener() {
  216. public void actionPerformed(java.awt.event.ActionEvent evt) {
  217. jButton4ActionPerformed(evt);
  218. }
  219. });
  220.  
  221. jButton5.setBackground(new java.awt.Color(255, 255, 204));
  222. jButton5.setForeground(new java.awt.Color(0, 153, 0));
  223. jButton5.setText("5");
  224. jButton5.setActionCommand("jButton5 ");
  225. jButton5.addActionListener(new java.awt.event.ActionListener() {
  226. public void actionPerformed(java.awt.event.ActionEvent evt) {
  227. jButton5ActionPerformed(evt);
  228. }
  229. });
  230.  
  231. jButtonMod.setBackground(new java.awt.Color(204, 255, 204));
  232. jButtonMod.setForeground(new java.awt.Color(0, 153, 0));
  233. jButtonMod.setText("%");
  234. jButtonMod.setActionCommand("jButtonMod");
  235. jButtonMod.addActionListener(new java.awt.event.ActionListener() {
  236. public void actionPerformed(java.awt.event.ActionEvent evt) {
  237. jButtonModActionPerformed(evt);
  238. }
  239. });
  240.  
  241. jButton1getX.setBackground(new java.awt.Color(204, 255, 204));
  242. jButton1getX.setForeground(new java.awt.Color(0, 153, 0));
  243. jButton1getX.setText("1/x");
  244. jButton1getX.setActionCommand("jButton1getX");
  245. jButton1getX.addActionListener(new java.awt.event.ActionListener() {
  246. public void actionPerformed(java.awt.event.ActionEvent evt) {
  247. jButton1getXActionPerformed(evt);
  248. }
  249. });
  250.  
  251. jButton6.setBackground(new java.awt.Color(255, 255, 204));
  252. jButton6.setForeground(new java.awt.Color(0, 153, 0));
  253. jButton6.setText("6");
  254. jButton6.setActionCommand("jButton6");
  255. jButton6.addActionListener(new java.awt.event.ActionListener() {
  256. public void actionPerformed(java.awt.event.ActionEvent evt) {
  257. jButton6ActionPerformed(evt);
  258. }
  259. });
  260.  
  261. jButton1.setBackground(new java.awt.Color(255, 255, 204));
  262. jButton1.setForeground(new java.awt.Color(0, 153, 0));
  263. jButton1.setText("1");
  264. jButton1.setActionCommand("jButton1");
  265. jButton1.addActionListener(new java.awt.event.ActionListener() {
  266. public void actionPerformed(java.awt.event.ActionEvent evt) {
  267. jButton1ActionPerformed(evt);
  268. }
  269. });
  270.  
  271. jButtonDot.setBackground(new java.awt.Color(204, 255, 204));
  272. jButtonDot.setForeground(new java.awt.Color(0, 153, 0));
  273. jButtonDot.setText(".");
  274. jButtonDot.setActionCommand("jButtonDot");
  275. jButtonDot.addActionListener(new java.awt.event.ActionListener() {
  276. public void actionPerformed(java.awt.event.ActionEvent evt) {
  277. jButtonDotActionPerformed(evt);
  278. }
  279. });
  280.  
  281. jButton3.setBackground(new java.awt.Color(255, 255, 204));
  282. jButton3.setForeground(new java.awt.Color(0, 153, 0));
  283. jButton3.setText("3");
  284. jButton3.setActionCommand("jButton3");
  285. jButton3.addActionListener(new java.awt.event.ActionListener() {
  286. public void actionPerformed(java.awt.event.ActionEvent evt) {
  287. jButton3ActionPerformed(evt);
  288. }
  289. });
  290.  
  291. jButton2.setBackground(new java.awt.Color(255, 255, 204));
  292. jButton2.setForeground(new java.awt.Color(0, 153, 0));
  293. jButton2.setText("2");
  294. jButton2.setActionCommand("jButton2");
  295. jButton2.addActionListener(new java.awt.event.ActionListener() {
  296. public void actionPerformed(java.awt.event.ActionEvent evt) {
  297. jButton2ActionPerformed(evt);
  298. }
  299. });
  300.  
  301. jButtonEquals.setBackground(new java.awt.Color(204, 255, 204));
  302. jButtonEquals.setForeground(new java.awt.Color(0, 153, 0));
  303. jButtonEquals.setText("=");
  304. jButtonEquals.setActionCommand("jButtonEquals");
  305. jButtonEquals.addActionListener(new java.awt.event.ActionListener() {
  306. public void actionPerformed(java.awt.event.ActionEvent evt) {
  307. jButtonEqualsActionPerformed(evt);
  308. }
  309. });
  310.  
  311. jButton0.setBackground(new java.awt.Color(255, 255, 204));
  312. jButton0.setForeground(new java.awt.Color(0, 153, 0));
  313. jButton0.setText("0");
  314. jButton0.setActionCommand("jButton0");
  315. jButton0.addActionListener(new java.awt.event.ActionListener() {
  316. public void actionPerformed(java.awt.event.ActionEvent evt) {
  317. jButton0ActionPerformed(evt);
  318. }
  319. });
  320.  
  321. jLabel1.setText("Decimal places:");
  322.  
  323. javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  324. jPanel1.setLayout(jPanel1Layout);
  325. jPanel1Layout.setHorizontalGroup(
  326. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  327. .addGroup(jPanel1Layout.createSequentialGroup()
  328. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  329. .addGroup(jPanel1Layout.createSequentialGroup()
  330. .addGap(67, 67, 67)
  331. .addComponent(jButton0, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  332. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  333. .addComponent(jLabel1)
  334. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  335. .addComponent(jTextFieldNachkst, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
  336. .addGroup(jPanel1Layout.createSequentialGroup()
  337. .addGap(14, 14, 14)
  338. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  339. .addGroup(jPanel1Layout.createSequentialGroup()
  340. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  341. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
  342. .addGroup(jPanel1Layout.createSequentialGroup()
  343. .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  344. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  345. .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  346. .addGap(10, 10, 10)
  347. .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  348. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  349. .addComponent(jButtonMod))
  350. .addGroup(jPanel1Layout.createSequentialGroup()
  351. .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  352. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  353. .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  354. .addGap(10, 10, 10)
  355. .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  356. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  357. .addComponent(jButtonMult, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
  358. .addGroup(jPanel1Layout.createSequentialGroup()
  359. .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  360. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  361. .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  362. .addGap(10, 10, 10)
  363. .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  364. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  365. .addComponent(jButtonDot, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)))
  366. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  367. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  368. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  369. .addComponent(jButtonDiv, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE)
  370. .addComponent(jButtonEquals, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE))
  371. .addComponent(jButton1getX)))
  372. .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
  373. .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
  374. .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
  375. .addComponent(jButtonPlusMin, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  376. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  377. .addComponent(jButtonQuadr, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  378. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  379. .addComponent(jButtonSqrt, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  380. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  381. .addComponent(jButtonPlus, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
  382. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  383. .addComponent(jButtonMin, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
  384. .addGroup(jPanel1Layout.createSequentialGroup()
  385. .addComponent(jButtonRound, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  386. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  387. .addComponent(jButtonExit, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
  388. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  389. .addComponent(jButtonC, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))))))
  390. .addContainerGap(22, Short.MAX_VALUE))
  391. );
  392. jPanel1Layout.setVerticalGroup(
  393. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  394. .addGroup(jPanel1Layout.createSequentialGroup()
  395. .addContainerGap(18, Short.MAX_VALUE)
  396. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  397. .addComponent(jButtonRound)
  398. .addComponent(jButtonExit)
  399. .addComponent(jButtonC))
  400. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  401. .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  402. .addGap(18, 18, 18)
  403. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  404. .addComponent(jButtonPlusMin)
  405. .addComponent(jButtonQuadr)
  406. .addComponent(jButtonSqrt)
  407. .addComponent(jButtonPlus)
  408. .addComponent(jButtonMin))
  409. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  410. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  411. .addComponent(jButtonDiv)
  412. .addComponent(jButtonMult)
  413. .addComponent(jButton9)
  414. .addComponent(jButton8)
  415. .addComponent(jButton7))
  416. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  417. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  418. .addComponent(jButton1getX)
  419. .addComponent(jButtonMod)
  420. .addComponent(jButton6)
  421. .addComponent(jButton5)
  422. .addComponent(jButton4))
  423. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  424. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  425. .addComponent(jButton1)
  426. .addComponent(jButton2)
  427. .addComponent(jButton3)
  428. .addComponent(jButtonDot)
  429. .addComponent(jButtonEquals))
  430. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  431. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  432. .addComponent(jButton0)
  433. .addComponent(jLabel1)
  434. .addComponent(jTextFieldNachkst, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  435. .addContainerGap(22, Short.MAX_VALUE))
  436. );
  437.  
  438. jPanel3.setBackground(new java.awt.Color(102, 255, 255));
  439.  
  440. jLabel6.setForeground(new java.awt.Color(0, 102, 102));
  441. jLabel6.setText("Number to convert: ");
  442.  
  443. jLabel7.setForeground(new java.awt.Color(0, 102, 102));
  444. jLabel7.setText("from base:");
  445.  
  446. jLabel8.setForeground(new java.awt.Color(0, 102, 102));
  447. jLabel8.setText("to base: ");
  448.  
  449. jButtonConvert.setBackground(new java.awt.Color(204, 255, 204));
  450. jButtonConvert.setForeground(new java.awt.Color(0, 102, 102));
  451. jButtonConvert.setText("Convert");
  452. jButtonConvert.addActionListener(new java.awt.event.ActionListener() {
  453. public void actionPerformed(java.awt.event.ActionEvent evt) {
  454. jButtonConvertActionPerformed(evt);
  455. }
  456. });
  457.  
  458. jLabel9.setForeground(new java.awt.Color(0, 102, 102));
  459. jLabel9.setText("Result:");
  460.  
  461. jTextFieldNumToConv.setBackground(new java.awt.Color(204, 255, 204));
  462.  
  463.  
  464. jTextFieldFromBase.setBackground(new java.awt.Color(204, 255, 204));
  465. jTextFieldFromBase.setForeground(new java.awt.Color(0, 153, 153));
  466.  
  467.  
  468. jTextFieldToBase.setBackground(new java.awt.Color(204, 255, 204));
  469. jTextFieldToBase.setForeground(new java.awt.Color(0, 153, 153));
  470.  
  471.  
  472. jTextFieldResult.setBackground(new java.awt.Color(204, 255, 204));
  473. jTextFieldResult.setForeground(new java.awt.Color(0, 153, 153));
  474.  
  475. javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
  476. jPanel3.setLayout(jPanel3Layout);
  477. jPanel3Layout.setHorizontalGroup(
  478. jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  479. .addGroup(jPanel3Layout.createSequentialGroup()
  480. .addGap(20, 20, 20)
  481. .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  482. .addComponent(jLabel9)
  483. .addComponent(jButtonConvert)
  484. .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
  485. .addGroup(jPanel3Layout.createSequentialGroup()
  486. .addComponent(jLabel8)
  487. .addGap(157, 157, 157)
  488. .addComponent(jTextFieldToBase, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
  489. .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
  490. .addComponent(jLabel7)
  491. .addGap(148, 148, 148)
  492. .addComponent(jTextFieldFromBase, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
  493. .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING)
  494. .addComponent(jTextFieldNumToConv, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE))
  495. .addComponent(jTextFieldResult, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE))
  496. .addContainerGap(24, Short.MAX_VALUE))
  497. );
  498. jPanel3Layout.setVerticalGroup(
  499. jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  500. .addGroup(jPanel3Layout.createSequentialGroup()
  501. .addGap(16, 16, 16)
  502. .addComponent(jLabel6)
  503. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  504. .addComponent(jTextFieldNumToConv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  505. .addGap(18, 18, 18)
  506. .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  507. .addComponent(jLabel7)
  508. .addComponent(jTextFieldFromBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  509. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  510. .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  511. .addComponent(jLabel8)
  512. .addComponent(jTextFieldToBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  513. .addGap(18, 18, 18)
  514. .addComponent(jButtonConvert)
  515. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  516. .addComponent(jLabel9)
  517. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  518. .addComponent(jTextFieldResult, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  519. .addContainerGap(20, Short.MAX_VALUE))
  520. );
  521.  
  522. jMenu1.setText("Options");
  523.  
  524. jMenuItem1.setText("Calculator");
  525. jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
  526. public void actionPerformed(java.awt.event.ActionEvent evt) {
  527. jMenuItem1ActionPerformed(evt);
  528. }
  529. });
  530. jMenu1.add(jMenuItem1);
  531.  
  532. jMenuItem2.setText("Base Convertion");
  533. jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
  534. public void actionPerformed(java.awt.event.ActionEvent evt) {
  535. jMenuItem2ActionPerformed(evt);
  536. }
  537. });
  538. jMenu1.add(jMenuItem2);
  539.  
  540. jMenuBar2.add(jMenu1);
  541.  
  542. setJMenuBar(jMenuBar2);
  543.  
  544. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  545. getContentPane().setLayout(layout);
  546. layout.setHorizontalGroup(
  547. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  548. .addGroup(layout.createSequentialGroup()
  549. .addContainerGap()
  550. .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  551. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  552. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  553. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  554. .addContainerGap()
  555. .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  556. .addContainerGap()))
  557. );
  558. layout.setVerticalGroup(
  559. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  560. .addGroup(layout.createSequentialGroup()
  561. .addContainerGap()
  562. .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  563. .addContainerGap(20, Short.MAX_VALUE))
  564. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  565. .addGroup(layout.createSequentialGroup()
  566. .addContainerGap()
  567. .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  568. .addContainerGap(34, Short.MAX_VALUE)))
  569. );
  570.  
  571. pack();
  572. }// </editor-fold>
  573.  
  574. StringBuffer sb = new StringBuffer();
  575. Stack<String> operation = new Stack<String>();
  576.  
  577. // JFormattedTextField, EventObject getSource()
  578.  
  579. private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
  580. // TODO add your handling code here:
  581. }
  582.  
  583. private void jButtonPlusMinActionPerformed(java.awt.event.ActionEvent evt) {
  584. // TODO add your handling code here:
  585. jTextField1.setText("-");
  586. sb.append("-");
  587. operation.push("-");
  588. }
  589. private void jButtonCActionPerformed(java.awt.event.ActionEvent evt) {
  590. // TODO add your handling code here:
  591. jTextField1.setText("");
  592. sb.delete(0,100);
  593.  
  594. }
  595.  
  596. private void jButtonRoundActionPerformed(java.awt.event.ActionEvent evt) {
  597. // TODO add your handling code here:
  598. //sb.append(jTextField1.getText());
  599. //System.out.println("1Step:vzima text:" + sb.toString());
  600. jTextField1.setText(round(Double.parseDouble(
  601. jTextField1.getText()), Integer.parseInt
  602. (jTextFieldNachkst.getText())));
  603. sb.append("!");
  604. System.out.println("2Step:slaga tochka:"+sb.toString());
  605. operation.push("!");
  606.  
  607.  
  608. }
  609.  
  610. private void jButtonExitActionPerformed(java.awt.event.ActionEvent evt) {
  611. // TODO add your handling code here:
  612. System.exit(0);
  613. }
  614.  
  615. private void jButtonPlusActionPerformed(java.awt.event.ActionEvent evt) {
  616. // TODO add your handling code here:
  617. sb.append(jTextField1.getText());
  618. jTextField1.setText("");
  619. sb.append("+");
  620. operation.push("+");
  621. }
  622.  
  623. private void jButtonMinActionPerformed(java.awt.event.ActionEvent evt) {
  624. // TODO add your handling code here:
  625. sb.append(jTextField1.getText());
  626. jTextField1.setText("");
  627. sb.append("-");
  628. operation.push("-");
  629. }
  630.  
  631. private void jButtonMultActionPerformed(java.awt.event.ActionEvent evt) {
  632. // TODO add your handling code here:
  633. sb.append(jTextField1.getText());
  634. jTextField1.setText("");
  635. sb.append("*");
  636. operation.push("*");
  637.  
  638. }
  639.  
  640. private void jButtonDivActionPerformed(java.awt.event.ActionEvent evt) {
  641. sb.append(jTextField1.getText());
  642. jTextField1.setText("");
  643. sb.append("/");
  644. operation.push("/");
  645. }
  646.  
  647. private void jButtonSqrtActionPerformed(java.awt.event.ActionEvent evt) {
  648. // TODO add your handling code here:
  649. sb.append(jTextField1.getText());
  650. jTextField1.setText("");
  651. sb.append("@");
  652. operation.push("@");
  653.  
  654. }
  655.  
  656. private void jButtonQuadrActionPerformed(java.awt.event.ActionEvent evt) {
  657. // TODO add your handling code here:
  658. sb.append(jTextField1.getText());
  659. jTextField1.setText("");
  660. sb.append("^");
  661. operation.push("^");
  662.  
  663. }
  664.  
  665. private void jButtonModActionPerformed(java.awt.event.ActionEvent evt) {
  666. // TODO add your handling code here:
  667. sb.append(jTextField1.getText());
  668. jTextField1.setText("");
  669. sb.append("%");
  670. operation.push("%");
  671. }
  672.  
  673. private void jButton1getXActionPerformed(java.awt.event.ActionEvent evt) {
  674. // TODO add your handling code here:
  675. sb.append(jTextField1.getText());
  676. jTextField1.setText("");
  677. sb.append("$");
  678. operation.push("$");
  679.  
  680. }
  681.  
  682. private void jButtonDotActionPerformed(java.awt.event.ActionEvent evt) {
  683. // TODO add your handling code here:
  684. jTextField1.setText(jTextField1.getText() + ".");
  685.  
  686. }
  687. StringBuffer undo=new StringBuffer();
  688. private void calculate() {
  689. String wahl = operation.peek();
  690. int i = sb.indexOf(wahl);
  691. double firstOperand = Double.parseDouble(sb.substring(1, i));
  692. sb.deleteCharAt(i);
  693. double secondOperand = Double.parseDouble(sb.substring(i));
  694. double ergebnis = 0;
  695. switch (wahl) {
  696. case "+":
  697. ergebnis = firstOperand + secondOperand;
  698. break;
  699. case "-":
  700. ergebnis = firstOperand - secondOperand;
  701. break;
  702. case "*":
  703. ergebnis = firstOperand * secondOperand;
  704. break;
  705. case "/":
  706. ergebnis = firstOperand / secondOperand;
  707. break;
  708. case "%": ergebnis=firstOperand % secondOperand;
  709. break;
  710.  
  711. }
  712. undo.append(sb);
  713. sb.delete(1, 100);
  714. noDotNull(ergebnis);
  715.  
  716. if(noDotNull(ergebnis) == true) {
  717. sb.append((int)ergebnis); }
  718. else {
  719. sb.append(ergebnis);
  720. }
  721. System.out.println(sb.toString());
  722.  
  723. }
  724.  
  725. private void calculateSpec() {
  726. String wahl = operation.peek();
  727. int i = sb.indexOf(wahl);
  728. double firstOperand = Double.parseDouble(sb.substring(1, i));
  729. sb.deleteCharAt(i);
  730. double ergebnis = 0;
  731. switch (wahl) {
  732. case "^":
  733. ergebnis = firstOperand * firstOperand;
  734. break;
  735. case "$":
  736. ergebnis = 1 / firstOperand;
  737. break;
  738. case "@":
  739. ergebnis = Math.sqrt(firstOperand);
  740. break;
  741. case "!": ergebnis= Double.parseDouble(round(firstOperand,Integer.parseInt(jTextFieldNachkst.getText())));
  742. break;
  743.  
  744. }
  745. sb.delete(1, 100);
  746. noDotNull(ergebnis);
  747. System.out.println("Erg after rounding:" + ergebnis);
  748. if(noDotNull(ergebnis) == true) ergebnis = (int)ergebnis;
  749. sb.append(ergebnis);
  750. System.out.println(sb.toString());
  751.  
  752. }
  753. public boolean noDotNull(double ergebnis)
  754. {
  755. int i = 1;
  756.  
  757. for(;i<(int)ergebnis;i++)
  758. {
  759. if(ergebnis % i == 0)
  760. break;
  761. }
  762. return ergebnis % i == 0;
  763. }
  764.  
  765. public String round(double erg,int nachkommastellen) {
  766. String x1 = jTextFieldNachkst.getText();
  767. nachkommastellen = Integer.parseInt(x1);
  768. /* Rundung */
  769. double s = Math.pow(10, nachkommastellen);
  770. double ergebnisl = Math.round(erg * s) / s;
  771. return String.valueOf(ergebnisl);
  772.  
  773. }
  774. private void numberListener(JButton button) {
  775. if (sb.length()==0){
  776. jTextField1.setText(button.getText());
  777. sb.append("#");
  778. } else {
  779. jTextField1.setText(jTextField1.getText()+ button.getText());
  780. }
  781. }
  782. private void jButtonEqualsActionPerformed(java.awt.event.ActionEvent evt) {
  783. // TODO add your handling code here:
  784. sb.append(jTextField1.getText());
  785. if (operation.peek()=="@" || operation.peek()== "^" || operation.peek()=="$" || operation.peek()=="!") {
  786. calculateSpec();
  787. } else {
  788. calculate();
  789. System.out.println("Golemina na SB:" + sb.length());
  790. }
  791. jTextField1.setText(sb.substring(1));
  792. sb.delete(1,100);
  793. System.out.println("Golemina na SB:" + sb.length());
  794. System.out.println("Sled =:"+sb.toString());
  795.  
  796. }
  797.  
  798. private void jButton0ActionPerformed(java.awt.event.ActionEvent evt) {
  799. numberListener(jButton0);
  800.  
  801. }
  802. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
  803. numberListener(jButton1);
  804.  
  805. }
  806. private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
  807. numberListener(jButton2);
  808.  
  809. }
  810. private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
  811. numberListener(jButton3);
  812.  
  813. }
  814. private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
  815. numberListener(jButton4);
  816.  
  817. }
  818. private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
  819. numberListener(jButton5);
  820.  
  821. }
  822. private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
  823. numberListener(jButton6);
  824.  
  825. }
  826. private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {
  827. numberListener(jButton7);
  828.  
  829. }
  830. private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {
  831. numberListener(jButton8);
  832.  
  833. }
  834. private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {
  835. numberListener(jButton9);
  836.  
  837. }
  838.  
  839. /* Methods for the second Panel */
  840. private void jButtonConvertActionPerformed(java.awt.event.ActionEvent evt) {
  841. DisplayNumber number;
  842.  
  843. number = new DisplayNumber(jTextFieldNumToConv.getText(),
  844. Integer.parseInt(jTextFieldFromBase.getText()));
  845. jTextFieldResult.setText(number.displayInBase
  846. (Integer.parseInt(jTextFieldToBase.getText())));
  847. }
  848.  
  849. private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
  850. jPanel1.setVisible(false);
  851. jPanel3.setVisible(true);
  852. }
  853.  
  854. private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
  855. jPanel3.setVisible(false);
  856. jPanel1.setVisible(true);
  857.  
  858. }
  859.  
  860.  
  861. /**
  862. * @param args the command line arguments
  863. */
  864. public static void main(String args[]) {
  865. /*
  866. * Set the Nimbus look and feel
  867. */
  868. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  869. /*
  870. * If Nimbus (introduced in Java SE 6) is not available, stay with the
  871. * default look and feel. For details see
  872. * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  873. */
  874. try {
  875. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  876. if ("Nimbus".equals(info.getName())) {
  877. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  878. break;
  879. }
  880. }
  881. } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
  882. java.util.logging.Logger.getLogger(GrafOb.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  883. }
  884. //</editor-fold>
  885.  
  886. /*
  887. * Create and display the form
  888. */
  889. java.awt.EventQueue.invokeLater(new Runnable() {
  890.  
  891. @Override
  892. public void run() {
  893. new GrafOb().setVisible(true);
  894. }
  895. });
  896. }
  897. // Variables declaration - do not modify
  898. private javax.swing.JButton jButton0;
  899. private javax.swing.JButton jButton1;
  900. private javax.swing.JButton jButtonConvert;
  901. private javax.swing.JButton jButton1getX;
  902. private javax.swing.JButton jButton2;
  903. private javax.swing.JButton jButton3;
  904. private javax.swing.JButton jButton4;
  905. private javax.swing.JButton jButton5;
  906. private javax.swing.JButton jButton6;
  907. private javax.swing.JButton jButton7;
  908. private javax.swing.JButton jButton8;
  909. private javax.swing.JButton jButton9;
  910. private javax.swing.JButton jButtonC;
  911. private javax.swing.JButton jButtonDiv;
  912. private javax.swing.JButton jButtonDot;
  913. private javax.swing.JButton jButtonEquals;
  914. private javax.swing.JButton jButtonExit;
  915. private javax.swing.JButton jButtonMin;
  916. private javax.swing.JButton jButtonMod;
  917. private javax.swing.JButton jButtonMult;
  918. private javax.swing.JButton jButtonPlus;
  919. private javax.swing.JButton jButtonPlusMin;
  920. private javax.swing.JButton jButtonQuadr;
  921. private javax.swing.JButton jButtonRound;
  922. private javax.swing.JButton jButtonSqrt;
  923. private javax.swing.JLabel jLabel1;
  924. private javax.swing.JLabel jLabel6;
  925. private javax.swing.JLabel jLabel7;
  926. private javax.swing.JLabel jLabel8;
  927. private javax.swing.JLabel jLabel9;
  928. private javax.swing.JMenu jMenu1;
  929. private javax.swing.JMenuBar jMenuBar2;
  930. private javax.swing.JMenuItem jMenuItem1;
  931. private javax.swing.JMenuItem jMenuItem2;
  932. private javax.swing.JPanel jPanel1;
  933. private javax.swing.JPanel jPanel3;
  934. private javax.swing.JTextField jTextField1;
  935. private javax.swing.JTextField jTextFieldNumToConv;
  936. private javax.swing.JTextField jTextFieldFromBase;
  937. private javax.swing.JTextField jTextFieldToBase;
  938. private javax.swing.JTextField jTextFieldResult;
  939. private javax.swing.JTextField jTextFieldNachkst;
  940. // End of variables declaration
  941. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement