|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.text.JTextComponent | +--javax.swing.JEditorPane | +--javax.swing.JTextPane | +--com.instantbank.lettertemplate.editor.applet.TemplateEditor.ComponentEditor
Actual Editor for the template's components. One instance of this class is needed for each template's component. It provides the required edition services.
Inner Class Summary | |
(package private) class |
TemplateEditor.ComponentEditor.DocumentChange
Signals changes occurred to the document under this editor, setting the hasChanged attribute of the corresponding component. |
(package private) class |
TemplateEditor.ComponentEditor.VariableInsertAction
Implements variable insertion at caret position, via right mouse click and if there is a selected leaf in the tree of variables. |
Inner classes inherited from class javax.swing.JEditorPane |
javax.swing.JEditorPane.AccessibleJEditorPane, javax.swing.JEditorPane.AccessibleJEditorPaneHTML, javax.swing.JEditorPane.HeaderParser, javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport, javax.swing.JEditorPane.PageLoader, javax.swing.JEditorPane.PlainEditorKit |
Inner classes inherited from class javax.swing.text.JTextComponent |
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.ClipboardObserver, javax.swing.text.JTextComponent.ComposedTextCaret, javax.swing.text.JTextComponent.DefaultKeymap, javax.swing.text.JTextComponent.InputMethodRequestsHandler, javax.swing.text.JTextComponent.KeyBinding, javax.swing.text.JTextComponent.KeymapActionMap, javax.swing.text.JTextComponent.KeymapWrapper, javax.swing.text.JTextComponent.MutableCaretEvent |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent, javax.swing.JComponent.ActionStandin, javax.swing.JComponent.IntVector, javax.swing.JComponent.KeyboardState |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Field Summary | |
(package private) int |
componentType
Type of LetterComponent edited by this editor. |
protected javax.swing.text.StyleContext |
context
Context manager for the Elements' attributes. |
protected javax.swing.text.DefaultStyledDocument |
doc
Document model for this editor. |
protected javax.swing.text.rtf.RTFEditorKit |
kit
Editor "kit" for this editor. |
protected int |
xFinish
Final point of the current selection. |
protected int |
xStart
Starting point of the current selection. |
Fields inherited from class javax.swing.JTextPane |
uiClassID |
Fields inherited from class javax.swing.JEditorPane |
kitLoaderRegistryKey, kitRegistryKey, kitTypeRegistryKey, managingFocus, pageProperties, typeHandlers |
Fields inherited from class javax.swing.text.JTextComponent |
canAccessSystemClipboard, caret, caretColor, caretEvent, composedText, composedTextCaret, composedTextContent, composedTextEnd, composedTextStart, DEFAULT_KEYMAP, defaultClipboardOwner, disabledTextColor, editable, editor, FOCUS_ACCELERATOR_KEY, focusAccelerator, focusedComponent, highlighter, inputMethodRequestsHandler, keymap, keymapTable, margin, model, needToSendKeyTypedEvent, originalCaret, SandboxClipboardKey, selectedTextColor, selectionColor |
Fields inherited from class javax.swing.JComponent |
_bounds, accessibleContext, actionMap, ACTIONMAP_CREATED, alignmentX, alignmentY, ANCESTOR_INPUTMAP_CREATED, ANCESTOR_USING_BUFFER, ancestorInputMap, ancestorNotifier, autoscroller, border, changeSupport, clientProperties, CREATED_DOUBLE_BUFFER, flags, FOCUS_INPUTMAP_CREATED, focusInputMap, HAS_FOCUS, htmlKey, htmlView, inputVerifier, IS_DOUBLE_BUFFERED, IS_OPAQUE, IS_PAINTING_TILE, IS_PRINTING, IS_PRINTING_ALL, KEY_EVENTS_ENABLED, KEYBOARD_BINDINGS_KEY, listenerList, maximumSize, minimumSize, NEXT_FOCUS, paintImmediatelyClip, paintingChild, preferredSize, readObjectCallbacks, REQUEST_FOCUS_DISABLED, tmpRect, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, verifyInputWhenFocusTarget, vetoableChangeSupport, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, WHEN_IN_FOCUSED_WINDOW_BINDINGS, WIF_INPUTMAP_CREATED, windowInputMap |
Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads, serialVersionUID |
Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
(package private) |
TemplateEditor.ComponentEditor(int type)
Constructor for the ComponentEditor object |
Method Summary | |
private java.lang.String |
buildGuiVarName(java.lang.Long varCode,
java.lang.Long delta)
Delivers the name for a Date variable as shown in the user iterface. |
void |
clean()
Removes the text displayed by this ComponentEditor. |
javax.swing.text.DefaultStyledDocument |
cloneDoc()
Calculates a clone of the editor's doc where variables are substituted by a "varChar" and a suitable VARCODE attribute. |
void |
copyWithAttr()
Copy the selected text --with attributes-- to the local clipboard . |
void |
cutWithAttr()
Cut the selected text and copy it --with attributes-- to the local clipboard . |
private java.lang.Long |
deltaDialog(java.lang.Long varCode,
java.lang.String offsetType)
Captures the value of an offset to be applied to a date, measured in days. |
void |
displayImage(int pos,
byte[] image)
Displays an image inside this ComponentEditor |
void |
displayLetterComponent(LetterComponent comp)
Shows the content of a LetterComponent in the text area of this ComponentEditor. |
void |
displayVariable(int pos,
java.util.ArrayList slot)
Displays a variable inside this ComponentEditor. |
void |
echoVars(java.util.ArrayList trace)
Debug method. |
void |
echoVarsImages()
Debug method, it echoes the trace of images and variables contained in the document. |
void |
fillLetterComponent(LetterComponent comp)
Fills a letter component with the status of this ComponentEditor: the text, images and variables. |
void |
initSelection()
Establishes an initial --void-- selection of the text displayed by this ComponentEditor. |
void |
insertImage(int pos,
byte[] image)
Inserts an image at the specified position inside this ComponentEditor. |
void |
insertVariable(int pos,
java.lang.Long varCode,
java.lang.Long varFormat,
java.lang.Long delta)
Inserts a variable at a position in the document. |
void |
pasteWithAttr()
Paste the local clipboard text --with attributes--
to the selected region. |
protected void |
setAttributeSet(javax.swing.text.AttributeSet attr)
Sets the attributes for the selected portion of the text. |
void |
setupKeymap()
Sets up the keymap in order to capture Ctrl-C, Ctrl-X and Ctr-V keystrokes and make copy-cut-paste with attributes. |
protected void |
setVarFormatAttribute(java.lang.Long format)
Sets the variable format attribute for the character at the start of the selected region. |
protected void |
showAttributes(int p)
Updates the display of the attributes of the selected component on the corresponding controls. |
java.lang.String |
toRtfString()
Calculates the RTF representation of the text contained in this editor's document . |
java.lang.String |
toRtfString(javax.swing.text.DefaultStyledDocument doc)
Calculates the RTF representation of a document. |
java.util.ArrayList |
traceImages()
Calculates a trace of the images in the document tied to this ComponentEditor. |
java.util.ArrayList |
traceImages(javax.swing.text.DefaultStyledDocument doc)
Calculates a trace of the images in a document. |
java.util.ArrayList |
traceVariables()
Calculates a trace of the variables in a 'clone' of this.document. |
java.util.ArrayList |
traceVariables(javax.swing.text.DefaultStyledDocument doc)
Calculates a trace of the variables in a 'cloned' document. |
java.lang.String |
whoAmI()
Debug method that identifies this ComponentEditor among the three possibilities: header, body, closing. |
Methods inherited from class javax.swing.JTextPane |
addStyle, createDefaultEditorKit, getCharacterAttributes, getInputAttributes, getLogicalStyle, getParagraphAttributes, getStyle, getStyledDocument, getStyledEditorKit, getUIClassID, insertComponent, insertIcon, paramString, removeStyle, replaceSelection, setCharacterAttributes, setDocument, setEditorKit, setLogicalStyle, setParagraphAttributes, setStyledDocument, writeObject |
Methods inherited from class javax.swing.JEditorPane |
|
Methods inherited from class javax.swing.text.JTextComponent |
addCaretListener, addInputMethodListener, addKeymap, canAccessSystemClipboard, copy, createComposedString, cut, exchangeCaret, fireCaretUpdate, getActions, getCaret, getCaretColor, getCaretPosition, getClipboard, getDisabledTextColor, getDocument, getFocusAccelerator, getFocusedComponent, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getUI, isEditable, isFocusTraversable, isProcessInputMethodEventOverridden, loadKeymap, mapCommittedTextToAction, modelToView, moveCaretPosition, paste, processInputMethodEvent, read, readObject, removeCaretListener, removeKeymap, removeNotify, replaceInputMethodText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setDisabledTextColor, setEditable, setFocusAccelerator, setHighlighter, setInputMethodCaretPosition, setKeymap, setMargin, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateInputMap, updateUI, viewToModel, write |
Methods inherited from class javax.swing.JComponent |
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, adjustPaintFlags, alwaysOnTop, checkIfChildObscuredBySibling, clearFocusOwners, componentInputMapChanged, computeVisibleRect, computeVisibleRect, compWriteObjectNotify, contains, createToolTip, disable, enable, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperties, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getCreatedDoubleBuffer, getDebugGraphicsOptions, getFlag, getGraphics, getHeight, getInputMap, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isLightweightComponent, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paintWithBuffer, print, printAll, printBorder, printChildren, printComponent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processMouseMotionEvent, putClientProperty, rectangleIsObscured, rectangleIsObscuredBySibling, registerKeyboardAction, registerKeyboardAction, registerWithKeyboardManager, registerWithKeyboardManager, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setCreatedDoubleBuffer, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFlag, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, unregisterWithKeyboardManager, unregisterWithKeyboardManager, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMouseEventTarget, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFocusOwner, setLayout, transferFocus, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, constructComponentName, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getLocale, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, getWindowForObject, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resetGC, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
protected javax.swing.text.StyleContext context
protected javax.swing.text.DefaultStyledDocument doc
protected javax.swing.text.rtf.RTFEditorKit kit
protected int xStart
protected int xFinish
int componentType
Constructor Detail |
TemplateEditor.ComponentEditor(int type)
type
- Print type of the component: Laser, typewritter.Method Detail |
private java.lang.Long deltaDialog(java.lang.Long varCode, java.lang.String offsetType)
varCode
- Code of the date variable.offsetType
- "workable" or "chronological".public void insertVariable(int pos, java.lang.Long varCode, java.lang.Long varFormat, java.lang.Long delta)
pos
- Position of the variablevarCode
- Code of the inserted variablevarFormat
- Printing format when the variable is substituted
for an actual value.delta
- Date offset (in days) for the variable. Makes sense only
if the variable is of Date type.private java.lang.String buildGuiVarName(java.lang.Long varCode, java.lang.Long delta)
varCode
- Variable's code.delta
- The date offset in days (workable or chronological).public void insertImage(int pos, byte[] image)
pos
- Position in the textimage
- Raw bytes of the imagepublic void setupKeymap()
public java.lang.String toRtfString(javax.swing.text.DefaultStyledDocument doc)
doc
- The document the RTF representations is calculated for.public java.lang.String toRtfString()
document
.public void copyWithAttr()
local clipboard
.public void cutWithAttr()
local clipboard
.public void pasteWithAttr()
local clipboard
text --with attributes--
to the selected region.public javax.swing.text.DefaultStyledDocument cloneDoc()
public java.util.ArrayList traceVariables()
cloneDoc()
method.public java.util.ArrayList traceVariables(javax.swing.text.DefaultStyledDocument doc)
doc
- The cloned document that contains the variables. See cloneDoc
method.public java.util.ArrayList traceImages()
ICONBYTES
attribute that was inserted whith the image.public java.util.ArrayList traceImages(javax.swing.text.DefaultStyledDocument doc)
doc
- The document the trace of images is calculated for.ICONBYTES
attribute that was inserted whith the image which currently is an
array with the raw bytes of the image.public void echoVarsImages()
public void echoVars(java.util.ArrayList trace)
trace
- The set of variables to be shown.public void fillLetterComponent(LetterComponent comp)
comp
- The Letter Component to be filled.public void displayLetterComponent(LetterComponent comp)
comp
- The component to be displayed.public void displayImage(int pos, byte[] image)
pos
- Position for insertion.image
- The image to be displayedpublic void displayVariable(int pos, java.util.ArrayList slot)
pos
- Variable's position in the componentslot
- Variable's < --, code, format, delta>public void clean()
public void initSelection()
xStart
and
xFinish
.protected void showAttributes(int p)
p
- Position in the document.protected void setAttributeSet(javax.swing.text.AttributeSet attr)
attr
- The values of the attributesprotected void setVarFormatAttribute(java.lang.Long format)
format
- Code of the variable format.public java.lang.String whoAmI()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |