Package: com.multiversesocial.hyperview
Class: com.multiversesocial.hyperview.TextPane
Source: src/com/multiversesocial/hyperview/TextPane.java
-------- TextPane.java - HyperView 3.0 Orange Framework Complete remake with true large-file paging via NIO MappedByteBuffer + FileChannel
Extends: BasicPane
Implements: TextPaneConstants, HyperFileRequestPopListener, BufferControl
disk.gifpublic class TextPane extends BasicPane implements TextPaneConstants, HyperFileRequestPopListener, BufferControl
| Declaration | Value / initializer | Description | Source |
|---|---|---|---|
boolean binaryOutput | No comment in source; assigned in TextPane(), load(); used in update(). | ||
boolean binarySource | No comment in source; assigned in TextPane(), load(). | ||
int bufferSize | No comment in source; assigned in makeBitMap(), load(), increaseBufferSize(); used in TextPane(), print(), toString(). | ||
volatile ByteBuffer byteBuffer | No comment in source; name appears in 1 other source file(s): STDInputHandler. | ||
private Charset charset | = StandardCharsets.ISO_8859_1 | default ASC | |
Gadget charsetGadget | No comment in source; assigned in TextPane(). | ||
TextPane childPane | No comment in source; not referenced by name in this type’s methods. | ||
private String clipboard | = "" | ---------- CLIPBOARD & CURSOR ---------- | |
CloseListener closeListener | ---------- original fields (unchanged) ---------- | ||
int columns | No comment in source; used in toString(). | ||
String commandString | No comment in source; name appears in 4 other source file(s): CLICommand, Help, HyperView, STDInputHandler. | ||
volatile byte[] controlBuffer | No comment in source; assigned in makeBitMap(). | ||
int count | No comment in source; assigned in TextPane(). | ||
int currentColumn | No comment in source; assigned in makeBitMap(), load(), print(); used in toString(). | ||
int currentDataOffset | No comment in source; assigned in TextPane(), makeBitMap(); used in toString(). | ||
String currentDirName | No comment in source; assigned in onFileSelect(); used in load(). | ||
int currentPage | No comment in source; assigned in TextPane(), makeBitMap(), update(), load(), print(); used in inView(). | ||
int currentPrintOffset | No comment in source; assigned in TextPane(), load(); used in update(), inView(), toString(). | ||
int currentRow | No comment in source; assigned in makeBitMap(), load(), print(); used in toString(). | ||
private static final long CURSOR_BLINK_DELAY | = 500 | No comment in source; used in update(). | |
private int cursorCol | = 0 | No comment in source; assigned in inKey(), setCursorPosition(); used in update(). | |
private int cursorRow | = 0 | No comment in source; assigned in inKey(), setCursorPosition(); used in update(). | |
private boolean cursorVisible | = true | No comment in source; assigned in update(), setCursorPosition(). | |
volatile int dataEnd | No comment in source; assigned in TextPane(), load(), print(). | ||
private static final int DEFAULT_MOVEBUFFER_SIZE | = 64 | No comment in source; used in TextPane(); name appears in 17 other source file(s): AnimGob, BasicPane, Gadget, GetString …. | |
private static final int DEFAULT_WINDOW_SIZE | = 16777216 16 * 1024 * 1024 | No comment in source; used in load(). | |
int displayMaxColumns | No comment in source; assigned in makeBitMap(); used in update(), load(), print(), setCursorPosition(), toString(). | ||
int displayMaxRows | No comment in source; assigned in makeBitMap(); used in update(), load(), print(), onClick(), getRowFromY() …. | ||
String[] displayString | No comment in source; assigned in makeBitMap(); used in getColFromX(), selectWordAt(), getSelectedWord(). | ||
int[] displayStringStart | No comment in source; assigned in makeBitMap(). | ||
int displayTextHeight | No comment in source; assigned in makeBitMap(); used in update(), getRowFromY(). | ||
private static final long DOUBLE_CLICK_DELAY | = 500 | No comment in source; used in onClick(). | |
volatile FileChannel fileChannel | No comment in source; assigned in load(); used in loadWindow(). | ||
volatile String fileName | No comment in source; assigned in update(), load(), onFileSelect(). | ||
char fileSeparator | No comment in source; assigned in TextPane(); used in load(). | ||
private long fileSize | = 0L | No comment in source; assigned in load(); used in loadWindow(), update(). | |
FontBaseButton fontBaseButton | No comment in source; assigned in TextPane(). | ||
private static final Map<Font,int[]> fontCharWidthCache | = new HashMap<>() | ---------- character width cache ---------- | |
int fontHeight | No comment in source; used in print(). | ||
Gadget forceBinaryGadget | No comment in source; assigned in TextPane(). | ||
Color frameBottomColor | No comment in source; assigned in TextPane(); used in makeBitMap(), erase(), setPaneColor(). | ||
Color frameColor | No comment in source; name appears in 2 other source file(s): BasicPane, HyperBoolPop. | ||
Color frameFaceColor | No comment in source; assigned in TextPane(); used in makeBitMap(), erase(), setPaneColor(). | ||
Color frameTopColor | No comment in source; assigned in TextPane(); used in makeBitMap(), erase(), setPaneColor(). | ||
int frameWidth | No comment in source; assigned in makeBitMap(). | ||
boolean gettingFile | No comment in source; assigned in TextPane(), onFileSelect(). | ||
HyperFileRequestPopListener hyperFileRequestPopListener | No comment in source; assigned in TextPane(). | ||
int inBytes | No comment in source; assigned in makeBitMap(); used in toString(). | ||
private int lastClickCol | = -1 | No comment in source; assigned in onClick(). | |
private int lastClickRow | = -1 | No comment in source; assigned in onClick(). | |
private long lastClickTime | = 0 | ---------- DOUBLE-CLICK DETECTION ---------- | |
private long lastCursorBlink | = 0 | No comment in source; assigned in update(), setCursorPosition(). | |
private MappedByteBuffer mappedWindow | = null | No comment in source; assigned in loadWindow(). | |
int maxAdvance | Precomputed maximum drawing width | ||
int maxColumns | No comment in source; assigned in TextPane(); used in toString(). | ||
int maxPages | No comment in source; assigned in TextPane(), load(), increaseBufferSize(); used in makeBitMap(), toString(). | ||
int maxRows | No comment in source; assigned in TextPane(); used in toString(). | ||
Color menuPaneColor | No comment in source; assigned in TextPane(), setPaneColor(); used in makeBitMap(), update(), erase(), print(). | ||
int mpTextHeight | No comment in source; not referenced by name in this type’s methods. | ||
int mWidth | No comment in source; assigned in makeBitMap(). | ||
private boolean pagedMode | = false | ---------- NEW: paged large-file + Unicode support ---------- | |
Color pageRectangleColor | No comment in source; assigned in TextPane(); used in makeBitMap(), update(). | ||
int pageSize | No comment in source; assigned in makeBitMap(); used in update(), load(), inView(), increaseBufferSize(), toString(). | ||
int pageXOffset | No comment in source; assigned in TextPane(); used in makeBitMap(), update(). | ||
int pageYOffset | No comment in source; assigned in TextPane(). | ||
int printX | No comment in source; not referenced by name in this type’s methods. | ||
int printY | No comment in source; not referenced by name in this type’s methods. | ||
int rows | No comment in source; used in toString(). | ||
HyperScrollbar rowScrollbar | No comment in source; assigned in TextPane(); used in load(), increaseBufferSize(). | ||
private int selectionEnd | = -1 | No comment in source; assigned in selectWordAt(), clearSelection(); used in update(), getSelectedWord(). | |
private int selectionRow | = -1 | ---------- WORD SELECTION ---------- | |
private int selectionStart | = -1 | No comment in source; assigned in selectWordAt(), clearSelection(); used in update(), getSelectedWord(). | |
private static final long SMALL_FILE_THRESHOLD_PERCENT | = 10 | No comment in source; used in load(). | |
volatile byte[] sourceByte | No comment in source; assigned in makeBitMap(), loadWindow(), load(), print(), increaseBufferSize(); used in getByte(), update(), toString(). | ||
int[] sourceStringLength | No comment in source; assigned in makeBitMap(). | ||
Color textColor | No comment in source; assigned in TextPane(); used in makeBitMap(), erase(), print(). | ||
Font textFont | No comment in source; assigned in makeBitMap(); used in update(), getColFromX(). | ||
FontMetrics textFontMetrics | No comment in source; assigned in makeBitMap(); used in update(). | ||
Color textPaneColor | No comment in source; name appears in 3 other source file(s): BasicPane, HyperBoolPop, HyperEditBuffer. | ||
int textPaneFlags | No comment in source; assigned in increaseBufferSize(); used in load(), print(). | ||
int textPaneHeight | No comment in source; name appears in 3 other source file(s): BasicPane, HyperBoolPop, HyperEditBuffer. | ||
int textPaneWidth | No comment in source; name appears in 3 other source file(s): BasicPane, HyperBoolPop, HyperEditBuffer. | ||
int titleHeight | No comment in source; assigned in makeBitMap(). | ||
String titleString | No comment in source; assigned in TextPane(). | ||
Dispatch updateDispatch | No comment in source; assigned in TextPane(). | ||
private int windowSize | = 0 | No comment in source; assigned in load(); used in loadWindow(), getByte(). | |
private long windowStartOffset | = 0L | No comment in source; assigned in loadWindow(); used in getByte(). | |
int wraps | No comment in source; assigned in TextPane(), load(); used in toString(). |
| Signature | Description | Source |
|---|---|---|
TextPane() | 3 statement(s); calls super(). | |
TextPane(HyperView tView, int tWidth, int tHeight) | 2 statement(s); calls this(). | |
TextPane(HyperView tView, int tWidth, int tHeight, Color tfc1, Color tfc2, Color tfc3, Color tmpc) | 2 statement(s); calls this(). | |
TextPane(HyperView tView, String tTitle, int tX, int tY, int tWidth, int tHeight, Color fc1, Color fc2, Color fc3, Color mpc, int tMaxColumns, int tMaxRows) | 2 statement(s); calls this(). | |
TextPane(HyperView tView, String tTitle, int tX, int tY, int tWidth, int tHeight, Font tFont, Color fc1, Color fc2, Color fc3, Color mpc, int tMaxPages, int tMaxColumns, int tMaxRows) | 68 statement(s); calls super(), frameFaceColor.darker().darker(), frameFaceColor.darker(), makeBitMap(), curView.addGadget() …; creates Dispatch, ImageGadget, GetFileDispatch. |
| Signature | Description | Source |
|---|---|---|
static { … } | Implicit default constructor generated by the compiler (not written in the source). | |
public String callToString() | Returns toString(). | |
public void clearSelection() | 3 statement(s). | |
public void drawString(String str, int tPen, int tx, int ty) | 2 statement(s); calls graphics.setColor(), graphics.drawString(). | |
public void erase() | 11 statement(s); calls graphics.setColor(), graphics.drawLine(), graphics.fillRect(). | |
private byte getByte(long logicalOffset) | ---------- transparent byte access ---------- | |
private int[] getCharWidths(Font font, FontMetrics fm) | ---------- get cached char widths ---------- | |
private int getColFromX(int x, int row) | 7 statement(s); calls graphics.getFontMetrics(), text.length(), fm.charWidth(), text.charAt(). | |
private int getRowFromY(int y) | 6 statement(s). | |
public String getSelectedWord() | 2 statement(s); calls line.length(), line.substring(). | |
public int increaseBufferSize() | 21 statement(s); calls curView.curRun.maxMemory(); creates HyperPop. | |
public void inKey() | Cont ContGetStringHandleKey analog for TextPane focus gadget. | |
public boolean inView() | 3 statement(s). | |
private boolean isWordChar(char c) | Returns Character.isLetterOrDigit(c) || c == '_' || c == '-'. | |
public void load(byte[] tInByteArray) | 16 statement(s); calls update(). | |
public int load(String tFileName) | 20 statement(s); calls tFile.exists(), tFile.length(), load(), tFileName.toLowerCase(), lowerName.endsWith() …; creates File, FileInputStream. | |
public void load(String[] tPrintStringArray) | 7 statement(s); calls tPrintStringArray[tY].getBytes(), increaseBufferSize(), update(). | |
private void loadWindow(long offset) throws IOException | ---------- load sliding window ---------- | |
public void makeBitMap(Font tFont) | 70 statement(s); calls textFont.toString(), curView.screenGraphics.getFontMetrics(), textFontMetrics.getHeight(), textFontMetrics.getMaxAdvance(), curView.createImage() …. | |
public void onClick() | 11 statement(s); calls closeListener.onClose(), System.currentTimeMillis(), getRowFromY(), getColFromX(), selectWordAt() …. | |
public void onFileSelect(String tCurrentDirName, String tFileString) | 4 statement(s); calls load(). | |
public void print(String tPrintString) | 8 statement(s); calls tPrintString.getBytes(), increaseBufferSize(), update(). | |
public void print(byte[] tInByte) | 7 statement(s); calls increaseBufferSize(), update(). | |
public void print(String[] str, int tX, int tY) | 6 statement(s); calls graphics.setColor(), graphics.fillRect(), graphics.drawString(). | |
private void selectWordAt(int row, int col) | 12 statement(s); calls line.length(), isWordChar(), line.charAt(), line.substring(). | |
public void setCharset(Charset newCharset) | 1 statement(s); calls update(). | |
public void setCursorPosition(int row, int col) | 1 statement(s); calls Math.min(), System.currentTimeMillis(). | |
public void setFont(Font tFont) | Sets conFont = tFont. | |
public void setPaneColor(int tColorIndex) | 11 statement(s); calls graphics.setColor(), graphics.drawLine(), graphics.fillRect(). | |
public String toString() | 63 statement(s); calls "\r\n".toCharArray(), tStringBuilder.append(), tStringBuilder.toString(); creates StringBuilder. | |
public void update() | 29 statement(s); calls charset.equals(), graphics.setFont(), graphics.setColor(), graphics.fillRect(), graphics.drawString() …; creates String, Font, StringBuilder. |
class TextPaneUpperArrowMethod extends UpperArrowMethod
| Signature | Description | Source |
|---|---|---|
TextPaneUpperArrowMethod() | inner scrollbar classes |
| Signature | Description | Source |
|---|---|---|
public void function(HyperScrollbar hsb) | 3 statement(s); calls update(), hsb.updateThumbPane(). |
class TextPaneLowerArrowMethod extends LowerArrowMethod
| Signature | Description | Source |
|---|---|---|
TextPaneLowerArrowMethod() | Implicit default constructor generated by the compiler (not written in the source). |
| Signature | Description | Source |
|---|---|---|
public void function(HyperScrollbar hsb) | 5 statement(s); calls update(), hsb.updateThumbPane(). |
class TextPaneThumbMethod extends ThumbPaneMethod
| Signature | Description | Source |
|---|---|---|
TextPaneThumbMethod() | Implicit default constructor generated by the compiler (not written in the source). |
| Signature | Description | Source |
|---|---|---|
public void function(HyperScrollbar hsb) | 4 statement(s); calls update(). |
class GetFileDispatch extends Dispatch
| Signature | Description | Source |
|---|---|---|
GetFileDispatch(HyperView ttView) | 2 statement(s); calls super(). |
| Signature | Description | Source |
|---|---|---|
public boolean begin(HyperView tView) | 2 statement(s); calls tHyperFileRequestPop.addHyperFileRequestPopListener(); creates HyperFileRequestPop. |
class SetBinaryToggle extends Dispatch
| Signature | Description | Source |
|---|---|---|
SetBinaryToggle() | Implicit default constructor generated by the compiler (not written in the source). |
| Signature | Description | Source |
|---|---|---|
public boolean begin(HyperView tView) | 3 statement(s); calls update(). |
class SetCharsetToggle extends Dispatch
| Signature | Description | Source |
|---|---|---|
SetCharsetToggle() | Implicit default constructor generated by the compiler (not written in the source). |
| Signature | Description | Source |
|---|---|---|
public boolean begin(HyperView tView) | 3 statement(s); calls charset.equals(), charsetGadget.setName(), update(). |
Fields: charHeight, deviceColor0, deviceColor1, deviceColor2, frameColor1, frameColor2, frameColor3, itemColor0, itemColor1, itemColor2, mpHeight, mpWidth, mpX, mpX2, mpY, mpY2, selectedColor0, selectedColor1, selectedColor2
Methods: drawString(String, int, int), drawStrings(StringArr, int, int)
Fields: backColor, conFont, cursorGraphics, cursorHeight, cursorImage, cursorName, cursorScrollXOffset, cursorScrollYOffset, cursorWidth, cursorX, cursorY, displayInfo, fGColor, flipCount, font, gadFlags, gadFlags2, gadNumber, keyboard, lastCursorX, lastCursorY, lineColorA, lineColorB, lineColorC, locked, method, parentTitlebar, stringHeight, stringWidth, stringX, stringY, tc1, tc2, tc3, tc4
Methods: addDispatch(Dispatch), allKeyMsgENA(), cleanUp(), drawCursor(), drawOutline(), drawOutline2(), getForeground(), inString(String), isEnabled(), isShowing(), isVisible(), keyReleaseENA(), keyTypedENA(), layerDisable(), layerENA(), makeBitmap(Font), mouseWheelMoved(MouseWheelEvent), onMouseOver(), setEnabled(boolean), setForeground(int), setName(String), setVisible(boolean), toFront(), updateText()
Fields: asynchGraphics1, asynchGraphics2, asynchImage1, asynchImage2, attachedGob, attachedIndex, backGround, bgMemoryImageSource, bGPen, bottomMax, clickX, clickY, collisionClassMask, curAttached, currentZIndex, curView, depth, destGob, destGraphics, dispatchHoldCount, drawMode, dX, dY, dZ, fgMemoryImageSource, fGPen, gobEventFlags, gobFlags, gobFlags2, gobGadIndex, gobHx, gobHy, gobHz, gobName, gobNumber, gobOrbitRadius, gobPic, gobTypeFlags, graphics, gravity, height, heightBase, hSin, hyp, infoString, lClickX, lClickY, leftMin, maxAttached, memoryCounter, moveNum, mX, mX2, mY, mY2, oldX, oldY, oldZ, orbitGob, rightMax, scanLine, selectGraphics, selectImage, selectTime, spline, tint, topMin, totalAttached, width, widthBase, wSin, x, x2, y, y2, z
Methods: addGob(Gob), addSpline(Spline), center(), collisionOff(), collisionOn(), disable(), enable(), getGraphics(), getImageFromJar(String), getPixels(), gobZInit(), initScanline(int), isInView(), isMemoryImageSource(), move(int, int), move(Gadget, int, int), moveNext(), onDisplay(), onRelease(), printGobAttr(HyperView), printScanLines(), remGob(), remove(), zENA(), zOff()
Fields: attachment, index, linkFlags, name, next, parentList, prev
Methods: inList()
instantiation — BeliefButton.java, line 38
38 textPane = new TextPane(tView, // Put in "this" View 39 " NCLI ", // Title 40 201,118, // X,Y location in View 41 320,200, // Width/height
subclass — ViewMemoryPane.java, line 3
3 public class ViewMemoryPane extends TextPane
4 {
static call — ViewMain.java, line 330
330 tp.print(" Textpane TextPane.print((String)) command");