Package org.luwrain.controls
Class NavigationArea
java.lang.Object
org.luwrain.controls.NavigationArea
- All Implemented Interfaces:
ClipboardTranslator.Provider,RegionTextQueryTranslator.Provider,Area,HotPoint,HotPointControl,Lines
- Direct Known Subclasses:
ConsoleArea,EditArea,FormArea,SimpleArea
public abstract class NavigationArea
extends Object
implements Area, HotPointControl, ClipboardTranslator.Provider, RegionTextQueryTranslator.Provider
An area with basic navigation operations. This abstract class
implements the usual behaviour for navigation over the static text
in the area. There is no data container, so it's implied that
user should implement method
getLine() and getLineCount().
The supported operations include arrow keys, Page up/down and Home/End. The copying to clipboard is supported as well.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClipboardTranslatorprotected final ControlContextprotected intprotected intprotected intprotected final RegionPointprotected final RegionTextQueryTranslator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidannounceLine(int index, String line) voidstatic voiddefaultLineAnnouncement(ControlContext context, int index, String line) voidAction[]intintprotected StringgetLineNotNull(int index) intgetNewHotPointX(int oldHotPointY, int newHotPointY, int oldHotPointX, String oldLine, String newLine) protected intgetNextBlockLine(int startFrom) protected intgetPrevBlockLine(int startFrom) protected intprotected booleanisBlockBoundLine(int index, String line) protected booleanonAltEnd(InputEvent event) protected booleanonAltHome(InputEvent event) protected booleanonAltLeft(InputEvent event) protected booleanonAltRight(InputEvent event) booleanonAreaQuery(AreaQuery query) booleanonClipboardCopy(int fromX, int fromY, int toX, int toY, boolean withDeleting) booleanbooleanonDeleteRegion(int fromX, int fromY, int toX, int toY) protected booleanonEnd(InputEvent event) protected booleanonHome(InputEvent event) booleanonInputEvent(InputEvent event) protected booleanonMoveDown(InputEvent event) protected booleanonMoveLeft(InputEvent event) protected booleanonMoveRight(InputEvent event) protected booleanonMoveUp(InputEvent event) protected booleanonPageDown(InputEvent event) protected booleanonPageUp(InputEvent event) onRegionTextQuery(int fromX, int fromY, int toX, int toY) booleanonSystemEvent(SystemEvent event) voidredraw()Redraws content and updates hot point position.voidreset(boolean announce) voidsetHotPoint(int x, int y) Sets the hot point to the new position.voidsetHotPointX(int value) voidsetHotPointY(int value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.luwrain.core.Area
getAreaNameMethods inherited from interface org.luwrain.core.Lines
getLine, getLineCount
-
Field Details
-
context
-
regionPoint
-
clipboardTranslator
-
regionTextQueryTranslator
-
hotPointX
protected int hotPointX -
hotPointY
protected int hotPointY -
hotPointTransCount
protected int hotPointTransCount
-
-
Constructor Details
-
NavigationArea
-
-
Method Details
-
onInputEvent
- Specified by:
onInputEventin interfaceArea
-
onSystemEvent
- Specified by:
onSystemEventin interfaceArea
-
onAreaQuery
- Specified by:
onAreaQueryin interfaceArea
-
getAreaActions
- Specified by:
getAreaActionsin interfaceArea
-
onHome
-
onEnd
-
onAltHome
-
onAltEnd
-
onMoveDown
-
onMoveUp
-
onMoveRight
-
onMoveLeft
-
onPageDown
-
isBlockBoundLine
-
getNextBlockLine
protected int getNextBlockLine(int startFrom) -
onPageUp
-
getPrevBlockLine
protected int getPrevBlockLine(int startFrom) -
onAltRight
-
onAltLeft
-
announceLine
-
getNewHotPointX
-
reset
public void reset(boolean announce) -
redraw
public void redraw()Redraws content and updates hot point position. -
beginHotPointTrans
public void beginHotPointTrans()- Specified by:
beginHotPointTransin interfaceHotPointControl
-
endHotPointTrans
public void endHotPointTrans()- Specified by:
endHotPointTransin interfaceHotPointControl
-
setHotPoint
public void setHotPoint(int x, int y) Sets the hot point to the new position. The provided coordinates are adjusted to real area size and the user may not take care about exceeding area bounds.- Parameters:
x- The x coordinate of the new positiony- The y coordinate of the new position
-
setHotPointX
public void setHotPointX(int value) - Specified by:
setHotPointXin interfaceHotPointControl
-
setHotPointY
public void setHotPointY(int value) - Specified by:
setHotPointYin interfaceHotPointControl
-
getHotPointX
public int getHotPointX()- Specified by:
getHotPointXin interfaceArea- Specified by:
getHotPointXin interfaceHotPoint- Specified by:
getHotPointXin interfaceHotPointControl
-
getHotPointY
public int getHotPointY()- Specified by:
getHotPointYin interfaceArea- Specified by:
getHotPointYin interfaceHotPoint- Specified by:
getHotPointYin interfaceHotPointControl
-
onRegionTextQuery
- Specified by:
onRegionTextQueryin interfaceRegionTextQueryTranslator.Provider
-
onClipboardCopyAll
public boolean onClipboardCopyAll()- Specified by:
onClipboardCopyAllin interfaceClipboardTranslator.Provider
-
onClipboardCopy
public boolean onClipboardCopy(int fromX, int fromY, int toX, int toY, boolean withDeleting) - Specified by:
onClipboardCopyin interfaceClipboardTranslator.Provider
-
onDeleteRegion
public boolean onDeleteRegion(int fromX, int fromY, int toX, int toY) - Specified by:
onDeleteRegionin interfaceClipboardTranslator.Provider
-
getRegionPoint
-
getValidLineCount
protected int getValidLineCount() -
getLineNotNull
-
defaultLineAnnouncement
-