anecho.gui
Class SyncFrame

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 anecho.gui.SyncFrame
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
DataIn

public class SyncFrame
extends java.awt.Frame

The JamochaMUD Frame synchroniser: SyncFrame.java handles the synchronising of frame minimize/maximize, and potentially, movement events

See Also:
Serialized Form

Nested Class Summary
 
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 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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SyncFrame(java.lang.String title)
          Creates a new SyncFrame.
SyncFrame(java.lang.String title, boolean sync, SyncFrameGroup group)
          Creates a new SyncFrame.
SyncFrame(java.lang.String title, SyncFrameGroup group)
          Creates a new SyncFrame.
 
Method Summary
 void dispose()
          dispose of public class Window is handled to remove this frame from it's * registered SyncFrameGroups first before letting the super-class handle the rest
 boolean getCloseState()
          Report the "Close state" of this frame.
 boolean getTerminationState()
          Report the "termination state" of this frame
 boolean isLocked()
          Returns the "lock" state of this frame.
 boolean isSynced()
          Get the synchronisation status of this frame
 java.lang.String paramString()
          A paramString so that other classes can identify individual SyncFrames.
 void processComponentEvent(java.awt.event.ComponentEvent event)
           
 void processWindowEvent(java.awt.event.WindowEvent event)
           
 void setAllStates(boolean state)
          Set the state of all the frames in this group to be the same
 void setBounds(int newX, int newY, int width, int height)
          This method is overridden to keep us up to date with the component's location
 void setBounds(java.awt.Rectangle bounds)
          setBounds is overridden to keep us up to date with the component's location
 void setCloseState(boolean state)
          Set the frame to close when the "close" icon of the frame is activated
 void setGroupSync(boolean sync)
          Set the synchronisation of the entire frame group
 void setLocation(int newX, int newY)
          setLocation is overridden to keep us up to date with the component's location
 void setLocation(java.awt.Point newLoc)
          setBounds is overridden to keep us up to date with the component's location
 void setLock(boolean status)
          Sets the "lock" status of this frame.
 void setSync(boolean sync)
          Set the synchronisation of this frame
 void setSyncFrameGroup(SyncFrameGroup group)
          Set the SyncFrameGroup for this frame
 void setTerminationState(boolean state)
          Set the "termination state" of this frame (whether it kills the JVM or not)
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getAccessibleContext, 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
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, 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, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, 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, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, 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
 

Constructor Detail

SyncFrame

public SyncFrame(java.lang.String title)
Creates a new SyncFrame.

Parameters:
title - The title of our Frame.

SyncFrame

public SyncFrame(java.lang.String title,
                 SyncFrameGroup group)
Creates a new SyncFrame.

Parameters:
title - The title of our Frame.
group - The SyncFrameGroup that this SyncFrame will belong to.

SyncFrame

public SyncFrame(java.lang.String title,
                 boolean sync,
                 SyncFrameGroup group)
Creates a new SyncFrame.

Parameters:
title - The title of our Frame.
sync - true - This SyncFrame is the be synchronised with the other SyncFrames in the group false - This SyncFrame is to not be synchronised with its given SyncFrameGroup.
group - The SyncFrameGroup that this SyncFrame will belong to.
Method Detail

setSync

public void setSync(boolean sync)
Set the synchronisation of this frame

Parameters:
sync - true - This frame is to be synchronised with its SyncFrameGroup. false - This frame is not to be synchronised with its SyncFrameGroup.

setGroupSync

public void setGroupSync(boolean sync)
Set the synchronisation of the entire frame group

Parameters:
sync - true - Set all frames in this group to be synchronized false - Set all frames in this group to not be synchronized

isSynced

public boolean isSynced()
Get the synchronisation status of this frame

Returns:
returns the boolean state of this SyncFrame's synchronisation status
See Also:
gui.SyncFrame#setSync

setSyncFrameGroup

public void setSyncFrameGroup(SyncFrameGroup group)
Set the SyncFrameGroup for this frame

Parameters:
group - The SyncFrameGroup that this SyncFrame is to become a member of.

setTerminationState

public void setTerminationState(boolean state)
Set the "termination state" of this frame (whether it kills the JVM or not)

Parameters:
state - A true state indicates that closing this SyncFrame will terminate the JVM. A false indicates this SyncFrame will simply terminate itself, leaving the JVM to run

getTerminationState

public boolean getTerminationState()
Report the "termination state" of this frame

Returns:
A true state indicates that the closing of this frame will terminate the JVM, a false will simply close the frame

setCloseState

public void setCloseState(boolean state)
Set the frame to close when the "close" icon of the frame is activated

Parameters:
state - A true closes the appropriate frame. A false does not close the frame when activate

getCloseState

public boolean getCloseState()
Report the "Close state" of this frame.

Returns:

processWindowEvent

public void processWindowEvent(java.awt.event.WindowEvent event)
Overrides:
processWindowEvent in class java.awt.Window
Parameters:
event -

processComponentEvent

public void processComponentEvent(java.awt.event.ComponentEvent event)
Overrides:
processComponentEvent in class java.awt.Component
Parameters:
event -

setAllStates

public void setAllStates(boolean state)
Set the state of all the frames in this group to be the same

Parameters:
state - If true, all the frames in the group will be synchronised If false the frames will act independantly of each other.

setBounds

public void setBounds(int newX,
                      int newY,
                      int width,
                      int height)
This method is overridden to keep us up to date with the component's location

Overrides:
setBounds in class java.awt.Window
Parameters:
newX - New X-axis position for this frame.
newY - New Y-axis position for this frame.
width - New width for this frame
height - Newheight for this frame

setBounds

public void setBounds(java.awt.Rectangle bounds)
setBounds is overridden to keep us up to date with the component's location

Overrides:
setBounds in class java.awt.Component
Parameters:
bounds - New position and size for this component

setLocation

public void setLocation(int newX,
                        int newY)
setLocation is overridden to keep us up to date with the component's location

Overrides:
setLocation in class java.awt.Component
Parameters:
newX - New X-axis position for this frame.
newY - New Y-axis position for this frame.

setLocation

public void setLocation(java.awt.Point newLoc)
setBounds is overridden to keep us up to date with the component's location

Overrides:
setLocation in class java.awt.Component
Parameters:
newLoc - New position for this component

dispose

public void dispose()
dispose of public class Window is handled to remove this frame from it's * registered SyncFrameGroups first before letting the super-class handle the rest

Overrides:
dispose in class java.awt.Window

paramString

public java.lang.String paramString()
A paramString so that other classes can identify individual SyncFrames.

Overrides:
paramString in class java.awt.Frame
Returns:
The name of the class, plus the name of the class

setLock

public void setLock(boolean status)
Sets the "lock" status of this frame. This is needed when dealing with SyncFrameGroups to prevent "stuttering". A SyncFrame becomes "locked" true by default if another SyncFrame is moved, hidden, or shown. Without the lock, certain OSes activate the other SyncFrame's events after the original event has been completed, making terrible loops. Once a locked frame has received an event, it is unlocked (set false) again.

Parameters:
status - the SyncFrame's lock status
See Also:
gui.SyncFrameGroup

isLocked

public boolean isLocked()
Returns the "lock" state of this frame.

Returns:
the state of the lock as a boolean variable
See Also:
gui.SyncFrame#setLock