├── .gitattributes ├── .gitignore ├── README.txt ├── doc ├── allclasses-frame.html ├── allclasses-noframe.html ├── com │ └── mtk │ │ └── calculator │ │ ├── CalcLauncher.html │ │ ├── Calculator.OperatorAction.html │ │ ├── Calculator.html │ │ ├── class-use │ │ ├── CalcLauncher.html │ │ ├── Calculator.OperatorAction.html │ │ └── Calculator.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── package-use.html ├── constant-values.html ├── deprecated-list.html ├── help-doc.html ├── index-files │ ├── index-1.html │ ├── index-2.html │ ├── index-3.html │ ├── index-4.html │ ├── index-5.html │ ├── index-6.html │ └── index-7.html ├── index.html ├── overview-tree.html ├── package-list ├── resources │ ├── background.gif │ ├── tab.gif │ ├── titlebar.gif │ └── titlebar_end.gif └── stylesheet.css ├── javadoc.xml └── src └── com └── mtk └── calculator ├── CalcLauncher.java └── Calculator.java /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | README.txt 2 | 3 | An amazing calculator which was made using java by importing swing/awt. 4 | 5 | The main class is ClacLauncher 6 | -------------------------------------------------------------------------------- /doc/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes 7 | 8 | 9 | 10 | 11 |

All Classes

12 |
13 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes 7 | 8 | 9 | 10 | 11 |

All Classes

12 |
13 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/com/mtk/calculator/CalcLauncher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CalcLauncher 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 78 | 79 | 80 |
81 |
com.mtk.calculator
82 |

Class CalcLauncher

83 |
84 |
85 | 93 |
94 | 108 |
109 |
110 | 157 |
158 |
159 | 198 |
199 |
200 | 201 | 202 |
203 | 204 | 205 | 206 | 207 | 216 |
217 | 259 | 260 | 261 | 262 | -------------------------------------------------------------------------------- /doc/com/mtk/calculator/Calculator.OperatorAction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Calculator.OperatorAction 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 78 | 79 | 80 |
81 |
com.mtk.calculator
82 |

Class Calculator.OperatorAction

83 |
84 |
85 | 93 |
94 | 113 |
114 |
115 | 181 |
182 |
183 | 243 |
244 |
245 | 246 | 247 |
248 | 249 | 250 | 251 | 252 | 261 |
262 | 304 | 305 | 306 | 307 | -------------------------------------------------------------------------------- /doc/com/mtk/calculator/Calculator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Calculator 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 78 | 79 | 80 |
81 |
com.mtk.calculator
82 |

Class Calculator

83 |
84 |
85 | 93 |
94 | 111 |
112 |
113 | 221 |
222 |
223 | 332 |
333 |
334 | 335 | 336 |
337 | 338 | 339 | 340 | 341 | 350 |
351 | 393 | 394 | 395 | 396 | -------------------------------------------------------------------------------- /doc/com/mtk/calculator/class-use/CalcLauncher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class com.mtk.calculator.CalcLauncher 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Uses of Class
com.mtk.calculator.CalcLauncher

66 |
67 |
No usage of com.mtk.calculator.CalcLauncher
68 | 69 |
70 | 71 | 72 | 73 | 74 | 83 |
84 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /doc/com/mtk/calculator/class-use/Calculator.OperatorAction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class com.mtk.calculator.Calculator.OperatorAction 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Uses of Class
com.mtk.calculator.Calculator.OperatorAction

66 |
67 |
No usage of com.mtk.calculator.Calculator.OperatorAction
68 | 69 |
70 | 71 | 72 | 73 | 74 | 83 |
84 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /doc/com/mtk/calculator/class-use/Calculator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class com.mtk.calculator.Calculator 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Uses of Class
com.mtk.calculator.Calculator

66 |
67 |
No usage of com.mtk.calculator.Calculator
68 | 69 |
70 | 71 | 72 | 73 | 74 | 83 |
84 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /doc/com/mtk/calculator/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.mtk.calculator 7 | 8 | 9 | 10 | 11 |

com.mtk.calculator

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/com/mtk/calculator/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.mtk.calculator 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Package com.mtk.calculator

66 |
67 |
68 | 87 |
88 | 89 |
90 | 91 | 92 | 93 | 94 | 103 |
104 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /doc/com/mtk/calculator/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.mtk.calculator Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Hierarchy For Package com.mtk.calculator

66 |
67 |
68 |

Class Hierarchy

69 | 76 |
77 | 78 |
79 | 80 | 81 | 82 | 83 | 92 |
93 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /doc/com/mtk/calculator/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Package com.mtk.calculator 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Uses of Package
com.mtk.calculator

66 |
67 |
No usage of com.mtk.calculator
68 | 69 |
70 | 71 | 72 | 73 | 74 | 83 |
84 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /doc/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Constant Field Values 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Constant Field Values

66 |

Contents

67 |
68 | 69 |
70 | 71 | 72 | 73 | 74 | 83 |
84 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /doc/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deprecated List 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Deprecated API

66 |

Contents

67 |
68 | 69 |
70 | 71 | 72 | 73 | 74 | 83 |
84 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /doc/help-doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Help 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

How This API Document Is Organized

66 |
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
67 |
68 |
69 | 168 | This help file applies to API documentation generated using the standard doclet.
169 | 170 |
171 | 172 | 173 | 174 | 175 | 184 |
185 | 212 | 213 | 214 | 215 | -------------------------------------------------------------------------------- /doc/index-files/index-1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | C-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
C M  65 | 66 | 67 |

C

68 |
69 |
CalcLauncher - Class in com.mtk.calculator
70 |
71 |
The main launcher for java calculator.
72 |
73 |
CalcLauncher() - Constructor for class com.mtk.calculator.CalcLauncher
74 |
 
75 |
com.mtk.calculator - package com.mtk.calculator
76 |
 
77 |
78 | C M 
79 | 80 |
81 | 82 | 83 | 84 | 85 | 94 |
95 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /doc/index-files/index-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | M-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
C M  65 | 66 | 67 |

M

68 |
69 |
main(String[]) - Static method in class com.mtk.calculator.CalcLauncher
70 |
 
71 |
72 | C M 
73 | 74 |
75 | 76 | 77 | 78 | 79 | 88 |
89 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /doc/index-files/index-3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | C-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
A B C G N O  65 | 66 | 67 |

C

68 |
69 |
calcOperation - Variable in class com.mtk.calculator.Calculator
70 |
 
71 |
Calculator - Class in com.mtk.calculator
72 |
 
73 |
Calculator() - Constructor for class com.mtk.calculator.Calculator
74 |
75 |
Consturct a new Calculator Frame.
76 |
77 |
Calculator.OperatorAction - Class in com.mtk.calculator
78 |
 
79 |
Calculator.OperatorAction(int) - Constructor for class com.mtk.calculator.Calculator.OperatorAction
80 |
 
81 |
com.mtk.calculator - package com.mtk.calculator
82 |
 
83 |
currentCalc - Variable in class com.mtk.calculator.Calculator
84 |
 
85 |
86 | A B C G N O 
87 | 88 |
89 | 90 | 91 | 92 | 93 | 102 |
103 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /doc/index-files/index-4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | G-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
A B C G N O  65 | 66 | 67 |

G

68 |
69 |
guiFrame - Variable in class com.mtk.calculator.Calculator
70 |
 
71 |
72 | A B C G N O 
73 | 74 |
75 | 76 | 77 | 78 | 79 | 88 |
89 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /doc/index-files/index-5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | N-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
A B C G N O  65 | 66 | 67 |

N

68 |
69 |
numberCalc - Variable in class com.mtk.calculator.Calculator
70 |
 
71 |
72 | A B C G N O 
73 | 74 |
75 | 76 | 77 | 78 | 79 | 88 |
89 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /doc/index-files/index-6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | O-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
A B C G N O  65 | 66 | 67 |

O

68 |
69 |
operator - Variable in class com.mtk.calculator.Calculator.OperatorAction
70 |
 
71 |
72 | A B C G N O 
73 | 74 |
75 | 76 | 77 | 78 | 79 | 88 |
89 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /doc/index-files/index-7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | O-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
A B C G M N O  65 | 66 | 67 |

O

68 |
69 |
operator - Variable in class com.mtk.calculator.Calculator.OperatorAction
70 |
 
71 |
72 | A B C G M N O 
73 | 74 |
75 | 76 | 77 | 78 | 79 | 88 |
89 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Generated Documentation (Untitled) 7 | 18 | 19 | 20 | 21 | 22 | 23 | <noscript> 24 | <div>JavaScript is disabled on your browser.</div> 25 | </noscript> 26 | <h2>Frame Alert</h2> 27 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="com/mtk/calculator/package-summary.html">Non-frame version</a>.</p> 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /doc/overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Hierarchy For All Packages

66 | Package Hierarchies: 67 | 70 |
71 |
72 |

Class Hierarchy

73 | 80 |
81 | 82 |
83 | 84 | 85 | 86 | 87 | 96 |
97 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /doc/package-list: -------------------------------------------------------------------------------- 1 | com.mtk.calculator 2 | -------------------------------------------------------------------------------- /doc/resources/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdtareque/Calculator/07f62fd66e8fccd633ab53c07cc3c029ae47fa05/doc/resources/background.gif -------------------------------------------------------------------------------- /doc/resources/tab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdtareque/Calculator/07f62fd66e8fccd633ab53c07cc3c029ae47fa05/doc/resources/tab.gif -------------------------------------------------------------------------------- /doc/resources/titlebar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdtareque/Calculator/07f62fd66e8fccd633ab53c07cc3c029ae47fa05/doc/resources/titlebar.gif -------------------------------------------------------------------------------- /doc/resources/titlebar_end.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdtareque/Calculator/07f62fd66e8fccd633ab53c07cc3c029ae47fa05/doc/resources/titlebar_end.gif -------------------------------------------------------------------------------- /doc/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | /* 3 | Overall document style 4 | */ 5 | body { 6 | background-color:#ffffff; 7 | color:#353833; 8 | font-family:Arial, Helvetica, sans-serif; 9 | font-size:76%; 10 | margin:0; 11 | } 12 | a:link, a:visited { 13 | text-decoration:none; 14 | color:#4c6b87; 15 | } 16 | a:hover, a:focus { 17 | text-decoration:none; 18 | color:#bb7a2a; 19 | } 20 | a:active { 21 | text-decoration:none; 22 | color:#4c6b87; 23 | } 24 | a[name] { 25 | color:#353833; 26 | } 27 | a[name]:hover { 28 | text-decoration:none; 29 | color:#353833; 30 | } 31 | pre { 32 | font-size:1.3em; 33 | } 34 | h1 { 35 | font-size:1.8em; 36 | } 37 | h2 { 38 | font-size:1.5em; 39 | } 40 | h3 { 41 | font-size:1.4em; 42 | } 43 | h4 { 44 | font-size:1.3em; 45 | } 46 | h5 { 47 | font-size:1.2em; 48 | } 49 | h6 { 50 | font-size:1.1em; 51 | } 52 | ul { 53 | list-style-type:disc; 54 | } 55 | code, tt { 56 | font-size:1.2em; 57 | } 58 | dt code { 59 | font-size:1.2em; 60 | } 61 | table tr td dt code { 62 | font-size:1.2em; 63 | vertical-align:top; 64 | } 65 | sup { 66 | font-size:.6em; 67 | } 68 | /* 69 | Document title and Copyright styles 70 | */ 71 | .clear { 72 | clear:both; 73 | height:0px; 74 | overflow:hidden; 75 | } 76 | .aboutLanguage { 77 | float:right; 78 | padding:0px 21px; 79 | font-size:.8em; 80 | z-index:200; 81 | margin-top:-7px; 82 | } 83 | .legalCopy { 84 | margin-left:.5em; 85 | } 86 | .bar a, .bar a:link, .bar a:visited, .bar a:active { 87 | color:#FFFFFF; 88 | text-decoration:none; 89 | } 90 | .bar a:hover, .bar a:focus { 91 | color:#bb7a2a; 92 | } 93 | .tab { 94 | background-color:#0066FF; 95 | background-image:url(resources/titlebar.gif); 96 | background-position:left top; 97 | background-repeat:no-repeat; 98 | color:#ffffff; 99 | padding:8px; 100 | width:5em; 101 | font-weight:bold; 102 | } 103 | /* 104 | Navigation bar styles 105 | */ 106 | .bar { 107 | background-image:url(resources/background.gif); 108 | background-repeat:repeat-x; 109 | color:#FFFFFF; 110 | padding:.8em .5em .4em .8em; 111 | height:auto;/*height:1.8em;*/ 112 | font-size:1em; 113 | margin:0; 114 | } 115 | .topNav { 116 | background-image:url(resources/background.gif); 117 | background-repeat:repeat-x; 118 | color:#FFFFFF; 119 | float:left; 120 | padding:0; 121 | width:100%; 122 | clear:right; 123 | height:2.8em; 124 | padding-top:10px; 125 | overflow:hidden; 126 | } 127 | .bottomNav { 128 | margin-top:10px; 129 | background-image:url(resources/background.gif); 130 | background-repeat:repeat-x; 131 | color:#FFFFFF; 132 | float:left; 133 | padding:0; 134 | width:100%; 135 | clear:right; 136 | height:2.8em; 137 | padding-top:10px; 138 | overflow:hidden; 139 | } 140 | .subNav { 141 | background-color:#dee3e9; 142 | border-bottom:1px solid #9eadc0; 143 | float:left; 144 | width:100%; 145 | overflow:hidden; 146 | } 147 | .subNav div { 148 | clear:left; 149 | float:left; 150 | padding:0 0 5px 6px; 151 | } 152 | ul.navList, ul.subNavList { 153 | float:left; 154 | margin:0 25px 0 0; 155 | padding:0; 156 | } 157 | ul.navList li{ 158 | list-style:none; 159 | float:left; 160 | padding:3px 6px; 161 | } 162 | ul.subNavList li{ 163 | list-style:none; 164 | float:left; 165 | font-size:90%; 166 | } 167 | .topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { 168 | color:#FFFFFF; 169 | text-decoration:none; 170 | } 171 | .topNav a:hover, .bottomNav a:hover { 172 | text-decoration:none; 173 | color:#bb7a2a; 174 | } 175 | .navBarCell1Rev { 176 | background-image:url(resources/tab.gif); 177 | background-color:#a88834; 178 | color:#FFFFFF; 179 | margin: auto 5px; 180 | border:1px solid #c9aa44; 181 | } 182 | /* 183 | Page header and footer styles 184 | */ 185 | .header, .footer { 186 | clear:both; 187 | margin:0 20px; 188 | padding:5px 0 0 0; 189 | } 190 | .indexHeader { 191 | margin:10px; 192 | position:relative; 193 | } 194 | .indexHeader h1 { 195 | font-size:1.3em; 196 | } 197 | .title { 198 | color:#2c4557; 199 | margin:10px 0; 200 | } 201 | .subTitle { 202 | margin:5px 0 0 0; 203 | } 204 | .header ul { 205 | margin:0 0 25px 0; 206 | padding:0; 207 | } 208 | .footer ul { 209 | margin:20px 0 5px 0; 210 | } 211 | .header ul li, .footer ul li { 212 | list-style:none; 213 | font-size:1.2em; 214 | } 215 | /* 216 | Heading styles 217 | */ 218 | div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { 219 | background-color:#dee3e9; 220 | border-top:1px solid #9eadc0; 221 | border-bottom:1px solid #9eadc0; 222 | margin:0 0 6px -8px; 223 | padding:2px 5px; 224 | } 225 | ul.blockList ul.blockList ul.blockList li.blockList h3 { 226 | background-color:#dee3e9; 227 | border-top:1px solid #9eadc0; 228 | border-bottom:1px solid #9eadc0; 229 | margin:0 0 6px -8px; 230 | padding:2px 5px; 231 | } 232 | ul.blockList ul.blockList li.blockList h3 { 233 | padding:0; 234 | margin:15px 0; 235 | } 236 | ul.blockList li.blockList h2 { 237 | padding:0px 0 20px 0; 238 | } 239 | /* 240 | Page layout container styles 241 | */ 242 | .contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { 243 | clear:both; 244 | padding:10px 20px; 245 | position:relative; 246 | } 247 | .indexContainer { 248 | margin:10px; 249 | position:relative; 250 | font-size:1.0em; 251 | } 252 | .indexContainer h2 { 253 | font-size:1.1em; 254 | padding:0 0 3px 0; 255 | } 256 | .indexContainer ul { 257 | margin:0; 258 | padding:0; 259 | } 260 | .indexContainer ul li { 261 | list-style:none; 262 | } 263 | .contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { 264 | font-size:1.1em; 265 | font-weight:bold; 266 | margin:10px 0 0 0; 267 | color:#4E4E4E; 268 | } 269 | .contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { 270 | margin:10px 0 10px 20px; 271 | } 272 | .serializedFormContainer dl.nameValue dt { 273 | margin-left:1px; 274 | font-size:1.1em; 275 | display:inline; 276 | font-weight:bold; 277 | } 278 | .serializedFormContainer dl.nameValue dd { 279 | margin:0 0 0 1px; 280 | font-size:1.1em; 281 | display:inline; 282 | } 283 | /* 284 | List styles 285 | */ 286 | ul.horizontal li { 287 | display:inline; 288 | font-size:0.9em; 289 | } 290 | ul.inheritance { 291 | margin:0; 292 | padding:0; 293 | } 294 | ul.inheritance li { 295 | display:inline; 296 | list-style:none; 297 | } 298 | ul.inheritance li ul.inheritance { 299 | margin-left:15px; 300 | padding-left:15px; 301 | padding-top:1px; 302 | } 303 | ul.blockList, ul.blockListLast { 304 | margin:10px 0 10px 0; 305 | padding:0; 306 | } 307 | ul.blockList li.blockList, ul.blockListLast li.blockList { 308 | list-style:none; 309 | margin-bottom:25px; 310 | } 311 | ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { 312 | padding:0px 20px 5px 10px; 313 | border:1px solid #9eadc0; 314 | background-color:#f9f9f9; 315 | } 316 | ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { 317 | padding:0 0 5px 8px; 318 | background-color:#ffffff; 319 | border:1px solid #9eadc0; 320 | border-top:none; 321 | } 322 | ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { 323 | margin-left:0; 324 | padding-left:0; 325 | padding-bottom:15px; 326 | border:none; 327 | border-bottom:1px solid #9eadc0; 328 | } 329 | ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { 330 | list-style:none; 331 | border-bottom:none; 332 | padding-bottom:0; 333 | } 334 | table tr td dl, table tr td dl dt, table tr td dl dd { 335 | margin-top:0; 336 | margin-bottom:1px; 337 | } 338 | /* 339 | Table styles 340 | */ 341 | .contentContainer table, .classUseContainer table, .constantValuesContainer table { 342 | border-bottom:1px solid #9eadc0; 343 | width:100%; 344 | } 345 | .contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table { 346 | width:100%; 347 | } 348 | .contentContainer .description table, .contentContainer .details table { 349 | border-bottom:none; 350 | } 351 | .contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{ 352 | vertical-align:top; 353 | padding-right:20px; 354 | } 355 | .contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast, 356 | .contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast, 357 | .contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne, 358 | .contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne { 359 | padding-right:3px; 360 | } 361 | .overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption { 362 | position:relative; 363 | text-align:left; 364 | background-repeat:no-repeat; 365 | color:#FFFFFF; 366 | font-weight:bold; 367 | clear:none; 368 | overflow:hidden; 369 | padding:0px; 370 | margin:0px; 371 | } 372 | caption a:link, caption a:hover, caption a:active, caption a:visited { 373 | color:#FFFFFF; 374 | } 375 | .overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span { 376 | white-space:nowrap; 377 | padding-top:8px; 378 | padding-left:8px; 379 | display:block; 380 | float:left; 381 | background-image:url(resources/titlebar.gif); 382 | height:18px; 383 | } 384 | .overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd { 385 | width:10px; 386 | background-image:url(resources/titlebar_end.gif); 387 | background-repeat:no-repeat; 388 | background-position:top right; 389 | position:relative; 390 | float:left; 391 | } 392 | ul.blockList ul.blockList li.blockList table { 393 | margin:0 0 12px 0px; 394 | width:100%; 395 | } 396 | .tableSubHeadingColor { 397 | background-color: #EEEEFF; 398 | } 399 | .altColor { 400 | background-color:#eeeeef; 401 | } 402 | .rowColor { 403 | background-color:#ffffff; 404 | } 405 | .overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td { 406 | text-align:left; 407 | padding:3px 3px 3px 7px; 408 | } 409 | th.colFirst, th.colLast, th.colOne, .constantValuesContainer th { 410 | background:#dee3e9; 411 | border-top:1px solid #9eadc0; 412 | border-bottom:1px solid #9eadc0; 413 | text-align:left; 414 | padding:3px 3px 3px 7px; 415 | } 416 | td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { 417 | font-weight:bold; 418 | } 419 | td.colFirst, th.colFirst { 420 | border-left:1px solid #9eadc0; 421 | white-space:nowrap; 422 | } 423 | td.colLast, th.colLast { 424 | border-right:1px solid #9eadc0; 425 | } 426 | td.colOne, th.colOne { 427 | border-right:1px solid #9eadc0; 428 | border-left:1px solid #9eadc0; 429 | } 430 | table.overviewSummary { 431 | padding:0px; 432 | margin-left:0px; 433 | } 434 | table.overviewSummary td.colFirst, table.overviewSummary th.colFirst, 435 | table.overviewSummary td.colOne, table.overviewSummary th.colOne { 436 | width:25%; 437 | vertical-align:middle; 438 | } 439 | table.packageSummary td.colFirst, table.overviewSummary th.colFirst { 440 | width:25%; 441 | vertical-align:middle; 442 | } 443 | /* 444 | Content styles 445 | */ 446 | .description pre { 447 | margin-top:0; 448 | } 449 | .deprecatedContent { 450 | margin:0; 451 | padding:10px 0; 452 | } 453 | .docSummary { 454 | padding:0; 455 | } 456 | /* 457 | Formatting effect styles 458 | */ 459 | .sourceLineNo { 460 | color:green; 461 | padding:0 30px 0 0; 462 | } 463 | h1.hidden { 464 | visibility:hidden; 465 | overflow:hidden; 466 | font-size:.9em; 467 | } 468 | .block { 469 | display:block; 470 | margin:3px 0 0 0; 471 | } 472 | .strong { 473 | font-weight:bold; 474 | } 475 | -------------------------------------------------------------------------------- /javadoc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/com/mtk/calculator/CalcLauncher.java: -------------------------------------------------------------------------------- 1 | package com.mtk.calculator; 2 | import java.awt.EventQueue; 3 | 4 | 5 | /** 6 | * The main launcher for java calculator. Creates the {@code Calculator} object. 7 | * @author mtk 8 | * @version 1.0 Nov 25, 2012 9 | * @see Calculator 10 | */ 11 | public class CalcLauncher { 12 | /** 13 | * @param args 14 | * Currently no arguments required to be passed to this program. 15 | */ 16 | public static void main(String[] args) { 17 | 18 | // Use the event dispatch thread for Swing components 19 | EventQueue.invokeLater(new Runnable() { 20 | /* (non-Javadoc) 21 | * @see java.lang.Runnable#run() 22 | */ 23 | @Override 24 | public void run() { 25 | new Calculator(); 26 | } 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/com/mtk/calculator/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.mtk.calculator; 2 | 3 | import java.awt.GridLayout; 4 | import java.awt.BorderLayout; 5 | import java.awt.event.ActionListener; 6 | import java.awt.event.ActionEvent; 7 | import javax.swing.JFrame; 8 | import javax.swing.JPanel; 9 | import javax.swing.JTextField; 10 | import javax.swing.JButton; 11 | import java.awt.Container; 12 | 13 | /** 14 | * Create the UI and also performs the event handling and operations of calculations. 15 | * @author mtk 16 | * @version 1.0 Nov 25, 2012 17 | */ 18 | public class Calculator implements ActionListener { 19 | 20 | JFrame guiFrame; 21 | JPanel buttonPanel; 22 | JTextField numberCalc; 23 | int calcOperation = 0; 24 | int currentCalc; 25 | 26 | /** 27 | * Consturct a new Calculator Frame. Sets a default 28 | * EXIT_ON_CLOSE option. Positions the JFrame in 29 | * the middle of the screen Also fills the UI with required components. 30 | */ 31 | public Calculator() { 32 | guiFrame = new JFrame(); 33 | 34 | guiFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 35 | guiFrame.setTitle("Simple Calculator"); 36 | guiFrame.setSize(300, 300); 37 | 38 | guiFrame.setLocationRelativeTo(null); 39 | 40 | numberCalc = new JTextField(); 41 | numberCalc.setHorizontalAlignment(JTextField.RIGHT); 42 | numberCalc.setEditable(false); 43 | 44 | guiFrame.add(numberCalc, BorderLayout.NORTH); 45 | 46 | buttonPanel = new JPanel(); 47 | 48 | buttonPanel.setLayout(new GridLayout(5, 3)); 49 | guiFrame.add(buttonPanel, BorderLayout.CENTER); 50 | 51 | // Add the number buttons 52 | for (int i = 1; i < 10; i++) { 53 | addButton(buttonPanel, String.valueOf(i)); 54 | } 55 | addButton(buttonPanel, " "); 56 | addButton(buttonPanel, "0"); 57 | addButton(buttonPanel, " "); 58 | 59 | JButton addButton = new JButton("+"); 60 | addButton.setActionCommand("+"); 61 | 62 | OperatorAction subAction = new OperatorAction(1); 63 | addButton.addActionListener(subAction); 64 | 65 | JButton subButton = new JButton("-"); 66 | subButton.setActionCommand("-"); 67 | 68 | OperatorAction addAction = new OperatorAction(2); 69 | subButton.addActionListener(addAction); 70 | 71 | JButton equalsButton = new JButton("="); 72 | equalsButton.setActionCommand("="); 73 | equalsButton.addActionListener(new ActionListener() { 74 | /* (non-Javadoc) 75 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 76 | */ 77 | @Override 78 | public void actionPerformed(ActionEvent event) { 79 | if (!numberCalc.getText().isEmpty()) { 80 | int number = Integer.parseInt(numberCalc.getText()); 81 | if (calcOperation == 1) { 82 | int calculate = currentCalc + number; 83 | numberCalc.setText(Integer.toString(calculate)); 84 | } else if (calcOperation == 2) { 85 | int calculate = currentCalc - number; 86 | numberCalc.setText(Integer.toString(calculate)); 87 | } 88 | } 89 | } 90 | }); 91 | 92 | buttonPanel.add(addButton); 93 | buttonPanel.add(subButton); 94 | buttonPanel.add(equalsButton); 95 | guiFrame.setVisible(true); 96 | } 97 | 98 | /** 99 | * @param parent 100 | * the main container of the component to be added 101 | * @param name 102 | * name of the JButton that is to be added 103 | */ 104 | private void addButton(Container parent, String name) { 105 | JButton but = new JButton(name); 106 | but.setActionCommand(name); 107 | but.addActionListener(this); 108 | parent.add(but); 109 | } 110 | 111 | /* (non-Javadoc) 112 | * As all the buttons are doing the same thing it's easier to make the class 113 | * implement the ActionListener interface and control the 114 | * button clicks from one place 115 | * 116 | * @see 117 | * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 118 | */ 119 | @Override 120 | public void actionPerformed(ActionEvent event) { 121 | String action = event.getActionCommand(); 122 | numberCalc.setText(action); 123 | } 124 | 125 | /** 126 | * @author mtk 127 | * 128 | */ 129 | private class OperatorAction implements ActionListener { 130 | private int operator; 131 | 132 | /** 133 | * @param operation 134 | */ 135 | public OperatorAction(int operation) { 136 | operator = operation; 137 | } 138 | 139 | /* (non-Javadoc) 140 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 141 | */ 142 | public void actionPerformed(ActionEvent event) { 143 | currentCalc = Integer.parseInt(numberCalc.getText()); 144 | calcOperation = operator; 145 | } 146 | } 147 | } --------------------------------------------------------------------------------