public class DocumentEditor extends RichTextEditor
DocumentEditor object is a multi-line area that displays
text. It is suited for editing styled documents.
It is created with tool bar.| 修飾子とタイプ | フィールドと説明 |
|---|---|
static java.lang.String |
A_LIST |
static java.lang.String |
A_SAVE_AS_OBJECT |
static java.lang.String |
A_SAVE_AS_TEXT |
static java.lang.String |
A_UNLIST |
protected static Visualizable |
LIST_HEADING
The heading visual object for the list.
|
protected static int |
LIST_HEADING_SPACE
The heading space for the list.
|
protected static int |
LIST_INDENT
The indentation of the list.
|
protected boolean |
writeTargetIsObject |
A_BOLD, A_CENTER, A_CLEAR_STYLE, A_DEC_INDENT, A_HR, A_IMAGE, A_INC_INDENT, A_ITALIC, A_LARGE, A_LEFT, A_RIGHT, A_SMALL, A_UNDERLINE, boldButton, I_BOLD, I_ITALIC, I_UNDERLINE, italicButton, L_ALIGN, L_FORMAT, L_INSERT, L_LIST, underlineButtonA_COPY, A_CUT, A_FIND, A_GOTO, A_OPEN, A_PASTE, A_PRINT, A_SAVE, A_SAVE_AS, A_UNDO, caretDisableComps, change, checkboxMenuMap, I_AUTO_INDENT, I_INCREMENTAL_LOAD, I_SHOW_MATCH, I_SOFT_TAB, I_WORD_WRAP, INC_LINE_COUNT, incrementalLoad, L_CLOSE, L_CLOSE_CONFIRM, L_EDIT, L_EXIT, L_EXIT_CONFIRM, L_FILE, L_FONT, L_FONT_COLOR, L_FONT_NAME, L_FONT_SIZE, L_FONT_STYLE, L_HELP, L_KFC_ADDRESS, L_KFC_ADDRESS2, L_KFC_AUTHOR, L_KFC_URL, L_NEW_WIN, L_OPEN_CONFIRM, L_READ_ENCODING, L_VERSION, L_VIEW, L_WRITE_ENCODING, P_AUTO_INDENT, P_FILE, P_INCREMENTAL_LOAD, P_READ_ENCODING, P_SHOW_MATCH, P_SOFT_TAB, P_SUB_COMPS, P_WORD_WRAP, P_WRITE_ENCODING, readEncoding, savedTextCursor, subComps, subCompStates, textChanged, writeEncoding, writeTargetCHAR_WRAP, columns, DEFAULT_HORIZONTAL_STYLE, DEFAULT_VERTICAL_STYLE, editController, editModel, editView, NO_WRAP, NOT_EDITABLE_BACKGROUND, NOT_EDITABLE_FOREGROUND, NOT_EDITABLE_SELECTION_BACKGROUND, NOT_EDITABLE_SELECTION_FOREGROUND, rows, savedBackgroundColor, savedForegroundColor, savedSelectionBackgroundColor, savedSelectionForegroundColor, SCROLLBARS_BOTH, SCROLLBARS_HORIZONTAL_ONLY, SCROLLBARS_NONE, SCROLLBARS_VERTICAL_ONLY, textListener, textListenerK, textPositionListeners, WORD_WRAPfocusTraversable| コンストラクタと説明 |
|---|
DocumentEditor()
Constructs a new rich text area with tool bar.
|
DocumentEditor(boolean showToolBar)
Constructs a new rich text area with tool bar.
|
DocumentEditor(int rows,
int columns)
Constructs a new rich text area with tool bar, with the specified
number of rows and columns.
|
DocumentEditor(int rows,
int columns,
boolean showToolBar)
Constructs a new rich text area with tool bar, with the specified
number of rows and columns.
|
DocumentEditor(int rows,
int columns,
boolean showToolBar,
java.awt.event.ActionListener openActionListener,
java.awt.event.ActionListener saveActionListener,
java.awt.event.ActionListener printActionListener)
Constructs a new rich text area with tool bar, with the specified
number of rows and columns.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.
|
void |
clear_list()
Clears the selected paragraph as a list.
|
protected java.awt.Component |
createFontNameComponent() |
protected java.awt.Menu |
createFormatMenu() |
protected java.awt.Component[] |
createInsertComponents() |
protected java.awt.Menu |
createInsertMenu() |
protected java.awt.Component[] |
createListComponents() |
protected java.awt.Component |
createTextComponent(TextEditModel model,
int rows,
int columns) |
protected ToolBar |
createToolBar(boolean showToolBar,
java.awt.event.ActionListener openActionListener,
java.awt.event.ActionListener saveActionListener,
java.awt.event.ActionListener printActionListener)
Creates a tool bar.
|
protected java.awt.Menu |
createViewMenu() |
void |
decrease_indent()
Decreases the selected paragraph indentation.
|
protected int |
getListIndent(int listLevel) |
protected int |
getListLevel(ParagraphStyle pStyle) |
void |
increase_indent()
Increases the selected paragraph indentation.
|
boolean |
loadAsObject(java.io.InputStream stream)
Loads the contents of the specified stream as object into
this component.
|
static void |
main(java.lang.String[] args)
Executes the examples.
|
void |
make_font_large()
Makes the selected text large.
|
void |
make_font_small()
Makes the selected text small.
|
void |
make_list()
Makes the selected paragraph as a list.
|
void |
open_file(java.io.File file)
Opens the specified file.
|
void |
save_file_as(boolean serialize)
Saves the text into the selected file.
|
void |
save_file_as(java.io.File file)
Saves the text into the specified file.
|
void |
save_file_as(java.io.File file,
boolean serialize)
Saves the text into the specified file.
|
boolean |
saveAsObject(java.io.OutputStream stream)
Saves the contents of this component as object into the
specified stream.
|
protected void |
setWriteTarget(java.io.File file) |
protected void |
setWriteTarget(java.io.File file,
boolean isObject) |
void |
textPositionChanged(TextPositionEvent te)
Invoked when the position of the text has changed.
|
align_to_center, align_to_left, align_to_right, clear_font_bold, clear_font_italic, clear_font_styles, clear_font_underlined, createAlignmentComponents, createDefaultTextEditModel, createFontComponents1, createFontComponents2, getInsertionStyle, insert_hr, insert_image, insertTextAttachmentAsLine, insertVisualizable, itemStateChanged, make_font_bold, make_font_bold, make_font_italic, make_font_italic, make_font_underlined, make_font_underlined, parseInt, parseSignedInt, set_alignment, set_font_color, set_font_color, set_font_name, set_font_name, set_font_size_diff, set_font_size, set_font_sizeaddCaretDisableComp, addCaretDisableItem, addPropertyChangeListener, addSubComp, addTextListener, addTextPositionListener, appendAnyway, createCheckboxMenuItem, createEditComponents, createEditMenu, createFileComponents, createFindComponents, createFontMenu, createIconButton, createIconToggleButton, createMenuItem, createPrintComponents, createReadCharSetMenu, createTextComponent, createWriteCharSetMenu, disableSubComps, enableSubComps, getEditMenu, getFileFromLoadDialog, getFileFromSaveDialog, getFormatMenu, getIcon, getInsertMenu, getReadEncoding, getToolLabel, getToolTip, getViewMenu, getWriteEncoding, initComponent, isIncrementalLoad, isTextChanged, isWordWrap, load, open_file, print_file, print_file, removePropertyChangeListener, removeTextListener, removeTextPositionListener, save_file_as, save_file, save, setAutoIndentEnabled, setIncrementalLoad, setReadEncoding, setRichText, setShowMatchEnabled, setSoftTab, setText, setTEXT, setTextChanged, setWordWrap, setWriteEncoding, textValueChanged, warnaddKeyAction, append, append, append, appendText, backward_character, backward_word, beep, beginning_of_file, beginning_of_line, clearSoftTab, clearUndo, copy_clipboard, createTextComponent, createTextComponent, cut_clipboard, delete_next_character, delete_next_word, delete_previous_character, delete_previous_word, delete_selection, delete_to_end_of_line, delete_to_start_of_line, deselect_all, end_of_file, end_of_line, find_word, forward_character, forward_word, getCaretColor, getCaretPosition, getColumns, getController, getCurrentTextStyle, getEventSource, getKeyAction, getKeyBinding, getKeymap, getLineWrap, getLocationOfText, getMinimumSize, getMinimumSize, getModel, getParagraphStyleAt, getParagraphStyleCount, getParagraphStyles, getParagraphStyles, getPopupMenu, getPreferredSize, getPreferredSize, getRichText, getRows, getScrollbarThickness, getScrollbarVisibility, getSelectedText, getSelectedTEXT, getSelectionBackground, getSelectionEnd, getSelectionForeground, getSelectionStart, getSoftTab, getText, getTEXT, getText, getTextCaret, getTextStyleAt, getTextStyleCount, getTextStyles, getTextStyles, getView, goto_line, insert_character, insert_string, insert, insert, insert, insertText, isAutoIndentEnabled, isClickable, isClickToFocus, isEditable, isMouseFocus, isShowMatchEnabled, isSoftTab, kill_next_character, kill_next_word, kill_previous_character, kill_previous_word, kill_selection, kill_to_end_of_line, kill_to_start_of_line, minimumSize, modifyRangeParagraphStyle, modifyRangeParagraphStyle, modifyRangeTextStyle, modifyRangeTextStyle, modifySelectionParagraphStyle, modifySelectionParagraphStyle, modifySelectionTextStyle, modifySelectionTextStyle, newbreak, newline_and_indent, newline, next_line, next_page, paragraphStyles, paragraphStyles, paste_clipboard, performKeyAction, performKeyAction, preferredSize, previous_line, previous_page, print, print, print, print, print, processEvent, redraw_display, removeKeyAction, removeKeyActionNamed, replaceRange, replaceRange, replaceRange, replaceSelection, replaceSelection, replaceSelection, replaceText, select_all, select_line, select_word, select, select, select, selectAll, selectionIsCaret, setBackground, setCaretColor, setCaretPosition, setCaretPosition, setClickable, setClickToFocus, setColumns, setCursor, setEditable, setEditable, setEnabled, setFont, setForeground, setKeymap, setLineWrap, setLocationOfText, setMouseFocus, setPopupMenu, setRangeParagraphStyle, setRangeParagraphStyle, setRangeTextStyle, setRangeTextStyle, setRows, setScrollbarThickness, setSelectionBackground, setSelectionEnd, setSelectionForeground, setSelectionParagraphStyle, setSelectionParagraphStyle, setSelectionStart, setSelectionTextStyle, setSelectionTextStyle, setSoftTab, setTextCaret, tab, textStyles, textStyles, undo, unkilladdFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, delegateFocusEvent, delegateKeyEvent, delegateMouseEvent, focusGained, focusLost, getToolTipText, getToolTipVisual, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, setToolTipText, setToolTipText, setToolTipVisualaddNotify, bounds, disable, doLayout, enable, enable, getBounds, getFrame, getInsets, getLocation, getSize, hide, insets, isDirectNotification, isFocusTraversable, layout, location, minimumSize, postOldEvent, preferredSize, repaintNow, requestFocus, reshape, setBounds, setFocusTraversable, setVisible, show, show, size, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, getMousePosition, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, list, list, locate, paint, paintComponents, paramString, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected boolean writeTargetIsObject
public static final java.lang.String A_SAVE_AS_TEXT
public static final java.lang.String A_SAVE_AS_OBJECT
public static final java.lang.String A_LIST
public static final java.lang.String A_UNLIST
protected static final int LIST_INDENT
protected static final int LIST_HEADING_SPACE
protected static final Visualizable LIST_HEADING
public DocumentEditor()
public DocumentEditor(boolean showToolBar)
showToolBar is true, then shows the tool bar initially;
otherwise hides.
This rich text area is created with vertical scroll bar.showToolBar - if true, then shows the tool bar initially;
otherwise hides.public DocumentEditor(int rows,
int columns)
rows - the number of rowscolumns - the number of columns.public DocumentEditor(int rows,
int columns,
boolean showToolBar)
showToolBar is true,
then shows the tool bar initially; otherwise hidden.
This rich text area is created with vertical scroll bar.rows - the number of rowscolumns - the number of columns.showToolBar - if true, then shows the tool bar initially;
otherwise hides.public DocumentEditor(int rows,
int columns,
boolean showToolBar,
java.awt.event.ActionListener openActionListener,
java.awt.event.ActionListener saveActionListener,
java.awt.event.ActionListener printActionListener)
showToolBar is true,
then shows the tool bar initially; otherwise hidden.
This rich text area is created with vertical scroll bar.rows - the number of rowscolumns - the number of columns.showToolBar - if true, then shows the tool bar initially;
otherwise hides.openActionListener - the action listener that receives action
events from the open button in tool bar.saveActionListener - the action listener that receives action
events from the save button in tool bar.printActionListener - the action listener that receives action
events from the print button in tool bar.protected java.awt.Component createTextComponent(TextEditModel model, int rows, int columns)
createTextComponent クラス内 TextEditorpublic void make_font_large()
make_font_large クラス内 RichTextEditorpublic void make_font_small()
make_font_small クラス内 RichTextEditorpublic void make_list()
public void clear_list()
public void increase_indent()
public void decrease_indent()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed インタフェース内 java.awt.event.ActionListeneractionPerformed クラス内 RichTextEditorActionListenerpublic void textPositionChanged(TextPositionEvent te)
textPositionChanged インタフェース内 TextPositionListenertextPositionChanged クラス内 TextEditorjava.awt.event.TextPositionListenerpublic void open_file(java.io.File file)
open_file クラス内 TextEditorpublic void save_file_as(java.io.File file)
save_file_as クラス内 TextEditorpublic void save_file_as(boolean serialize)
serialize - if true, saves the text as an object.public void save_file_as(java.io.File file,
boolean serialize)
file - the file to store into.serialize - if true, saves the text as an object.public boolean loadAsObject(java.io.InputStream stream)
stream - the stream to be loaded.public boolean saveAsObject(java.io.OutputStream stream)
stream - the stream to save into.protected ToolBar createToolBar(boolean showToolBar, java.awt.event.ActionListener openActionListener, java.awt.event.ActionListener saveActionListener, java.awt.event.ActionListener printActionListener)
createToolBar クラス内 TextEditorshowToolBar - if true, then shows the tool bar initially;
otherwise hides.openActionListener - the action listener that receives action
events from the open button in tool bar.saveActionListener - the action listener that receives action
events from the save button in tool bar.printActionListener - the action listener that receives action
events from the print button in tool bar.protected java.awt.Component createFontNameComponent()
protected java.awt.Component[] createListComponents()
protected java.awt.Component[] createInsertComponents()
protected java.awt.Menu createViewMenu()
createViewMenu クラス内 TextEditorprotected java.awt.Menu createInsertMenu()
createInsertMenu クラス内 TextEditorprotected java.awt.Menu createFormatMenu()
createFormatMenu クラス内 TextEditorprotected int getListLevel(ParagraphStyle pStyle)
protected int getListIndent(int listLevel)
protected void setWriteTarget(java.io.File file)
setWriteTarget クラス内 TextEditorprotected void setWriteTarget(java.io.File file,
boolean isObject)
public static void main(java.lang.String[] args)