public abstract class AbstractSwingScriptLogger extends javax.swing.JFrame implements SwingScriptLogger
javax.swing.JFrame.AccessibleJFrame
java.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, rootPaneCheckingEnabled
CROSSHAIR_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_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
CLEAR_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.
|
protected java.lang.String |
getTab()
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 |
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 |
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.
|
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, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, 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, toFront
add, 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, validateTree
action, 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, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
doGetLabel, getLabel
appendError, appendLinks, appendObjectLinks, appendStackTrace, finishedScript
protected 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 registerLinkIndexConverter(LinkIndexConverter converter)
registerLinkIndexConverter
in interface ScriptLogger
converter
- the link index converterpublic LinkIndexConverter getLinkIndexConverter()
public 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 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 java.util.List<java.lang.String> getLines()
protected void initializeHTMLContent()
public void clear()
clear
in interface ScriptLogger
public 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 appendObjectLink(HyperlinkElement element)
appendObjectLink
in interface ScriptLogger
element
- the hyperlink elementpublic 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 appendObjectLink(HyperlinkElement element, java.lang.String htmlColor)
appendObjectLink
in interface ScriptLogger
element
- the hyperlink elementhtmlColor
- the HTML color to use for the textpublic void appendArrayLinks(java.lang.String txt, java.lang.String... linkIDs)
appendArrayLinks
in interface ScriptLogger
txt
- 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 ScriptLogger
txt
- the textlinkIDs
- the hyperlinks IDshtmlColor
- the colorpublic void appendColorArrayLinks(java.lang.String txt, java.lang.String htmlColor, java.lang.String... linkIDs)
appendColorArrayLinks
in interface ScriptLogger
txt
- the texthtmlColor
- the html colorlinkIDs
- the hyperlinks IDspublic void appendObjectLinks(java.lang.String txt, HyperlinkElement... links)
appendObjectLinks
in interface ScriptLogger
txt
- the textlinks
- the hyperlinks Objectspublic 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 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-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence