├── _config.yml ├── logo.png ├── src ├── resources │ └── icon │ │ ├── icon-notice.txt │ │ └── icon.png ├── simplejavacalculator │ ├── BufferedImageCustom.java │ ├── SimpleJavaCalculator.java │ ├── Calculator.java │ └── UI.java └── simplejavacalculatorTest │ └── CalculatorTest.java ├── manifest.mf ├── .gitignore ├── Screenshots ├── screenshot.png └── screenshot2.png ├── nbproject ├── genfiles.properties ├── project.xml ├── project.properties └── build-impl.xml ├── README.md └── license.txt /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-modernist -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pH-7/Simple-Java-Calculator/HEAD/logo.png -------------------------------------------------------------------------------- /src/resources/icon/icon-notice.txt: -------------------------------------------------------------------------------- 1 | `icon.png`, all rights reserved by xdvrx1 2 | -------------------------------------------------------------------------------- /manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /nbproject/private/ 2 | /build/ 3 | /dist/ 4 | *.class 5 | 6 | # Mac OS System 7 | .DS_Store* 8 | ._* 9 | -------------------------------------------------------------------------------- /Screenshots/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pH-7/Simple-Java-Calculator/HEAD/Screenshots/screenshot.png -------------------------------------------------------------------------------- /Screenshots/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pH-7/Simple-Java-Calculator/HEAD/Screenshots/screenshot2.png -------------------------------------------------------------------------------- /src/resources/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pH-7/Simple-Java-Calculator/HEAD/src/resources/icon/icon.png -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=189d4337 2 | build.xml.script.CRC32=ede855f2 3 | build.xml.stylesheet.CRC32=8064a381@1.75.2.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=189d4337 7 | nbproject/build-impl.xml.script.CRC32=36b7c7b6 8 | nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 9 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | SimpleJavaCalculator 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/simplejavacalculator/BufferedImageCustom.java: -------------------------------------------------------------------------------- 1 | package simplejavacalculator; 2 | 3 | import java.io.*; 4 | import java.awt.image.BufferedImage; 5 | import javax.imageio.ImageIO; 6 | import java.awt.*; 7 | 8 | /** 9 | *This class will return an image 10 | *from a binary data. 11 | */ 12 | class BufferedImageCustom { 13 | public Image imageReturn() 14 | throws IOException { 15 | Image image; 16 | 17 | InputStream bis = getClass().getResourceAsStream("/resources/icon/icon.png"); 18 | BufferedImage bImage2 = ImageIO.read(bis); 19 | image = bImage2; 20 | 21 | return image; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/simplejavacalculator/SimpleJavaCalculator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @name Simple Java Calculator 3 | * @package ph.calculator 4 | * @file Main.java 5 | * @author SORIA Pierre-Henry 6 | * @email pierrehs@hotmail.com 7 | * @link http://github.com/pH-7 8 | * @copyright Copyright Pierre-Henry SORIA, All Rights Reserved. 9 | * @license Apache (http://www.apache.org/licenses/LICENSE-2.0) 10 | * @create 2012-03-30 11 | * 12 | * @modifiedby Achintha Gunasekara 13 | * @modweb http://www.achinthagunasekara.com 14 | * @modemail contact@achinthagunasekara.com 15 | */ 16 | 17 | package simplejavacalculator; 18 | 19 | public class SimpleJavaCalculator { 20 | 21 | public static void main(String[] args) { 22 | try { 23 | UI uiCal = new UI(); 24 | uiCal.init(); 25 | } 26 | catch (Exception e) { 27 | System.out.println(e.getMessage()); 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # Simple Java Calculator 4 | 5 | ![Logo Simple Java Calculator](logo.png) 6 | 7 | --- 8 | 9 | This calculator is **simple** with an **easy to use code** to help novices **learn how to create a calculator** program with **`Java`**. 10 | 11 | --- 12 | 13 |
14 | 15 | This project was **originally written using `Eclipse`**, but I have **migrated it to NetBeans**. 16 | 17 | If you use the executable "SimpleJavaCalculator.jar" file and that doesn't work, you can type this in your terminal: 18 | 19 | ```shell 20 | java -jar /your_calculator_directory/SimpleJavaCalculator.jar` 21 | ``` 22 | 23 | ## :sparkles: Example 24 | 25 | ![Example: Java Calculator](Screenshots/screenshot.png) 26 | 27 | ## You might also like :monocle_face: 28 | 29 | **[My Simple Java Text Editor](https://github.com/pH-7/Simple-Java-Text-Editor).** 30 | 31 | [![Open-Source Simple Java Text Editor](https://github.com/pH-7/Simple-Java-Text-Editor/blob/master/Screenshots/find-replace-word-in-java-text-editor.png)](https://github.com/pH-7/Simple-Java-Text-Editor "Open-Source Simple Java Text Editor") 32 | 33 | 34 | ## 💡 Authors 35 | 36 | ### Base Application 37 | 38 | - **[Pierre-Henry Soria](https://ph7.me)** 39 | 40 | ### Modifications and Improvements 41 | 42 | - [Achintha Gunasekara](http://www.achinthagunasekara.com) 43 | - [xdvrx1](https://github.com/xdvrx1) 44 | 45 | 46 | ## 📮 Contact 47 | 48 | Pierre-Henry Soria: pierrehs [AT] hotmail [D0T] com 49 | 50 | Achintha Gunasekara: contact [AT] achinthagunasekara [D0T] com 51 | 52 | 53 | ## ⚖️ License 54 | 55 | Apache License, Version 2.0 or later; Read **[license.txt](./license.txt)** for further details. 56 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processor.options= 4 | annotation.processing.processors.list= 5 | annotation.processing.run.all.processors=true 6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 7 | build.classes.dir=${build.dir}/classes 8 | build.classes.excludes=**/*.java,**/*.form 9 | # This directory is removed when the project is cleaned: 10 | build.dir=build 11 | build.generated.dir=${build.dir}/generated 12 | build.generated.sources.dir=${build.dir}/generated-sources 13 | # Only compile against the classpath explicitly listed here: 14 | build.sysclasspath=ignore 15 | build.test.classes.dir=${build.dir}/test/classes 16 | build.test.results.dir=${build.dir}/test/results 17 | # Uncomment to specify the preferred debugger connection transport: 18 | #debug.transport=dt_socket 19 | debug.classpath=\ 20 | ${run.classpath} 21 | debug.test.classpath=\ 22 | ${run.test.classpath} 23 | # Files in build.classes.dir which should be excluded from distribution jar 24 | dist.archive.excludes= 25 | # This directory is removed when the project is cleaned: 26 | dist.dir=dist 27 | dist.jar=${dist.dir}/SimpleJavaCalculator.jar 28 | dist.javadoc.dir=${dist.dir}/javadoc 29 | excludes= 30 | includes=** 31 | jar.compress=false 32 | javac.classpath= 33 | # Space-separated list of extra javac options 34 | javac.compilerargs= 35 | javac.deprecation=false 36 | javac.processorpath=\ 37 | ${javac.classpath} 38 | javac.source=1.8 39 | javac.target=1.8 40 | javac.test.classpath=\ 41 | ${javac.classpath}:\ 42 | ${build.classes.dir} 43 | javac.test.processorpath=\ 44 | ${javac.test.classpath} 45 | javadoc.additionalparam= 46 | javadoc.author=false 47 | javadoc.encoding=${source.encoding} 48 | javadoc.noindex=false 49 | javadoc.nonavbar=false 50 | javadoc.notree=false 51 | javadoc.private=false 52 | javadoc.splitindex=true 53 | javadoc.use=true 54 | javadoc.version=false 55 | javadoc.windowtitle= 56 | main.class=simplejavacalculator.SimpleJavaCalculator 57 | manifest.file=manifest.mf 58 | meta.inf.dir=${src.dir}/META-INF 59 | mkdist.disabled=false 60 | platform.active=default_platform 61 | run.classpath=\ 62 | ${javac.classpath}:\ 63 | ${build.classes.dir} 64 | # Space-separated list of JVM arguments used when running the project. 65 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 66 | # To set system properties for unit tests define test-sys-prop.name=value: 67 | run.jvmargs= 68 | run.test.classpath=\ 69 | ${javac.test.classpath}:\ 70 | ${build.test.classes.dir} 71 | source.encoding=UTF-8 72 | src.dir=src 73 | test.src.dir=test 74 | -------------------------------------------------------------------------------- /src/simplejavacalculator/Calculator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @name Simple Java Calculator 3 | * @package ph.calculator 4 | * @file Main.java 5 | * @author SORIA Pierre-Henry 6 | * @email pierrehs@hotmail.com 7 | * @link http://github.com/pH-7 8 | * @copyright Copyright Pierre-Henry SORIA, All Rights Reserved. 9 | * @license Apache (http://www.apache.org/licenses/LICENSE-2.0) 10 | */ 11 | 12 | package simplejavacalculator; 13 | 14 | import static java.lang.Double.NaN; 15 | import static java.lang.Math.log; 16 | import static java.lang.Math.log10; 17 | import static java.lang.Math.pow; 18 | 19 | public class Calculator { 20 | 21 | public enum BiOperatorModes { 22 | normal, add, minus, multiply, divide , xpowerofy 23 | } 24 | 25 | public enum MonoOperatorModes { 26 | square, squareRoot, oneDividedBy, cos, sin, tan, log, rate, abs, ln, 27 | } 28 | 29 | private Double num1, num2; 30 | private BiOperatorModes mode = BiOperatorModes.normal; 31 | 32 | private Double calculateBiImpl() { 33 | if (mode.equals(BiOperatorModes.normal)) { 34 | return num2; 35 | } 36 | if (mode.equals(BiOperatorModes.add)) { 37 | if (num2 != 0) { 38 | return num1 + num2; 39 | } 40 | 41 | return num1; 42 | } 43 | if (mode.equals(BiOperatorModes.minus)) { 44 | return num1 - num2; 45 | } 46 | if (mode.equals(BiOperatorModes.multiply)) { 47 | return num1 * num2; 48 | } 49 | if (mode.equals(BiOperatorModes.divide)) { 50 | return num1 / num2; 51 | } 52 | if (mode.equals(BiOperatorModes.xpowerofy)) { 53 | return pow(num1,num2); 54 | } 55 | 56 | // never reach 57 | throw new Error(); 58 | } 59 | 60 | public Double calculateBi(BiOperatorModes newMode, Double num) { 61 | if (mode.equals(BiOperatorModes.normal)) { 62 | num2 = 0.0; 63 | num1 = num; 64 | mode = newMode; 65 | return NaN; 66 | } else { 67 | num2 = num; 68 | num1 = calculateBiImpl(); 69 | mode = newMode; 70 | return num1; 71 | } 72 | } 73 | 74 | public Double calculateEqual(Double num) { 75 | return calculateBi(BiOperatorModes.normal, num); 76 | } 77 | 78 | public Double reset() { 79 | num2 = 0.0; 80 | num1 = 0.0; 81 | mode = BiOperatorModes.normal; 82 | 83 | return NaN; 84 | } 85 | 86 | 87 | public Double calculateMono(MonoOperatorModes newMode, Double num) { 88 | if (newMode.equals(MonoOperatorModes.square)) { 89 | return num * num; 90 | } 91 | if (newMode.equals(MonoOperatorModes.squareRoot)) { 92 | return Math.sqrt(num); 93 | } 94 | if (newMode.equals(MonoOperatorModes.oneDividedBy)) { 95 | return 1 / num; 96 | } 97 | if (newMode.equals(MonoOperatorModes.cos)) { 98 | return Math.cos(Math.toRadians(num)); 99 | } 100 | if (newMode.equals(MonoOperatorModes.sin)) { 101 | return Math.sin(Math.toRadians(num)); 102 | } 103 | if (newMode.equals(MonoOperatorModes.tan)) { 104 | if (num == 0 || num % 180 == 0 ) { 105 | return 0.0; 106 | } 107 | if (num % 90 == 0.0 && num % 180 != 0.0) { 108 | return NaN; 109 | } 110 | 111 | return Math.tan(Math.toRadians(num)); 112 | } 113 | if (newMode.equals(MonoOperatorModes.log)) { 114 | return log10(num); 115 | } 116 | if (newMode.equals(MonoOperatorModes.ln)) { 117 | return log(num); 118 | } 119 | if (newMode.equals(MonoOperatorModes.rate) ) { 120 | return num / 100; 121 | } 122 | if (newMode.equals(MonoOperatorModes.abs)){ 123 | return Math.abs(num); 124 | } 125 | 126 | // never reach 127 | throw new Error(); 128 | } 129 | 130 | } 131 | 132 | -------------------------------------------------------------------------------- /src/simplejavacalculatorTest/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package simplejavacalculatorTest; 2 | 3 | import org.junit.jupiter.api.Assertions; 4 | import org.junit.jupiter.api.Test; 5 | import static java.lang.Double.NaN; 6 | import java.lang.Math; 7 | 8 | 9 | import simplejavacalculator.Calculator; 10 | 11 | class CalculatorTest { 12 | 13 | @Test 14 | void calculateBiNormalTest() { 15 | Calculator calculator = new Calculator(); 16 | calculator.calculateBi(Calculator.BiOperatorModes.normal, 2.0); 17 | Assertions.assertEquals(NaN, calculator.calculateBi(Calculator.BiOperatorModes.normal, 3.0)); 18 | } 19 | 20 | @Test 21 | void calculateBiAddTest() { 22 | Calculator calculator = new Calculator(); 23 | calculator.calculateBi(Calculator.BiOperatorModes.add, 3.0); 24 | Assertions.assertEquals(5.5, calculator.calculateBi(Calculator.BiOperatorModes.normal, 2.5)); 25 | } 26 | 27 | @Test 28 | void calculateBiMinusTest() { 29 | Calculator calculator = new Calculator(); 30 | calculator.calculateBi(Calculator.BiOperatorModes.minus, 3.1415); 31 | Assertions.assertEquals(2.0415, calculator.calculateBi(Calculator.BiOperatorModes.normal, 1.1)); 32 | } 33 | 34 | @Test 35 | void calculateBiMultiplyTest() { 36 | Calculator calculator = new Calculator(); 37 | calculator.calculateBi(Calculator.BiOperatorModes.multiply, 3.2); 38 | Assertions.assertEquals(6.4, calculator.calculateBi(Calculator.BiOperatorModes.normal, 2.0)); 39 | } 40 | 41 | @Test 42 | void calculateBiDivideTest() { 43 | Calculator calculator = new Calculator(); 44 | calculator.calculateBi(Calculator.BiOperatorModes.divide, 6.4); 45 | Assertions.assertEquals(3.2, calculator.calculateBi(Calculator.BiOperatorModes.normal, 2.0)); 46 | } 47 | 48 | @Test 49 | void calculateEqualTest() { 50 | Calculator calculator = new Calculator(); 51 | calculator.calculateBi(Calculator.BiOperatorModes.add, 6.4); 52 | calculator.calculateBi(Calculator.BiOperatorModes.add, 2.0); 53 | Assertions.assertEquals(11.4, calculator.calculateEqual(3.0)); 54 | } 55 | 56 | @Test 57 | void resetTest() { 58 | Calculator calculator = new Calculator(); 59 | calculator.calculateBi(Calculator.BiOperatorModes.add, 6.4); 60 | Assertions.assertEquals(8.4, calculator.calculateBi(Calculator.BiOperatorModes.add, 2.0)); 61 | Assertions.assertEquals(NaN, calculator.reset()); 62 | } 63 | 64 | @Test 65 | void CalculateMonoSquareTest() { 66 | Calculator calculator = new Calculator(); 67 | Assertions.assertEquals(9.0, calculator.calculateMono(Calculator.MonoOperatorModes.square, 3.0)); 68 | } 69 | 70 | @Test 71 | void CalculateMonoSquareRootTest() { 72 | Calculator calculator = new Calculator(); 73 | Assertions.assertEquals(5.0, calculator.calculateMono(Calculator.MonoOperatorModes.squareRoot, 25.0)); 74 | } 75 | 76 | @Test 77 | void CalculateMonoOneDividedByTest() { 78 | Calculator calculator = new Calculator(); 79 | Assertions.assertEquals(0.10, calculator.calculateMono(Calculator.MonoOperatorModes.oneDividedBy, 10.0)); 80 | } 81 | 82 | @Test 83 | void CalculateMonoSinTest() { 84 | Calculator calculator = new Calculator(); 85 | Assertions.assertEquals(0.5, calculator.calculateMono(Calculator.MonoOperatorModes.sin, java.lang.Math.PI / 6), 0.0000000001); 86 | } 87 | 88 | @Test 89 | void CalculateMonoCosTest() { 90 | Calculator calculator = new Calculator(); 91 | Assertions.assertEquals(0.5, calculator.calculateMono(Calculator.MonoOperatorModes.cos, java.lang.Math.PI / 3), 0.0000000001); 92 | } 93 | 94 | @Test 95 | void CalculateMonoTanTest() { 96 | Calculator calculator = new Calculator(); 97 | Assertions.assertEquals(1.0, calculator.calculateMono(Calculator.MonoOperatorModes.tan, java.lang.Math.PI / 4), 0.0000000001); 98 | } 99 | 100 | @Test 101 | void CalculateMonoLogTest() { 102 | Calculator calculator = new Calculator(); 103 | Assertions.assertEquals(2.0, calculator.calculateMono(Calculator.MonoOperatorModes.log, 100.0)); 104 | } 105 | 106 | @Test 107 | void CalculateMonoRateTest() { 108 | Calculator calculator = new Calculator(); 109 | Assertions.assertEquals(.75, calculator.calculateMono(Calculator.MonoOperatorModes.rate, 75.0)); 110 | } 111 | 112 | @Test 113 | void CalculateMonoAbsTest() { 114 | Calculator calculator = new Calculator(); 115 | Assertions.assertEquals(3.0, calculator.calculateMono(Calculator.MonoOperatorModes.abs, -3.0)); 116 | Assertions.assertEquals(3.0, calculator.calculateMono(Calculator.MonoOperatorModes.abs, 3.0)); 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /src/simplejavacalculator/UI.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @name Simple Java Calculator 3 | * @package ph.calculator 4 | * @file UI.java 5 | * @author SORIA Pierre-Henry 6 | * @email pierrehs@hotmail.com 7 | * @link http://github.com/pH-7 8 | * @copyright Copyright Pierre-Henry SORIA, All Rights Reserved. 9 | * @license Apache (http://www.apache.org/licenses/LICENSE-2.0) 10 | * @create 2012-03-30 11 | * 12 | * @modifiedby Achintha Gunasekara 13 | * @modifiedby Kydon Chantzaridis 14 | * @modweb http://www.achinthagunasekara.com 15 | * @modemail contact@achinthagunasekara.com 16 | * @modemail kchantza@csd.auth.gr 17 | */ 18 | 19 | package simplejavacalculator; 20 | 21 | import java.awt.FlowLayout; 22 | import java.awt.event.ActionEvent; 23 | import java.awt.event.ActionListener; 24 | 25 | import javax.swing.JButton; 26 | import javax.swing.JFrame; 27 | import javax.swing.JPanel; 28 | import javax.swing.JTextArea; 29 | import java.awt.Font; 30 | import javax.swing.Box; 31 | import javax.swing.BoxLayout; 32 | 33 | import java.awt.Image; 34 | import javax.swing.ImageIcon; 35 | import java.io.*; 36 | 37 | public class UI implements ActionListener { 38 | 39 | private final JFrame frame; 40 | 41 | private final JPanel panel; 42 | private final JPanel panelSub1; 43 | private final JPanel panelSub2; 44 | private final JPanel panelSub3; 45 | private final JPanel panelSub4; 46 | private final JPanel panelSub5; 47 | private final JPanel panelSub6; 48 | private final JPanel panelSub7; 49 | private final JPanel panelSub8; 50 | 51 | private final JTextArea text; 52 | 53 | private final JButton but[], butAdd, butMinus, butMultiply, butDivide, 54 | butEqual, butCancel, butSquareRoot, butSquare, butOneDividedBy, 55 | butCos, butSin, butTan, butxpowerofy, butlog, butrate, butabs, butBinary, butln; 56 | private final Calculator calc; 57 | 58 | private final String[] buttonValue = {"0", "1", "2", "3", "4", "5", "6", 59 | "7", "8", "9"}; 60 | 61 | 62 | private final Font font; 63 | private final Font textFont; 64 | private ImageIcon image; 65 | private BufferedImageCustom imageReturn; 66 | 67 | public UI() throws IOException { 68 | frame = new JFrame("Calculator PH"); 69 | 70 | imageReturn = new BufferedImageCustom(); 71 | image = new ImageIcon(imageReturn.imageReturn()); 72 | 73 | panel = new JPanel(); 74 | panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); 75 | panelSub1 = new JPanel(new FlowLayout()); 76 | panelSub2 = new JPanel(new FlowLayout()); 77 | panelSub3 = new JPanel(new FlowLayout()); 78 | panelSub4 = new JPanel(new FlowLayout()); 79 | panelSub5 = new JPanel(new FlowLayout()); 80 | panelSub6 = new JPanel(new FlowLayout()); 81 | panelSub7 = new JPanel(new FlowLayout()); 82 | panelSub8 = new JPanel(new FlowLayout()); 83 | 84 | font = new Font("Consolas",Font.PLAIN, 18); 85 | 86 | text = new JTextArea(1, 30); 87 | 88 | textFont = new Font("Consolas",Font.BOLD, 24); 89 | 90 | but = new JButton[10]; 91 | for (int i = 0; i < 10; i++) { 92 | but[i] = new JButton(String.valueOf(i)); 93 | } 94 | butAdd = new JButton("+"); 95 | butMinus = new JButton("-"); 96 | butMultiply = new JButton("*"); 97 | butDivide = new JButton("/"); 98 | butEqual = new JButton("="); 99 | butSquareRoot = new JButton("sqrt"); 100 | butSquare = new JButton("x*x"); 101 | butOneDividedBy = new JButton("1/x"); 102 | butCos = new JButton("Cos"); 103 | butSin = new JButton("Sin"); 104 | butTan = new JButton("Tan"); 105 | butln = new JButton("ln"); 106 | butxpowerofy = new JButton("x^y"); 107 | butlog = new JButton("log10(x)"); 108 | butrate = new JButton("x%"); 109 | butabs = new JButton("abs(x)"); 110 | butCancel = new JButton("C"); 111 | butBinary = new JButton("Bin"); 112 | 113 | calc = new Calculator(); 114 | 115 | } 116 | 117 | public void init() { 118 | frame.setSize(450, 450); 119 | frame.setLocationRelativeTo(null); 120 | frame.setResizable(false); 121 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 122 | frame.setIconImage(image.getImage()); 123 | 124 | text.setFont(textFont); 125 | text.setEditable(false); 126 | 127 | for (int i = 0; i < 10; i++) { 128 | but[i].setFont(font); 129 | } 130 | butAdd.setFont(font); 131 | butMinus.setFont(font); 132 | butMultiply.setFont(font); 133 | butDivide.setFont(font); 134 | butEqual.setFont(font); 135 | butSquareRoot.setFont(font); 136 | butSquare.setFont(font); 137 | butOneDividedBy.setFont(font); 138 | butCos.setFont(font); 139 | butSin.setFont(font); 140 | butTan.setFont(font); 141 | butln.setFont(font); 142 | butxpowerofy.setFont(font); 143 | butlog.setFont(font); 144 | butrate.setFont(font); 145 | butabs.setFont(font); 146 | butCancel.setFont(font); 147 | butBinary.setFont(font); 148 | 149 | panel.add(Box.createHorizontalStrut(100)); 150 | panelSub1.add(text); 151 | panel.add(panelSub1); 152 | 153 | panelSub2.add(but[1]); 154 | panelSub2.add(but[2]); 155 | panelSub2.add(but[3]); 156 | panelSub2.add(Box.createHorizontalStrut(15)); 157 | panelSub2.add(butAdd); 158 | panelSub2.add(butMinus); 159 | panel.add(panelSub2); 160 | 161 | panelSub3.add(but[4]); 162 | panelSub3.add(but[5]); 163 | panelSub3.add(but[6]); 164 | panelSub3.add(Box.createHorizontalStrut(15)); 165 | panelSub3.add(butMultiply); 166 | panelSub3.add(butDivide); 167 | panel.add(panelSub3); 168 | 169 | panelSub4.add(but[7]); 170 | panelSub4.add(but[8]); 171 | panelSub4.add(but[9]); 172 | panelSub4.add(Box.createHorizontalStrut(15)); 173 | panelSub4.add(butEqual); 174 | panelSub4.add(butCancel); 175 | panel.add(panelSub4); 176 | 177 | panelSub5.add(Box.createHorizontalStrut(92)); 178 | panelSub5.add(but[0]); 179 | panelSub5.add(butln); 180 | panelSub5.add(Box.createHorizontalStrut(210)); 181 | panel.add(panelSub5); 182 | 183 | panelSub6.add(butSquare); 184 | panelSub6.add(butSquareRoot); 185 | panelSub6.add(butOneDividedBy); 186 | panelSub6.add(butxpowerofy); 187 | panel.add(panelSub6); 188 | 189 | panelSub7.add(butCos); 190 | panelSub7.add(butSin); 191 | panelSub7.add(butTan); 192 | panel.add(panelSub7); 193 | 194 | panelSub8.add(butlog); 195 | panelSub8.add(butrate); 196 | panelSub8.add(butabs); 197 | panelSub8.add(butBinary); 198 | panel.add(panelSub8); 199 | 200 | for (int i = 0; i < 10; i++) { 201 | but[i].addActionListener(this); 202 | } 203 | butAdd.addActionListener(this); 204 | butMinus.addActionListener(this); 205 | butMultiply.addActionListener(this); 206 | butDivide.addActionListener(this); 207 | butSquare.addActionListener(this); 208 | butSquareRoot.addActionListener(this); 209 | butOneDividedBy.addActionListener(this); 210 | butCos.addActionListener(this); 211 | butSin.addActionListener(this); 212 | butTan.addActionListener(this); 213 | butln.addActionListener(this); 214 | butxpowerofy.addActionListener(this); 215 | butlog.addActionListener(this); 216 | butrate.addActionListener(this); 217 | butabs.addActionListener(this); 218 | butBinary.addActionListener(this); 219 | 220 | butEqual.addActionListener(this); 221 | butCancel.addActionListener(this); 222 | 223 | frame.add(panel); 224 | frame.setVisible(true); 225 | } 226 | 227 | @Override 228 | public void actionPerformed(ActionEvent e) { 229 | final Object source = e.getSource(); 230 | Double checkNum = null; 231 | 232 | for (int i = 0; i < 10; i++) { 233 | if (source == but[i]) { 234 | text.replaceSelection(buttonValue[i]); 235 | return; 236 | } 237 | } 238 | 239 | 240 | try { 241 | checkNum = Double.parseDouble(text.getText()); 242 | } catch(NumberFormatException k) { 243 | 244 | } 245 | 246 | if (checkNum != null || source == butCancel) { 247 | if (source == butAdd) { 248 | writer(calc.calculateBi(Calculator.BiOperatorModes.add, reader())); 249 | text.replaceSelection(butAdd.getText()); 250 | } 251 | 252 | if (source == butMinus) { 253 | writer(calc.calculateBi(Calculator.BiOperatorModes.minus, reader())); 254 | text.replaceSelection(butMinus.getText()); 255 | } 256 | 257 | if (source == butMultiply) { 258 | writer(calc.calculateBi(Calculator.BiOperatorModes.multiply, reader())); 259 | text.replaceSelection(butMultiply.getText()); 260 | } 261 | 262 | if (source == butDivide) { 263 | writer(calc.calculateBi(Calculator.BiOperatorModes.divide, reader())); 264 | text.replaceSelection(butDivide.getText()); 265 | } 266 | 267 | if (source == butxpowerofy) { 268 | writer(calc.calculateBi(Calculator.BiOperatorModes.xpowerofy, reader())); 269 | } 270 | 271 | if (source == butSquare) { 272 | writer(calc.calculateMono(Calculator.MonoOperatorModes.square, reader())); 273 | } 274 | 275 | if (source == butSquareRoot) 276 | writer(calc.calculateMono(Calculator.MonoOperatorModes.squareRoot, reader())); 277 | 278 | if (source == butOneDividedBy) 279 | writer(calc.calculateMono(Calculator.MonoOperatorModes.oneDividedBy, reader())); 280 | 281 | if (source == butCos) 282 | writer(calc.calculateMono(Calculator.MonoOperatorModes.cos, reader())); 283 | 284 | if (source == butSin) 285 | writer(calc.calculateMono(Calculator.MonoOperatorModes.sin, reader())); 286 | 287 | if (source == butTan) 288 | writer(calc.calculateMono(Calculator.MonoOperatorModes.tan, reader())); 289 | 290 | if (source == butlog) 291 | writer(calc.calculateMono(Calculator.MonoOperatorModes.log, reader())); 292 | 293 | if (source == butln) 294 | writer(calc.calculateMono(Calculator.MonoOperatorModes.ln, reader())); 295 | 296 | if (source == butrate) 297 | writer(calc.calculateMono(Calculator.MonoOperatorModes.rate, reader())); 298 | 299 | if (source == butabs) 300 | writer(calc.calculateMono(Calculator.MonoOperatorModes.abs, reader())); 301 | 302 | if (source == butEqual) 303 | writer(calc.calculateEqual(reader())); 304 | 305 | if (source == butCancel) 306 | writer(calc.reset()); 307 | 308 | if (source == butBinary) 309 | parsetoBinary(); 310 | } 311 | 312 | text.selectAll(); 313 | } 314 | 315 | private void parsetoBinary() { 316 | try { 317 | text.setText("" + Long.toBinaryString(Long.parseLong(text.getText()))); 318 | } catch (NumberFormatException ex) { 319 | System.err.println("Error while parse to binary." + ex.toString()); 320 | } 321 | } 322 | 323 | public Double reader() { 324 | Double num; 325 | String str; 326 | str = text.getText(); 327 | num = Double.valueOf(str); 328 | 329 | return num; 330 | } 331 | 332 | public void writer(final Double num) { 333 | if (Double.isNaN(num)) { 334 | text.setText(""); 335 | } else { 336 | text.setText(Double.toString(num)); 337 | } 338 | } 339 | } 340 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /nbproject/build-impl.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | Must set src.dir 227 | Must set test.src.dir 228 | Must set build.dir 229 | Must set dist.dir 230 | Must set build.classes.dir 231 | Must set dist.javadoc.dir 232 | Must set build.test.classes.dir 233 | Must set build.test.results.dir 234 | Must set build.classes.excludes 235 | Must set dist.jar 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | Must set javac.includes 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | No tests executed. 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | Must set JVM to use for profiling in profiler.info.jvm 716 | Must set profiler agent JVM arguments in profiler.info.jvmargs.agent 717 | 718 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | Must select some files in the IDE or set javac.includes 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | To run this application from the command line without Ant, try: 995 | 996 | java -jar "${dist.jar.resolved}" 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | Must select one file in the IDE or set run.class 1044 | 1045 | 1046 | 1047 | Must select one file in the IDE or set run.class 1048 | 1049 | 1050 | 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | Must select one file in the IDE or set debug.class 1075 | 1076 | 1077 | 1078 | 1079 | Must select one file in the IDE or set debug.class 1080 | 1081 | 1082 | 1083 | 1084 | Must set fix.includes 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1096 | 1099 | 1100 | This target only works when run from inside the NetBeans IDE. 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | Must select one file in the IDE or set profile.class 1110 | This target only works when run from inside the NetBeans IDE. 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | This target only works when run from inside the NetBeans IDE. 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | This target only works when run from inside the NetBeans IDE. 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | 1157 | 1158 | 1159 | 1160 | 1161 | 1162 | 1163 | 1164 | 1165 | 1166 | 1167 | 1168 | 1169 | 1170 | Must select one file in the IDE or set run.class 1171 | 1172 | 1173 | 1174 | 1175 | 1176 | Must select some files in the IDE or set test.includes 1177 | 1178 | 1179 | 1180 | 1181 | Must select one file in the IDE or set run.class 1182 | 1183 | 1184 | 1185 | 1186 | Must select one file in the IDE or set applet.url 1187 | 1188 | 1189 | 1190 | 1195 | 1196 | 1197 | 1198 | 1199 | 1200 | 1201 | 1202 | 1203 | 1204 | 1205 | 1206 | 1207 | 1208 | 1209 | 1210 | 1211 | 1212 | 1213 | 1214 | 1215 | 1216 | 1217 | 1218 | 1219 | 1220 | 1221 | 1222 | 1223 | 1224 | 1225 | 1226 | 1227 | 1228 | 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | 1239 | 1240 | 1241 | 1242 | 1243 | 1244 | 1245 | 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | 1265 | Must select some files in the IDE or set javac.includes 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1275 | 1276 | 1277 | 1282 | 1283 | 1284 | 1285 | 1286 | 1287 | 1288 | 1289 | Some tests failed; see details above. 1290 | 1291 | 1292 | 1293 | 1294 | 1295 | 1296 | 1297 | 1298 | Must select some files in the IDE or set test.includes 1299 | 1300 | 1301 | 1302 | Some tests failed; see details above. 1303 | 1304 | 1305 | 1306 | Must select some files in the IDE or set test.class 1307 | Must select some method in the IDE or set test.method 1308 | 1309 | 1310 | 1311 | Some tests failed; see details above. 1312 | 1313 | 1314 | 1319 | 1320 | Must select one file in the IDE or set test.class 1321 | 1322 | 1323 | 1324 | Must select one file in the IDE or set test.class 1325 | Must select some method in the IDE or set test.method 1326 | 1327 | 1328 | 1329 | 1330 | 1331 | 1332 | 1333 | 1334 | 1335 | 1336 | 1337 | 1342 | 1343 | Must select one file in the IDE or set applet.url 1344 | 1345 | 1346 | 1347 | 1348 | 1349 | 1350 | 1355 | 1356 | Must select one file in the IDE or set applet.url 1357 | 1358 | 1359 | 1360 | 1361 | 1362 | 1363 | 1364 | 1369 | 1370 | 1371 | 1372 | 1373 | 1374 | 1375 | 1376 | 1377 | 1378 | 1379 | 1380 | 1381 | 1382 | 1383 | 1384 | 1385 | 1386 | 1387 | 1388 | 1389 | 1390 | 1391 | 1392 | 1393 | 1394 | 1395 | 1396 | 1397 | 1398 | 1399 | 1400 | 1401 | 1402 | 1403 | 1404 | 1405 | 1406 | 1407 | 1408 | 1409 | 1410 | 1411 | 1412 | 1413 | 1414 | --------------------------------------------------------------------------------