Class IHMTPCalculette

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--IHMTPCalculette

public class IHMTPCalculette
extends java.awt.Panel
implements java.awt.event.ActionListener

Gestion de le pile d'Object du TP3 selon le modèle MVC. Interface graphique.

TP 6 Java


L'évaluation d'une expression arithmétique peut êtreréalisée par l'usage d'une pile d'entiers.
Par exemple l'expression 3 + 2 engendre la séquence:
<empiler(3); empiler(2);
empiler(depiler()+depiler())>
de même que l'expression 3 + 2 * 5 correspond à la séquence:
empiler(3);empiler(2);empiler(5);
empiler(depiler()*depiler();
empiler(depiler()+depiler())>

See Also:
Pile, PileI, Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
private  java.awt.Button boutonEmpiler
          le panneau contenant les 3 boutons.
private  java.awt.Button boutonMoins
           
private  java.awt.Button boutonPlus
           
private  java.awt.Label contenu
          le contenu de la pile en haut de l'ihm.
private  PileI p
           
private  java.awt.TextField saisie
           
 
Fields inherited from class java.awt.Panel
base, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
IHMTPCalculette(PileI p)
          Création de l'IHM.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          Méthode déclenchée par les coutons de cette interface.
 void modifierContenu(java.lang.String s)
          Affiche un texte en haut de l'IHM.
 
Methods inherited from class java.awt.Panel
, addNotify, constructComponentName
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, nextFocus, paint, paintComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printOneComponent, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, setLayout, transferFocus, update, validate, validateTree, writeObject
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

contenu

private java.awt.Label contenu
le contenu de la pile en haut de l'ihm.

saisie

private java.awt.TextField saisie

boutonEmpiler

private java.awt.Button boutonEmpiler
le panneau contenant les 3 boutons.

boutonPlus

private java.awt.Button boutonPlus

boutonMoins

private java.awt.Button boutonMoins

p

private PileI p
Constructor Detail

IHMTPCalculette

public IHMTPCalculette(PileI p)
Création de l'IHM.
Parameters:
p - la pile attendue.
Method Detail

modifierContenu

public void modifierContenu(java.lang.String s)
Affiche un texte en haut de l'IHM.
Parameters:
s - est affiché au dessus de la zone de saisie.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Méthode déclenchée par les coutons de cette interface. La touche entrée a le même effet que le bouton "empiler" rappel : 3 + 2 correspond à la séquence :
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
ae - l'évènement transmis