| javax.swing.JComponent org.syntax.jedit.TextAreaPainter
TextAreaPainter | public class TextAreaPainter extends JComponent implements TabExpander(Code) | | The text area repaint manager. It performs double buffering and paints
lines of text.
author: Slava Pestov version: $Id$ |
Inner Class :public interface Highlight | |
Method Summary | |
public void | addCustomHighlight(Highlight highlight) Adds a custom highlight painter. | final public Color | getBracketHighlightColor() Returns the bracket highlight color. | final public Color | getCaretColor() Returns the caret color. | final public Color | getEOLMarkerColor() Returns the EOL marker color. | final public boolean | getEOLMarkersPainted() Returns true if EOL markers are drawn, false otherwise. | public FontMetrics | getFontMetrics() Returns the font metrics used by this component. | public boolean | getInvalidLinesPainted() Returns true if invalid lines are painted as red tildes (~),
false otherwise. | final public Color | getLineHighlightColor() Returns the line highlight color. | public Dimension | getMaximumSize() | public Dimension | getMinimumSize() Returns the painter's minimum size. | public Dimension | getPreferredSize() Returns the painter's preferred size. | final public Color | getSelectionColor() Returns the selection color. | final public SyntaxStyle[] | getStyles() Returns the syntax styles used to paint colorized text. | public String | getToolTipText(MouseEvent evt) Returns the tool tip to display at the specified location. | final public void | invalidateLine(int line) Marks a line as needing a repaint. | final public void | invalidateLineRange(int firstLine, int lastLine) Marks a range of lines as needing a repaint. | final public void | invalidateSelectedLines() Repaints the lines containing the selection. | final public boolean | isBlockCaretEnabled() Returns true if the caret should be drawn as a block, false otherwise. | final public boolean | isBracketHighlightEnabled() Returns true if bracket highlighting is enabled, false otherwise. | final public boolean | isLineHighlightEnabled() Returns true if line highlight is enabled, false otherwise. | final public boolean | isManagingFocus() Returns if this component can be traversed by pressing the
Tab key. | public float | nextTabStop(float x, int tabOffset) Implementation of TabExpander interface. | public void | paint(Graphics gfx) Repaints the text. | protected void | paintBracketHighlight(Graphics gfx, int line, int y) | protected void | paintCaret(Graphics gfx, int line, int y) | protected void | paintHighlight(Graphics gfx, int line, int y) | protected void | paintLine(Graphics gfx, TokenMarker tokenMarker, int line, int x) | protected void | paintLineHighlight(Graphics gfx, int line, int y) | protected int | paintPlainLine(Graphics gfx, int line, Font defaultFont, Color defaultColor, int x, int y) | protected int | paintSyntaxLine(Graphics gfx, TokenMarker tokenMarker, int line, Font defaultFont, Color defaultColor, int x, int y) | final public void | setBlockCaretEnabled(boolean blockCaret) Sets if the caret should be drawn as a block, false otherwise. | final public void | setBracketHighlightColor(Color bracketHighlightColor) Sets the bracket highlight color. | final public void | setBracketHighlightEnabled(boolean bracketHighlight) Enables or disables bracket highlighting. | final public void | setCaretColor(Color caretColor) Sets the caret color. | final public void | setEOLMarkerColor(Color eolMarkerColor) Sets the EOL marker color. | final public void | setEOLMarkersPainted(boolean eolMarkers) Sets if EOL markers are to be drawn. | public void | setFont(Font font) Sets the font for this component. | public void | setInvalidLinesPainted(boolean paintInvalid) Sets if invalid lines are to be painted as red tildes. | final public void | setLineHighlightColor(Color lineHighlightColor) Sets the line highlight color. | final public void | setLineHighlightEnabled(boolean lineHighlight) Enables or disables current line highlighting. | final public void | setSelectionColor(Color selectionColor) Sets the selection color. | final public void | setStyles(SyntaxStyle[] styles) Sets the syntax styles used to paint colorized text. |
blockCaret | protected boolean blockCaret(Code) | | |
bracketHighlight | protected boolean bracketHighlight(Code) | | |
bracketHighlightColor | protected Color bracketHighlightColor(Code) | | |
currentLineIndex | int currentLineIndex(Code) | | |
eolMarkers | protected boolean eolMarkers(Code) | | |
highlights | protected Highlight highlights(Code) | | |
lineHighlight | protected boolean lineHighlight(Code) | | |
lineHighlightColor | protected Color lineHighlightColor(Code) | | |
paintInvalid | protected boolean paintInvalid(Code) | | |
tabSize | protected int tabSize(Code) | | |
addCustomHighlight | public void addCustomHighlight(Highlight highlight)(Code) | | Adds a custom highlight painter.
Parameters: highlight - The highlight |
getBracketHighlightColor | final public Color getBracketHighlightColor()(Code) | | Returns the bracket highlight color.
|
getCaretColor | final public Color getCaretColor()(Code) | | Returns the caret color.
|
getEOLMarkerColor | final public Color getEOLMarkerColor()(Code) | | Returns the EOL marker color.
|
getEOLMarkersPainted | final public boolean getEOLMarkersPainted()(Code) | | Returns true if EOL markers are drawn, false otherwise.
|
getFontMetrics | public FontMetrics getFontMetrics()(Code) | | Returns the font metrics used by this component.
|
getInvalidLinesPainted | public boolean getInvalidLinesPainted()(Code) | | Returns true if invalid lines are painted as red tildes (~),
false otherwise.
|
getLineHighlightColor | final public Color getLineHighlightColor()(Code) | | Returns the line highlight color.
|
getMinimumSize | public Dimension getMinimumSize()(Code) | | Returns the painter's minimum size.
|
getPreferredSize | public Dimension getPreferredSize()(Code) | | Returns the painter's preferred size.
|
getSelectionColor | final public Color getSelectionColor()(Code) | | Returns the selection color.
|
getStyles | final public SyntaxStyle[] getStyles()(Code) | | Returns the syntax styles used to paint colorized text. Entry n
will be used to paint tokens with id = n.
See Also: org.syntax.jedit.Token |
getToolTipText | public String getToolTipText(MouseEvent evt)(Code) | | Returns the tool tip to display at the specified location.
Parameters: evt - The mouse event |
invalidateLine | final public void invalidateLine(int line)(Code) | | Marks a line as needing a repaint.
Parameters: line - The line to invalidate |
invalidateLineRange | final public void invalidateLineRange(int firstLine, int lastLine)(Code) | | Marks a range of lines as needing a repaint.
Parameters: firstLine - The first line to invalidate Parameters: lastLine - The last line to invalidate |
invalidateSelectedLines | final public void invalidateSelectedLines()(Code) | | Repaints the lines containing the selection.
|
isBlockCaretEnabled | final public boolean isBlockCaretEnabled()(Code) | | Returns true if the caret should be drawn as a block, false otherwise.
|
isBracketHighlightEnabled | final public boolean isBracketHighlightEnabled()(Code) | | Returns true if bracket highlighting is enabled, false otherwise.
When bracket highlighting is enabled, the bracket matching the
one before the caret (if any) is highlighted.
|
isLineHighlightEnabled | final public boolean isLineHighlightEnabled()(Code) | | Returns true if line highlight is enabled, false otherwise.
|
isManagingFocus | final public boolean isManagingFocus()(Code) | | Returns if this component can be traversed by pressing the
Tab key. This returns false.
|
nextTabStop | public float nextTabStop(float x, int tabOffset)(Code) | | Implementation of TabExpander interface. Returns next tab stop after
a specified point.
Parameters: x - The x co-ordinate Parameters: tabOffset - Ignored The next tab stop after x |
paint | public void paint(Graphics gfx)(Code) | | Repaints the text.
Parameters: g - The graphics context |
paintBracketHighlight | protected void paintBracketHighlight(Graphics gfx, int line, int y)(Code) | | |
paintCaret | protected void paintCaret(Graphics gfx, int line, int y)(Code) | | |
paintHighlight | protected void paintHighlight(Graphics gfx, int line, int y)(Code) | | |
paintLineHighlight | protected void paintLineHighlight(Graphics gfx, int line, int y)(Code) | | |
paintPlainLine | protected int paintPlainLine(Graphics gfx, int line, Font defaultFont, Color defaultColor, int x, int y)(Code) | | |
setBlockCaretEnabled | final public void setBlockCaretEnabled(boolean blockCaret)(Code) | | Sets if the caret should be drawn as a block, false otherwise.
Parameters: blockCaret - True if the caret should be drawn as a block,false otherwise. |
setBracketHighlightColor | final public void setBracketHighlightColor(Color bracketHighlightColor)(Code) | | Sets the bracket highlight color.
Parameters: bracketHighlightColor - The bracket highlight color |
setBracketHighlightEnabled | final public void setBracketHighlightEnabled(boolean bracketHighlight)(Code) | | Enables or disables bracket highlighting.
When bracket highlighting is enabled, the bracket matching the
one before the caret (if any) is highlighted.
Parameters: bracketHighlight - True if bracket highlighting should beenabled, false otherwise |
setCaretColor | final public void setCaretColor(Color caretColor)(Code) | | Sets the caret color.
Parameters: caretColor - The caret color |
setEOLMarkerColor | final public void setEOLMarkerColor(Color eolMarkerColor)(Code) | | Sets the EOL marker color.
Parameters: eolMarkerColor - The EOL marker color |
setEOLMarkersPainted | final public void setEOLMarkersPainted(boolean eolMarkers)(Code) | | Sets if EOL markers are to be drawn.
Parameters: eolMarkers - True if EOL markers should be drawn, false otherwise |
setFont | public void setFont(Font font)(Code) | | Sets the font for this component. This is overridden to update the
cached font metrics and to recalculate which lines are visible.
Parameters: font - The font |
setInvalidLinesPainted | public void setInvalidLinesPainted(boolean paintInvalid)(Code) | | Sets if invalid lines are to be painted as red tildes.
Parameters: paintInvalid - True if invalid lines should be drawn, false otherwise |
setLineHighlightColor | final public void setLineHighlightColor(Color lineHighlightColor)(Code) | | Sets the line highlight color.
Parameters: lineHighlightColor - The line highlight color |
setLineHighlightEnabled | final public void setLineHighlightEnabled(boolean lineHighlight)(Code) | | Enables or disables current line highlighting.
Parameters: lineHighlight - True if current line highlight should be enabled,false otherwise |
setSelectionColor | final public void setSelectionColor(Color selectionColor)(Code) | | Sets the selection color.
Parameters: selectionColor - The selection color |
setStyles | final public void setStyles(SyntaxStyle[] styles)(Code) | | Sets the syntax styles used to paint colorized text. Entry n
will be used to paint tokens with id = n.
Parameters: styles - The syntax styles See Also: org.syntax.jedit.Token |
Methods inherited from javax.swing.JComponent | public void addAncestorListener(AncestorListener listener)(Code)(Java Doc) public void addNotify()(Code)(Java Doc) public synchronized void addVetoableChangeListener(VetoableChangeListener listener)(Code)(Java Doc) public void computeVisibleRect(Rectangle visibleRect)(Code)(Java Doc) public boolean contains(int x, int y)(Code)(Java Doc) public JToolTip createToolTip()(Code)(Java Doc) public void disable()(Code)(Java Doc) public void enable()(Code)(Java Doc) public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)(Code)(Java Doc) public void firePropertyChange(String propertyName, int oldValue, int newValue)(Code)(Java Doc) public void firePropertyChange(String propertyName, char oldValue, char newValue)(Code)(Java Doc) protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws java.beans.PropertyVetoException(Code)(Java Doc) public AccessibleContext getAccessibleContext()(Code)(Java Doc) public ActionListener getActionForKeyStroke(KeyStroke aKeyStroke)(Code)(Java Doc) final public ActionMap getActionMap()(Code)(Java Doc) public float getAlignmentX()(Code)(Java Doc) public float getAlignmentY()(Code)(Java Doc) public AncestorListener[] getAncestorListeners()(Code)(Java Doc) public boolean getAutoscrolls()(Code)(Java Doc) public int getBaseline(int width, int height)(Code)(Java Doc) public BaselineResizeBehavior getBaselineResizeBehavior()(Code)(Java Doc) public Border getBorder()(Code)(Java Doc) public Rectangle getBounds(Rectangle rv)(Code)(Java Doc) final public Object getClientProperty(Object key)(Code)(Java Doc) protected Graphics getComponentGraphics(Graphics g)(Code)(Java Doc) public JPopupMenu getComponentPopupMenu()(Code)(Java Doc) public int getConditionForKeyStroke(KeyStroke aKeyStroke)(Code)(Java Doc) public int getDebugGraphicsOptions()(Code)(Java Doc) public static Locale getDefaultLocale()(Code)(Java Doc) public FontMetrics getFontMetrics(Font font)(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public boolean getInheritsPopupMenu()(Code)(Java Doc) final public InputMap getInputMap(int condition)(Code)(Java Doc) final public InputMap getInputMap()(Code)(Java Doc) public InputVerifier getInputVerifier()(Code)(Java Doc) public Insets getInsets()(Code)(Java Doc) public Insets getInsets(Insets insets)(Code)(Java Doc) public T[] getListeners(Class<T> listenerType)(Code)(Java Doc) public Point getLocation(Point rv)(Code)(Java Doc) public Dimension getMaximumSize()(Code)(Java Doc) public Dimension getMinimumSize()(Code)(Java Doc) public Component getNextFocusableComponent()(Code)(Java Doc) public Point getPopupLocation(MouseEvent event)(Code)(Java Doc) public Dimension getPreferredSize()(Code)(Java Doc) public KeyStroke[] getRegisteredKeyStrokes()(Code)(Java Doc) public JRootPane getRootPane()(Code)(Java Doc) public Dimension getSize(Dimension rv)(Code)(Java Doc) public Point getToolTipLocation(MouseEvent event)(Code)(Java Doc) public String getToolTipText()(Code)(Java Doc) public String getToolTipText(MouseEvent event)(Code)(Java Doc) public Container getTopLevelAncestor()(Code)(Java Doc) public TransferHandler getTransferHandler()(Code)(Java Doc) public String getUIClassID()(Code)(Java Doc) public boolean getVerifyInputWhenFocusTarget()(Code)(Java Doc) public synchronized VetoableChangeListener[] getVetoableChangeListeners()(Code)(Java Doc) public Rectangle getVisibleRect()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public int getX()(Code)(Java Doc) public int getY()(Code)(Java Doc) public void grabFocus()(Code)(Java Doc) public boolean isDoubleBuffered()(Code)(Java Doc) public static boolean isLightweightComponent(Component c)(Code)(Java Doc) public boolean isManagingFocus()(Code)(Java Doc) public boolean isOpaque()(Code)(Java Doc) public boolean isOptimizedDrawingEnabled()(Code)(Java Doc) final public boolean isPaintingForPrint()(Code)(Java Doc) public boolean isPaintingTile()(Code)(Java Doc) public boolean isRequestFocusEnabled()(Code)(Java Doc) public boolean isValidateRoot()(Code)(Java Doc) public void paint(Graphics g)(Code)(Java Doc) protected void paintBorder(Graphics g)(Code)(Java Doc) protected void paintChildren(Graphics g)(Code)(Java Doc) protected void paintComponent(Graphics g)(Code)(Java Doc) public void paintImmediately(int x, int y, int w, int h)(Code)(Java Doc) public void paintImmediately(Rectangle r)(Code)(Java Doc) protected String paramString()(Code)(Java Doc) public void print(Graphics g)(Code)(Java Doc) public void printAll(Graphics g)(Code)(Java Doc) protected void printBorder(Graphics g)(Code)(Java Doc) protected void printChildren(Graphics g)(Code)(Java Doc) protected void printComponent(Graphics g)(Code)(Java Doc) protected void processComponentKeyEvent(KeyEvent e)(Code)(Java Doc) protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)(Code)(Java Doc) protected void processKeyEvent(KeyEvent e)(Code)(Java Doc) protected void processMouseEvent(MouseEvent e)(Code)(Java Doc) protected void processMouseMotionEvent(MouseEvent e)(Code)(Java Doc) final public void putClientProperty(Object key, Object value)(Code)(Java Doc) public void registerKeyboardAction(ActionListener anAction, String aCommand, KeyStroke aKeyStroke, int aCondition)(Code)(Java Doc) public void registerKeyboardAction(ActionListener anAction, KeyStroke aKeyStroke, int aCondition)(Code)(Java Doc) public void removeAncestorListener(AncestorListener listener)(Code)(Java Doc) public void removeNotify()(Code)(Java Doc) public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)(Code)(Java Doc) public void repaint(long tm, int x, int y, int width, int height)(Code)(Java Doc) public void repaint(Rectangle r)(Code)(Java Doc) public boolean requestDefaultFocus()(Code)(Java Doc) public void requestFocus()(Code)(Java Doc) public boolean requestFocus(boolean temporary)(Code)(Java Doc) public boolean requestFocusInWindow()(Code)(Java Doc) protected boolean requestFocusInWindow(boolean temporary)(Code)(Java Doc) public void resetKeyboardActions()(Code)(Java Doc) public void reshape(int x, int y, int w, int h)(Code)(Java Doc) public void revalidate()(Code)(Java Doc) public void scrollRectToVisible(Rectangle aRect)(Code)(Java Doc) final public void setActionMap(ActionMap am)(Code)(Java Doc) public void setAlignmentX(float alignmentX)(Code)(Java Doc) public void setAlignmentY(float alignmentY)(Code)(Java Doc) public void setAutoscrolls(boolean autoscrolls)(Code)(Java Doc) public void setBackground(Color bg)(Code)(Java Doc) public void setBorder(Border border)(Code)(Java Doc) public void setComponentPopupMenu(JPopupMenu popup)(Code)(Java Doc) public void setDebugGraphicsOptions(int debugOptions)(Code)(Java Doc) public static void setDefaultLocale(Locale l)(Code)(Java Doc) public void setDoubleBuffered(boolean aFlag)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)(Code)(Java Doc) public void setFont(Font font)(Code)(Java Doc) public void setForeground(Color fg)(Code)(Java Doc) public void setInheritsPopupMenu(boolean value)(Code)(Java Doc) final public void setInputMap(int condition, InputMap map)(Code)(Java Doc) public void setInputVerifier(InputVerifier inputVerifier)(Code)(Java Doc) public void setMaximumSize(Dimension maximumSize)(Code)(Java Doc) public void setMinimumSize(Dimension minimumSize)(Code)(Java Doc) public void setNextFocusableComponent(Component aComponent)(Code)(Java Doc) public void setOpaque(boolean isOpaque)(Code)(Java Doc) public void setPreferredSize(Dimension preferredSize)(Code)(Java Doc) public void setRequestFocusEnabled(boolean requestFocusEnabled)(Code)(Java Doc) public void setToolTipText(String text)(Code)(Java Doc) public void setTransferHandler(TransferHandler newHandler)(Code)(Java Doc) protected void setUI(ComponentUI newUI)(Code)(Java Doc) public void setVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget)(Code)(Java Doc) public void setVisible(boolean aFlag)(Code)(Java Doc) public void unregisterKeyboardAction(KeyStroke aKeyStroke)(Code)(Java Doc) public void update(Graphics g)(Code)(Java Doc) public void updateUI()(Code)(Java Doc)
|
|
|