I am having a problem with the JGoView.setScale method. I have nodes containing a JGoArea with two JGoText fields: a title and a main text area.
They are created as follows:
private void createTitleTextbox() {
//Create the JGoText box for the title
titleTextbox = new JGoText();
titleTextbox.setAlignment(TITLE_ALIGN);
titleTextbox.setFaceName(TITLE_FONT);
titleTextbox.setFontSize(TITLE_SIZE);
titleTextbox.setTextColor(TITLE_COLOR);
titleTextbox.setBold(TITLE_BOLD);
titleTextbox.setTransparent(true);
titleTextbox.setAutoResize(true);
titleTextbox.setEditable(false);
titleTextbox.setWrapping(false);
titleTextbox.setMultiline(false);
titleTextbox.setClipping(false);
titleTextbox.setSelectable(false);
titleTextbox.setDraggable(false);
titleTextbox.setResizable(false);
addObjectAtTail(titleTextbox);
}
private void createMainTextbox() {
//Create the JGoText box for the text
mainTextbox = new JGoText();
mainTextbox.setAlignment(MAINTEXT_ALIGN);
mainTextbox.setFaceName(MAINTEXT_FONT);
mainTextbox.setFontSize(MAINTEXT_SIZE);
mainTextbox.setTextColor(MAINTEXT_COLOR);
mainTextbox.setBold(MAINTEXT_BOLD);
mainTextbox.setTransparent(true);
mainTextbox.setAutoResize(false);
mainTextbox.setEditable(false);
mainTextbox.setWrapping(true);
mainTextbox.setMultiline(true);
mainTextbox.setClipping(true);
mainTextbox.setSelectable(false);
mainTextbox.setDraggable(false);
mainTextbox.setResizable(false);
addObjectAtTail(mainTextbox);
}
The desired behavior is that the node’s width changes to accomodate
the full text of the title field on one line without wrapping.
At default scale they look as desired.
However, when the scale is at higher or lower than 1.0d the title field has display issues. It looks like it has something to do with the AutoSize being set to true?
At scale = 0.5d:
and at scale = 2.0d:
Any clue how I can make this work?