org.mt4j.components.visibleComponents.widgets.keyboard
Class MTKeyboard

java.lang.Object
  extended by org.mt4j.components.MTComponent
      extended by org.mt4j.components.visibleComponents.AbstractVisibleComponent
          extended by org.mt4j.components.visibleComponents.shapes.AbstractShape
              extended by org.mt4j.components.visibleComponents.shapes.MTPolygon
                  extended by org.mt4j.components.visibleComponents.shapes.MTRoundRectangle
                      extended by org.mt4j.components.visibleComponents.widgets.keyboard.MTKeyboard
All Implemented Interfaces:
IMTComponent, IMTComponent3D, IMTInputEventListener, IGestureEventListener
Direct Known Subclasses:
MTTextKeyboard

public class MTKeyboard
extends MTRoundRectangle

    

A multitouch keyboard using vector graphics.

Author:
Christopher Ruff

Field Summary
 
Fields inherited from class org.mt4j.components.visibleComponents.shapes.AbstractShape
BOUNDS_CHECK_THEN_GEOMETRY_CHECK, BOUNDS_DONT_USE, BOUNDS_ONLY_CHECK
 
Constructor Summary
MTKeyboard(processing.core.PApplet pApplet)
          Creates a new keyboard without an text input acceptor.
 
Method Summary
 void addTextInputListener(ITextInputListener textListener)
           
 void close()
           
protected  void closeButtonClicked()
           
protected  void closeKeyboard()
           
protected  void destroyComponent()
          
Override this to clean up resources when destroying a component.
 ITextInputListener[] getTextInputListeners()
           
protected  void keyboardButtonClicked(MTKey clickedKey, boolean shiftPressed)
          Keyboard button clicked.
protected  void keyboardButtonDown(MTKey clickedKey, boolean shiftPressed)
          Called after keyboard button pressed.
protected  void keyboardButtonUp(MTKey clickedKey, boolean shiftPressed)
          Keyboard button up.
 void removeTextInputListener(ITextInputListener textListener)
           
protected  void setDefaultGestureActions()
          Assigns the default gesture to this component, drag, rotate, scale.
 
Methods inherited from class org.mt4j.components.visibleComponents.shapes.MTRoundRectangle
computeDefaultBounds, setSizeLocal
 
Methods inherited from class org.mt4j.components.visibleComponents.shapes.MTPolygon
drawComponent, drawPureGl, get2DPolygonArea, getCenterOfMass2DLocal, getCenterPointLocal, getGeometryIntersectionLocal, getHeightXY, getHeightXYVectLocal, getNormal, getWidthXY, getWidthXYVectLocal, isGeometryContainsPointLocal, setGeometryInfo, setHeightXYGlobal, setHeightXYRelativeToParent, setSizeXYGlobal, setSizeXYRelativeToParent, setVertices, setWidthXYGlobal, setWidthXYRelativeToParent
 
Methods inherited from class org.mt4j.components.visibleComponents.shapes.AbstractShape
componentContainsPointLocal, destroy, destroyDisplayLists, disableAndDeleteDisplayLists, generateAndUseDisplayLists, generateDisplayLists, getBoundingShape, getCenterPointGlobal, getCenterPointRelativeToParent, getConvexHullXYGlobal, getGeometryInfo, getIntersectionLocal, getTexture, getTextureMode, getVertexCount, getVerticesGlobal, getVerticesLocal, isBoundingShapeSet, isBoundsAutoCompute, isContainedIn, isTextureEnabled, isUseDirectGL, isUseDisplayList, isUseVBOs, setBoundingShape, setBoundsAutoCompute, setBoundsBehaviour, setBoundsPickingBehaviour, setFillColor, setMatricesDirty, setPositionGlobal, setPositionRelativeToOther, setPositionRelativeToParent, setStrokeColor, setTexture, setTextureEnabled, setTextureMode, setUseDirectGL, setUseDisplayList, setUseVBOs, tweenTranslate, tweenTranslate, tweenTranslateTo
 
Methods inherited from class org.mt4j.components.visibleComponents.AbstractVisibleComponent
applyStyle, getFillColor, getFillDrawMode, getFillPaint, getLineStipple, getMaterial, getStrokeColor, getStrokeWeight, getStyleInfo, isDrawSmooth, isNoFill, isNoStroke, postDraw, postDrawChildren, preDraw, setDrawSmooth, setFillDrawMode, setFillPaint, setLineStipple, setMaterial, setNoFill, setNoStroke, setStrokeWeight, setStyleInfo
 
Methods inherited from class org.mt4j.components.MTComponent
addChild, addChild, addChildren, addGestureListener, addInputListener, addStateChangeListener, applyLocalMatrix, attachCamera, containsChild, containsDirectChild, containsPointGlobal, fireInputEvent, fireStateChange, fireStateChange, getAttachedCamera, getChildbyID, getChildByIndex, getChildByName, getChildClip, getChildCount, getChildIndexOf, getChildList, getChildren, getClip, getController, getCustomViewportSetting, getDefaultViewportSetting, getGestureListeners, getGlobalInverseMatrix, getGlobalMatrix, getGlobalVecToParentRelativeSpace, getID, getInputListeners, getInputProcessors, getIntersectionGlobal, getLight, getLocalInverseMatrix, getLocalMatrix, getLocalVecToParentRelativeSpace, getName, getParent, getRenderer, getRoot, getTransformToDestinationLocalSpace, getTransformToDestinationParentSpace, getUserData, getViewingCamera, globalToLocal, globalToLocal, hasCustomViewPort, isComposite, isDepthBufferDisabled, isEnabled, isGestureAllowed, isPickable, isVisible, localToGlobal, pick, pick, processGestureEvent, processInputEvent, registerInputProcessor, removeAllChildren, removeAllGestureEventListeners, removeAllGestureEventListeners, removeChild, removeChild, removeFromParent, removeGestureEventListener, removeInputListener, removeStateChangeListener, reOrthogonalize, rotateX, rotateX, rotateXGlobal, rotateY, rotateY, rotateYGlobal, rotateZ, rotateZ, rotateZGlobal, scale, scale, scaleGlobal, sendChildToFront, sendToFront, setChildClip, setClip, setComposite, setController, setDepthBufferDisabled, setEnabled, setGestureAllowance, setLight, setLocalMatrix, setName, setPickable, setUserData, setViewPortSettings, setVisible, toString, transform, translate, translate, translateGlobal, unregisterAllInputProcessors, unregisterInputProcessor, updateComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MTKeyboard

public MTKeyboard(processing.core.PApplet pApplet)
Creates a new keyboard without an text input acceptor.

Parameters:
pApplet - the applet
Method Detail

setDefaultGestureActions

protected void setDefaultGestureActions()
Description copied from class: AbstractShape
Assigns the default gesture to this component, drag, rotate, scale.
Gets called in the constructor. Can be overridden in subclasses to allow other/more default gestures.

Overrides:
setDefaultGestureActions in class AbstractShape

keyboardButtonDown

protected void keyboardButtonDown(MTKey clickedKey,
                                  boolean shiftPressed)
Called after keyboard button pressed.

Parameters:
clickedKey - the clicked key
shiftPressed - the shift pressed

keyboardButtonUp

protected void keyboardButtonUp(MTKey clickedKey,
                                boolean shiftPressed)
Keyboard button up.

Parameters:
clickedKey - the clicked key
shiftPressed - the shift pressed

keyboardButtonClicked

protected void keyboardButtonClicked(MTKey clickedKey,
                                     boolean shiftPressed)
Keyboard button clicked.

Parameters:
clickedKey - the clicked key
shiftPressed - the shift pressed

addTextInputListener

public void addTextInputListener(ITextInputListener textListener)

getTextInputListeners

public ITextInputListener[] getTextInputListeners()

removeTextInputListener

public void removeTextInputListener(ITextInputListener textListener)

close

public void close()

closeKeyboard

protected void closeKeyboard()

closeButtonClicked

protected void closeButtonClicked()

destroyComponent

protected void destroyComponent()
Description copied from class: MTComponent

Override this to clean up resources when destroying a component. This method gets called by the destroy method. So you shouldnt invoke this method directly.

Overrides:
destroyComponent in class MTPolygon