com.inet.html.views
Class RotationPainter

java.lang.Object
  extended by com.inet.html.views.ContentPainter
      extended by com.inet.html.views.RotationPainter

public class RotationPainter
extends ContentPainter

This class is similar to the JRE GlyphView.GlyphPainter. But since HTML does not support tabs and has no predefined Break length, these parts of the functions are removed. This painter has the ability to rotate the glyphs.
NOTE: This will not work for arabic text!


Field Summary
static int GLYPH_DOWN
           
static int GLYPH_LEFT
           
static int GLYPH_RIGHT
           
static int GLYPH_UP
           
 
Constructor Summary
RotationPainter(int glyphOrientation, ContentView view)
          Creates the painter
 
Method Summary
 ContentPainter copy(ContentView target)
          Returns a copy of this painter
 int getGlyphOrientation()
          Returns the glyph orientation of this painter
 void paint(java.awt.Graphics g, java.awt.Shape a, int start, int length, int baseline)
          Paints the glyphs representing the given range.
 void setView(ContentView view)
          Sets the view this painter is bound to
 
Methods inherited from class com.inet.html.views.ContentPainter
getAscent, getCharOffsets, getDescent, getHeight, getSpan, isCharOffsetsSet, isReversed, modelToView, reset, setCharOffsets, setReversed, sync, viewToModel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLYPH_RIGHT

public static final int GLYPH_RIGHT
See Also:
Constant Field Values

GLYPH_LEFT

public static final int GLYPH_LEFT
See Also:
Constant Field Values

GLYPH_DOWN

public static final int GLYPH_DOWN
See Also:
Constant Field Values

GLYPH_UP

public static final int GLYPH_UP
See Also:
Constant Field Values
Constructor Detail

RotationPainter

public RotationPainter(int glyphOrientation,
                       ContentView view)
Creates the painter

Parameters:
glyphOrientation - the rotation constant
view - the view, whose content will be painted by this painter
Method Detail

setView

public void setView(ContentView view)
Sets the view this painter is bound to

Overrides:
setView in class ContentPainter
Parameters:
view - the view, whose content will be painted by this painter

paint

public void paint(java.awt.Graphics g,
                  java.awt.Shape a,
                  int start,
                  int length,
                  int baseline)
Paints the glyphs representing the given range.

Overrides:
paint in class ContentPainter
Parameters:
g - the graphics to paint to
a - the allocation to paint to
start - the start index within the text of the view
length - the end index within the text of the view
baseline - the offset from the top of the shape to the baseline of the current line

getGlyphOrientation

public int getGlyphOrientation()
Returns the glyph orientation of this painter

Returns:
the glyph orientation of this painter

copy

public ContentPainter copy(ContentView target)
Returns a copy of this painter

Overrides:
copy in class ContentPainter
Parameters:
target - the view to bind to
Returns:
the copy of this painter