📄 textarea.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: TextArea.java
package com.motorola.lwt;
// Referenced classes of package com.motorola.lwt:
// TextComponent, Component
public class TextArea extends TextComponent
{
public TextArea(String s, int i, int j)
{
super(s, true);
rows = i;
columns = j;
}
synchronized void scrollTo(int i, boolean flag)
{
screenPosition(i);
if(screenPositionY - 2 < lineHeight)
viewPortOriginY += screenPositionY - 2 - lineHeight;
else
if(screenPositionY + 2 > getHeight())
viewPortOriginY += (screenPositionY + 2) - getHeight();
}
synchronized void reformatText(int i, int j)
{
if(textLength < 2)
{
rowCount = 0;
rowBoundaries[0] = 0;
rowBoundaries[1] = textLength;
} else
{
int k = getWidth() - 8;
int l = 0;
int i1 = -999;
int j1 = 0;
int k1 = 4;
if(i <= rowBoundaries[1])
{
rowCount = 0;
addBreak(0);
} else
{
int l1 = getRowNumber(i);
rowCount = l1;
l = rowBoundaries[rowCount - 1];
}
for(; l < textLength; l++)
if(text[l] == '\r')
{
if(l + 1 < textLength && text[l + 1] == '\n')
l++;
addBreak(l + 1);
k1 = 4;
j1 = 0;
} else
if(text[l] == '\n')
{
addBreak(l + 1);
k1 = 4;
j1 = 0;
} else
{
k1 += textWidth[l];
if(text[l] == ' ')
{
i1 = l;
j1 = k1;
} else
if(k1 > k)
{
if(j1 > (getWidth() * 3) / 5)
{
k1 = (k1 - j1) + 4;
if((justification & 0x2) > 0)
{
addBreak(i1);
k1 -= textWidth[i1];
} else
{
addBreak(i1 + 1);
}
} else
{
addBreak(l);
k1 = 4 + textWidth[l];
}
j1 = 0;
}
}
addBreak(l);
rowCount--;
}
repaint();
}
void addBreak(int i)
{
rowBoundaries[rowCount] = i;
rowCount++;
if(rowCount == rowBoundaries.length)
{
int ai[] = new int[rowCount + 10];
System.arraycopy(rowBoundaries, 0, ai, 0, rowCount);
rowBoundaries = ai;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -