Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.relayirc.swingui
Class ChatApp  view ChatApp download ChatApp.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended byorg.relayirc.swingui.ChatApp
All Implemented Interfaces:
javax.accessibility.Accessible, org.relayirc.chatengine.ChatEngineListener, org.relayirc.chatengine.IChatApp, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class ChatApp
extends javax.swing.JFrame
implements org.relayirc.chatengine.IChatApp, org.relayirc.chatengine.ChatEngineListener

Main class of the Relay-JFC chat application.


Nested Class Summary
private  class ChatApp._AboutAction
           
private  class ChatApp._CascadeAction
           
private  class ChatApp._ConnectAction
           
private  class ChatApp._DisconnectAction
           
private  class ChatApp._ExitAction
           
private  class ChatApp._JoinAction
           
private  class ChatApp._ListAction
           
private  class ChatApp._MenuBar
           
private  class ChatApp._ServerListAction
           
private  class ChatApp._SetupAction
           
private  class ChatApp._StyleContext
           
private  class ChatApp._TileHAction
           
private  class ChatApp._TileVAction
           
private  class ChatApp._ToolBar
           
 
Nested classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  ChatApp._AboutAction _aboutAction
           
private static java.lang.String _appname
           
private static java.lang.String _appversion
           
private  ChatApp._CascadeAction _cascadeAction
           
private static ChatApp _chatApp
           
private  ChatApp._ConnectAction _connectAction
           
private  ChatConsole _console
           
private  ChatApp._DisconnectAction _disconnectAction
           
private  boolean _dockConsole
           
protected  org.relayirc.chatengine.IChatEngine _engine
           
private  ChatApp._ExitAction _exitAction
           
private  FavoritesFrame _favorites
           
private  java.util.Hashtable _framesByPanel
           
private  ChatApp._JoinAction _joinAction
           
private  ChatApp._ListAction _listAction
           
private  org.relayirc.swingutil.MDIPanel _mdiPanel
           
private  ChatApp._MenuBar _menubar
           
private  org.relayirc.chatengine.ChatOptions _options
           
private  ChatApp._ServerListAction _serverListAction
           
private  ChatApp._SetupAction _setupAction
           
private  org.relayirc.swingutil.StatusBar _statusBar
           
private  boolean _statusBarEnabled
           
private static ChatApp._StyleContext _styles
           
private  ChatApp._TileHAction _tilehAction
           
private  ChatApp._TileVAction _tilevAction
           
private  ChatApp._ToolBar _toolbar
           
private  javax.swing.JSplitPane _vertSplitter
           
static javax.swing.ImageIcon aboutIcon
           
static javax.swing.ImageIcon addIcon
           
static javax.swing.ImageIcon cancelIcon
           
static javax.swing.ImageIcon channelIcon
           
static javax.swing.ImageIcon closedFolderIcon
           
static javax.swing.ImageIcon colorsIcon
           
static javax.swing.ImageIcon connectIcon
           
static javax.swing.ImageIcon disconnectIcon
           
static javax.swing.ImageIcon favoriteIcon
           
static javax.swing.ImageIcon fontIcon
           
static javax.swing.ImageIcon helpIcon
           
static javax.swing.ImageIcon joinChannelIcon
           
static javax.swing.ImageIcon okIcon
           
static javax.swing.ImageIcon openFolderIcon
           
static javax.swing.ImageIcon removeIcon
           
static javax.swing.ImageIcon saveIcon
           
static javax.swing.ImageIcon searchIcon
           
static javax.swing.ImageIcon serverIcon
           
static javax.swing.ImageIcon setupIcon
           
static javax.swing.ImageIcon tileCascadeIcon
           
static javax.swing.ImageIcon tileHorizontalIcon
           
static javax.swing.ImageIcon tileVerticalIcon
           
static javax.swing.ImageIcon userIcon
           
 
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.Window
 
Fields inherited from class java.awt.Container
 
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
 
Constructor Summary
ChatApp()
          Construct a chat application.
 
Method Summary
 void cascade()
          Arrange windows in cascade formation.
 void closeApp()
          Disconnect from the IRC server, save options and exit applicatin.
 void connect()
          Present connection dialog to user and allow connection.
 void connect(org.relayirc.chatengine.Server server)
          Connect to the specified chat server.
private  void createActions()
           
private  void createIcons()
           
 void display(java.lang.String str)
          Display text on the main console.
 void dock(org.relayirc.swingutil.MDIClientPanel panel)
          To dock/undock a MDIClientPanel, first set the panel's dock state then call this function to register that dock state.
 java.lang.String getAppName()
          Returns the name of the chat application.
 java.lang.String getAppVersion()
          Returns the version of the chat application.
static ChatApp getChatApp()
          Returns the one-and-only chat application object (a singleton).
static javax.swing.text.Style getChatStyle(java.lang.String st)
           
 org.relayirc.chatengine.IChatEngine getEngine()
          Get application's chat engine
 org.relayirc.chatengine.ChatOptions getOptions()
          Get application's options
 void initGUI()
           
 void layoutGUI()
           
 void listChannels()
           
 void loadLookAndFeel(java.lang.String name)
          Load a Swing pluggable look and feel specified by name
static void main(java.lang.String[] args)
          Main method for the Relay-JFC chat application.
 void onChannelJoin(org.relayirc.chatengine.ChatEngineEvent event)
          Create channel window for this new channel
 void onChannelPart(org.relayirc.chatengine.ChatEngineEvent event)
          Does nothing as channel objects take care of parting.
 void onConnection(org.relayirc.chatengine.ChatEngineEvent event)
          Engine has connected to IRC server.
 void onDisconnection(org.relayirc.chatengine.ChatEngineEvent event)
          Engine has disconnected from IRC server.
 void onStatus(org.relayirc.chatengine.ChatEngineEvent event)
          Status message from engine.
 void removeChatPanel(ChatChannelPanel panel)
           
 void run()
          The main application thread, for internal use only.
static void setChatFont(java.awt.Font font)
           
 void setEngine(org.relayirc.chatengine.IChatEngine eng)
           
 void setShowConsole(boolean show)
           
 void setStatusBarEnabled(boolean flag)
           
 void showJoinChannelDlg()
           
 void showServerListDlg()
           
 void shutdown()
           
 void tileHorizontal()
           
 void tileVertical()
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getPreferredSize, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, 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, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

_chatApp

private static ChatApp _chatApp

_appname

private static final java.lang.String _appname
See Also:
Constant Field Values

_appversion

private static final java.lang.String _appversion
See Also:
Constant Field Values

_styles

private static ChatApp._StyleContext _styles

_engine

protected org.relayirc.chatengine.IChatEngine _engine

_options

private org.relayirc.chatengine.ChatOptions _options

_mdiPanel

private org.relayirc.swingutil.MDIPanel _mdiPanel

_framesByPanel

private java.util.Hashtable _framesByPanel

_vertSplitter

private javax.swing.JSplitPane _vertSplitter

_console

private ChatConsole _console

_favorites

private FavoritesFrame _favorites

_dockConsole

private boolean _dockConsole

_menubar

private ChatApp._MenuBar _menubar

_toolbar

private ChatApp._ToolBar _toolbar

_statusBar

private org.relayirc.swingutil.StatusBar _statusBar

_statusBarEnabled

private boolean _statusBarEnabled

_connectAction

private ChatApp._ConnectAction _connectAction

_disconnectAction

private ChatApp._DisconnectAction _disconnectAction

_setupAction

private ChatApp._SetupAction _setupAction

_joinAction

private ChatApp._JoinAction _joinAction

_exitAction

private ChatApp._ExitAction _exitAction

_cascadeAction

private ChatApp._CascadeAction _cascadeAction

_tilehAction

private ChatApp._TileHAction _tilehAction

_tilevAction

private ChatApp._TileVAction _tilevAction

_aboutAction

private ChatApp._AboutAction _aboutAction

_listAction

private ChatApp._ListAction _listAction

_serverListAction

private ChatApp._ServerListAction _serverListAction

addIcon

public static javax.swing.ImageIcon addIcon

aboutIcon

public static javax.swing.ImageIcon aboutIcon

cancelIcon

public static javax.swing.ImageIcon cancelIcon

channelIcon

public static javax.swing.ImageIcon channelIcon

closedFolderIcon

public static javax.swing.ImageIcon closedFolderIcon

colorsIcon

public static javax.swing.ImageIcon colorsIcon

connectIcon

public static javax.swing.ImageIcon connectIcon

disconnectIcon

public static javax.swing.ImageIcon disconnectIcon

favoriteIcon

public static javax.swing.ImageIcon favoriteIcon

fontIcon

public static javax.swing.ImageIcon fontIcon

helpIcon

public static javax.swing.ImageIcon helpIcon

joinChannelIcon

public static javax.swing.ImageIcon joinChannelIcon

okIcon

public static javax.swing.ImageIcon okIcon

openFolderIcon

public static javax.swing.ImageIcon openFolderIcon

setupIcon

public static javax.swing.ImageIcon setupIcon

removeIcon

public static javax.swing.ImageIcon removeIcon

saveIcon

public static javax.swing.ImageIcon saveIcon

searchIcon

public static javax.swing.ImageIcon searchIcon

tileHorizontalIcon

public static javax.swing.ImageIcon tileHorizontalIcon

tileVerticalIcon

public static javax.swing.ImageIcon tileVerticalIcon

tileCascadeIcon

public static javax.swing.ImageIcon tileCascadeIcon

userIcon

public static javax.swing.ImageIcon userIcon

serverIcon

public static javax.swing.ImageIcon serverIcon
Constructor Detail

ChatApp

public ChatApp()
Construct a chat application.

Method Detail

main

public static void main(java.lang.String[] args)
Main method for the Relay-JFC chat application.


run

public void run()
The main application thread, for internal use only.


cascade

public void cascade()
Arrange windows in cascade formation.


closeApp

public void closeApp()
Disconnect from the IRC server, save options and exit applicatin.


connect

public void connect(org.relayirc.chatengine.Server server)
Connect to the specified chat server. If already connected to that then say so and do nothing. If already connected to a different prompt user if it is OK to disconnect and reconnect to the specified server.


connect

public void connect()
Present connection dialog to user and allow connection.


createActions

private void createActions()

createIcons

private void createIcons()

display

public void display(java.lang.String str)
Display text on the main console.


dock

public void dock(org.relayirc.swingutil.MDIClientPanel panel)
To dock/undock a MDIClientPanel, first set the panel's dock state then call this function to register that dock state. Simply calls the MDIPanel.registerDockState() method for the specified panel.


getChatApp

public static ChatApp getChatApp()
Returns the one-and-only chat application object (a singleton).


getAppName

public java.lang.String getAppName()
Returns the name of the chat application.

Specified by:
getAppName in interface org.relayirc.chatengine.IChatApp

getAppVersion

public java.lang.String getAppVersion()
Returns the version of the chat application.

Specified by:
getAppVersion in interface org.relayirc.chatengine.IChatApp

getChatStyle

public static javax.swing.text.Style getChatStyle(java.lang.String st)

setChatFont

public static void setChatFont(java.awt.Font font)

getEngine

public org.relayirc.chatengine.IChatEngine getEngine()
Description copied from interface: org.relayirc.chatengine.IChatApp
Get application's chat engine

Specified by:
getEngine in interface org.relayirc.chatengine.IChatApp

setEngine

public void setEngine(org.relayirc.chatengine.IChatEngine eng)

getOptions

public org.relayirc.chatengine.ChatOptions getOptions()
Description copied from interface: org.relayirc.chatengine.IChatApp
Get application's options

Specified by:
getOptions in interface org.relayirc.chatengine.IChatApp

setStatusBarEnabled

public void setStatusBarEnabled(boolean flag)

setShowConsole

public void setShowConsole(boolean show)

initGUI

public void initGUI()

layoutGUI

public void layoutGUI()

listChannels

public void listChannels()

loadLookAndFeel

public void loadLookAndFeel(java.lang.String name)
Load a Swing pluggable look and feel specified by name


onChannelJoin

public void onChannelJoin(org.relayirc.chatengine.ChatEngineEvent event)
Create channel window for this new channel

Specified by:
onChannelJoin in interface org.relayirc.chatengine.ChatEngineListener

onChannelPart

public void onChannelPart(org.relayirc.chatengine.ChatEngineEvent event)
Does nothing as channel objects take care of parting.

Specified by:
onChannelPart in interface org.relayirc.chatengine.ChatEngineListener

onConnection

public void onConnection(org.relayirc.chatengine.ChatEngineEvent event)
Description copied from interface: org.relayirc.chatengine.ChatEngineListener
Engine has connected to IRC server.

Specified by:
onConnection in interface org.relayirc.chatengine.ChatEngineListener

onDisconnection

public void onDisconnection(org.relayirc.chatengine.ChatEngineEvent event)
Description copied from interface: org.relayirc.chatengine.ChatEngineListener
Engine has disconnected from IRC server.

Specified by:
onDisconnection in interface org.relayirc.chatengine.ChatEngineListener

onStatus

public void onStatus(org.relayirc.chatengine.ChatEngineEvent event)
Description copied from interface: org.relayirc.chatengine.ChatEngineListener
Status message from engine.

Specified by:
onStatus in interface org.relayirc.chatengine.ChatEngineListener

removeChatPanel

public void removeChatPanel(ChatChannelPanel panel)

shutdown

public void shutdown()

showJoinChannelDlg

public void showJoinChannelDlg()

showServerListDlg

public void showServerListDlg()

tileHorizontal

public void tileHorizontal()

tileVertical

public void tileVertical()