public abstract class XalWindow extends javax.swing.JFrame implements XalDocumentView, XalDocumentListener
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
protected XalDocument |
document
The document corresponding to this main window
|
static int |
NO_OPTION |
static int |
YES_OPTION |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
XalWindow(XalDocument aDocument)
Creates a new instance of WindowAdaptor
|
XalWindow(XalDocument aDocument,
boolean displaysToolbar) |
Modifier and Type | Method and Description |
---|---|
void |
captureAsImage()
Capture the window content as a PNG.
|
void |
closeWindow()
Close this window.
|
void |
customizeCommands(Commander commander)
Override this method to register custom commands.
|
int |
displayConfirmDialog(java.lang.String title,
java.lang.String message)
Display a confirmation dialog with a title and message
|
void |
displayError(java.lang.Exception exception)
Display an error dialog box with information about the exception and
provide an audible alert.
|
void |
displayError(java.lang.String aTitle,
java.lang.String message)
Display an error dialog box and provide an audible alert.
|
void |
displayError(java.lang.String aTitle,
java.lang.String prefix,
java.lang.Exception exception)
Display an error dialog box with information about the exception and
provide an audible alert.
|
void |
displayWarning(java.lang.Exception exception)
Display a warning dialog box showing information about an exception that
has been thrown and provide an audible alert.
|
void |
displayWarning(java.lang.String aTitle,
java.lang.String message)
Display a warning dialog box and provide an audible alert.
|
void |
displayWarning(java.lang.String aTitle,
java.lang.String prefix,
java.lang.Exception exception)
Display a warning dialog box with information about the exception and provide
an audible alert.
|
void |
documentHasClosed(XalDocument document)
Implement XalDocumentListener.
|
void |
documentWillClose(XalDocument document)
Implement XalDocumentListener.
|
void |
freeCustomResources()
Dispose of custom window resources.
|
void |
generateWindowTitle()
Generate the title on the title bar to reflect the document state.
|
javax.swing.JToolBar |
getToolBar()
Get the toolbar associated with this window.
|
void |
hasChangesChanged(XalDocument document,
boolean newHasChangesStatus)
Implement XalDocumentListener.
|
void |
hideWindow()
Iconify this window.
|
Commander |
makeCommander()
Subclasses should override this method to provide a custom Commander.
|
void |
makeFrame()
Make the frame and populate the menubar and toolbar.
|
java.awt.event.WindowListener |
newWindowHandler()
Create a new window listener.
|
void |
registerEvents()
Register the event handlers
|
void |
releaseWindow()
Dispose of this window and remove its association with the document.
|
void |
showWindow()
Show this window.
|
void |
titleChanged(XalDocument document,
java.lang.String documentTitle)
Implement XalDocumentListener and handle the event where the title has changed.
|
boolean |
userPermitsCloseWithUnsavedChanges()
Query the user to see if it is okay to close the document given that
unsaved changes exist.
|
boolean |
usesToolbar()
Subclasses may override this method to not create the toolbar.
|
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
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, 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, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
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, transferFocusDownCycle, validate, validateTree
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, 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, 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, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getJMenuBar, getLocation, getLocationOnScreen, isVisible, setJMenuBar, setLocation, setVisible
public static final int YES_OPTION
public static final int NO_OPTION
protected XalDocument document
public XalWindow(XalDocument aDocument)
public XalWindow(XalDocument aDocument, boolean displaysToolbar)
public void registerEvents()
public void makeFrame()
public Commander makeCommander()
public javax.swing.JToolBar getToolBar()
getToolBar
in interface XalDocumentView
public void customizeCommands(Commander commander)
public void closeWindow()
public void captureAsImage()
captureAsImage
in interface XalDocumentView
public java.awt.event.WindowListener newWindowHandler()
public void showWindow()
showWindow
in interface XalDocumentView
public void hideWindow()
hideWindow
in interface XalDocumentView
public boolean userPermitsCloseWithUnsavedChanges()
public final void releaseWindow()
public void freeCustomResources()
public void generateWindowTitle()
public final void titleChanged(XalDocument document, java.lang.String documentTitle)
titleChanged
in interface XalDocumentListener
document
- The document initiating the title changed event.documentTitle
- The new document title.public void hasChangesChanged(XalDocument document, boolean newHasChangesStatus)
hasChangesChanged
in interface XalDocumentListener
document
- The document initiating the event.newHasChangesStatus
- The new status identifying whethe the document has changes to be savedtitleChanged(xal.extension.application.XalDocument, java.lang.String)
public void documentWillClose(XalDocument document)
documentWillClose
in interface XalDocumentListener
document
- The document that will close.public void documentHasClosed(XalDocument document)
documentHasClosed
in interface XalDocumentListener
document
- The document that has closed.public boolean usesToolbar()
public int displayConfirmDialog(java.lang.String title, java.lang.String message)
displayConfirmDialog
in interface XalDocumentView
title
- The title of the dialogmessage
- The message to displaypublic void displayWarning(java.lang.String aTitle, java.lang.String message)
displayWarning
in interface XalDocumentView
aTitle
- Title of the warning dialog box.message
- The warning message to appear in the warning dialog box.public void displayWarning(java.lang.Exception exception)
displayWarning
in interface XalDocumentView
exception
- The exception whose description is being displayed.public void displayWarning(java.lang.String aTitle, java.lang.String prefix, java.lang.Exception exception)
displayWarning
in interface XalDocumentView
aTitle
- Title of the warning dialog box.prefix
- Text that should appear in the dialog box before the exception messasge.exception
- The exception about which the warning dialog is displayed.public void displayError(java.lang.String aTitle, java.lang.String message)
displayError
in interface XalDocumentView
aTitle
- Title of the warning dialog box.message
- The warning message to appear in the warning dialog box.public void displayError(java.lang.Exception exception)
displayError
in interface XalDocumentView
exception
- The exception about which the warning dialog is displayed.public void displayError(java.lang.String aTitle, java.lang.String prefix, java.lang.Exception exception)
displayError
in interface XalDocumentView
aTitle
- Title of the warning dialog box.prefix
- Text that should appear in the dialog box before the exception messasge.exception
- The exception about which the warning dialog is displayed.