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

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.mesh.MTTriangleMesh
                  extended by org.mt4j.components.visibleComponents.widgets.keyboard.MTKey
All Implemented Interfaces:
IMTComponent, IMTComponent3D, IMTInputEventListener, IGestureEventListener

public class MTKey
extends MTTriangleMesh

    

Key class used in the mt keyboard.

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
MTKey(GeometryInfo geom, processing.core.PApplet pApplet, java.lang.String characterUnicodeToWrite, java.lang.String characterUnicodeToWriteShifted)
          Instantiates a new mT key.
 
Method Summary
protected  IBoundingShape computeDefaultBounds()
          Computes a default bounding box for the shape.
 void destroyComponent()
          
Override this to clean up resources when destroying a component.
protected  void destroyDisplayLists()
          This is called during the shape's destroy() method.
 void drawComponent(processing.core.PGraphics g)
          Draws this component only (Not its children!).
 java.lang.String getCharacterToWrite()
          Gets the character to write.
 java.lang.String getCharacterToWriteShifted()
          Gets the character to write shifted.
 float getOriginalHeight()
          Gets the original height.
 float getOriginalWidth()
          Gets the original width.
 boolean isPressed()
          Checks if is pressed.
 void setGeometryInfo(GeometryInfo geometryInfo)
          Sets a new geometryInfo with new vertices for this shape.
 void setOutlineContours(java.util.List<Vertex[]> contours)
          Sets the outline contours.
 void setPressed(boolean pressed)
          Sets the pressed.
 void setUseDisplayList(boolean useDisplayList)
          Tries to use a opengl display list for rendering this shape.
 void setVertices(Vertex[] vertices)
          Sets new vertices for that shape.
 
Methods inherited from class org.mt4j.components.visibleComponents.shapes.mesh.MTTriangleMesh
calculateDefaultNormals, drawComponent, generateDisplayLists, getCenterPointLocal, getGeometryIntersectionLocal, getHeightXY, getHeightXYVectObjSpace, getOutlineContours, getTriangleCount, getTriangles, getWidthXY, getWidthXYVectObjSpace, isCalculateDefaultNormals, isDrawNormals, isGeometryContainsPointLocal, setCalculateDefaultNormals, setDrawNormals, setStrokeColor
 
Methods inherited from class org.mt4j.components.visibleComponents.shapes.AbstractShape
componentContainsPointLocal, destroy, disableAndDeleteDisplayLists, generateAndUseDisplayLists, getBoundingShape, getCenterPointGlobal, getCenterPointRelativeToParent, getConvexHullXYGlobal, getGeometryInfo, getIntersectionLocal, getTexture, getTextureMode, getVertexCount, getVerticesGlobal, getVerticesLocal, isBoundingShapeSet, isBoundsAutoCompute, isContainedIn, isTextureEnabled, isUseDirectGL, isUseDisplayList, isUseVBOs, setBoundingShape, setBoundsAutoCompute, setBoundsBehaviour, setBoundsPickingBehaviour, setDefaultGestureActions, setFillColor, setMatricesDirty, setPositionGlobal, setPositionRelativeToOther, setPositionRelativeToParent, setTexture, setTextureEnabled, setTextureMode, setUseDirectGL, 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

MTKey

public MTKey(GeometryInfo geom,
             processing.core.PApplet pApplet,
             java.lang.String characterUnicodeToWrite,
             java.lang.String characterUnicodeToWriteShifted)
Instantiates a new mT key.

Parameters:
vertices - the vertices
contours - the contours
pApplet - the applet
characterUnicodeToWrite - the character unicode to write
characterUnicodeToWriteShifted - the character unicode to write shifted
Method Detail

setOutlineContours

public void setOutlineContours(java.util.List<Vertex[]> contours)
Description copied from class: MTTriangleMesh
Sets the outline contours.
NOTE: To draw the outlines, the default setting of noStroke has to be changed to false!

Overrides:
setOutlineContours in class MTTriangleMesh
Parameters:
contours - the new outline contours

setUseDisplayList

public void setUseDisplayList(boolean useDisplayList)
Description copied from class: AbstractShape
Tries to use a opengl display list for rendering this shape.
You have to be in OpenGL mode and setDrawDirectGL() has to be set to "true" first!
NOTE: the display list has to be created first to use it! This can be done by calling generateDisplayLists. Instead of these 2 steps we can also just call generateAndUseDisplayLists()
NOTE: if the shape was using a display list before we should delete it before setting a new one!

Overrides:
setUseDisplayList in class AbstractShape
Parameters:
useDisplayList - the use display list

setVertices

public void setVertices(Vertex[] vertices)
Description copied from class: AbstractShape
Sets new vertices for that shape. and generates new vertex arrays for opengl mode.