Package org.gjt.sp.jedit.print
Class PageBreakExtension
- java.lang.Object
-
- org.gjt.sp.jedit.textarea.TextAreaExtension
-
- org.gjt.sp.jedit.print.PageBreakExtension
-
- All Implemented Interfaces:
EBComponent
public class PageBreakExtension extends TextAreaExtension implements EBComponent
Draws a line across the text area indicating where a printing page break would be.
-
-
Constructor Summary
Constructors Constructor Description PageBreakExtension(JEditTextArea textArea)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Color
getPageBreakColor()
void
handleMessage(EBMessage msg)
Handles a message sent on the EditBus.boolean
isPageBreakEnabled()
void
paintValidLine(java.awt.Graphics2D gfx, int screenLine, int physicalLine, int start, int end, int y)
Called by the text area when the extension is to paint a screen line which has an associated physical line number in the buffer.void
setPageBreakColor(java.awt.Color pageBreakColor)
void
setPageBreakEnabled(boolean pageBreak)
-
Methods inherited from class org.gjt.sp.jedit.textarea.TextAreaExtension
getToolTipText, paintInvalidLine, paintScreenLineRange
-
-
-
-
Constructor Detail
-
PageBreakExtension
public PageBreakExtension(JEditTextArea textArea)
-
-
Method Detail
-
handleMessage
public void handleMessage(EBMessage msg)
Description copied from interface:EBComponent
Handles a message sent on the EditBus. This method must specify the type of responses the plugin will have for various subclasses of theEBMessage
class. Typically this is done with one or moreif
blocks that test whether the message is an instance of a derived message class in which the component has an interest. For example:if(msg instanceof BufferUpdate) { // a buffer's state has changed! } else if(msg instanceof ViewUpdate) { // a view's state has changed! } // ... and so on
- Specified by:
handleMessage
in interfaceEBComponent
- Parameters:
msg
- The message
-
getPageBreakColor
public java.awt.Color getPageBreakColor()
-
setPageBreakColor
public void setPageBreakColor(java.awt.Color pageBreakColor)
-
isPageBreakEnabled
public boolean isPageBreakEnabled()
-
setPageBreakEnabled
public void setPageBreakEnabled(boolean pageBreak)
-
paintValidLine
public void paintValidLine(java.awt.Graphics2D gfx, int screenLine, int physicalLine, int start, int end, int y)
Description copied from class:TextAreaExtension
Called by the text area when the extension is to paint a screen line which has an associated physical line number in the buffer. Note that since one physical line may consist of several screen lines due to soft wrap, the start and end offsets of the screen line are passed in as well.- Overrides:
paintValidLine
in classTextAreaExtension
- Parameters:
gfx
- The graphics contextscreenLine
- The screen line numberphysicalLine
- The physical line numberstart
- The offset where the screen line begins, from the start of the bufferend
- The offset where the screen line ends, from the start of the buffery
- The y co-ordinate of the top of the line's bounding box
-
-