|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.view.View
jackpal.androidterm.emulatorview.EmulatorView
public class EmulatorView
A view on a TermSession
. Displays the terminal emulator's screen,
provides access to its scrollback buffer, and passes input through to the
terminal emulator.
If this view is inflated from an XML layout, you need to call attachSession
and setDensity
before using
the view. If creating this view from code, use the EmulatorView(Context, TermSession, DisplayMetrics)
constructor, which will
take care of this for you.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class android.view.View |
---|
View.BaseSavedState, View.DragShadowBuilder, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnDragListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLayoutChangeListener, View.OnLongClickListener, View.OnSystemUiVisibilityChangeListener, View.OnTouchListener |
Field Summary |
---|
Constructor Summary | |
---|---|
EmulatorView(Context context,
AttributeSet attrs)
Constructor called when inflating this view from XML. |
|
EmulatorView(Context context,
AttributeSet attrs,
int defStyle)
Constructor called when inflating this view from XML with a default style set. |
|
EmulatorView(Context context,
TermSession session,
DisplayMetrics metrics)
Create an EmulatorView for a TermSession . |
Method Summary | |
---|---|
void |
attachSession(TermSession session)
Attach a TermSession to this view. |
protected int |
computeVerticalScrollExtent()
Compute the vertical extent of the horizontal scrollbar's thumb within the vertical range. |
protected int |
computeVerticalScrollOffset()
Compute the vertical offset of the vertical scrollbar's thumb within the horizontal range. |
protected int |
computeVerticalScrollRange()
Compute the vertical range that the vertical scrollbar represents. |
boolean |
getKeypadApplicationMode()
Get the terminal emulator's keypad application mode. |
String |
getSelectedText()
Get selected text. |
boolean |
getSelectingText()
Whether the view is currently in text selection mode. |
TermSession |
getTermSession()
Get the TermSession corresponding to this view. |
int |
getVisibleHeight()
Get the height of the visible portion of this view. |
int |
getVisibleWidth()
Get the width of the visible portion of this view. |
boolean |
onCheckIsTextEditor()
|
InputConnection |
onCreateInputConnection(EditorInfo outAttrs)
|
boolean |
onDown(MotionEvent e)
|
protected void |
onDraw(Canvas canvas)
Draw the view to the provided Canvas . |
boolean |
onFling(MotionEvent e1,
MotionEvent e2,
float velocityX,
float velocityY)
|
boolean |
onJumpTapDown(MotionEvent e1,
MotionEvent e2)
|
boolean |
onJumpTapUp(MotionEvent e1,
MotionEvent e2)
|
boolean |
onKeyDown(int keyCode,
KeyEvent event)
Called when a key is pressed in the view. |
boolean |
onKeyUp(int keyCode,
KeyEvent event)
Called when a key is released in the view. |
void |
onLongPress(MotionEvent e)
|
void |
onPause()
Inform the view that it is no longer visible on the screen. |
void |
onResume()
Inform the view that it is now visible on screen. |
boolean |
onScroll(MotionEvent e1,
MotionEvent e2,
float distanceX,
float distanceY)
|
void |
onShowPress(MotionEvent e)
|
void |
onSingleTapConfirmed(MotionEvent e)
|
boolean |
onSingleTapUp(MotionEvent e)
|
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh)
This is called during layout when the size of this view has changed. |
boolean |
onTouchEvent(MotionEvent ev)
|
void |
page(int delta)
Page the terminal view (scroll it up or down by delta
screenfuls). |
void |
pageHorizontal(int deltaColumns)
Page the terminal view horizontally. |
void |
sendControlKey()
Send a Ctrl key event to the terminal. |
void |
sendFnKey()
Send an Fn key event to the terminal. |
void |
setBackKeyCharacter(int keyCode)
Set the key code to be sent when the Back key is pressed. |
void |
setColorScheme(ColorScheme scheme)
Set this EmulatorView 's color scheme. |
void |
setControlKeyCode(int keyCode)
Set the keycode corresponding to the Ctrl key. |
void |
setCursorStyle(int style,
int blink)
Sets style information about the cursor. |
void |
setDensity(DisplayMetrics metrics)
Update the screen density for the screen on which the view is displayed. |
void |
setExtGestureListener(GestureDetector.OnGestureListener listener)
Set a GestureDetector.OnGestureListener to receive gestures performed on this
view. |
void |
setFnKeyCode(int keyCode)
Set the keycode corresponding to the Fn key. |
void |
setTextSize(int fontSize)
Sets the text size, which in turn sets the number of rows and columns. |
void |
setUseCookedIME(boolean useCookedIME)
Sets the IME mode ("cooked" or "raw"). |
void |
toggleSelectingText()
Toggle text selection mode in the view. |
void |
updateSize(boolean force)
Update the view's idea of its size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EmulatorView(Context context, TermSession session, DisplayMetrics metrics)
EmulatorView
for a TermSession
.
context
- The Context
for the view.session
- The TermSession
this view will be displaying.metrics
- The DisplayMetrics
of the screen on which the view
will be displayed.public EmulatorView(Context context, AttributeSet attrs)
You should call attachSession
and setDensity
before using an EmulatorView
created
using this constructor.
public EmulatorView(Context context, AttributeSet attrs, int defStyle)
You should call attachSession
and setDensity
before using an EmulatorView
created
using this constructor.
Method Detail |
---|
public void attachSession(TermSession session)
TermSession
to this view.
session
- The TermSession
this view will be displaying.public void setDensity(DisplayMetrics metrics)
metrics
- The DisplayMetrics
of the screen.public void onResume()
public void onPause()
public void setColorScheme(ColorScheme scheme)
EmulatorView
's color scheme.
scheme
- The ColorScheme
to use (use null for the default
scheme).TermSession.setColorScheme(jackpal.androidterm.emulatorview.ColorScheme)
,
ColorScheme
public boolean onCheckIsTextEditor()
onCheckIsTextEditor
in class View
public InputConnection onCreateInputConnection(EditorInfo outAttrs)
onCreateInputConnection
in class View
public boolean getKeypadApplicationMode()
public void setExtGestureListener(GestureDetector.OnGestureListener listener)
GestureDetector.OnGestureListener
to receive gestures performed on this
view. Can be used to implement additional
functionality via touch gestures or override built-in gestures.
listener
- The GestureDetector.OnGestureListener
which will receive
gestures.protected int computeVerticalScrollRange()
computeVerticalScrollRange
in class View
protected int computeVerticalScrollExtent()
computeVerticalScrollExtent
in class View
protected int computeVerticalScrollOffset()
computeVerticalScrollOffset
in class View
public TermSession getTermSession()
TermSession
corresponding to this view.
TermSession
object for this view.public int getVisibleWidth()
public int getVisibleHeight()
public void page(int delta)
delta
screenfuls).
delta
- The number of screens to scroll. Positive means scroll down,
negative means scroll up.public void pageHorizontal(int deltaColumns)
deltaColumns
- the number of columns to scroll. Positive scrolls to
the right.public void setTextSize(int fontSize)
fontSize
- the new font size, in density-independent pixels.public void setCursorStyle(int style, int blink)
style
- The style of the cursor.blink
- Whether the cursor should blink.public void setUseCookedIME(boolean useCookedIME)
useCookedIME
- Whether the IME should be used in cooked mode.public boolean onSingleTapUp(MotionEvent e)
onSingleTapUp
in interface GestureDetector.OnGestureListener
public void onLongPress(MotionEvent e)
onLongPress
in interface GestureDetector.OnGestureListener
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
onScroll
in interface GestureDetector.OnGestureListener
public void onSingleTapConfirmed(MotionEvent e)
public boolean onJumpTapDown(MotionEvent e1, MotionEvent e2)
public boolean onJumpTapUp(MotionEvent e1, MotionEvent e2)
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
onFling
in interface GestureDetector.OnGestureListener
public void onShowPress(MotionEvent e)
onShowPress
in interface GestureDetector.OnGestureListener
public boolean onDown(MotionEvent e)
onDown
in interface GestureDetector.OnGestureListener
public boolean onTouchEvent(MotionEvent ev)
onTouchEvent
in class View
public boolean onKeyDown(int keyCode, KeyEvent event)
onKeyDown
in interface KeyEvent.Callback
onKeyDown
in class View
keyCode
- The keycode of the key which was pressed.event
- A KeyEvent
describing the event.
public boolean onKeyUp(int keyCode, KeyEvent event)
onKeyUp
in interface KeyEvent.Callback
onKeyUp
in class View
keyCode
- The keycode of the key which was released.event
- A KeyEvent
describing the event.
protected void onSizeChanged(int w, int h, int oldw, int oldh)
onSizeChanged
in class View
public void updateSize(boolean force)
force
- Whether a size adjustment should be performed even if the
view's size has not changed.protected void onDraw(Canvas canvas)
Canvas
.
onDraw
in class View
canvas
- The Canvas
to draw the view to.public void toggleSelectingText()
public boolean getSelectingText()
public String getSelectedText()
String
with the selected text.public void sendControlKey()
public void sendFnKey()
public void setBackKeyCharacter(int keyCode)
public void setControlKeyCode(int keyCode)
public void setFnKeyCode(int keyCode)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |