MainSwingFramepublic class JSyncFrame
extends javax.swing.JFrame
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategyjava.awt.Container.AccessibleAWTContainerBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTCROSSHAIR_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| Constructor | Description |
|---|---|
JSyncFrame(java.lang.String title) |
The JamochaMUD Frame synchroniser:
JSyncFrame.java handles the synchronising of
Swing frame minimize/maximize, and potentially, movement events
|
JSyncFrame(java.lang.String title,
boolean sync,
SyncFrameGroup group) |
The JamochaMUD Frame synchroniser:
SyncFrame.java handles the synchronising of
frame minimize/maximize, and potentially, movement events
|
JSyncFrame(java.lang.String title,
SyncFrameGroup group) |
The JamochaMUD Frame synchroniser:
SyncFrame.java handles the synchronising of
frame minimize/maximize, and potentially, movement events
|
| Modifier and Type | Method | Description |
|---|---|---|
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
|
SyncFrameGroup |
getSyncFrameGroup() |
|
boolean |
isCloseState() |
Report the "Close state" of this frame.
|
boolean |
isGroupSync() |
|
boolean |
isLocked() |
Returns the "lock" state of this frame.
|
boolean |
isSynced() |
Get the synchronisation status of this frame
|
boolean |
isTerminated() |
Report the "termination state" of this frame
|
java.lang.String |
paramString() |
A paramString so that other classes can identify individual SyncFrames.
|
void |
processComponentEvent(java.awt.event.ComponentEvent event) |
This method processes Component Events, letting other frames in the
group know if they have changed size or moved.
|
void |
processWindowEvent(java.awt.event.WindowEvent event) |
This method handles the closing and iconifying of the frame, calling
other frames in this group if necessary.
|
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) |
The JamochaMUD Frame synchroniser:
SyncFrame.java handles the synchronising of
frame minimize/maximize, and potentially, movement events
|
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)
|
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, 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, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleadd, 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, validateTreeaddNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedaddImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, 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, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFrontpublic JSyncFrame(java.lang.String title)
title - The title to be displayed on this frame componentpublic JSyncFrame(java.lang.String title,
SyncFrameGroup group)
title - The title to be displayed on this frame component.group - The group that this JSyncFrame is to be part of.public JSyncFrame(java.lang.String title,
boolean sync,
SyncFrameGroup group)
title - The title to be displayed on this frame componentsync - Indicates whether this frame is to sync with other frames in this group.
true - indicates synchronisation should occur
false - indicates this frame acts independently of other frames in the SyncGroupgroup - The SyncGroup this frame belongs topublic void setSync(boolean sync)
sync - Indicates whether this frame is to sync with other frames in this group.
true - indicates synchronisation should occur
false - indicates this frame acts independently of other frames in the SyncGrouppublic void setGroupSync(boolean sync)
sync - true - Synchronise this frame with the rest of the group
false - this frame should act independently of the other framespublic boolean isGroupSync()
public boolean isSynced()
gui.SyncFrame#setSyncpublic void setSyncFrameGroup(SyncFrameGroup group)
group - This is the group this frame should belong to.public SyncFrameGroup getSyncFrameGroup()
public void setTerminationState(boolean state)
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 runpublic boolean isTerminated()
true state indicates that the closing
of this frame will terminate the JVM,
a false will simply close the framepublic void setCloseState(boolean state)
state - A true closes the appropriate frame.
A false does not close the frame when activatepublic boolean isCloseState()
true - This frame should close when it is "x"'d out
false - This frame should not close when "x"'d outpublic void processWindowEvent(java.awt.event.WindowEvent event)
processWindowEvent in class javax.swing.JFrameevent - Our WindowEventpublic void processComponentEvent(java.awt.event.ComponentEvent event)
processComponentEvent in class java.awt.Componentevent - Our ComponentEvent.public void setAllStates(boolean state)
state - If true, all the frames in
the group will be synchronised
If false the frames will act
independantly of each other.public void setBounds(int newX,
int newY,
int width,
int height)
setBounds in class java.awt.WindownewX - New X-axis position for this frame.newY - New Y-axis position for this frame.width - Width of the componentheight - Height of this componentpublic void setBounds(java.awt.Rectangle bounds)
setBounds in class java.awt.Windowbounds - The position and size of this framepublic void setLocation(int newX,
int newY)
setLocation in class java.awt.WindownewX - New X-axis position for this frame.newY - New Y-axis position for this frame.public void setLocation(java.awt.Point newLoc)
setLocation in class java.awt.WindownewLoc - New position for this frame.public void dispose()
dispose in class java.awt.Windowpublic java.lang.String paramString()
paramString in class javax.swing.JFramepublic void setLock(boolean status)
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.status - the SyncFrame's lock statusgui.SyncFrameGrouppublic boolean isLocked()
gui.SyncFrame#setLock