Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.util.swing
Class SIPCommFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by net.java.sip.communicator.util.swing.SIPCommFrame
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Observer, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
CallDialog, ChatRoomAuthenticationWindow, ChatRoomConfigurationWindow, ChatWindow, ContactInfoDialog, HistoryWindow, InitialAccountRegistrationFrame, JoinChatRoomWindow, MainFrame, WhiteboardFrame

public class SIPCommFrame
extends JFrame
implements Observer

A custom frame that remembers its size and location and could have a semi-transparent background.

Author:
Yana Stamcheva, Lyubomir Marinov, Adam Netocny
See Also:
Serialized Form

Nested Class Summary
static class SIPCommFrame.MainContentPane
          The main content pane.
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
(package private) static String PNAME_CALCULATED_POSITIONING
          Property that disables the automatic resizing and positioning when a window's top edge is outside the visible area of the screen.
 
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
 
Constructor Summary
SIPCommFrame()
          Creates a SIPCommFrame.
SIPCommFrame(boolean isSaveSizeAndLocation)
          Creates an instance of SIPCommFrame by specifying explicitly if the size and location properties are saved.
 
Method Summary
protected  void addKeybindingAction(String binding, Action action)
          Bindings the string representation for a keybinding to the action that will be executed.
protected  void close(boolean isEscaped)
          All functions implemented in this method will be invoked when user presses the Escape key.
 void dispose()
          Overwrites the dispose method in order to save the size and the position of this window before closing it.
(package private) static void saveSizeAndLocation(Component component)
          Saves the size and the location of a specific Component through the ConfigurationService.
protected  void setKeybindingInput(KeybindingSet.Category category)
          Sets the input map to utilize a given category of keybindings.
 void setSizeAndLocation()
          Sets window size and position.
 void setVisible(boolean isVisible)
          Overwrites the setVisible method in order to set the size and the position of this window before showing it.
 void setVisible(boolean isVisible, boolean isPackEnabled)
          Overwrites the setVisible method in order to set the size and the position of this window before showing it.
 void update(Observable obs, Object arg)
          Listens for changes in binding sets so they can be reflected in the input map.
 void validate()
          Validates this container and all of its subcomponents.
protected  void windowClosing(WindowEvent e)
          Invoked when this window is in the process of being closed.
 
Methods inherited from class javax.swing.JFrame
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
 
Methods inherited from class java.awt.Frame
addNotify, 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, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, 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, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, 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

PNAME_CALCULATED_POSITIONING

static final String PNAME_CALCULATED_POSITIONING
Property that disables the automatic resizing and positioning when a window's top edge is outside the visible area of the screen.

true use automatic repositioning (default)
false rely on the window manager to place the window

See Also:
Constant Field Values
Constructor Detail

SIPCommFrame

public SIPCommFrame()
Creates a SIPCommFrame.


SIPCommFrame

public SIPCommFrame(boolean isSaveSizeAndLocation)
Creates an instance of SIPCommFrame by specifying explicitly if the size and location properties are saved. By default size and location are stored.

Parameters:
isSaveSizeAndLocation - indicates whether to save the size and location of this dialog
Method Detail

validate

public void validate()
Validates this container and all of its subcomponents.

The validate method is used to cause a container to lay out its subcomponents again. It should be invoked when this container's subcomponents are modified (added to or removed from the container, or layout-related information changed) after the container has been displayed.

If this Container is not valid, this method invokes the validateTree method and marks this Container as valid. Otherwise, no action is performed.

Overrides:
validate in class Container
See Also:
Container.add(java.awt.Component), Component.invalidate(), JComponent.revalidate(), Container.validateTree()

setKeybindingInput

protected void setKeybindingInput(KeybindingSet.Category category)
Sets the input map to utilize a given category of keybindings. The frame is updated to reflect the new bindings when they change. This replaces any previous bindings that have been added.

Parameters:
category - set of keybindings to be utilized

addKeybindingAction

protected void addKeybindingAction(String binding,
                                   Action action)
Bindings the string representation for a keybinding to the action that will be executed.

Parameters:
binding - string representation of action used by input map
action - the action which will be executed when user presses the given key combination

windowClosing

protected void windowClosing(WindowEvent e)
Invoked when this window is in the process of being closed. The close operation can be overridden at this point.

Parameters:
e - the WindowEvent that notified us

saveSizeAndLocation

static void saveSizeAndLocation(Component component)
                         throws ConfigPropertyVetoException
Saves the size and the location of a specific Component through the ConfigurationService.

Parameters:
component - the Component which is to have its size and location saved through the ConfigurationService
Throws:
ConfigPropertyVetoException - if the ConfigurationService does not accept the saving because of objections from its PropertyVetoListeners.

setSizeAndLocation

public void setSizeAndLocation()
Sets window size and position.


setVisible

public void setVisible(boolean isVisible)
Overwrites the setVisible method in order to set the size and the position of this window before showing it.

Overrides:
setVisible in class Window
Parameters:
isVisible - indicates if this frame should be visible

setVisible

public void setVisible(boolean isVisible,
                       boolean isPackEnabled)
Overwrites the setVisible method in order to set the size and the position of this window before showing it.

Parameters:
isVisible - indicates if this window will be made visible or will be hidden
isPackEnabled - indicates if the pack() method should be invoked before showing this window

dispose

public void dispose()
Overwrites the dispose method in order to save the size and the position of this window before closing it.

Overrides:
dispose in class Window

update

public void update(Observable obs,
                   Object arg)
Listens for changes in binding sets so they can be reflected in the input map.

Specified by:
update in interface Observer
Parameters:
obs - the KeybindingSet from which to update

close

protected void close(boolean isEscaped)
All functions implemented in this method will be invoked when user presses the Escape key.

Parameters:
isEscaped - indicates if this frame has been closed by pressing the Esc key

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.