public abstract class AbstractSwingScriptLogger extends javax.swing.JFrame implements SwingScriptLogger
javax.swing.JFrame.AccessibleJFramejava.awt.Window.AccessibleAWTWindow, java.awt.Window.Type| Modifier and Type | Field and Description |
|---|---|
protected StylableSizableArea |
area
The area.
|
protected javax.swing.JProgressBar |
progressBar
The progress bar. it is null by default.
|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabledCROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTCLEAR_KEY, OK_KEY, PRINT_KEY, SEARCH_KEY| Constructor and Description |
|---|
AbstractSwingScriptLogger()
Constructor.
|
AbstractSwingScriptLogger(boolean hasProgressBar)
Constructor.
|
AbstractSwingScriptLogger(java.lang.String title)
Constructor.
|
AbstractSwingScriptLogger(java.lang.String title,
boolean hasProgressBar)
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 |
appendArrayLinks(java.lang.String txt,
java.lang.String... linkIDs)
Append a hyperlinked line of text in the message area, with a default color.
|
void |
appendColorArrayLinks(java.lang.String txt,
java.lang.String htmlColor,
java.lang.String... linkIDs)
Append a hyperlinked line of text in the message area, with a default 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,
HyperlinkElement... links)
Append a hyperlinked line of text in the message area, with a specified 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 javax.swing.JPanel |
createYesNoPanel()
Create a Panel with a OK and a print buttons.
|
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.
|
java.lang.String |
getTab()
Return the tab that can be usage for a text content.
|
protected java.lang.String |
getTabImpl()
Return the tab.
|
protected abstract void |
init()
Initialize the logger.
|
protected void |
initializeHTMLContent()
Initialize the HTML content.
|
protected void |
initializeTextArea()
Initialize the text area.
|
void |
newLine()
Append a new line.
|
void |
registerHyperLinkListener(ScriptLoggerHyperLinkListener hyperlinkListener)
Register 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 |
setLoggerTitle(java.lang.String title)
Set the title of the logger area.
|
void |
setProgress(float value)
Set the value of the progress bar.
|
void |
setStatusMessage(java.lang.String message)
Set the message of the logger status 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.
|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFrontadd, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdoGetLabel, getLabelappendError, appendLinks, appendObjectLinks, appendStackTrace, finishedScriptprotected StylableSizableArea area
protected javax.swing.JProgressBar progressBar
public AbstractSwingScriptLogger()
public AbstractSwingScriptLogger(java.lang.String title)
title - the window titlepublic AbstractSwingScriptLogger(boolean hasProgressBar)
hasProgressBar - true if there must be a progress barpublic AbstractSwingScriptLogger(java.lang.String title,
boolean hasProgressBar)
title - the window titlehasProgressBar - true if there must be a progress barprotected abstract void init()
public void setLoggerTitle(java.lang.String title)
setLoggerTitle in interface ScriptLoggertitle - the titlepublic void setStatusMessage(java.lang.String message)
setStatusMessage in interface ScriptLoggermessage - the messagepublic void registerLinkIndexConverter(LinkIndexConverter converter)
registerLinkIndexConverter in interface ScriptLoggerconverter - the link index converterpublic LinkIndexConverter getLinkIndexConverter()
public void acceptNullObjectLinks(boolean accept)
LinkIndexConverter.getLinkFromObject(java.lang.Object).acceptNullObjectLinks in interface ScriptLoggeraccept - true if the logger must accept objects which generate null linkspublic void registerHyperLinkListener(ScriptLoggerHyperLinkListener hyperlinkListener)
registerHyperLinkListener in interface ScriptLoggerhyperlinkListener - the listenerpublic ScriptLoggerHyperLinkListener getHyperLinkListener()
protected void initializeTextArea()
protected void visitHyperLink(java.lang.String linkDesc)
linkDesc - the hyperlink descriptionpublic java.util.List<java.lang.String> getLines()
protected void initializeHTMLContent()
public void clear()
clear in interface ScriptLoggerpublic void newLine()
newLine in interface ScriptLoggerpublic void append(java.lang.String text)
append in interface ScriptLoggertext - the textpublic void append(java.lang.String txt,
java.lang.String htmlColor)
append in interface ScriptLoggertxt - the texthtmlColor - the HTML color to use for the textpublic void appendLink(java.lang.String txt,
java.lang.String linkID)
appendLink in interface ScriptLoggertxt - the textlinkID - the hyperlink IDpublic void appendObjectLink(HyperlinkElement element)
appendObjectLink in interface ScriptLoggerelement - the hyperlink elementpublic void appendLink(java.lang.String txt,
java.lang.String linkID,
java.lang.String htmlColor)
appendLink in interface ScriptLoggertxt - the textlinkID - the hyperlink IDhtmlColor - the HTML color to use for the textpublic void appendObjectLink(HyperlinkElement element, java.lang.String htmlColor)
appendObjectLink in interface ScriptLoggerelement - the hyperlink elementhtmlColor - the HTML color to use for the textpublic void appendArrayLinks(java.lang.String txt,
java.lang.String... linkIDs)
appendArrayLinks in interface ScriptLoggertxt - the textlinkIDs - the hyperlinks IDspublic void appendLinks(java.lang.String txt,
java.util.List<java.lang.String> linkIDs,
java.lang.String htmlColor)
appendLinks in interface ScriptLoggertxt - the textlinkIDs - the hyperlinks IDshtmlColor - the colorpublic void appendColorArrayLinks(java.lang.String txt,
java.lang.String htmlColor,
java.lang.String... linkIDs)
appendColorArrayLinks in interface ScriptLoggertxt - the texthtmlColor - the html colorlinkIDs - the hyperlinks IDspublic void appendObjectLinks(java.lang.String txt,
HyperlinkElement... links)
appendObjectLinks in interface ScriptLoggertxt - the textlinks - the hyperlinks Objectspublic void appendObjectLinks(java.lang.String txt,
java.lang.String htmlColor,
HyperlinkElement... links)
appendObjectLinks in interface ScriptLoggertxt - 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 ScriptLoggertxt - the textlinks - the hyperlinks ObjectshtmlColor - the colorpublic void appendError(java.lang.String txt)
appendError in interface ScriptLoggertxt - the textprotected java.lang.String getTabImpl()
public java.lang.String getTab()
getTab in interface ScriptLoggerpublic void clearTab()
clearTab in interface ScriptLoggerpublic void setTab(int tabs)
tabssetTab in interface ScriptLoggertabs - the current value for of the tab for the textpublic void setProgress(float value)
setProgress in interface ScriptLoggervalue - the valueprotected javax.swing.JPanel createYesNoPanel()
protected 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-2025 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence