📄 sdainputpanel.java
字号:
selectedChar = 13; } else { g.setColor(foreColor); } drawLine(g, 9 * width / 10 + width / 10 / 4, curHeight + 3 * fontHeight / 4, 9 * width / 10 + 3 * width / 10 / 4, curHeight + 3 * fontHeight / 4); drawLine(g, 9 * width / 10 + 3 * width / 10 / 4, curHeight + fontHeight / 4, 9 * width / 10 + 3 * width / 10 / 4, curHeight + 3 * fontHeight / 4); fillTriangle(g, 9 * width / 10 + width / 10 / 4, curHeight + 3 * fontHeight / 4, 9 * width / 10 + width / 10 / 4 + 4, curHeight + 3 * fontHeight / 4 - 4, 9 * width / 10 + width / 10 / 4 + 4, curHeight + 3 * fontHeight / 4 + 4); curHeight += fontHeight; } private void getFuncChar() { if (charYPos == 0 && charXPos == 0) { //ESC selectedChar = 27; } if (charYPos == 0 && charXPos == 1) { //Tab selectedChar = 9; } if (charYPos == 0 && charXPos == 2) { if (!SBCCase) { selectedChar = ' '; } else { selectedChar = ' '; } } //← if (charYPos == 0 && charXPos == 3) { selectedChar = 37; }//↑ if (charYPos == 0 && charXPos == 4) { selectedChar = 38; }//↓ if (charYPos == 0 && charXPos == 5) { selectedChar = 40; }//→ if (charYPos == 0 && charXPos == 6) { selectedChar = 39; } if (charYPos == 0 && charXPos == 7) { selectedChar = 46; }//退格 if (charYPos == 0 && charXPos == 8) { selectedChar = 8; }//回车 if (charYPos == 0 && charXPos == 9) { selectedChar = 13; } } //大写字母 private void paintUpperCase(Graphics g) { Font ft = getFont(); char[] Chars1 = new char[13]; System.arraycopy(UpperCaseChars, 0, Chars1, 0, 13); char[] Chars2 = new char[13]; System.arraycopy(UpperCaseChars, 13, Chars2, 0, 13); char[] Chars3 = new char[13]; System.arraycopy(SBCUpperCaseChars, 0, Chars3, 0, 13); char[] Chars4 = new char[13]; System.arraycopy(SBCUpperCaseChars, 13, Chars4, 0, 13); g.setColor(borderColor); int fontHeight = getFont().getHeight(); g.setFont(getFont()); drawRect(g, 0, curHeight, width - 1, fontHeight); drawRect(g, 0, curHeight + fontHeight, width - 1, fontHeight); //画具体(ABCD....) for (int i = 0; i < 13; i++) { if (charYPos == 1 && charXPos == i) { g.setColor(selectedBackColor); fillRect(g, i * width / 13 + 1, curHeight + 1, (i + 1) * width / 13 - i * width / 13 - 1, fontHeight - 1); g.setColor(selectedForeColor); if (SBCCase) { selectedChar = Chars3[i]; } else { selectedChar = Chars1[i]; } } else { g.setColor(foreColor); } drawString(g, String.valueOf(Chars1[i]), i * width / 13 + (width / 13 - ft.charWidth(Chars1[i])) / 2, curHeight); g.setColor(foreColor); drawLine(g, i * width / 13, curHeight, i * width / 13, curHeight + fontHeight); } for (int i = 0; i < 13; i++) { if (charYPos == 2 && charXPos == i) { g.setColor(selectedBackColor); fillRect(g, i * width / 13 + 1, curHeight + fontHeight + 1, (i + 1) * width / 13 - i * width / 13 - 1, fontHeight - 1); g.setColor(selectedForeColor); if (SBCCase) { selectedChar = Chars4[i]; } else { selectedChar = Chars2[i]; } } else { g.setColor(foreColor); } drawString(g, String.valueOf(Chars2[i]), i * width / 13 + (width / 13 - ft.charWidth(Chars2[i])) / 2, curHeight + fontHeight); g.setColor(foreColor); drawLine(g, i * width / 13, curHeight + fontHeight, i * width / 13, curHeight + 2 * fontHeight); } curHeight += 2 * fontHeight; }//小写字母 private void paintLowerCase(Graphics g) { //abcdefghijklmnopqrstuvwxyz Font ft = getFont(); char[] Chars1 = new char[13]; System.arraycopy(LowerCaseChars, 0, Chars1, 0, 13); char[] Chars2 = new char[13]; System.arraycopy(LowerCaseChars, 13, Chars2, 0, 13); char[] Chars3 = new char[13]; System.arraycopy(SBCLowerCaseChars, 0, Chars3, 0, 13); char[] Chars4 = new char[13]; System.arraycopy(SBCLowerCaseChars, 13, Chars4, 0, 13); g.setColor(borderColor); int fontHeight = getFont().getHeight(); g.setFont(getFont()); drawRect(g, 0, curHeight, width - 1, fontHeight); drawRect(g, 0, curHeight + fontHeight, width - 1, fontHeight); //画具体(ABCD....) for (int i = 0; i < 13; i++) { if (charYPos == 1 && charXPos == i) { g.setColor(selectedBackColor); fillRect(g, i * width / 13 + 1, curHeight + 1, (i + 1) * width / 13 - i * width / 13 - 1, fontHeight - 1); g.setColor(selectedForeColor); if (SBCCase) { selectedChar = Chars3[i]; } else { selectedChar = Chars1[i]; } } else { g.setColor(foreColor); } drawString(g, String.valueOf(Chars1[i]), i * width / 13 + (width / 13 - ft.charWidth(Chars1[i])) / 2, curHeight); g.setColor(foreColor); drawLine(g, i * width / 13, curHeight, i * width / 13, curHeight + fontHeight); } for (int i = 0; i < 13; i++) { if (charYPos == 2 && charXPos == i) { g.setColor(selectedBackColor); fillRect(g, i * width / 13 + 1, curHeight + fontHeight + 1, (i + 1) * width / 13 - i * width / 13 - 1, fontHeight - 1); g.setColor(selectedForeColor); if (SBCCase) { selectedChar = Chars4[i]; } else { selectedChar = Chars2[i]; } } else { g.setColor(foreColor); } drawString(g, String.valueOf(Chars2[i]), i * width / 13 + (width / 13 - ft.charWidth(Chars2[i])) / 2, curHeight + fontHeight); g.setColor(foreColor); drawLine(g, i * width / 13, curHeight + fontHeight, i * width / 13, curHeight + 2 * fontHeight); } curHeight += 2 * fontHeight; }//数字 private void paintDigit(Graphics g) { char[] Chars1 = new char[10]; System.arraycopy(SBCDigitChars, 0, Chars1, 0, 10); char[] Chars2 = new char[10]; System.arraycopy(DigitChars, 0, Chars2, 0, 10); g.setColor(borderColor); int fontHeight = getFont().getHeight(); Font ft = getFont(); drawRect(g, 0, curHeight, width - 1, fontHeight); //画具体(A,a,1,,.,#,PY,全) g.setColor(foreColor); for (int i = 1; i < 10; i++) { drawLine(g, i * width / 10, curHeight, i * width / 10, curHeight + fontHeight); } for (int i = 0; i < 10; i++) { if (charYPos == 1 && charXPos == i) { g.setColor(selectedBackColor); fillRect(g, i * width / 10 + 1, curHeight + 1, (i + 1) * width / 10 - i * width / 10 - 1, fontHeight - 1); g.setColor(selectedForeColor); if (SBCCase) { selectedChar = Chars1[i]; } else { selectedChar = Chars2[i]; } } else { g.setColor(foreColor); } drawString(g, String.valueOf(i), i * width / 10 + (width / 10 - ft.stringWidth(String.valueOf(i))) / 2, curHeight); } curHeight += fontHeight; }//标点 private void paintPoint(Graphics g) { Font ft = getFont(); char[] Chars1 = new char[14]; System.arraycopy(PointChars, 0, Chars1, 0, 14); char[] Chars2 = new char[14]; System.arraycopy(PointChars, 14, Chars2, 0, 14); char[] Chars3 = new char[14]; System.arraycopy(SBCPointChars, 0, Chars3, 0, 14); char[] Chars4 = new char[14]; System.arraycopy(SBCPointChars, 14, Chars4, 0, 14); g.setColor(borderColor); int fontHeight = getFont().getHeight(); g.setFont(getFont()); drawRect(g, 0, curHeight, width - 1, fontHeight); drawRect(g, 0, curHeight + fontHeight, width - 1, fontHeight); //画具体(ABCD....) for (int i = 0; i < 14; i++) { if (charYPos == 1 && charXPos == i) { g.setColor(selectedBackColor); fillRect(g, i * width / 14 + 1, curHeight + 1, (i + 1) * width / 14 - i * width / 14 - 1, fontHeight - 1); g.setColor(selectedForeColor); if (SBCCase) { selectedChar = Chars3[i]; } else { selectedChar = Chars1[i]; } } else { g.setColor(foreColor); } drawString(g, String.valueOf(Chars1[i]), i * width / 14 + (width / 14 - ft.charWidth(Chars1[i])) / 2, curHeight); g.setColor(foreColor); drawLine(g, i * width / 14, curHeight, i * width / 14, curHeight + fontHeight); } for (int i = 0; i < 14; i++) { if (charYPos == 2 && charXPos == i) { g.setColor(selectedBackColor); fillRect(g, i * width / 14 + 1, curHeight + fontHeight + 1, (i + 1) * width / 14 - i * width / 14 - 1, fontHeight - 1); g.setColor(selectedForeColor); if (SBCCase) { selectedChar = Chars4[i]; } else { selectedChar = Chars2[i]; } } else { g.setColor(foreColor); } drawString(g, String.valueOf(Chars2[i]), i * width / 14 + (width / 14 - ft.charWidth(Chars2[i])) / 2, curHeight + fontHeight); g.setColor(foreColor); drawLine(g, i * width / 14, curHeight + fontHeight, i * width / 14, curHeight + 2 * fontHeight); } curHeight += 2 * fontHeight; }//符号 private void paintSymbol(Graphics g) { Font ft = getFont(); char[] Chars1 = new char[13]; System.arraycopy(SymbolChars, 0, Chars1, 0, 13); char[] Chars2 = new char[13]; System.arraycopy(SymbolChars, 13, Chars2, 0, 13); char[] Chars3 = new char[13]; System.arraycopy(SBCSymbolChars, 0, Chars3, 0, 13); char[] Chars4 = new char[13]; System.arraycopy(SBCSymbolChars, 13, Chars4, 0, 13); g.setColor(borderColor); int fontHeight = getFont().getHeight(); g.setFont(getFont()); drawRect(g, 0, curHeight, width - 1, fontHeight); drawRect(g, 0, curHeight + fontHeight, width - 1, fontHeight); //画具体(ABCD....) for (int i = 0; i < 13; i++) { if (charYPos == 1 && charXPos == i) { g.setColor(selectedBackColor); fillRect(g, i * width / 13 + 1, curHeight + 1, (i + 1) * width / 13 - i * width / 13 - 1, fontHeight - 1); g.setColor(selectedForeColor); if (SBCCase) { selectedChar = Chars3[i]; } else { selectedChar = Chars1[i]; } } else { g.setColor(foreColor); } drawString(g, String.valueOf(Chars1[i]), i * width / 13 + (width / 13 - ft.charWidth(Chars1[i])) / 2, curHeight); g.setColor(foreColor); drawLine(g, i * width / 13, curHeight, i * width / 13, curHeight + fontHeight); } for (int i = 0; i < 13; i++) { if (charYPos == 2 && charXPos == i) { g.setColor(selectedBackColor); fillRect(g, i * width / 13 + 1, curHeight + fontHeight + 1, (i + 1) * width / 13 - i * width / 13 - 1, fontHeight - 1); g.setColor(selectedForeColor); if (SBCCase) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -