|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JEditorPane
javax.swing.JTextPane
com.quadrique.jbuildingblocks.gui.TextPane
public class TextPane
A convenience class to simplify the usage of the JTextPane component The JTextPane is encapsulated in a specialized JPanel
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
|---|
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JEditorPane |
|---|
HONOR_DISPLAY_PROPERTIES, W3C_LENGTH_UNITS |
| Fields inherited from class javax.swing.text.JTextComponent |
|---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
TextPane()
constructor |
|
| Method Summary | |
|---|---|
MenuPopup |
getPopupMenu()
|
int |
getPositionOfComponent(Object zObj)
|
void |
insertComponentAtTheEnd(JComponent zComponent)
to insert a JComponent (e.g. |
void |
insertTextAtTheEnd(String zText,
TextPaneAttributeSet zSet)
to insert text at the end of the document |
void |
mouseClicked(MouseEvent e)
The mouse listener interface |
void |
mouseEntered(MouseEvent e)
The mouse listener interface |
void |
mouseExited(MouseEvent e)
The mouse listener interface |
void |
mousePressed(MouseEvent e)
The mouse listener interface |
void |
mouseReleased(MouseEvent e)
The mouse listener interface |
ArrayList<TextPaneSegment> |
parseToSegments()
parse the current document in segments segments are either text or a component the beginning/end of a segment is indicated by the transition from text to component and vice-versa |
void |
removeComponent(JComponent zComponent)
to remove a component from the pane |
void |
setSelectionToCaret()
to set the current selection to be the caret position. |
void |
setSelectionToEnd()
to set the current selection to be the end of the document |
void |
setUserData(int zStartPos,
int zEndPos,
Object zUserData)
set the given user data object to each character in the given range |
void |
setUserDataToSelection(Object zObj)
set the given user data object to the current selection |
| Methods inherited from class javax.swing.JTextPane |
|---|
addStyle, getCharacterAttributes, getInputAttributes, getLogicalStyle, getParagraphAttributes, getStyle, getStyledDocument, getUIClassID, insertComponent, insertIcon, removeStyle, replaceSelection, setCharacterAttributes, setDocument, setEditorKit, setLogicalStyle, setParagraphAttributes, setStyledDocument |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextPane()
throws Exception
Exception - if an error occurs| Method Detail |
|---|
public void setSelectionToCaret()
public void setSelectionToEnd()
public void insertComponentAtTheEnd(JComponent zComponent)
throws Exception
zComponent - the compoennt to insert
Exception - if an error occurs
public void insertTextAtTheEnd(String zText,
TextPaneAttributeSet zSet)
throws Exception
zText - the text to insertzSet - the attribute set for the given text
Exception - if an error occurs
public void setUserData(int zStartPos,
int zEndPos,
Object zUserData)
throws Exception
zStartPos - position from the beginning of the document (0-based)zEndPos - position form the baginning of the docuemnt (0-based). PleasezUserData - the user data object
note that the character at the position zEndPos is not included
Exception
public void setUserDataToSelection(Object zObj)
throws Exception
zObj - the user data object
Exception
public void removeComponent(JComponent zComponent)
throws Exception
zComponent - the component to remove
Exception - if an error occur (including the case were the component
is not found)
public ArrayList<TextPaneSegment> parseToSegments()
throws Exception
Exceptionpublic MenuPopup getPopupMenu()
public int getPositionOfComponent(Object zObj)
throws Exception
Exceptionpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenere - the mouse eventMouseListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenere - the mouse eventMouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenere - the mouse eventMouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenere - the mouse eventMouseListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenere - the mouse eventMouseListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||