|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.TextUI javax.swing.plaf.basic.BasicTextUI javax.swing.plaf.basic.BasicEditorPaneUI oracle.javatools.editor.BasicEditorUI
The BasicEditorUI
overrides the default look and
feel for the BasicEditorPane implementation in order to adhere to
the locking policies in the document. The default
BasicTextUI
implementation makes the assumption that
the document model used by the editor pane inherits from
AbstractDocument, which is not true in our case. Because of this
assumption, none of our locking calls are made when the editor
is painted if the installed UI delegate is the Swing default one.
Nested Class Summary |
Nested classes inherited from class javax.swing.plaf.basic.BasicTextUI |
javax.swing.plaf.basic.BasicTextUI.BasicCaret, javax.swing.plaf.basic.BasicTextUI.BasicHighlighter |
Constructor Summary | |
BasicEditorUI()
|
Method Summary | |
protected javax.swing.text.Caret |
createCaret()
Creates the object to use for a caret. |
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent component)
Creates a UI for the BasicEditorPane. |
void |
damageRange(javax.swing.text.JTextComponent component,
int startOffset,
int endOffset,
javax.swing.text.Position.Bias startOffsetBias,
javax.swing.text.Position.Bias endOffsetBias)
Causes the portion of the view responsible for the given part of the model to be repainted. |
java.awt.Dimension |
getMaximumSize(javax.swing.JComponent component)
Gets the maximum size for the editor component. |
java.awt.Dimension |
getMinimumSize(javax.swing.JComponent component)
Gets the minimum size for the editor component. |
int |
getNextVisualPositionFrom(javax.swing.text.JTextComponent component,
int offset,
javax.swing.text.Position.Bias bias,
int direction,
javax.swing.text.Position.Bias[] biasRet)
Provides a way to determine the next visually represented model location that one might place a caret. |
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent component)
Gets the preferred size for the editor component. |
void |
installUI(javax.swing.JComponent component)
Installs the UI for a component. |
java.awt.Rectangle |
modelToView(javax.swing.text.JTextComponent component,
int offset,
javax.swing.text.Position.Bias bias)
Converts the given location in the model to a place in the view coordinate system. |
protected void |
paintSafely(java.awt.Graphics graphics)
Paints the interface safely with a guarantee that the model won't change from the view of this thread. |
int |
viewToModel(javax.swing.text.JTextComponent component,
java.awt.Point point,
javax.swing.text.Position.Bias[] biasReturn)
Converts the given place in the view coordinate system to the nearest representative location in the model. |
Methods inherited from class javax.swing.plaf.basic.BasicEditorPaneUI |
getEditorKit, getPropertyPrefix, propertyChange |
Methods inherited from class javax.swing.plaf.basic.BasicTextUI |
create, create, createHighlighter, createKeymap, damageRange, getComponent, getKeymapName, getRootView, getToolTipText, getVisibleEditorRect, installDefaults, installKeyboardActions, installListeners, modelChanged, modelToView, paint, paintBackground, setView, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI, update, viewToModel |
Methods inherited from class javax.swing.plaf.ComponentUI |
contains, getAccessibleChild, getAccessibleChildrenCount |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicEditorUI()
Method Detail |
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent component)
component
- the JTextPane component
public void installUI(javax.swing.JComponent component)
component
- the editor componentComponentUI.installUI(javax.swing.JComponent)
protected javax.swing.text.Caret createCaret()
protected void paintSafely(java.awt.Graphics graphics)
graphics
- the graphics contextpublic java.awt.Dimension getPreferredSize(javax.swing.JComponent component)
component
- the editor component
public java.awt.Dimension getMinimumSize(javax.swing.JComponent component)
component
- the editor component
public java.awt.Dimension getMaximumSize(javax.swing.JComponent component)
component
- the editor component
public java.awt.Rectangle modelToView(javax.swing.text.JTextComponent component, int offset, javax.swing.text.Position.Bias bias) throws javax.swing.text.BadLocationException
component
- the text component for which this UI is installedoffset
- the local location in the model to translate >= 0
javax.swing.text.BadLocationException
- if the given offset does not
represent a valid location in the documentTextUI.modelToView(javax.swing.text.JTextComponent, int)
public int viewToModel(javax.swing.text.JTextComponent component, java.awt.Point point, javax.swing.text.Position.Bias[] biasReturn)
component
- the text component for which this UI is installedpoint
- the location in the view to translate. This
should be in the same coordinate system as the mouse events.
TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point)
public int getNextVisualPositionFrom(javax.swing.text.JTextComponent component, int offset, javax.swing.text.Position.Bias bias, int direction, javax.swing.text.Position.Bias[] biasRet) throws javax.swing.text.BadLocationException
component
- the text component for which this UI is installedoffset
- the position to convert >= 0direction
- the direction from the current position that can
be thought of as the arrow keys typically found on a keyboard.
This may be SwingConstants.WEST, SwingConstants.EAST,
SwingConstants.NORTH, or SwingConstants.SOUTH.
javax.swing.text.BadLocationException
- if the given offset does not
represent a valid location in the document
java.lang.IllegalArgumentException
- for an invalid directionpublic void damageRange(javax.swing.text.JTextComponent component, int startOffset, int endOffset, javax.swing.text.Position.Bias startOffsetBias, javax.swing.text.Position.Bias endOffsetBias)
component
- the text component for which this UI is installedstartOffset
- the beginning of the range >= 0endOffset
- the end of the range >= startOffset
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.