DrawTexts
Class SPad

java.lang.Object
  extended by DrawTexts.SPad

public class SPad
extends java.lang.Object

 

These are subwindows of the screen:

a        N       b
W        C       E
c        S       d



Field Summary
static int a_
           
static int b_
           
 java.awt.Color backgroundColor
           
static java.awt.Color BRIGHT_BLUED
           
static int c_
           
static int C_
           
static int d_
           
 boolean drawBorders
           
static int[] drawSequence
          Default draw sequence.
static int E_
           
static int F_
          For detection self test do1b Make this more consistent
 java.awt.Color focusColor
          Focus color
 java.awt.Color focusForeColor
          Talk color
static int focusIx
          Which pad has focus.
 java.awt.Color foreTextColor
           
 java.awt.Font ft
           
 java.awt.Graphics g
           
 java.awt.Image img
           
 java.awt.image.ImageObserver iobs
           
static int N_
           
static int none_
          When used, none_ means "no pad"
static int P_
           
 int paintImgYPosition
           
static int S_
           
 java.lang.StringBuffer sb
          Keeps user's input line.
static SPad[] sPad
           
 int talkH
          Talk Zone fields and methods used when user prints.
 int talkW
          Talk Zone fields and methods used when user prints.
 int talkX
          Talk Zone fields and methods used when user prints.
 int talkY
          Talk Zone fields and methods used when user prints.
static int W_
           
 int xL
          Total dimensions.
 int xR
           
 int yL
          Total dimensions.
 int yR
           
 
Constructor Summary
SPad(int Ix, int xR, int yR, int xL, int yL)
          The idea is to be able to preset dimensions before graphics context is even yet known.
 
Method Summary
 boolean addChar(char c)
          Appends char to buffer if space available.
 void Clear()
          Clears and prepares screen for drawing.
 void ClearTerminal()
          Sets backgroundColor to terminal area.
 void ClearTerminalFromCurrentPosition()
           
 void ClearTerminalFromCurrentPosition(java.awt.Color c)
          It does extra step along y, and restores bk.
 void doScrollString(int direction)
           
static void drawPads()
           
 void DrewBorder()
          Prepares screen for drawing.
 void fromTopLine(java.lang.String s)
          Starts print from first line
static void internalInit()
          initialize implicit-collection of SPads
static void paintTalk()
           
 void releaseGraphics()
           
static void releaseGraphicsFromCollection()
           
 boolean removeChar()
           
 void removeFocus()
           
 void restoreTextColor()
           
 void restoreToDefaultFont()
          Restore changed current font
 boolean scrollImage(int direction)
          Return true if image not null to block text scroll
 void setAndScroll(java.lang.String[] s, int sBodyLength, int startIx, int startFromLine, java.awt.Font ft, java.awt.Color cl)
          Numeration begins from startFromLine=1.
 void setDefaultFont(java.awt.Font ft)
          Set Default and Current font
 void setFocus()
          Set SPad to listen to user's input
 void setFont(java.awt.Font ft)
          Font can be edited only after graphics is supplied.
 void setScrollGraphics(java.awt.Font ft, java.awt.Color cl)
           
 void setToPaintImage(java.awt.Image imgP, java.awt.image.ImageObserver iobsP)
           
 void skipLines(int n)
          Skip n lines and prints nothing
 void supplyGraphics(java.awt.Graphics g)
           
static void supplyGraphicsToCollection(int iX, java.awt.Image img, java.awt.Graphics g, java.awt.image.ImageObserver iobs, java.awt.Font dflFont)
           
 void talkPrint()
           
 void wr(java.lang.String s)
          Print string to the next position, redraw from the top, if no space:
 void wrc(java.lang.String s)
          Clear and write from top
 void wrm(java.lang.String s)
          Display multilined text with \n as line separator
 void wrm(java.lang.String s, int startFromLine)
          Display multilined text with \n as line separator starting from startFromLine from the top.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BRIGHT_BLUED

public static final java.awt.Color BRIGHT_BLUED

none_

public static final int none_
When used, none_ means "no pad"

See Also:
Constant Field Values

a_

public static final int a_
See Also:
Constant Field Values

W_

public static final int W_
See Also:
Constant Field Values

c_

public static final int c_
See Also:
Constant Field Values

N_

public static final int N_
See Also:
Constant Field Values

C_

public static final int C_
See Also:
Constant Field Values

S_

public static final int S_
See Also:
Constant Field Values

b_

public static final int b_
See Also:
Constant Field Values

E_

public static final int E_
See Also:
Constant Field Values

d_

public static final int d_
See Also:
Constant Field Values

P_

public static final int P_
See Also:
Constant Field Values

F_

public static final int F_
For detection self test do1b Make this more consistent

See Also:
Constant Field Values

sPad

public static SPad[] sPad

foreTextColor

public java.awt.Color foreTextColor

backgroundColor

public java.awt.Color backgroundColor

drawBorders

public boolean drawBorders

xL

public int xL
Total dimensions.


yL

public int yL
Total dimensions.


xR

public int xR

yR

public int yR

g

public java.awt.Graphics g

img

public java.awt.Image img

iobs

public java.awt.image.ImageObserver iobs

ft

public java.awt.Font ft

talkX

public int talkX
Talk Zone fields and methods used when user prints. Methods drawn over all graphics, when graphics is finished. Location:


talkY

public int talkY
Talk Zone fields and methods used when user prints. Methods drawn over all graphics, when graphics is finished. Location:


talkW

public int talkW
Talk Zone fields and methods used when user prints. Methods drawn over all graphics, when graphics is finished. Location:


talkH

public int talkH
Talk Zone fields and methods used when user prints. Methods drawn over all graphics, when graphics is finished. Location:


sb

public java.lang.StringBuffer sb
Keeps user's input line. 1000 chars should be enough for line.


focusColor

public java.awt.Color focusColor
Focus color


focusForeColor

public java.awt.Color focusForeColor
Talk color


drawSequence

public static int[] drawSequence
Default draw sequence. Center is in background.


focusIx

public static int focusIx
Which pad has focus.


paintImgYPosition

public int paintImgYPosition
Constructor Detail

SPad

public SPad(int Ix,
            int xR,
            int yR,
            int xL,
            int yL)
The idea is to be able to preset dimensions before graphics context is even yet known.

Method Detail

internalInit

public static void internalInit()
initialize implicit-collection of SPads


drawPads

public static void drawPads()

paintTalk

public static void paintTalk()

supplyGraphicsToCollection

public static void supplyGraphicsToCollection(int iX,
                                              java.awt.Image img,
                                              java.awt.Graphics g,
                                              java.awt.image.ImageObserver iobs,
                                              java.awt.Font dflFont)

releaseGraphicsFromCollection

public static void releaseGraphicsFromCollection()

supplyGraphics

public void supplyGraphics(java.awt.Graphics g)

releaseGraphics

public void releaseGraphics()

setFont

public void setFont(java.awt.Font ft)
Font can be edited only after graphics is supplied.


setDefaultFont

public void setDefaultFont(java.awt.Font ft)
Set Default and Current font


restoreToDefaultFont

public void restoreToDefaultFont()
Restore changed current font


Clear

public void Clear()
Clears and prepares screen for drawing. Clears terminal and non-terminal areas. Border is cleared also.


DrewBorder

public void DrewBorder()
Prepares screen for drawing.


setFocus

public void setFocus()
Set SPad to listen to user's input


removeFocus

public void removeFocus()

addChar

public boolean addChar(char c)
Appends char to buffer if space available. Returns false if exceeds x-dimension.


removeChar

public boolean removeChar()

talkPrint

public void talkPrint()

wrc

public void wrc(java.lang.String s)
Clear and write from top


wr

public void wr(java.lang.String s)
Print string to the next position, redraw from the top, if no space:


wrm

public void wrm(java.lang.String s)
Display multilined text with \n as line separator


wrm

public void wrm(java.lang.String s,
                int startFromLine)
Display multilined text with \n as line separator starting from startFromLine from the top. startFromLine <= 1 starts from the first line.


setAndScroll

public void setAndScroll(java.lang.String[] s,
                         int sBodyLength,
                         int startIx,
                         int startFromLine,
                         java.awt.Font ft,
                         java.awt.Color cl)
Numeration begins from startFromLine=1. Array's startIx begins from 0. sBodyLength - length of sub array of non-null strings intended for scrolling. String will be stashed and can be reused for scrolling.


setScrollGraphics

public void setScrollGraphics(java.awt.Font ft,
                              java.awt.Color cl)

doScrollString

public void doScrollString(int direction)

ClearTerminal

public void ClearTerminal()
Sets backgroundColor to terminal area. If pad has focus, then focus area is not touched. If no focus, all space of pad is cleared.


ClearTerminalFromCurrentPosition

public void ClearTerminalFromCurrentPosition()

ClearTerminalFromCurrentPosition

public void ClearTerminalFromCurrentPosition(java.awt.Color c)
It does extra step along y, and restores bk. col. par.


skipLines

public void skipLines(int n)
Skip n lines and prints nothing


fromTopLine

public void fromTopLine(java.lang.String s)
Starts print from first line


restoreTextColor

public void restoreTextColor()

scrollImage

public boolean scrollImage(int direction)
Return true if image not null to block text scroll


setToPaintImage

public void setToPaintImage(java.awt.Image imgP,
                            java.awt.image.ImageObserver iobsP)