|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jp.comp.calculator.CalculatorPanel
CalculatorPanel
represents a standart calculator supplemented with memory register and
possibility to change the number of fraction digits. The set of operation performed by
the calculator can be changed by implementing one of the interfaces InputOperation
or
CalculatorOperation
and adding it to the calculator
Calculator
,
InputOperation
,
CalculatorOperation
,
Serialized FormNested Class Summary | |
static class |
CalculatorPanel.CalculatorButton
Calculator's button with fixed size |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected javax.swing.JButton |
btn0
|
protected javax.swing.JButton |
btn1
|
protected javax.swing.JButton |
btn2
|
protected javax.swing.JButton |
btn3
|
protected javax.swing.JButton |
btn4
|
protected javax.swing.JButton |
btn5
|
protected javax.swing.JButton |
btn6
|
protected javax.swing.JButton |
btn7
|
protected javax.swing.JButton |
btn8
|
protected javax.swing.JButton |
btn9
|
protected javax.swing.JButton |
btnAdd
|
protected javax.swing.JButton |
btnBS
|
protected javax.swing.JButton |
btnC
|
protected javax.swing.JButton |
btnCE
|
protected javax.swing.JButton |
btnDecSep
|
protected javax.swing.JButton |
btnDiv
|
protected javax.swing.JButton |
btnEqual
|
protected javax.swing.JButton |
btnMC
|
protected javax.swing.JButton |
btnMM
|
protected javax.swing.JButton |
btnMP
|
protected javax.swing.JButton |
btnMR
|
protected javax.swing.JButton |
btnMS
|
protected javax.swing.JButton |
btnMult
|
protected javax.swing.JButton |
btnPercent
|
protected javax.swing.JButton |
btnRecip
|
protected javax.swing.JButton |
btnSign
|
protected javax.swing.JButton |
btnSqrt
|
protected javax.swing.JButton |
btnSub
|
static java.lang.String |
BUTTON_KEYSTROKE_1
Property for the method putClientProperty for the button's keystroke |
static java.lang.String |
BUTTON_KEYSTROKE_2
Property for the method putClientProperty for the button's keystroke |
static java.lang.String |
BUTTON_KEYSTROKE_3
Property for the method putClientProperty for the button's keystroke |
static java.lang.String |
DECIMAL_SEPARATOR
|
(package private) static java.awt.Dimension |
DEFAULT_DIMENSION
|
protected javax.swing.JTextField |
edtDisplay
|
protected javax.swing.JSpinner |
edtFractionDigits
|
protected java.lang.String |
fBufferedDisplayValue
|
protected double |
fBufferedResult
|
protected java.util.HashMap |
fButtonKeys
|
protected Calculator |
fCalculator
|
protected CalculatorEvent |
fCalculatorEvent
|
protected java.util.Vector |
fCalculatorListeners
|
protected boolean |
fErrorHappend
|
protected java.util.HashMap |
fInputOperations
|
protected char |
fLocalizedDecimalSeparator
|
protected char |
fLocalizedGroupingSeparator
|
protected int |
fLocalizedGroupingSize
|
protected java.lang.String |
fLocalizedMemorySymbol
|
protected java.lang.String |
fLocalizedMinusSymbol
|
protected java.text.DecimalFormat |
fNumberFormatter
|
protected int |
fOldFractionDigits
|
static int |
FRACTION_DIGITS_DEFAULT_VALUE
Default fraction digits value (2) |
static int |
FRACTION_DIGITS_MAX_VALUE
Max fraction digits value (11) |
static int |
FRACTION_DIGITS_MIN_VALUE
Min fraction digits value (0) |
protected boolean |
fShowFractionTrailingZeros
|
protected boolean |
fValueChanged
|
static java.lang.String |
INPUT_0_KEY
Input 0 key |
static java.lang.String |
INPUT_1_KEY
Input 1 key |
static java.lang.String |
INPUT_2_KEY
Input 2 key |
static java.lang.String |
INPUT_3_KEY
Input 3 key |
static java.lang.String |
INPUT_4_KEY
Input 4 key |
static java.lang.String |
INPUT_5_KEY
Input 5 key |
static java.lang.String |
INPUT_6_KEY
Input 6 key |
static java.lang.String |
INPUT_7_KEY
Input 7 key |
static java.lang.String |
INPUT_8_KEY
Input 8 key |
static java.lang.String |
INPUT_9_KEY
Input 9 key |
static InputOperation |
INPUT_BS
Default back space operation |
static java.lang.String |
INPUT_BS_KEY
Input back space key |
static InputOperation |
INPUT_CLEAR
Default display clear operation |
static java.lang.String |
INPUT_CLEAR_KEY
Input display clear key |
static InputOperation |
INPUT_DECIMAL_SEPARATOR
Default decimal separator operation |
static java.lang.String |
INPUT_DECIMAL_SEPARATOR_KEY
Input decimal separator key |
static InputOperation |
INPUT_NIMBER
Default input numbers operation |
static InputOperation |
INPUT_SIGN
Default sign operation |
static java.lang.String |
INPUT_SIGN_KEY
Input sign key |
protected javax.swing.JLabel |
lblMemory
|
static int |
MAX_INPUT_FRACTION_DIGITS
|
static java.lang.String |
MINUS_SYMBOL
|
static java.lang.String |
PROPERTY_CALCULATOR
Property name for the calculator property |
static java.lang.String |
PROPERTY_DISPLAY_BACKGROUND
Property name for the displayBackground property |
static java.lang.String |
PROPERTY_DISPLAY_FONT
Property name for the displayFont property |
static java.lang.String |
PROPERTY_DISPLAY_FOREGROUND
Property name for the displayForeground property |
static java.lang.String |
PROPERTY_FRACTION_DIGITS
Property name for the fractionDigits property |
static java.lang.String |
PROPERTY_FRACTION_DIGITS_BACKGROUND
Property name for the fractionDigitsBackground property |
static java.lang.String |
PROPERTY_FRACTION_DIGITS_FOREGROUND
Property name for the fractionDigitsForeground property |
static java.lang.String |
PROPERTY_GROUPING_USED
Property name for the groupingUsed property |
static java.lang.String |
PROPERTY_SHOW_FRACTION_TRAILING_ZEROS
Property name for the showFractionTrailingZeros property |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
CalculatorPanel()
Constructs a new Calculator with default Locale |
|
CalculatorPanel(java.util.Locale aLocale)
Constructs a new Calculator with specified Locale |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addActionListener(java.awt.event.ActionListener aListener)
Adds action listener |
void |
addCalculatorListener(CalculatorListener aListener)
Adds Calculator's listener |
void |
addInputOperation(java.lang.String anOperationKey,
InputOperation anInputOperation)
Adds a new input operation to the calculator panel. |
void |
beforeShow()
This method is used be CalculatorField |
protected void |
button_actionPerformed(java.awt.event.ActionEvent anEvent)
Process buttons click |
void |
componentAdded(java.awt.event.ContainerEvent anEvent)
Adds added button's KeyStroke to fButtonKeys |
void |
componentRemoved(java.awt.event.ContainerEvent anEvent)
Removes removed button's KeyStroke from fButtonKeys |
protected void |
copyDisplayValueToClipboard()
Copies display value to the clipboard |
protected void |
edtDisplay_keyPressed(java.awt.event.KeyEvent anEvent)
Process pressed key |
protected void |
edtDisplay_keyTyped(java.awt.event.KeyEvent anEvent)
Process typed key |
(package private) void |
edtFractionDigits_mousePressed(java.awt.event.MouseEvent e)
|
protected void |
edtFractionDigits_stateChanged()
When fraction digits value is changed it updates the result in the display |
protected void |
fireActionPerformed(java.awt.event.ActionEvent anEvent)
Fired when calculator's button is pressed |
protected void |
fireFractionDigitsChanged()
Fired when the fraction digits value is changed |
protected void |
fireResultChanged(CalculatorEvent anEvent)
Fired when the result is calculated |
protected java.lang.String |
formatBufferedDisplayValue()
|
void |
fractionDigitsChanged(CalculatorEvent anEvent)
Invoked when a change in the number of fraction digits occurs |
java.lang.String |
getAbout()
|
Calculator |
getCalculator()
Returns current Calculator |
java.awt.Color |
getDisplayBackground()
Gets display's background Color |
java.awt.Font |
getDisplayFont()
Gets display's font Color |
java.awt.Color |
getDisplayForeground()
Gets display's foreground Color |
double |
getDisplayValue()
Gets double presentation of display value |
int |
getFractionDigits()
Gets the number of fraction digits |
java.awt.Color |
getFractionDigitsBackground()
Gets display's background Color |
java.awt.Color |
getFractionDigitsForeground()
Gets display's foreground Color |
boolean |
isGroupingUsed()
Returns true if number grouping is used |
boolean |
isInputOperationExist(java.lang.String anOperationKey)
Returns true if input operation, specified by anOperationKey , exist |
boolean |
isShowFractionTrailingZeros()
Returns true if fraction trailing zeros should by shown depending on the value
of the property number of fraction digits |
boolean |
isValueChanged()
Returns true if display value is changed by entering a new value |
protected void |
processCalculatorOperation(java.lang.String anActionCommand)
Performs calculator operations |
protected void |
processInputOperation(java.lang.String anInputKey)
Process input operations |
protected void |
processKey(javax.swing.KeyStroke aKeyStroke)
Processes key |
void |
propertyChange(java.beans.PropertyChangeEvent anEvent)
Catches and forwards property change events comming from Calculator to show
memory sign when memory operation is performed |
void |
removeActionListener(java.awt.event.ActionListener aListener)
Removes action listener |
void |
removeCalculatorListener(CalculatorListener aListener)
Removes Calculator's listener |
void |
removeInputOperation(java.lang.String anOperationKey)
Removes the input operation, specified by anOperationKey , from the calculator panel |
void |
requestFocus()
|
protected void |
restoreDisplayValue()
Restores display value |
void |
resultChanged(CalculatorEvent anEvent)
Delegates the result is changed event form the Calculator |
void |
setAbout(java.lang.String aAbout)
|
void |
setBufferedDisplayValue()
Sets buffered string value to the display. |
void |
setCalculator(Calculator aCalculator)
Sets a new Calculator to perform calculator's operations |
void |
setDisplayBackground(java.awt.Color aColor)
Sets display's background Color |
void |
setDisplayFont(java.awt.Font aFont)
Sets display's font Color |
void |
setDisplayForeground(java.awt.Color aColor)
Sets display's foreground Color |
void |
setDisplayValue(double aValue)
Sets a new display value |
void |
setFractionDigits(int aValue)
Sets the specified number of fraction digits |
void |
setFractionDigitsBackground(java.awt.Color aColor)
Sets fraction digits's background Color |
void |
setFractionDigitsForeground(java.awt.Color aColor)
Sets fraction digits's foreground Color |
void |
setGroupingUsed(boolean aFlag)
Sets to true if number grouping should be used |
void |
setLayout(java.awt.LayoutManager mgr)
|
void |
setLocale(java.util.Locale aLocale)
Sets a new Calculator's Locale . |
void |
setShowFractionTrailingZeros(boolean aFlag)
Sets true if fraction trailing zeros should by shown depending on the value
of the property number of fraction digits |
void |
updateInputOperation(java.lang.String anOperationKey,
InputOperation anInputOperation)
Updates an existing input operation in the calculator panel. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String PROPERTY_DISPLAY_BACKGROUND
public static final java.lang.String PROPERTY_DISPLAY_FOREGROUND
public static final java.lang.String PROPERTY_DISPLAY_FONT
public static final java.lang.String PROPERTY_FRACTION_DIGITS_BACKGROUND
public static final java.lang.String PROPERTY_FRACTION_DIGITS_FOREGROUND
public static final java.lang.String PROPERTY_FRACTION_DIGITS
public static final java.lang.String PROPERTY_GROUPING_USED
public static final java.lang.String PROPERTY_CALCULATOR
public static final java.lang.String PROPERTY_SHOW_FRACTION_TRAILING_ZEROS
public static final java.lang.String BUTTON_KEYSTROKE_1
public static final java.lang.String BUTTON_KEYSTROKE_2
public static final java.lang.String BUTTON_KEYSTROKE_3
public static final java.lang.String INPUT_0_KEY
public static final java.lang.String INPUT_1_KEY
public static final java.lang.String INPUT_2_KEY
public static final java.lang.String INPUT_3_KEY
public static final java.lang.String INPUT_4_KEY
public static final java.lang.String INPUT_5_KEY
public static final java.lang.String INPUT_6_KEY
public static final java.lang.String INPUT_7_KEY
public static final java.lang.String INPUT_8_KEY
public static final java.lang.String INPUT_9_KEY
public static final java.lang.String INPUT_BS_KEY
public static final java.lang.String INPUT_CLEAR_KEY
public static final java.lang.String INPUT_DECIMAL_SEPARATOR_KEY
public static final java.lang.String INPUT_SIGN_KEY
public static final InputOperation INPUT_NIMBER
public static final InputOperation INPUT_BS
public static final InputOperation INPUT_CLEAR
public static final InputOperation INPUT_DECIMAL_SEPARATOR
public static final InputOperation INPUT_SIGN
public static final int FRACTION_DIGITS_DEFAULT_VALUE
public static final int FRACTION_DIGITS_MIN_VALUE
public static final int FRACTION_DIGITS_MAX_VALUE
public static final java.lang.String DECIMAL_SEPARATOR
public static final java.lang.String MINUS_SYMBOL
public static final int MAX_INPUT_FRACTION_DIGITS
static final java.awt.Dimension DEFAULT_DIMENSION
protected javax.swing.JTextField edtDisplay
protected javax.swing.JLabel lblMemory
protected javax.swing.JButton btnMC
protected javax.swing.JButton btnBS
protected javax.swing.JButton btnCE
protected javax.swing.JButton btnC
protected javax.swing.JSpinner edtFractionDigits
protected javax.swing.JButton btnMR
protected javax.swing.JButton btn7
protected javax.swing.JButton btn8
protected javax.swing.JButton btn9
protected javax.swing.JButton btnDiv
protected javax.swing.JButton btnSqrt
protected javax.swing.JButton btnMS
protected javax.swing.JButton btn4
protected javax.swing.JButton btn5
protected javax.swing.JButton btn6
protected javax.swing.JButton btnMult
protected javax.swing.JButton btnPercent
protected javax.swing.JButton btnMP
protected javax.swing.JButton btn1
protected javax.swing.JButton btn2
protected javax.swing.JButton btn3
protected javax.swing.JButton btnSub
protected javax.swing.JButton btnRecip
protected javax.swing.JButton btnMM
protected javax.swing.JButton btn0
protected javax.swing.JButton btnSign
protected javax.swing.JButton btnDecSep
protected javax.swing.JButton btnAdd
protected javax.swing.JButton btnEqual
protected java.util.HashMap fInputOperations
protected java.lang.String fBufferedDisplayValue
protected double fBufferedResult
protected boolean fValueChanged
protected boolean fShowFractionTrailingZeros
protected boolean fErrorHappend
protected java.text.DecimalFormat fNumberFormatter
protected Calculator fCalculator
protected int fOldFractionDigits
protected java.util.HashMap fButtonKeys
protected char fLocalizedDecimalSeparator
protected char fLocalizedGroupingSeparator
protected int fLocalizedGroupingSize
protected java.lang.String fLocalizedMinusSymbol
protected java.lang.String fLocalizedMemorySymbol
protected CalculatorEvent fCalculatorEvent
protected transient java.util.Vector fCalculatorListeners
Constructor Detail |
public CalculatorPanel()
Locale
public CalculatorPanel(java.util.Locale aLocale)
Locale
aLocale
- a new Calculator's Locale
Method Detail |
public void setLayout(java.awt.LayoutManager mgr)
protected void edtFractionDigits_stateChanged()
protected void edtDisplay_keyTyped(java.awt.event.KeyEvent anEvent)
anEvent
- typed keyprotected void edtDisplay_keyPressed(java.awt.event.KeyEvent anEvent)
anEvent
- pressed keyprotected void processKey(javax.swing.KeyStroke aKeyStroke)
aKeyStroke
- KeyStroke
protected void copyDisplayValueToClipboard()
protected void button_actionPerformed(java.awt.event.ActionEvent anEvent)
anEvent
- the event infoprotected void processInputOperation(java.lang.String anInputKey)
anInputKey
- action commandprotected void processCalculatorOperation(java.lang.String anActionCommand)
anActionCommand
- action commandpublic void requestFocus()
public void beforeShow()
CalculatorField to clear the calculator before to pop it up
protected void restoreDisplayValue()
protected java.lang.String formatBufferedDisplayValue()
public double getDisplayValue()
double
presentation of display value
public void setBufferedDisplayValue()
public void setDisplayValue(double aValue)
aValue
- a new display valuepublic boolean isShowFractionTrailingZeros()
true
if fraction trailing zeros should by shown depending on the value
of the property number of fraction digits
true
if fraction trailing zeros should by shownpublic void setShowFractionTrailingZeros(boolean aFlag)
true
if fraction trailing zeros should by shown depending on the value
of the property number of fraction digits
aFlag
- true
if fraction trailing zeros should by shownpublic boolean isValueChanged()
true
if display value is changed by entering a new value
true
if display value is changedpublic int getFractionDigits()
public void setFractionDigits(int aValue)
aValue
- the specified number of fraction digitspublic void setLocale(java.util.Locale aLocale)
Locale
. The change of the Calculator's Locale
will/may change the buttons text, messages text and the result format.
By default Default Locale
is used
aLocale
- a new Calculator's Locale
public java.awt.Color getDisplayForeground()
Color
Color
public void setDisplayForeground(java.awt.Color aColor)
Color
aColor
- display's foreground Color
public java.awt.Color getDisplayBackground()
Color
Color
public void setDisplayBackground(java.awt.Color aColor)
Color
aColor
- display's background Color
public java.awt.Font getDisplayFont()
Color
Color
public void setDisplayFont(java.awt.Font aFont)
Color
aFont
- display's font Color
public java.awt.Color getFractionDigitsForeground()
Color
Color
public void setFractionDigitsForeground(java.awt.Color aColor)
Color
aColor
- fraction digits's foreground Color
public java.awt.Color getFractionDigitsBackground()
Color
Color
public void setFractionDigitsBackground(java.awt.Color aColor)
Color
aColor
- fraction digits's background Color
public boolean isGroupingUsed()
true
if number grouping is used
true
if number grouping is usedpublic void setGroupingUsed(boolean aFlag)
true
if number grouping should be used
aFlag
- true
if number grouping should be usedpublic Calculator getCalculator()
Calculator
Calculator
public void setCalculator(Calculator aCalculator)
Calculator
to perform calculator's operations
aCalculator
- a new Calculator
public java.lang.String getAbout()
public void setAbout(java.lang.String aAbout)
public void addInputOperation(java.lang.String anOperationKey, InputOperation anInputOperation)
anOperationKey
already exist
IllegalArgumentException
will be thrown
anOperationKey
- operation keyanInputOperation
- input operation
java.lang.IllegalArgumentException
public void updateInputOperation(java.lang.String anOperationKey, InputOperation anInputOperation)
anOperationKey
doesn't exist IllegalArgumentException
will be thrown
anOperationKey
- operation keyanInputOperation
- input operation
java.lang.IllegalArgumentException
public void removeInputOperation(java.lang.String anOperationKey)
anOperationKey
, from the calculator panel
anOperationKey
- operation keypublic boolean isInputOperationExist(java.lang.String anOperationKey)
true
if input operation, specified by anOperationKey
, exist
anOperationKey
- operation key
true
if operation existpublic void fractionDigitsChanged(CalculatorEvent anEvent)
CalculatorListener
fractionDigitsChanged
in interface CalculatorListener
anEvent
- copy of the class eventpublic void resultChanged(CalculatorEvent anEvent)
Calculator
resultChanged
in interface CalculatorListener
anEvent
- CalculatorEvent
public void propertyChange(java.beans.PropertyChangeEvent anEvent)
Calculator
to show
memory sign when memory operation is performed
propertyChange
in interface java.beans.PropertyChangeListener
anEvent
- PropertyChangeEvent
public void componentAdded(java.awt.event.ContainerEvent anEvent)
fButtonKeys
componentAdded
in interface java.awt.event.ContainerListener
anEvent
- ContainerEvent
public void componentRemoved(java.awt.event.ContainerEvent anEvent)
fButtonKeys
componentRemoved
in interface java.awt.event.ContainerListener
anEvent
- ContainerEvent
protected void fireResultChanged(CalculatorEvent anEvent)
anEvent
- CalculatorEvent
protected void fireFractionDigitsChanged()
protected void fireActionPerformed(java.awt.event.ActionEvent anEvent)
anEvent
- the ActionEvent
public void addCalculatorListener(CalculatorListener aListener)
aListener
- Calculator's listenerpublic void removeCalculatorListener(CalculatorListener aListener)
aListener
- Calculator's listenerpublic void addActionListener(java.awt.event.ActionListener aListener)
aListener
- action listenerpublic void removeActionListener(java.awt.event.ActionListener aListener)
aListener
- action listenervoid edtFractionDigits_mousePressed(java.awt.event.MouseEvent e)
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |