void (Graphics g, int clipx, int clipy, int clipwidth, int clipheight, Object component, int width, int height, boolean inside, boolean pressed, boolean focus, boolean enabled, boolean hidden, int left) { java.lang.ref.Reference.reachabilityFence(inside); java.lang.ref.Reference.reachabilityFence(pressed); boolean editable = getBoolean(component, "editable", true); paintRect(g, 0, 0, width, height, enabled ? c_border : c_disable, editable ? c_textbg : c_bg, true, true, true, true); g.clipRect(1 + left, 1, width - left - 2, height - 2); String text = getString(component, "text", ""); int offset = getInteger(component, "offset", 0); FontMetrics fm = g.getFontMetrics(); //java int caret = 0; if (focus) { int start = getInteger(component, "start", 0); int end = getInteger(component, "end", 0); caret = hidden ? (fm.charWidth('*') * end) : fm.stringWidth(text.substring(0, end)); //java //midp font.substringWidth(text, 0, end); if (start != end) { int is = hidden ? (fm.charWidth('*') * start) : fm.stringWidth(text.substring(0, start)); //java //midp font.substringWidth(text, 0, start); g.setColor(c_select); g.fillRect(2 + left - offset + Math.min(is, caret), 1, Math.abs(caret - is), height - 2); } } if (focus) { g.setColor(c_focus); g.fillRect(1 + left - offset + caret, 1, 1, height - 2); } g.setColor(enabled ? c_text : c_disable); int fx = 2 + left - offset; int fy = (height + fm.getAscent() - fm.getDescent()) / 2; //java //midp int fy = (height - font.getHeight()) / 2; if (hidden) { int fh = fm.charWidth('*'); for (int i = text.length(); i > 0; i--) { g.drawString("*", fx, fy); //java //midp g.drawChar('*', fx, fy, Graphics.LEFT | Graphics.TOP); fx += fh; } } else { g.drawString(text, fx, fy); //java //midp g.drawString(text, fx, fy, Graphics.LEFT | Graphics.TOP); } g.setClip(clipx, clipy, clipwidth, clipheight); }