Re: Why does AffineTransform not work on JTextPane?




"fiziwig" <fiziwig@xxxxxxxxx> wrote in message news:1155235460.892436.215590@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Oliver Wong wrote:
"fiziwig" <fiziwig@xxxxxxxxx> wrote in message

<snip>

> OR any ideas for a different way to display STYLED text (font, size,
> color, bold, italic on a character-by-character basis) at a 90 or 180
> degree rotation. It doesn't have to be editable when rotated, but it
> does need to be editable when upright, otherwise I'd just use HTML in a
> JLabel.

How about using a JTextPane for editing, and when editing is done, copy
the contents and put it into a JLabel, and rotate the JLabel?


That might work. The problem is then I have to go through the text
character by character pulling out the attributes (font, size, color,
bold, italic,...) and turning those into HTML tags so that they will
display properly in the JLabel. Then when the user selects the text for
editing again I have to turn around and parse out all the HTML tags and
build it back into a styled document.

Or you could have a central "model" object which semantically preserves all the information you need in your document, and generate HTML like views for the Label, and the character-style like view and editor for the JTextPane.

Another thing you could try is, once the user has finished editing everything, taking a screen capture of the JTextPane, and then rotating that image, and displaying it.

- Oliver

.



Relevant Pages

  • Re: WORD needs a 1st-3rd/3rd to 1st person conversion feature.
    ... He had a different toolbar for each character; each time a writer ... If you really wanted to get fancy you could have Word check your script as ... Can it do the editing for you? ...
    (microsoft.public.word.vba.general)
  • Re: Why does AffineTransform not work on JTextPane?
    ... color, bold, italic on a character-by-character basis) at a 90 or 180 ... the contents and put it into a JLabel, and rotate the JLabel? ... character by character pulling out the attributes (font, size, color, ...
    (comp.lang.java.programmer)
  • Re: getchar() problem
    ... I am using Standard C compiled with GCC under Linux Fedora Core 4 ... When I run this program and enter a character at the prompt, ... to be a means of signalling "Editing done, ...
    (comp.lang.c)
  • Re: The New Doctor - Glasgow Herald
    ... was the Absence of any Editing in ... instance of another character in Hartnell-era Who fluffing their lines ...
    (rec.arts.drwho)
  • (vim) When would Join insert tabs instead of spaces?
    ... I was editing a file and wanted to join all the lines ... character" - that is, the character that gets inserted at the end of ... each line before the next line is joined - turned out to be a tab. ... I cannot, of course, replicate it now... ...
    (comp.editors)