public class KeyboardFracciones
extends java.lang.Object
miguelmonteiroclaveri@gmail.com github.com/mmonteiroc Paquete visual Proyecto Calculadora
Esta clase nos permite definir un keypad para trabajar con fracciones
Modifier and Type | Field and Description |
---|---|
private javax.swing.JButton |
a0Button
|
private javax.swing.JButton |
a1Button
|
private javax.swing.JButton |
a2Button
|
private javax.swing.JButton |
a3Button
|
private javax.swing.JButton |
a4Button
|
private javax.swing.JButton |
a5Button
|
private javax.swing.JButton |
a6Button
|
private javax.swing.JButton |
a7Button
|
private javax.swing.JButton |
a8Button
|
private javax.swing.JButton |
a9Button
|
private javax.swing.JButton |
calcularResultadoButton
|
private javax.swing.JButton |
clearButton
|
private javax.swing.JButton |
dividir
|
private javax.swing.JButton |
fraccionButton
|
private javax.swing.JButton |
multiplicacion
|
private javax.swing.JPanel |
PanelPrincipal
|
private javax.swing.JButton |
resta
|
private char |
SIMBOLO_FRACCION
|
private javax.swing.JButton |
suma
|
Constructor and Description |
---|
KeyboardFracciones(InterficieGrafica ig)
|
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
calculateAllFraccions(java.lang.String input)
|
javax.swing.JPanel |
getPanelPrincipal()
|
private javax.swing.JPanel PanelPrincipal
private javax.swing.JButton a1Button
private javax.swing.JButton a2Button
private javax.swing.JButton a4Button
private javax.swing.JButton a5Button
private javax.swing.JButton a3Button
private javax.swing.JButton a6Button
private javax.swing.JButton a8Button
private javax.swing.JButton a7Button
private javax.swing.JButton a9Button
private javax.swing.JButton a0Button
private javax.swing.JButton dividir
private javax.swing.JButton multiplicacion
private javax.swing.JButton resta
private javax.swing.JButton suma
private javax.swing.JButton fraccionButton
private javax.swing.JButton clearButton
private javax.swing.JButton calcularResultadoButton
private char SIMBOLO_FRACCION
KeyboardFracciones(InterficieGrafica ig)
ig
- Este constructor lo usamos para inicializar todos
los listeners que nosotros necesitamos .
private java.lang.String calculateAllFraccions(java.lang.String input)
input
- String que representa todas las operaciones de fracciones
Este metodo nos permite leer todas las fracciones de el input e ir calculandolas hasta que hayamos calculado todas y retornamos la fraccion resultante
public javax.swing.JPanel getPanelPrincipal()
Este simple metodo nos permite retornar el panel prinicpal de nuestro keypad