FIBS Board backgammon forum

FIBS Client software => JavaFibs => Topic started by: gugu on June 07, 2012, 05:25:09 AM

Title: word wrap?
Post by: gugu on June 07, 2012, 05:25:09 AM
I use the 'system area full output'...but the text in the system window disappears off the side.  Is there a wordwrap function?

Thanks
Title: Re: word wrap?
Post by: maria on June 07, 2012, 10:51:23 AM
In the command line, try fooling around with the linelength and pagelength variables.

The following is from the list of FIBS commands which can be found at http://www.fibs.com/CommandReference/ (http://www.fibs.com/CommandReference/)


The linelength and pagelength variables

Some commands produce more output than will fit on your screen. You can tell FIBS about the size of your window or screen by setting the two variables 'linelength' and 'pagelength'. The pagelength should be set to the number of lines in your window, the linelength should be set to the number of columns (or to a value slightly less than that). If you have a 80x24 screen you might issue the following commands:

> set pagelength 24
> set linelength 79

You should try 78 and 80 for the linelength too and see what you like best. You can then use the save command to make those settings permanent. Using the values from this example FIBS would wrap lines so they contain at most 79 characters and if the output of single command exceeds 23 lines it will print [Return] in the bottom line of the screen. Just hit your return key to see the next page of output, or type any other command to continue without seeing the rest of the output.
Title: Re: word wrap?
Post by: inim on February 06, 2013, 07:30:00 AM
Quote from: gugu on June 07, 2012, 05:25:09 AM
I use the 'system area full output'...but the text in the system window disappears off the side.  Is there a wordwrap function?

Word-wrap was broken by Java 7, so one theoretical option is to revert to Java 6. Which is not a real solution because this version is outdated and no longer maintained by Oracle starting in March 2013.

I already spent some time on trying to fix it at the code level, but I somehow do not find out what is wrong with the old code / changed in Java 7 :( It definitely is a bug which should be fixed, given I have an inspiration how to fix it.
Title: Re: word wrap?
Post by: pck on February 10, 2013, 02:11:38 PM
JTextPane wrap behaviour on long words changed in Java 7
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7125737 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7125737)

Thread: Word wraping behaviour in JTextPane since Java 7
https://forums.oracle.com/forums/thread.jspa?messageID=10757680 (https://forums.oracle.com/forums/thread.jspa?messageID=10757680)

Quote
public float getMinimumSpan(int axis) {
            switch (axis) {
            case View.X_AXIS:
                return 0;
            case View.Y_AXIS:
                return super.getMinimumSpan(axis);
            default:
                throw new IllegalArgumentException("Invalid axis: " + axis);
            }
        }

[...]

They changed algorithm of minimum size calculation. The logic is following when a row is bigger than available width the row must be broken. The first part (row) should be less than available width. The rest again is measured and can be broken once more if it's bigger than available width.

Now the tric. Size of content is defined by minimumSpan (can't be less than minimal possible). So when it's in a scroll scroll measures width and asks for minimal span. Then width of JScrollPane's content =width of vieport (or if min width is bigger =min width).

Thus when we say min=0 we always use the viewport width.
Title: Re: word wrap?
Post by: inim on February 12, 2013, 06:59:56 PM
Quote from: pck on February 10, 2013, 02:11:38 PM
Thread: Word wraping behaviour in JTextPane since Java 7
https://forums.oracle.com/forums/thread.jspa?messageID=10757680 (https://forums.oracle.com/forums/thread.jspa?messageID=10757680)

Interesting. Thx.
Title: Re: word wrap?
Post by: diane on May 18, 2013, 12:29:26 PM
Should this be fixing itself now - it is very annoying...