📄 lines.java
字号:
k2 = 0; l2 = 1; i1 = 0; do { k2 += g(ac[i2++]) * l2; l2 *= 10; } while(++i1 < 7); getHeight = k2; k2 = 0; l2 = 1; i1 = 0; do { k2 += g(ac[i2++]) * l2; l2 *= 10; } while(++i1 < 5); black = k2; } catch(Exception _ex) { } int j1 = 0; do { int l1 = 0; do drawCell(j1, l1); while(++l1 < 9); } while(++j1 < 9); gameInfomation(drawImage); repaint(); writeScore(); l(); }// ---------------------------------------------------------- private char[] getScore(int i1, int j1) { //分数计算,返回字符数组ac char ac[] = new char[j1]; for(int k1 = j1 - 1; k1 >= 0;) { ac[k1] = j(i1 % 10); k1--; i1 /= 10; } return ac; }// ---------------------------------------------------------- public boolean isDoubleBuffered() { return true; }// ---------------------------------------------------------- private int J() { if(getY < 0) return 0; int k1 = (4 - getY) + 1; int i1 = 0; do { int j1 = 0; do if(dispose[i1][j1] != 0) { drawCell(i1, j1, k1, dispose[i1][j1]); M(i1, j1); if(getY == 0) { I[i1][j1] = dispose[i1][j1]; dispose[i1][j1] = 0; drawCell(i1, j1); M(i1, j1); } } while(++j1 < 9); } while(++i1 < 9); getY--; return 1; }// ---------------------------------------------------------- private void writeText2(Graphics g1, int i1, int j1, int k1) { //写其他信息信息 if(g1 == null) return; Font font = g1.getFont(); if(!font.isPlain()) { font = new Font(font.getName(), 0, font.getSize()); g1.setFont(font); } FontMetrics fontmetrics = g1.getFontMetrics(font); int l1 = fontmetrics.getMaxAscent(); g1.setColor(Color.black); String s1 = "程序设计:"; int i2 = fontmetrics.stringWidth(s1); //g1.drawString(s1, i1 + (j1 - i1 - i2) / 2, k1); k1 += fontmetrics.getHeight(); g1.setColor(new Color(0xff000080)); s1 = "172.16.2.101"; i2 = fontmetrics.stringWidth(s1); i1 += (j1 - i1 - i2) / 2; g1.drawString(s1, i1, k1); //写超级连接文本 int j2 = (k1 + fontmetrics.getDescent()) - 1; g1.drawLine(i1 + 1, j2, i1 + i2, j2); //画超级连接下划线 //超级连接矩形区 getMaxDescent.x = i1; getMaxDescent.width = i2; getMaxDescent.y = k1 - l1; getMaxDescent.height = l1 + fontmetrics.getMaxDescent(); }// ---------------------------------------------------------- private Image L(int i1, Color color, int ai[][][], boolean flag) { //产生单元格精灵图象 byte byte0 = 39; int j3 = cellColor.getRed(); int l3 = cellColor.getGreen(); int j4 = cellColor.getBlue(); int ai1[] = new int[byte0 * byte0]; double ad[][][] = new double[byte0][byte0][3]; int ai2[][][] = new int[byte0][byte0][4]; double d6 = (double)i1 / 2D; double d7 = d6 * 1.01D; double d8 = Math.sqrt(d7 * d7 - d6 * d6); double ad1[][] = { { -1D, 1.0D, 0.69999999999999996D, 0.59999999999999998D, 0.29999999999999999D }, { 1.0D, -0.59999999999999998D, 0.29999999999999999D, 0.59999999999999998D, 3.5D } }; F(ad1[0]); F(ad1[1]); for(int j1 = 0; j1 < byte0; j1++) { for(int j2 = 0; j2 < byte0; j2++) { ad[j1][j2][0] = 0.0D; ad[j1][j2][1] = 0.0D; ad[j1][j2][2] = 1.0D; ai2[j1][j2][0] = j3; ai2[j1][j2][1] = l3; ai2[j1][j2][2] = j4; ai2[j1][j2][3] = 0; double d1 = (double)j1 - 0.5D * (double)(byte0 - 1); double d2 = 0.5D * (double)(byte0 - 1) - (double)j2; double d3 = d1 * d1; double d4 = d2 * d2; double d5 = Math.sqrt(d3 + d4); double d9 = (d6 - d5) + 0.5D; if(d9 < 0.0D) d9 = 0.0D; if(d9 > 1.0D) d9 = 1.0D; int l4 = Math.min(255, (int)Math.round(d9 * 256D)); ai2[j1][j2][3] = l4; if(l4 > 0) { ad[j1][j2][0] = d1; ad[j1][j2][1] = d2; if(l4 == 255 || d3 + d4 <= d7 * d7) ad[j1][j2][2] = Math.sqrt(d7 * d7 - d3 - d4); else ad[j1][j2][2] = d8; F(ad[j1][j2]); } } } c(ad, ai2, color, ad1, false); for(int k1 = 0; k1 < byte0; k1++) { for(int k2 = 0; k2 < byte0; k2++) { int i5 = ai2[k1][k2][3]; if(i5 == 0) { ai2[k1][k2][0] = ai[k1][k2][0]; ai2[k1][k2][1] = ai[k1][k2][1]; ai2[k1][k2][2] = ai[k1][k2][2]; } else if(i5 < 255) { ai2[k1][k2][0] = ai[k1][k2][0] * (255 - i5) + ai2[k1][k2][0] * i5 >>> 8; ai2[k1][k2][1] = ai[k1][k2][1] * (255 - i5) + ai2[k1][k2][1] * i5 >>> 8; ai2[k1][k2][2] = ai[k1][k2][2] * (255 - i5) + ai2[k1][k2][2] * i5 >>> 8; } } } if(!flag) { for(int l1 = 0; l1 < byte0; l1++) { for(int l2 = 0; l2 < byte0; l2++) ai2[l1][l2][3] = 255; } } for(int i2 = 0; i2 < byte0; i2++) { for(int i3 = 0; i3 < byte0; i3++) { int k3 = ai2[i2][i3][0]; int i4 = ai2[i2][i3][1]; int k4 = ai2[i2][i3][2]; int j5 = ai2[i2][i3][3]; j5 = j5 >= 10 ? 255 : 0; ai1[i2 + i3 * byte0] = j5 << 24 | k3 << 16 | i4 << 8 | k4; } } Image image = createImage(new MemoryImageSource(byte0, byte0, ai1, 0, byte0)); return image; } private void M(int i1, int j1) { O(12 + i1 * 40, 10 + j1 * 40, 40, 40); }// ---------------------------------------------------------- private Image createButton(int width, int height, String s1, Color color, boolean flag) { //根据给定参数创建信息框,按钮图形 //width:宽,height:高,s1内容,color:信息框颜色,flag:颜色亮度标志,按钮状态 Color color1 = color.darker(); Color color2 = color.brighter(); Image image = createImage(width, height); Graphics g1 = image.getGraphics(); FontMetrics fontmetrics = g1.getFontMetrics(g1.getFont()); //画背景 g1.setColor(color); g1.fillRect(0, 0, width, height); //写文字,byte0:文字偏移距离 g1.setColor(Color.black); byte byte0 = flag ? ((byte) (2)) : 0; g1.drawString(s1, (width - fontmetrics.stringWidth(s1)) / 2 + byte0, (height - fontmetrics.getHeight()) / 2 + fontmetrics.getMaxAscent() + byte0); //画边框 g1.setColor(flag ? color1 : color2); g1.drawLine(0, width - 1, 0, 0); g1.drawLine(0, 0, width - 1, 0); g1.setColor(flag ? color2 : color1); g1.drawLine(0, height - 1, width - 1, height - 1); g1.drawLine(width - 1, height - 1, width - 1, 1); return image; }// ---------------------------------------------------------- private void O(int i1, int j1, int k1, int l1) { Graphics g1 = getGraphics(); if(g1 == null) { return; } else { g1 = g1.create(); g1.clipRect(i1, j1, k1, l1); g1.drawImage(Z, 0, 0, this); g1.dispose(); return; } }// ---------------------------------------------------------- private void drawButton(Image[] btimage,Rectangle rect, boolean flag) { Graphics g1 = getGraphics(); if(g1 == null) { return; } else { Image image = flag ? btimage[1] : btimage[0]; g1.drawImage(image, rect.x, rect.y, this); return; } }// ---------------------------------------------------------- public void update(Graphics g1) { paint(g1); }// ---------------------------------------------------------- public void processMouseMotionEvent(MouseEvent mouseevent) { if(mouseevent.isPopupTrigger()) { return; } else { changeCursor(mouseevent.getX(), mouseevent.getY()); //检查鼠标是否进入超级连接区域 super.processMouseEvent(mouseevent); return; } }//---------------------------------------------------------- private void setBGColor(int index) { //确定背景色,6种色彩中的一种 if(index < 1 || index > 6) index = randbetwen(1, 6); switch(index) { case 1: // '\001' cellColor = new Color(204, 153, 255); darker = new Color(184, 133, 235); return; case 2: // '\002' cellColor = new Color(255, 204, 153); darker = new Color(235, 184, 133); return; case 3: // '\003' cellColor = new Color(204, 204, 153); darker = new Color(184, 184, 133); return; case 4: // '\004' cellColor = new Color(153, 204, 153); darker = new Color(133, 184, 133); return; case 5: // '\005' cellColor = new Color(153, 204, 204); darker = new Color(133, 184, 184); return; } cellColor = new Color(204, 204, 225); darker = new Color(184, 184, 205); }//------------------------------------------------------------------- private boolean R(int i1, int j1, int k1, int l1) { int k2 = 0; do { int i3 = 0; do getBlue[k2][i3] = 0; while(++i3 < 9); } while(++k2 < 9); getBlue[k1][l1] = 1; int i2 = 2; do { int j2 = 0; int l2 = 0; do { int j3 = 0; do if(getBlue[l2][j3] == i2 - 1) { if(l2 > 0) { if(l2 - 1 == i1 && j3 == j1) { getBlue[l2 - 1][j3] = i2; return true; } if(getBlue[l2 - 1][j3] == 0 && W(l2 - 1, j3)) { getBlue[l2 - 1][j3] = i2; j2++; } } if(l2 < 8) { if(l2 + 1 == i1 && j3 == j1) { getBlue[l2 + 1][j3] = i2; return true; } if(getBlue[l2 + 1][j3] == 0 && W(l2 + 1, j3)) { getBlue[l2 + 1][j3] = i2; j2++; } } if(j3 > 0) { if(l2 == i1 && j3 - 1 == j1) { getBlue[l2][j3 - 1] = i2; return true; } if(getBlue[l2][j3 - 1] == 0 && W(l2, j3 - 1)) { getBlue[l2][j3 - 1] = i2; j2++; } } if(j3 < 8) { if(l2 == i1 && j3 + 1 == j1) { getBlue[l2][j3 + 1] = i2; return true; } if(getBlue[l2][j3 + 1] == 0 && W(l2, j3 + 1)) { getBlue[l2][j3 + 1] = i2; j2++; } } } while(++j3 < 9); } while(++l2 < 9); if(j2 == 0) return false;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -