JCalculator

By Yiwen Yu
yuyiwei@msn.com
Introduction

With this plugin JCalculator we can calculate the words in line, and JCalculator can recorder the lines you input. JCalculator also provides some options for you e.g. remove blank character(s) from the calculate result ect.

Screen Copy

Application Panel

  1. Numeral system (in red range)
    We can select the numeral system for the calculate result as hexadecimal or decimalization(default) or octal or binary system.
  2. Image buttons (in green range)
    a. Calculate the words in the input line
    b. Clear the words in the input line
  3. Input line (in blue range)
    a. Input the words what you want to calculate into here.
    b. It's class 'org.gjt.sp.jedit.gui.HistoryTextField', it can record what you input after pressing the key 'ENTER', and can pop up the list with the recorded words when clicking it with right mouse button.
    c. Please read the section 'History Text Feilds' in the help of jEdit to know more about.
    d. The words in Input line would be cleared by pressing the key 'ESCAPE'.
  4. Calculate result (in pink range)
    a. Show the calculate result.
    b. There are some options for the calculate result
    c. There calculate result will be stored into the system cipboard by clicking it.

Numbers in JCalculator

Numeral System Prefix Example
Hexadecimal 0x 0x2aF
0X 0X2aF
Decimalization   12345678
Octal 0 037
Binary b b101

Specail
const number
Macro Value Example in the
'Input Line'
Result of example
π PI Math.PI 2 * PI * 10 62.83185307179586

What JCalculator Supports

Name Operator Example in the
'Input Line'
Result of Example Support
Decimal Fraction
Priority
Bracket ( (1 + 2) * 3 9   The max priority
) (1 + 2.0) * 3 9.0
Power POWER 2 POWER 3 8 The max priority - 1
2.0 POWER 3 8.0
Multiply * 2 * 3 6 11
MULTIPLY 2.0 MULTIPLY 3 6.0
Divide / 2 / 3 0
DIVIDE 2.0 DIVIDE 3 0.6666666666666666
Mode % 10 % 3 1  
MODE 10 MODE 3 1
Plus + 2 + 3 5 10
PLUS 2 PLUS 3.0 5.0
Decrease - 2 - 3.0 -1.0
DECREASE 2 DECREASE 3 -1
Left Shift << 1 << 2 4   9
LEFT_SHIFT 1 LEFT_SHIFT 2 4
Right Shift >> 8 >> 2 2  
RIGHT_SHIFT 8 RIGHT_SHIFT 2 2
And & 0xF & 3 3   6
AND 0xF AND 3 3
Or | 0x7 | 5 7   5
OR 0x7 OR 5 7
Xor ^ 0x7 ^ 5 2   4
XOR 0x7 XOR 5 2

Begin the calculation

Plugin Options


JCalculate provides some options as the above picture shows, you can enable or disable them in jEdit's Plugin Options.

History