public class FormFrame extends JFrame implements FormWindow, ContainerListener
JFrame implementing FormWindow (and FormContainer).JFrame.AccessibleJFrameFrame.AccessibleAWTFrameWindow.AccessibleAWTWindow, Window.TypeContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyaccessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabledCROSSHAIR_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_CURSORBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTDISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSEABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
FormFrame()
Constructs a new
FormFrame that is initially invisible
without at title. |
FormFrame(String title)
Creates a new, initially invisible
FormFrame with the
specified title. |
| Modifier and Type | Method and Description |
|---|---|
void |
addFormWrapListener(FormWrapListener l)
Adss a wrap listener which will be invoked
whenever the focus wraps in this window, i.e.
|
void |
alignLocation()
Aligns the location of this window in order not
to cover other windows (best as possible).
|
boolean |
areValuesChanged()
Checks whether the contents of some components in this or sub containers
have changed since the last
FormContainer.saveValues(). |
boolean |
checkAutoClose()
Checks if window should be autoclosed.
|
void |
componentAdded(ContainerEvent e) |
void |
componentRemoved(ContainerEvent e) |
protected FormComponentBinder |
createBinder()
Creates a binder for this form.
The default implementation invokes FormBindingFactory.createFormComponentBinder(this). |
void |
fireFormWrappedFocus(FormWrapEvent evt)
Fires all form wrap listeners for this window.
|
long |
getAutoClose()
Gets the autoclose timeout.
|
FormComponentBinder |
getBinder()
Gets the binder of this container.
|
void |
getFormValues()
Retrieves the values from all components in this container and
all sub containers.
Used to update the data from the view according to the data binding. |
String |
getHelpURL()
Gets the online-help URL.
|
boolean |
getKeepChangedValues()
Gets the behaviour for setFormValues().
|
Window |
getParentWindow()
Gets the parent window.
|
FormWindow |
getRelatedWindow()
Gets the related window.
Falls back to getOwner() if not set and owner is a formwindow. |
long |
getTimeOfLastValuesChanged()
Gets the system-time of last setFormValues() or triggerValuesChanged()
for this window in milliseconds.
|
TooltipDisplay |
getTooltipDisplay()
Gets the tooltip display for this window.
|
int |
getUIVersion()
Gets the look and feel version for this window.
|
void |
invalidateParentInfo()
Invalidates all container-relevant (cached) information
for the hierarchy of this container's parents.
For optimization purposes. |
boolean |
isAutoCloseable()
Returns whether this window is a candidate for autoClose-monitoring.
|
boolean |
isAutoPosition()
Returns whether auto position is enabled.
|
boolean |
isAutoUpdate()
Returns whether the auto-update feature is enabled.
|
boolean |
isBindable()
Determines whether this container is bindable.
|
boolean |
isChangeable()
Returns if this component is changeable.
|
boolean |
isHonourChangeable()
Returns whether this component should honour the changeable-attribute or not.
|
boolean |
isTriggerValuesChangedEnabled()
Determines whether triggering value changes is enabled.
|
void |
pack() |
void |
paint(Graphics g) |
protected void |
processWindowEvent(WindowEvent e) |
void |
removeFormWrapListener(FormWrapListener l)
Removes a form wrap listener.
|
void |
saveValues()
Sets a savepoint for all components in this container and
all sub containers.
|
void |
setAutoClose(long autoClose)
Set a timer to close the window automatically.
FormContainers use this feature to close after a certain time of inactivity and unchanged data. Note: autoClosing must be set before displaying the window (just like setModal()). |
void |
setAutoPosition(boolean flag)
Sets the autoposition feature.
Windows with this autoposition enabled will place themselves in a nice manner on the screen when displayed initially. |
void |
setAutoUpdate(boolean autoupdate)
Sets the auto-update feature for all components in this container and all sub containers.
|
void |
setBindable(boolean bindable)
Sets whether this container is bindable, i.e.
|
void |
setChangeable(boolean flag)
Set the component to be changeable.
This is a unified abstraction and will be translated to setEditable or setEnabled, whatever is appropriate to this component. |
void |
setFormValues()
Sets the values in all form components in this container and all
sub containers.
Used to update the view from the data according to the data binding. |
void |
setFormValuesKeepChanged()
Sets the values in all unchanged form components in this container and
all sub containers.
All changed components are left untouched. |
void |
setHelpURL(String helpURL)
Sets the online-help URL.
If a help url is set for this container, a browser will be launched to show that url if there is no help url for the component the help was requested for. |
void |
setHonourChangeable(boolean flag)
Sets whether this component should honour the changeable-attribute or not.
The default is true. |
void |
setKeepChangedValues(boolean keepChanged)
Sets the behaviour of setFormValues() of FormContainers in this FormWindow.
|
void |
setRelatedWindow(FormWindow relatedWindow)
Sets the related FormWindow.
Related windows are somewhat similar to Owners, but they don't change fg/bg-behaviour of the window-manager. |
void |
setTimeOfLastValuesChanged(long millis)
Sets the system-time of last setFormValues() or triggerValuesChanged()
for this window in milliseconds.
|
void |
setTooltipDisplay(TooltipDisplay display)
Sets the tooltip display for this window.
If a tooltip display is set the component's tooltips will be displayed for each component receiving the keyboard focus (instead of popping up on mouse hover). |
void |
setTriggerValuesChangedEnabled(boolean enabled)
Enables triggering value changes.
Disabling this feature may be necessary for model-agnostic containers. |
void |
setUIVersion(int version)
Sets a version number for the current look and feel of this window.
|
void |
showHelp()
Displays online help for this container.
|
void |
triggerValuesChanged()
Signals that values in the components of the container may have changed.
|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedaddPropertyChangeListener, 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, 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, toFrontadd, 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, validateTreeaction, 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, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTitle, setTitlegetFont, postEventpublic FormFrame(String title)
FormFrame with the
specified title.title - the title for the frame, null if no titleJFrame.JFrame(java.lang.String)public FormFrame()
FormFrame that is initially invisible
without at title.JFrame.JFrame()protected void processWindowEvent(WindowEvent e)
Overridden to allow FormUtilities keeping track of windows
processWindowEvent in class JFramepublic void paint(Graphics g)
Overridden in order to bring modal windows to front in case accidently covered by another window. This is the case whenever a modal dialog is not owned by the window covering it. It solves the problem of "freezing" an application because the user clicked on another window.
public void componentAdded(ContainerEvent e)
componentAdded in interface ContainerListenerpublic void componentRemoved(ContainerEvent e)
componentRemoved in interface ContainerListenerpublic Window getParentWindow()
FormContainergetParentWindow in interface FormContainerpublic void invalidateParentInfo()
FormContainerinvalidateParentInfo in interface FormContainerpublic void setAutoUpdate(boolean autoupdate)
FormContainersetAutoUpdate in interface FormContainerautoupdate - true if auto update the data (default), false if notFormComponent.setAutoUpdate(boolean)public boolean isAutoUpdate()
FormContainerisAutoUpdate in interface FormContainerFormComponent.isAutoUpdate()public void setFormValues()
FormContainersetFormValues in interface FormContainerpublic void setFormValuesKeepChanged()
FormContainersetFormValuesKeepChanged in interface FormContainerFormComponent.isValueChanged()public void getFormValues()
FormContainergetFormValues in interface FormContainerpublic void saveValues()
FormContainersaveValues in interface FormContainerFormComponent.saveValue()public boolean areValuesChanged()
FormContainerFormContainer.saveValues().
Notice that only components with (FormComponent.isTriggerValueChangedEnabled() == true)
will be checked.
areValuesChanged in interface FormContainerpublic void triggerValuesChanged()
FormContainertriggerValuesChanged in interface FormContainerpublic void setTriggerValuesChangedEnabled(boolean enabled)
FormContainersetTriggerValuesChangedEnabled in interface FormContainerenabled - true if invoke FormContainer.triggerValuesChanged() on each change (default), false if not.public boolean isTriggerValuesChangedEnabled()
FormContainerisTriggerValuesChangedEnabled in interface FormContainerFormContainer.triggerValuesChanged() on each change (default), false if not.public void setChangeable(boolean flag)
FormChangeablesetChangeable in interface FormChangeableflag - true the user can edit the data, false if show onlypublic boolean isChangeable()
FormChangeableisChangeable in interface FormChangeablepublic void setHonourChangeable(boolean flag)
FormChangeablesetHonourChangeable in interface FormChangeableflag - true if honour the changeable attribute, false if notpublic boolean isHonourChangeable()
FormChangeableisHonourChangeable in interface FormChangeablepublic void setHelpURL(String helpURL)
FormContainersetHelpURL in interface FormContainerhelpURL - the help urlFormUtilities.openHelpURL(Component)public String getHelpURL()
FormContainergetHelpURL in interface FormContainerpublic void showHelp()
FormContainershowHelp in interface FormContainerpublic int getUIVersion()
FormWindowgetUIVersion in interface FormWindowpublic void setUIVersion(int version)
FormWindowsetUIVersion in interface FormWindowversion - the n-th look and feel versionpublic void setTooltipDisplay(TooltipDisplay display)
FormWindowsetTooltipDisplay in interface FormWindowdisplay - the tooltip display, null = none (default)public TooltipDisplay getTooltipDisplay()
FormWindowgetTooltipDisplay in interface FormWindowpublic void fireFormWrappedFocus(FormWrapEvent evt)
FormWindowfireFormWrappedFocus in interface FormWindowevt - the form wrap eventpublic void addFormWrapListener(FormWrapListener l)
FormWindowaddFormWrapListener in interface FormWindowl - the form wrap listenerFormFocusTraversalPolicypublic void removeFormWrapListener(FormWrapListener l)
FormWindowremoveFormWrapListener in interface FormWindowl - the listener to removepublic void setAutoPosition(boolean flag)
FormWindowsetAutoPosition in interface FormWindowflag - true to enable autoposition, false if not (default)public boolean isAutoPosition()
FormWindowisAutoPosition in interface FormWindowpublic void setRelatedWindow(FormWindow relatedWindow)
FormFrames never have an owner (except the default shared swing object, which is no FormWindow).
setRelatedWindow in interface FormWindowrelatedWindow - the related FormWindowpublic FormWindow getRelatedWindow()
FormFrames never have an owner (except the default shared swing object, which is no FormWindow).
getRelatedWindow in interface FormWindowpublic void alignLocation()
FormWindowalignLocation in interface FormWindowpublic void setKeepChangedValues(boolean keepChanged)
FormWindowsetKeepChangedValues in interface FormWindowkeepChanged - true if setFormValues() should NOT override values
changed by the user. The default is false.public boolean getKeepChangedValues()
FormWindowgetKeepChangedValues in interface FormWindowpublic long getTimeOfLastValuesChanged()
FormWindowgetTimeOfLastValuesChanged in interface FormWindowpublic void setTimeOfLastValuesChanged(long millis)
FormWindowsetTimeOfLastValuesChanged in interface FormWindowmillis - the time of last values changedpublic void setAutoClose(long autoClose)
FormWindowsetAutoClose in interface FormWindowautoClose - the time in milliseconds, 0 = no autoclosepublic long getAutoClose()
FormWindowgetAutoClose in interface FormWindowpublic boolean isAutoCloseable()
FormWindowisAutoCloseable in interface FormWindowpublic boolean checkAutoClose()
FormWindowcheckAutoClose in interface FormWindowprotected FormComponentBinder createBinder()
FormBindingFactory.createFormComponentBinder(this).public FormComponentBinder getBinder()
FormContainergetBinder in interface FormContainerpublic void setBindable(boolean bindable)
FormContainerFormContainers are bindable by default.
setBindable in interface FormContainerbindable - true if bindable, else not eligible for the binding processpublic boolean isBindable()
FormContainerisBindable in interface FormContainerTentackle - distributed, domain- and model-driven