public class JGlossEditorKit extends HTMLEditorKit
JGlossEditorKit
is an extension of the
HTMLEditorKit
with several additions to manage the generation,
display and manipulation of JGloss documents. It also has to work around the
shortcomings in the HTML document API. It contains the views for the
annotation elements and its subelements as subclasses, since they share some
view attribute state with the JGlossEditorKit
instance.
The DTD element definition for an annotation element is
(#PCDATA|READING|BASETEXT|TRANSLATION)*
. Additional constraints
which are not enforceable through the DTD but used throughout JGloss are that
each reading element is followed by a kanji element, and there is exactly one
translation element which is the last child of the annotation element.
Modifier and Type | Class and Description |
---|---|
class |
JGlossEditorKit.AnnotationView
A view which renders an annotation.
|
HTMLEditorKit.HTMLFactory, HTMLEditorKit.HTMLTextAction, HTMLEditorKit.InsertHTMLTextAction, HTMLEditorKit.LinkController, HTMLEditorKit.Parser, HTMLEditorKit.ParserCallback
StyledEditorKit.AlignmentAction, StyledEditorKit.BoldAction, StyledEditorKit.FontFamilyAction, StyledEditorKit.FontSizeAction, StyledEditorKit.ForegroundAction, StyledEditorKit.ItalicAction, StyledEditorKit.StyledTextAction, StyledEditorKit.UnderlineAction
DefaultEditorKit.BeepAction, DefaultEditorKit.CopyAction, DefaultEditorKit.CutAction, DefaultEditorKit.DefaultKeyTypedAction, DefaultEditorKit.InsertBreakAction, DefaultEditorKit.InsertContentAction, DefaultEditorKit.InsertTabAction, DefaultEditorKit.PasteAction
BOLD_ACTION, COLOR_ACTION, DEFAULT_CSS, FONT_CHANGE_BIGGER, FONT_CHANGE_SMALLER, IMG_ALIGN_BOTTOM, IMG_ALIGN_MIDDLE, IMG_ALIGN_TOP, IMG_BORDER, ITALIC_ACTION, LOGICAL_STYLE_ACTION, PARA_INDENT_LEFT, PARA_INDENT_RIGHT
backwardAction, beepAction, beginAction, beginLineAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deleteNextWordAction, deletePrevCharAction, deletePrevWordAction, downAction, endAction, endLineAction, EndOfLineStringProperty, endParagraphAction, endWordAction, forwardAction, insertBreakAction, insertContentAction, insertTabAction, nextWordAction, pageDownAction, pageUpAction, pasteAction, previousWordAction, readOnlyAction, selectAllAction, selectionBackwardAction, selectionBeginAction, selectionBeginLineAction, selectionBeginParagraphAction, selectionBeginWordAction, selectionDownAction, selectionEndAction, selectionEndLineAction, selectionEndParagraphAction, selectionEndWordAction, selectionForwardAction, selectionNextWordAction, selectionPreviousWordAction, selectionUpAction, selectLineAction, selectParagraphAction, selectWordAction, upAction, writableAction
Constructor and Description |
---|
JGlossEditorKit(boolean _showReading,
boolean _showTranslation)
Creates a new editor kit for JGloss documents.
|
Modifier and Type | Method and Description |
---|---|
Document |
createDefaultDocument()
Creates a new document.
|
String |
getContentType()
Returns the MIME content type of the JGloss documents.
|
static DTD |
getDTD()
Initializes and returns the DTD used for parsing JGloss documents.
|
HTMLEditorKit.Parser |
getParser()
Returns an HTML parser for loading a document.
|
StyleSheet |
getStyleSheet() |
ViewFactory |
getViewFactory()
Returns the view factory which creates views for a JGloss document.
|
void |
setStyleSheet(StyleSheet _jglossStyleSheet) |
void |
showReading(boolean showReading)
Sets the visibility of reading annotations.
|
void |
showTranslation(boolean showTranslation)
Sets the visibility of translation annotations.
|
clone, createInputAttributes, deinstall, getAccessibleContext, getActions, getDefaultCursor, getInputAttributes, getLinkCursor, insertHTML, install, isAutoFormSubmission, read, setAutoFormSubmission, setDefaultCursor, setLinkCursor, write
getCharacterAttributeRun
createCaret, read, write
public JGlossEditorKit(boolean _showReading, boolean _showTranslation)
compactView
- true
if compact view mode should be used.showReading
- true
if reading annotations should be visible.showTranslation
- true
if translation annotations should be
visible.public void showReading(boolean showReading)
false
, the reading annotations will not be shown and will
not take screen space.showReading
- true
if reading annotations should be shown.public void showTranslation(boolean showTranslation)
false
, the translation annotations will not be shown and
will not take screen space.showTranslation
- true
if translation annotations should be shown.public String getContentType()
getContentType
in class HTMLEditorKit
public HTMLEditorKit.Parser getParser()
JGlossParserWrapper
.getParser
in class HTMLEditorKit
JGlossParserWrapper
.public Document createDefaultDocument()
JGlossDocument
initialized with the text parser
passed to the constructor of this JGlossEditorKit.createDefaultDocument
in class HTMLEditorKit
public ViewFactory getViewFactory()
getViewFactory
in class HTMLEditorKit
public static DTD getDTD()
public void setStyleSheet(StyleSheet _jglossStyleSheet)
setStyleSheet
in class HTMLEditorKit
public StyleSheet getStyleSheet()
getStyleSheet
in class HTMLEditorKit
Copyright © 2001-2013 the JGloss developers. All Rights Reserved.