public class DefaultSwingScriptLoggerArea extends javax.swing.JPanel implements SwingScriptLogger
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected StylableSizableArea |
area
The area.
|
protected javax.swing.JProgressBar |
progressBar
The progress bar. it is null by default.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
CLEAR_KEY, OK_KEY, PRINT_KEY, SEARCH_KEY
Constructor and Description |
---|
DefaultSwingScriptLoggerArea()
Constructor.
|
DefaultSwingScriptLoggerArea(boolean hasProgressBar,
boolean hasTools)
Constructor.
|
DefaultSwingScriptLoggerArea(boolean hasProgressBar,
boolean hasTools,
int rows,
int cols)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptNullObjectLinks(boolean accept)
Specifies if the logger must accept objects which generate null links from
LinkIndexConverter.getLinkFromObject(java.lang.Object) . |
void |
append(java.lang.String text)
Append a line of text in the message area, with a default color.
|
void |
append(java.lang.String txt,
java.lang.String htmlColor)
Append a line of text in the message area, with a specific color.
|
void |
appendError(java.lang.String txt)
Append a line of text in the message area, colored in red (for errors).
|
void |
appendLink(java.lang.String txt,
java.lang.String linkID)
Append a hyperlinked line of text in the message area, with a default color.
|
void |
appendLink(java.lang.String txt,
java.lang.String linkID,
java.lang.String htmlColor)
Append a hyperlinked line of text in the message area, with a specific color.
|
void |
appendLinks(java.lang.String txt,
java.util.List<java.lang.String> linkIDs,
java.lang.String htmlColor)
Append a hyperlinked line of text in the message area, with a specified color.
|
void |
appendObjectLink(HyperlinkElement element)
Append a hyperlinked line of text in the message area, with a default color.
|
void |
appendObjectLink(HyperlinkElement element,
java.lang.String htmlColor)
Append a hyperlinked line of text in the message area, with a specific color.
|
void |
appendObjectLinks(java.lang.String txt,
java.util.List<HyperlinkElement> links,
java.lang.String htmlColor)
Append a hyperlinked line of text in the message area, with a specified color.
|
void |
appendObjectLinks(java.lang.String txt,
java.lang.String htmlColor,
HyperlinkElement... links)
Append a hyperlinked line of text in the message area, with a specified color.
|
void |
clear()
Clear the content of the logger
|
void |
clearTab()
Clear the current value of the tab for the text.
|
protected void |
doPrint()
Print the content of the panel as html.
|
protected void |
doPrintImpl(java.io.File file)
Perform the html printing.
|
ScriptLoggerHyperLinkListener |
getHyperLinkListener()
Return the listener which will be fired when an hyperlink is visited.
|
java.util.List<java.lang.String> |
getLines()
Return the list of currently logger lines.
|
LinkIndexConverter |
getLinkIndexConverter()
Return class which will convert Objects to and from link indexes.
|
protected java.io.File |
getPrintDirectory()
Return the default directory to use for printing the area content.
|
protected java.lang.String |
getTab()
Return the tab.
|
protected void |
initializeHTMLContent(int rows,
int cols)
Initialize the HTML content.
|
protected void |
initializeTextArea()
Initialize the text area.
|
void |
registerHyperLinkListener(ScriptLoggerHyperLinkListener hyperlinkListener)
Set the listener which will be fired when an hyperlink is visited.
|
void |
registerLinkIndexConverter(LinkIndexConverter converter)
Register the class which will convert Objects to and from link indexes.
|
void |
setProgress(float value)
Set the value of the progress bar.
|
void |
setTab(int tabs)
Set the current value for of the tab for the text.
|
protected void |
visitHyperLink(java.lang.String linkDesc)
Visit an hyperlink.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
doGetLabel, getLabel
appendArrayLinks, appendColorArrayLinks, appendError, appendLinks, appendObjectLinks, appendObjectLinks, appendStackTrace, finishedScript
protected javax.swing.JProgressBar progressBar
protected StylableSizableArea area
public DefaultSwingScriptLoggerArea()
public DefaultSwingScriptLoggerArea(boolean hasProgressBar, boolean hasTools)
hasProgressBar
- true if there must be a progress barhasTools
- true if tools must be integrated in the areapublic DefaultSwingScriptLoggerArea(boolean hasProgressBar, boolean hasTools, int rows, int cols)
hasProgressBar
- true if there must be a progress barhasTools
- true if tools must be integrated in the arearows
- the number of rows of the logger areacols
- the number of columns of the logger areapublic void acceptNullObjectLinks(boolean accept)
LinkIndexConverter.getLinkFromObject(java.lang.Object)
.acceptNullObjectLinks
in interface ScriptLogger
accept
- true if the logger must accept objects which generate null linkspublic java.util.List<java.lang.String> getLines()
protected void initializeHTMLContent(int rows, int cols)
rows
- the number of rows of the logger areacols
- the number of columns of the logger areapublic void clear()
clear
in interface ScriptLogger
public void registerLinkIndexConverter(LinkIndexConverter converter)
registerLinkIndexConverter
in interface ScriptLogger
converter
- the link index converterpublic LinkIndexConverter getLinkIndexConverter()
public void registerHyperLinkListener(ScriptLoggerHyperLinkListener hyperlinkListener)
registerHyperLinkListener
in interface ScriptLogger
hyperlinkListener
- the listenerpublic ScriptLoggerHyperLinkListener getHyperLinkListener()
protected void initializeTextArea()
protected void visitHyperLink(java.lang.String linkDesc)
linkDesc
- the hyperlink descriptionpublic void append(java.lang.String text)
append
in interface ScriptLogger
text
- the textpublic void append(java.lang.String txt, java.lang.String htmlColor)
append
in interface ScriptLogger
txt
- the texthtmlColor
- the HTML color to use for the textpublic void appendLink(java.lang.String txt, java.lang.String linkID)
appendLink
in interface ScriptLogger
txt
- the textlinkID
- the hyperlink IDpublic void appendLink(java.lang.String txt, java.lang.String linkID, java.lang.String htmlColor)
appendLink
in interface ScriptLogger
txt
- the textlinkID
- the hyperlink IDhtmlColor
- the HTML color to use for the textpublic void appendLinks(java.lang.String txt, java.util.List<java.lang.String> linkIDs, java.lang.String htmlColor)
appendLinks
in interface ScriptLogger
txt
- the textlinkIDs
- the hyperlinks IDshtmlColor
- the colorpublic void appendObjectLink(HyperlinkElement element)
appendObjectLink
in interface ScriptLogger
element
- the hyperlink elementpublic void appendObjectLink(HyperlinkElement element, java.lang.String htmlColor)
appendObjectLink
in interface ScriptLogger
element
- the hyperlink elementhtmlColor
- the HTML color to use for the textpublic void appendObjectLinks(java.lang.String txt, java.lang.String htmlColor, HyperlinkElement... links)
appendObjectLinks
in interface ScriptLogger
txt
- the textlinks
- the hyperlinks ObjectshtmlColor
- the colorpublic void appendObjectLinks(java.lang.String txt, java.util.List<HyperlinkElement> links, java.lang.String htmlColor)
appendObjectLinks
in interface ScriptLogger
txt
- the textlinks
- the hyperlinks ObjectshtmlColor
- the colorpublic void appendError(java.lang.String txt)
appendError
in interface ScriptLogger
txt
- the textprotected java.lang.String getTab()
public void clearTab()
clearTab
in interface ScriptLogger
public void setTab(int tabs)
tabs
setTab
in interface ScriptLogger
tabs
- the current value for of the tab for the textpublic void setProgress(float value)
setProgress
in interface ScriptLogger
value
- the valueprotected java.io.File getPrintDirectory()
protected void doPrint()
protected void doPrintImpl(java.io.File file) throws java.io.IOException
file
- the file where to put the html contentjava.io.IOException
- if an IOException is thrownCopyright © 2019-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence