Re: Why does AffineTransform not work on JTextPane?
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Thu, 10 Aug 2006 18:54:06 GMT
"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
.
- Follow-Ups:
- Re: Why does AffineTransform not work on JTextPane?
- From: fiziwig
- Re: Why does AffineTransform not work on JTextPane?
- References:
- Why does AffineTransform not work on JTextPane?
- From: fiziwig
- Re: Why does AffineTransform not work on JTextPane?
- From: Oliver Wong
- Re: Why does AffineTransform not work on JTextPane?
- From: fiziwig
- Why does AffineTransform not work on JTextPane?
- Prev by Date: what is "Key class" in Entity Bean of EJB ?
- Next by Date: Re: Why does AffineTransform not work on JTextPane?
- Previous by thread: Re: Why does AffineTransform not work on JTextPane?
- Next by thread: Re: Why does AffineTransform not work on JTextPane?
- Index(es):
Relevant Pages
|