Examples of CursorPosition


Examples of org.apache.isis.viewer.dnd.view.text.CursorPosition

    @Override
    protected void drawHighlight(final Canvas canvas, final int maxWidth) {
        final int baseline = getBaseline();
        int top = baseline - style.getAscent();

        final CursorPosition from = selection.from();
        final CursorPosition to = selection.to();

        final String[] lines = textContent.getDisplayLines();
        final int displayFromLine = textContent.getDisplayFromLine();
        final int displayToLine = displayFromLine + lines.length;
        for (int i = displayFromLine; i <= displayToLine; i++) {
            if ((i >= from.getLine()) && (i <= to.getLine())) {
                final String line = textContent.getText(i);
                int start = 0;
                int end = style.stringWidth(line);

                if (from.getLine() == i) {
                    final int at = Math.min(from.getCharacter(), line.length());
                    start = style.stringWidth(line.substring(0, at));
                }

                if (to.getLine() == i) {
                    final int at = Math.min(to.getCharacter(), line.length());
                    end = style.stringWidth(line.substring(0, at));
                }

                canvas.drawSolidRectangle(start + (ViewConstants.HPADDING), top, end - start, getText().getLineHeight(), Toolkit.getColor(ColorsAndFonts.COLOR_TEXT_HIGHLIGHT));
            }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.view.text.CursorPosition

        this.maxLength = content.getMaximumLength();
        this.useEmptyLines = useEmptyLines;

        textContent = new TextContent(this, 1, wrapStyle, this.useEmptyLines);
        cursor = new CursorPosition(textContent, 0, 0);
        selection = new TextSelection(textContent);
        final ObjectAdapter value = getValue();
        textContent.setText(value == null ? "" : titleString(value));
        cursor.home();
        isSaved = true;
View Full Code Here

Examples of org.apache.isis.viewer.dnd.view.text.CursorPosition

        this.maxLength = content.getMaximumLength();
        this.useEmptyLines = useEmptyLines;

        textContent = new TextContent(this, 1, wrapStyle, this.useEmptyLines);
        cursor = new CursorPosition(textContent, 0, 0);
        selection = new TextSelection(textContent);
        final ObjectAdapter value = getValue();
        textContent.setText(value == null ? "" : titleString(value));
        cursor.home();
        isSaved = true;
View Full Code Here

Examples of org.apache.isis.viewer.dnd.view.text.CursorPosition

    @Override
    protected void drawHighlight(final Canvas canvas, final int maxWidth) {
        final int baseline = getBaseline();
        int top = baseline - style.getAscent();

        final CursorPosition from = selection.from();
        final CursorPosition to = selection.to();

        final String[] lines = textContent.getDisplayLines();
        final int displayFromLine = textContent.getDisplayFromLine();
        final int displayToLine = displayFromLine + lines.length;
        for (int i = displayFromLine; i <= displayToLine; i++) {
            if ((i >= from.getLine()) && (i <= to.getLine())) {
                final String line = textContent.getText(i);
                int start = 0;
                int end = style.stringWidth(line);

                if (from.getLine() == i) {
                    final int at = Math.min(from.getCharacter(), line.length());
                    start = style.stringWidth(line.substring(0, at));
                }

                if (to.getLine() == i) {
                    final int at = Math.min(to.getCharacter(), line.length());
                    end = style.stringWidth(line.substring(0, at));
                }

                canvas.drawSolidRectangle(start + (HPADDING), top, end - start, getText().getLineHeight(), Toolkit.getColor(ColorsAndFonts.COLOR_TEXT_HIGHLIGHT));
            }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.view.text.CursorPosition

        this.maxLength = content.getMaximumLength();
        this.useEmptyLines = useEmptyLines;

        textContent = new TextContent(this, 1, wrapStyle, this.useEmptyLines);
        cursor = new CursorPosition(textContent, 0, 0);
        selection = new TextSelection(textContent);
        final ObjectAdapter value = getValue();
        textContent.setText(value == null ? "" : titleString(value));
        cursor.home();
        isSaved = true;
View Full Code Here

Examples of org.apache.isis.viewer.dnd.view.text.CursorPosition

    @Override
    protected void drawHighlight(final Canvas canvas, final int maxWidth) {
        final int baseline = getBaseline();
        int top = baseline - style.getAscent();

        final CursorPosition from = selection.from();
        final CursorPosition to = selection.to();

        final String[] lines = textContent.getDisplayLines();
        final int displayFromLine = textContent.getDisplayFromLine();
        final int displayToLine = displayFromLine + lines.length;
        for (int i = displayFromLine; i <= displayToLine; i++) {
            if ((i >= from.getLine()) && (i <= to.getLine())) {
                final String line = textContent.getText(i);
                int start = 0;
                int end = style.stringWidth(line);

                if (from.getLine() == i) {
                    final int at = Math.min(from.getCharacter(), line.length());
                    start = style.stringWidth(line.substring(0, at));
                }

                if (to.getLine() == i) {
                    final int at = Math.min(to.getCharacter(), line.length());
                    end = style.stringWidth(line.substring(0, at));
                }

                canvas.drawSolidRectangle(start + (HPADDING), top, end - start, getText().getLineHeight(),
                    Toolkit.getColor(ColorsAndFonts.COLOR_TEXT_HIGHLIGHT));
View Full Code Here

Examples of org.jboss.aesh.terminal.CursorPosition

                    return getActualCursor(console.cursorQueue.take());
                }
                catch (Exception e) {
                    if(console.settings.isLogging())
                        LOGGER.log(Level.SEVERE, "Failed to find current row with ansi code: ",e);
                    return new CursorPosition(-1,-1);
                }
            }
            return new CursorPosition(-1,-1);
        }
View Full Code Here

Examples of org.jboss.aesh.terminal.CursorPosition

                    started = true;
                    i++;
                }
            }

            return new CursorPosition(row, col);
        }
View Full Code Here

Examples of org.jboss.aesh.terminal.CursorPosition

        int dx = x2 - x1;
        int dy = y2 -y1;
        int y = 0;
        for(int i=x1; i < x2; i++) {
            y = y1 + (dy) * (i - x1)/(dx);
            shell.setCursor(new CursorPosition(y,i));
            shell.out().print('x');
        }
    }
View Full Code Here

Examples of org.jboss.aesh.terminal.CursorPosition

    @Override
    public void drawString(String str, int x, int y) {
        if(currentColor != null)
            shell.out().print(currentColor.fullString());
        shell.setCursor(new CursorPosition(y,x));
        shell.out().print(str);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.