protected void drawInformation(GLGraphics gc) { super.drawInformation(gc); String info2 = "SHFIT+×ó - Ç°ÒÆ SHIFT+ÓÒ - ºóÒÆ"; Point ts = gc.textExtent(info2); Point size = getSize(); gc.drawText(info2, size.x / 2 - ts.x / 2, size.y - ts.y * 2 - 5); }
protected void drawInformation(GLGraphics gc) { super.drawInformation(gc); Point size = getSize(); gc.setColor(SWTResourceManager.getColor(0xFF, 0x99, 0x00)); gc.drawLine(0, size.y / 2 + paintOffset.y, size.x, size.y / 2 + paintOffset.y); gc.drawLine(size.x / 2 + paintOffset.x, 0, size.x / 2 + paintOffset.x, size.y); // 绘制起始点和目标点 if (position != null) { int blockSize = 2; if (ratio > 1.0f) { blockSize *= ratio; } gc.setColor(SWTResourceManager.getColor(0xFF, 0x99, 0x00)); Point pt = new Point(position.x, position.y); pt = coordToPos(pt); gc.drawRect(pt.x - blockSize, pt.y - blockSize, blockSize * 2, blockSize * 2); gc.drawLine(pt.x - blockSize, pt.y, pt.x + blockSize, pt.y); gc.drawLine(pt.x, pt.y - blockSize, pt.x, pt.y + blockSize); gc.setColor(SWTResourceManager.getColor(0x00, 0x99, 0xFF)); Point pt2 = new Point(directionX, directionY); pt2 = coordToPos(pt2); gc.drawRect(pt2.x - blockSize, pt2.y - blockSize, blockSize * 2, blockSize * 2); gc.drawLine(pt2.x - blockSize, pt2.y, pt2.x + blockSize, pt2.y); gc.drawLine(pt2.x, pt2.y - blockSize, pt2.x, pt2.y + blockSize); gc.drawLine(pt.x, pt.y, pt2.x, pt2.y); } // 绘制选项按钮 drawButtons(gc); }
protected void drawButtons(GLGraphics gc) { Point size = getSize(); gc.setColor(AbstractImageViewer.invert(getBackground())); int bx = 1; int i; for (i = 0; i < buttonTexts.length; i++) { Point ts = gc.textExtent(buttonTexts[i]); int by = size.y - ts.y - 8; int bw = ts.x + 7; int bh = ts.y + 6; buttonBounds[i] = new Rectangle(bx, by, bw, bh); gc.setColor(AbstractImageViewer.invert(getBackground())); gc.drawRect(buttonBounds[i]); gc.drawText(buttonTexts[i], buttonBounds[i].x + 4, buttonBounds[i].y + 4); bx += bw + 2; } }
protected void paintInput(GLGraphics gc) { Point size = getSize(); if (input != null) { gc.setZ(0); int drawX = size.x / 2 + paintOffset.x; int drawY = size.y / 2 + paintOffset.y; frame.draw(gc, drawX, drawY, ratio, cache); } }