pga
Class NumberField

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.TextComponent
              |
              +--java.awt.TextField
                    |
                    +--pga.NumberField

public class NumberField
extends java.awt.TextField
implements java.awt.event.KeyListener

Textove pole umoznujici vstup cisla (pouze cisla).

Hlida stiskle klavesy, zda jsou ciselne. Dale umoznuje operace s ciselnym nastavenim.

See Also:
Serialized Form

Fields inherited from class java.awt.TextComponent
textListener
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
NumberField(int numbers)
          Vytvori pole se zadanou sirkou.
NumberField(int numbers, int ini)
          Vytvori pole se zadanou sirkou a inicializuje na dane cislo.
 
Method Summary
 int getNumber()
          Vraci cislo v textovem poli
 boolean changed()
          Vraci, zda bylo cislo zmeneno od posledniho cteni
 void keyPressed(java.awt.event.KeyEvent e)
          Zpracuje stisklou klavesu.
 void keyReleased(java.awt.event.KeyEvent e)
          Zpracuje uvolnenou klavesu.
 void keyTyped(java.awt.event.KeyEvent e)
          Prazdne - kvuli rozhrani KeyListener.
 void setNumber(int number)
          Nastavi dane cislo do textoveho pole.
 
Methods inherited from class java.awt.TextField
addActionListener, addNotify, echoCharIsSet, getColumns, getEchoChar, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, minimumSize, minimumSize, paramString, preferredSize, preferredSize, processActionEvent, processEvent, removeActionListener, setColumns, setEchoChar, setEchoCharacter, setText
 
Methods inherited from class java.awt.TextComponent
addTextListener, getCaretPosition, getSelectedText, getSelectionEnd, getSelectionStart, getText, isEditable, processTextEvent, removeNotify, removeTextListener, select, selectAll, setCaretPosition, setEditable, setSelectionEnd, setSelectionStart
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, checkImage, checkImage, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, prepareImage, prepareImage, print, 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, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumberField

public NumberField(int numbers)
Vytvori pole se zadanou sirkou.
Parameters:
numbers - kolik se ma vejit cisel do texoveho pole

NumberField

public NumberField(int numbers,
                   int ini)
Vytvori pole se zadanou sirkou a inicializuje na dane cislo.
Parameters:
numbers - kolik se ma vejit cisel do texoveho pole
ini - pocatecni cislo
Method Detail

changed

public boolean changed()
Vraci, zda bylo cislo zmeneno od posledniho cteni

getNumber

public int getNumber()
Vraci cislo v textovem poli

setNumber

public void setNumber(int number)
Nastavi dane cislo do textoveho pole.
Parameters:
number - nastavovane cislo

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Prazdne - kvuli rozhrani KeyListener.
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Zpracuje stisklou klavesu.

Propusti jen klavesy, ktere mohou zmenit cislo na jine cislo. Ostatni klavesy "zkonzumuje"

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Zpracuje uvolnenou klavesu.

Propusti jen klavesy, ktere mohou zmenit cislo na jine cislo. Ostatni klavesy "zkonzumuje"

Specified by:
keyReleased in interface java.awt.event.KeyListener