|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
gr.zeus.ui.JConsole
public final class JConsole
A java console to replace the command line window. Redirects the stdout and stderr. Customizable. Can save its messages to text file. In addition, it can auto dump to a log file and clear the textarea. If used in conjunction with any exe creator for java, e.g: launch4j or JSmooth, it eliminates the dos application windows and your application looks more professional.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
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 |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary | |
---|---|
void |
clearBufferMessages()
Clears all the messages stored in the internal buffer from the begining of the JConsole . |
void |
clearScreenMessages()
Clears only the messages that are displayed in the textarea. |
void |
destroyConsole()
Destroys the console. |
void |
dumpConsole(java.lang.String filename,
boolean append)
Dumps all the console messages (up to now) to a file (not only the messages displayed in the textarea). |
boolean |
getAppendFirstTime()
Gets append policy. |
boolean |
getAutoSave()
Gets auto save status. |
java.awt.Color |
getBackgroundColor()
Gets the background color of the textarea. |
java.lang.String |
getClearButtonText()
Gets the text of the clear button. |
java.lang.String |
getCloseButtonText()
Gets the text of the close button. |
java.lang.String |
getConfimMessage()
Gets the text for the popup window that confirms file overwrite. |
java.lang.String |
getConfimTitle()
Gets the title for the popup window that confirms file overwrite. |
static JConsole |
getConsole()
Singleton constructor. |
java.lang.String |
getFilechooserApproveButtonText()
Gets the filechooser approve button text. |
java.lang.String |
getFilechooserTitle()
Gets the filechooser title. |
java.awt.Color |
getForegroundColor()
Gets the foreground color of the textarea. |
int |
getMaxChars()
If -1 no limit, else the messages will be flushed to 'traceFilename' and cleared when this limit is reached. |
java.lang.String |
getMessagesFilename()
Gets the default filename for the filechooser. |
java.lang.String |
getSaveButtonText()
Gets the text of the save button. |
java.awt.Color |
getSelectedTextColor()
Gets the selected text color of the textarea. |
java.awt.Color |
getSelectionColor()
Gets the selection color of the textarea. |
java.awt.Font |
getTextFont()
Gets the font of the textarea. |
java.lang.String |
getTitleText()
Gets the title for JConsole 's frame. |
java.lang.String |
getTraceFilename()
Gets the file used by dumpConsole() and
all auto save methods. |
void |
hideConsole()
Hides the console. |
void |
setAppendFirstTime(boolean b)
Sets append policy. |
void |
setAutoSave(boolean b)
Sets auto save status. |
void |
setBackgroundColor(java.awt.Color c)
Sets the background color of the textarea. |
void |
setClearButtonText(java.lang.String s)
Sets the text of the clear button. |
void |
setCloseButtonText(java.lang.String s)
Sets the text of the close button. |
void |
setConfimMessage(java.lang.String s)
Sets the text for the popup window that confirms file overwrite. |
void |
setConfimTitle(java.lang.String s)
Sets the title for the popup window that confirms file overwrite. |
void |
setFilechooserApproveButtonText(java.lang.String s)
Sets the filechooser approve button text. |
void |
setFilechooserTitle(java.lang.String s)
Sets the filechooser title. |
void |
setForegroundColor(java.awt.Color c)
Sets the foreground color of the textarea. |
void |
setMaxChars(int i)
If -1 no limit, else the messages will be flushed to 'traceFilename' and cleared when this limit is reached. |
void |
setMessagesFilename(java.lang.String s)
Sets the default filename for the filechooser. |
void |
setSaveButtonText(java.lang.String s)
Sets the text of the save button. |
void |
setSelectedTextColor(java.awt.Color c)
Sets the selected text color of the textarea. |
void |
setSelectionColor(java.awt.Color c)
Sets the selection color of the textarea. |
void |
setTextFont(java.awt.Font f)
Sets the font of the textarea. |
void |
setTitleText(java.lang.String s)
Sets the title for JConsole 's frame. |
void |
setTraceFilename(java.lang.String s)
Sets the file used by dumpConsole() and
all auto save methods. |
void |
showConsole()
Shows the console. |
void |
startConsole()
Attachs the new streams to stdout and stderr. |
void |
stopConsole()
Attachs the original streams to stdout and stderr. |
void |
updateLNF()
Updates the look and feel of the JConsole and it's
components. |
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
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, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, 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, isOpaque, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Method Detail |
---|
public static JConsole getConsole()
JConsole
.public void startConsole()
public void stopConsole()
public void showConsole()
public void hideConsole()
public void clearBufferMessages()
JConsole
. Use this if you have printed too many
messages and you want to free up the memory used. Perhaps you should
invoke dumpConsole()
to store the messages first, unless
of course you already have enabled autosave.
public void clearScreenMessages()
public void dumpConsole(java.lang.String filename, boolean append)
clearBufferMessages()
for this.
filename
- The filename to store all console's messages.append
- If true
text is appended in the file,
else the file gets overwritten.public void destroyConsole()
getConsole()
after this
method you will get a brand new console with no messages at all. This
method is not needed for simple applications that are about to invoke
System.exit() or normaly close.
public void updateLNF()
JConsole
and it's
components. MUST be called AFTER invoking:
UIManager.setLookAndFeel()
in your application.
public java.lang.String getConfimTitle()
public void setConfimTitle(java.lang.String s)
s
- The title.public java.lang.String getConfimMessage()
public void setConfimMessage(java.lang.String s)
s
- The message.public java.lang.String getMessagesFilename()
public void setMessagesFilename(java.lang.String s)
s
- The filename.public java.lang.String getTraceFilename()
dumpConsole()
and
all auto save methods.
public void setTraceFilename(java.lang.String s)
dumpConsole()
and
all auto save methods.
s
- The filename.public boolean getAppendFirstTime()
public void setAppendFirstTime(boolean b)
b
- true/falsepublic boolean getAutoSave()
public void setAutoSave(boolean b)
b
- true/falsepublic int getMaxChars()
public void setMaxChars(int i)
i
- The limit.public java.lang.String getTitleText()
JConsole
's frame.
public void setTitleText(java.lang.String s)
JConsole
's frame.
s
- The title.public java.awt.Color getForegroundColor()
public void setForegroundColor(java.awt.Color c)
c
- The color.public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color c)
c
- The color.public java.awt.Color getSelectedTextColor()
public void setSelectedTextColor(java.awt.Color c)
c
- The color.public java.awt.Color getSelectionColor()
public void setSelectionColor(java.awt.Color c)
c
- The color.public java.lang.String getClearButtonText()
public void setClearButtonText(java.lang.String s)
s
- The text.public java.lang.String getSaveButtonText()
public void setSaveButtonText(java.lang.String s)
s
- The text.public java.lang.String getCloseButtonText()
public void setCloseButtonText(java.lang.String s)
s
- The text.public java.lang.String getFilechooserTitle()
public void setFilechooserTitle(java.lang.String s)
s
- The title.public java.lang.String getFilechooserApproveButtonText()
public void setFilechooserApproveButtonText(java.lang.String s)
s
- The text.public java.awt.Font getTextFont()
public void setTextFont(java.awt.Font f)
f
- The font.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |