|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.formaria.swing.Keypad
public class Keypad
An KeyPad component is a visual representation of a numeric keypad.
Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from formaria.
$Revision: 1.12 $
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected int |
borderHeight
|
protected int |
borderWidth
|
protected ClickListener |
clickListener
|
protected Project |
currentProject
The owner project and the context in which this object operates. |
protected java.lang.String |
errorMessage
|
protected int |
errorStatus
|
protected int |
keyHeight
|
protected int |
keyWidth
|
protected StyleManager |
styleManager
|
| 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.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 | |
|---|---|
Keypad()
Constructor for a new Keypad. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the output value. |
int |
findCurrentResponse(int x,
int y)
Find the response corresponding to the current point |
java.awt.Color |
getColor(int idx,
int callerClassId)
Gets an indexed color. |
java.lang.String |
getStyle3D()
Get the style asociated with three dimensional objects/elements |
java.lang.String |
getStyleShade()
Get the style asociated with shaded elements |
java.lang.String |
getText()
Gets the output text |
java.lang.String |
getValue()
Gets the output value |
void |
paint(java.awt.Graphics sg)
Renders the keypad |
void |
paintStates()
Repaint the responses |
boolean |
respond()
Called by ClickListener to check if a response event should be sent to the parent form. |
void |
setErrorMessage(java.lang.String errorMsg)
Set the error message |
void |
setErrorStatus(int status)
Set the error status |
void |
setMaxLength(int len)
Sets the maximum length of the output value |
void |
setMinLength(int len)
Sets the minimum length of the output value |
void |
setOutputField(TextHolder of)
Sets a text field in which to display the key value. |
boolean |
setState(int x,
int y,
int defResponse)
Find a response |
void |
setStyle(java.lang.String newStyle)
Set the style asociated with shaded elements, background and text colors |
void |
setStyle3D(java.lang.String newStyle)
Get the style asociated with three dimensional objects/elements |
void |
setStyleShade(java.lang.String newStyle)
Set the style asociated with shaded elements, frame color |
void |
setText(java.lang.String newText)
Sets the control's text. |
void |
setValue(java.lang.String newValue)
Sets the output value |
void |
update(java.awt.Graphics g)
Refresh the display |
void |
updateSelectedState()
Fired the keyPressed event if a button has been pressed |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateUI |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, 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 |
|---|
protected int borderHeight
protected int borderWidth
protected int keyHeight
protected int keyWidth
protected ClickListener clickListener
protected StyleManager styleManager
protected int errorStatus
protected java.lang.String errorMessage
protected Project currentProject
| Constructor Detail |
|---|
public Keypad()
| Method Detail |
|---|
public void update(java.awt.Graphics g)
update in class javax.swing.JComponentg - the graphics contextpublic void paint(java.awt.Graphics sg)
paint in class javax.swing.JComponentsg - the graphics contextpublic void paintStates()
paintStates in interface StateListener
public boolean setState(int x,
int y,
int defResponse)
setState in interface StateListenerx - the x coordinate of the mouse clicky - the y coordinate of the mouse clickdefResponse - the default response
public int findCurrentResponse(int x,
int y)
findCurrentResponse in interface StateListenerx - the x coordinate of the mouse clicky - the y coordinate of the mouse click
public void updateSelectedState()
updateSelectedState in interface StateListenerpublic boolean respond()
public java.awt.Color getColor(int idx,
int callerClassId)
idx - The index of the color to get.callerClassId - The ID of this calling class
org.formaria.miniui.Frame#X_BUTTONpublic java.lang.String getStyle3D()
public java.lang.String getStyleShade()
public void setStyle(java.lang.String newStyle)
newStyle - the style namepublic void setStyle3D(java.lang.String newStyle)
newStyle - the style namepublic void setStyleShade(java.lang.String newStyle)
newStyle - the style namepublic void setText(java.lang.String newText)
setText in interface TextHoldernewText - The new text to display.public void setOutputField(TextHolder of)
of - the output text fieldpublic void clear()
public java.lang.String getValue()
public java.lang.String getText()
getText in interface TextHolderpublic void setValue(java.lang.String newValue)
newValue - the new keypad valuepublic void setMaxLength(int len)
len - the new maximum lengthpublic void setMinLength(int len)
len - the new minimum lengthpublic void setErrorStatus(int status)
setErrorStatus in interface ErrorDisplaystatus - public void setErrorMessage(java.lang.String errorMsg)
setErrorMessage in interface ErrorDisplayerrorMsg - the message text
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||