Oxygen XML Editor 14.2 Author API

ro.sync.ecss.extensions.api.highlights
Class HighlightPainterInfo

java.lang.Object
  extended by ro.sync.ecss.extensions.api.highlights.HighlightPainterInfo

@API(type=NOT_EXTENDABLE,
     src=PUBLIC)
public class HighlightPainterInfo
extends java.lang.Object

Information needed by the painter.


Constructor Summary
HighlightPainterInfo(Graphics g, int currentBoxHeight, Point origin, int relativeX, int textYPadding, int length, int startOffset, int endOffset, int baseLine, int fontAscent, int fontSize, int parentLineBoxHight, Point parentLineBoxOrigin)
          Renders the highlight.
HighlightPainterInfo(Graphics g, int currentBoxHeight, Point origin, int relativeX, int length, int startOffset, int endOffset, int baseLine, int fontAscent, int fontSize, int parentLineBoxHight, Point parentLineBoxOrigin)
          Renders the highlight.
 
Method Summary
 int getBaseLine()
          Returns the base line relative to top, relative to the box.
 int getCurrentBoxHeight()
          Current run of text/image height.
 int getEndOffset()
          Returns the end offset in content.
 int getFontAscent()
          Returns the font ascent.
 int getFontSize()
          Returns the font size.
 Graphics getGraphics()
          Returns the graphics used for paint.
 int getLength()
          Returns the length of highlight, in pixels.
 Point getOrigin()
          Returns the origin of box, relative to the upper corner of the editor.
 int getParentLineBoxHight()
           
 Point getParentLineBoxOrigin()
           
 int getRelativeX()
          Returns the relative X from where highlight should start.
 int getStartOffset()
          Returns the start offset in content.
 int getTextYPadding()
          Returns the relative Y position from box Y used to paint the text inside the box.
 boolean isHighlightOverImage()
           
 boolean isHighlightOverText()
          Returns true if the highlight is done over a text view.
 void setHighlightOverImage(boolean isHighlightOverImage)
          true if the highlight is over an image
 void setHighlightOverText(boolean isHighlightOverText)
          It is set by the author layout, so that the painter knows the painted box is a text box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HighlightPainterInfo

public HighlightPainterInfo(Graphics g,
                            int currentBoxHeight,
                            Point origin,
                            int relativeX,
                            int length,
                            int startOffset,
                            int endOffset,
                            int baseLine,
                            int fontAscent,
                            int fontSize,
                            int parentLineBoxHight,
                            Point parentLineBoxOrigin)
Renders the highlight.

Parameters:
g - The graphics
currentBoxHeight - The current box height.
origin - Origin (upper left corner of the box in absolute coordinates)
relativeX - The x relative to the origin where the highlight must start.
length - The length of the highlight, in pixels.
startOffset - Start offset of highlight
endOffset - End offset of highlight
baseLine - The base line relative to the box start
fontAscent - The font ascent
fontSize - The font size
parentLineBoxHight - The height of the parent line box. Can be -1.
parentLineBoxOrigin - The origin of the parent line box. Can be null.

HighlightPainterInfo

public HighlightPainterInfo(Graphics g,
                            int currentBoxHeight,
                            Point origin,
                            int relativeX,
                            int textYPadding,
                            int length,
                            int startOffset,
                            int endOffset,
                            int baseLine,
                            int fontAscent,
                            int fontSize,
                            int parentLineBoxHight,
                            Point parentLineBoxOrigin)
Renders the highlight.

Parameters:
g - The graphics
currentBoxHeight - The current box height.
origin - Origin (upper left corner of the box in absolute coordinates)
relativeX - The x relative to the origin where the highlight must start.
textYPadding - The relative Y position from box Y used to paint the box.
length - The length of the highlight, in pixels.
startOffset - Start offset of highlight
endOffset - End offset of highlight
baseLine - The base line relative to the box start
fontAscent - The font ascent
fontSize - The font size
parentLineBoxHight - The height of the parent line box. Can be -1.
parentLineBoxOrigin - The origin of the parent line box. Can be null.
Method Detail

setHighlightOverText

public void setHighlightOverText(boolean isHighlightOverText)
It is set by the author layout, so that the painter knows the painted box is a text box.

Parameters:
isHighlightOverText - The isHighlightOverText to set.

getGraphics

public Graphics getGraphics()
Returns the graphics used for paint.

Returns:
Returns the graphics used for paint.

getCurrentBoxHeight

public int getCurrentBoxHeight()
Current run of text/image height. Usually the highlight should expand as high as the containing box.

Returns:
Current run of text/image height. Usually the highlight should expand as high as the containing box.

getOrigin

public Point getOrigin()
Returns the origin of box, relative to the upper corner of the editor.

Returns:
Returns the origin of box, relative to the upper corner of the editor.

getRelativeX

public int getRelativeX()
Returns the relative X from where highlight should start.

Returns:
Returns the relative X from where highlight should start.

getTextYPadding

public int getTextYPadding()
Returns the relative Y position from box Y used to paint the text inside the box.

Returns:
The relative Y position from box Y used to paint the text inside the box.

getLength

public int getLength()
Returns the length of highlight, in pixels.

Returns:
Returns the length of highlight, in pixels.

getStartOffset

public int getStartOffset()
Returns the start offset in content.

Returns:
Returns the start offset in content.

getEndOffset

public int getEndOffset()
Returns the end offset in content.

Returns:
Returns the end offset in content.

getBaseLine

public int getBaseLine()
Returns the base line relative to top, relative to the box.

Returns:
Returns the base line relative to top, relative to the box.

getFontAscent

public int getFontAscent()
Returns the font ascent.

Returns:
Returns the font ascent.

getFontSize

public int getFontSize()
Returns the font size.

Returns:
Returns the font size.

isHighlightOverText

public boolean isHighlightOverText()
Returns true if the highlight is done over a text view.

Returns:
Returns true if the highlight is done over a text view.

getParentLineBoxHight

public int getParentLineBoxHight()
Returns:
Returns the height of parent line box. Can be -1.

getParentLineBoxOrigin

public Point getParentLineBoxOrigin()
Returns:
Returns the origin(absolute) of the parent line box. Can be null.

setHighlightOverImage

public void setHighlightOverImage(boolean isHighlightOverImage)
true if the highlight is over an image

Parameters:
isHighlightOverImage - true if the highlight is over an image

isHighlightOverImage

public boolean isHighlightOverImage()
Returns:
Returns true if the highlight is over an image

Oxygen XML Editor 14.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.