public interface YouScopeFrame
Modifier and Type | Method and Description |
---|---|
void |
addChildFrame(YouScopeFrame childFrame)
Adds the frame as a child frame to this frame.
|
void |
addFrameListener(YouScopeFrameListener listener)
Adds a listener to the frame which is informed e.g.
|
void |
addModalChildFrame(YouScopeFrame childFrame)
Adds the frame as a modal child frame to this frame.
|
YouScopeFrame |
createChildFrame()
Creates a non-modal child frame.
|
YouScopeFrame |
createFrame()
Creates a new non-modal frame.
|
YouScopeFrame |
createModalChildFrame()
Creates a modal child frame.
|
void |
endLoading()
Removes the indication from this frame that it is loaded or initialized.
|
java.awt.Dimension |
getSize()
Returns the size of the frame.
|
java.lang.String |
getTitle()
Returns the title of the frame.
|
boolean |
isClosable()
Returns if frame is closable by the user.
|
boolean |
isMaximizable()
Returns if frame is maximizable.
|
boolean |
isResizable()
Returns if frame is resizable.
|
boolean |
isVisible()
Returns if frame is visible.
|
void |
pack()
Sets the size of the frame such that all UI elements will be (optimally) sized.
|
void |
relocateFrameTo(YouScopeFrame targetFrame)
Relocates all calls to this object's functions to the corresponding functions of the target frame.
|
void |
removeFrameListener(YouScopeFrameListener listener)
Removes a previously added listener.
|
void |
setClosable(boolean closable)
Sets if the frame is closable by the user (i.e.
|
void |
setContentPane(java.awt.Component contentPane)
Sets the content pane of this frame.
|
void |
setMargins(int left,
int top,
int right,
int bottom)
Sets the margins between the frame borders and the frame content (i.e.
|
void |
setMaximizable(boolean maximizable)
Sets if the user should be able to maximize the frame.
|
void |
setMaximum(boolean maximum)
Maximizes the frame (if maximum == true) or restores the actual frame's size (if maximum == false).
|
void |
setResizable(boolean resizable)
Sets if the frame is resizable or not.This might only be interpreted as a hint by certain implementations.
|
void |
setSize(java.awt.Dimension size)
Sets the size of the frame.
|
void |
setTitle(java.lang.String title)
Sets the title of the frame.
|
void |
setToErrorState(java.lang.String message,
java.lang.Exception e)
Removes all previously added UI elements from the frame and displays instead the given error.
|
void |
setVisible(boolean visible)
Sets the visibility of the frame and its content.
|
void |
startInitializing()
Indicates to the user, in one or the other way, that the content of the frame is currently initialized.
|
void |
startLoading()
Similar to
startInitializing() , only that in this case the UI is already initialized, but certain data has to be loaded e.g. |
void |
toFront()
Positions the frame at the front and sets the focus to this frame.
|
void setContentPane(java.awt.Component contentPane)
contentPane
- The new content pane of the frame.void setVisible(boolean visible)
visible
- True if frame should be visible, false otherwise.void setMargins(int left, int top, int right, int bottom)
left
- margin left, in pixels.top
- margin top, in pixels.right
- margin right, in pixels.bottom
- margin bottom, in pixels.boolean isVisible()
void setMaximum(boolean maximum)
maximum
- True if frame should be maximized.YouScopeFrame createChildFrame()
YouScopeFrame createModalChildFrame()
YouScopeFrame createFrame()
void addChildFrame(YouScopeFrame childFrame)
childFrame
- The child frame to add.void addModalChildFrame(YouScopeFrame childFrame)
childFrame
- The frame to add as a modal child frame.void setSize(java.awt.Dimension size)
size
- Size of the frame.java.awt.Dimension getSize()
void pack()
void setResizable(boolean resizable)
resizable
- True if frame is resizable, false otherwise.void setClosable(boolean closable)
closable
- True if user should be able to close the frame in the usual way.void setMaximizable(boolean maximizable)
maximizable
- True if frame should be maximizable.boolean isResizable()
boolean isClosable()
boolean isMaximizable()
void addFrameListener(YouScopeFrameListener listener)
listener
- The listener to add.void removeFrameListener(YouScopeFrameListener listener)
listener
- The listener to remove.void setTitle(java.lang.String title)
title
- Title of the frame.java.lang.String getTitle()
void setToErrorState(java.lang.String message, java.lang.Exception e)
message
- The message describing the error.e
- The error.void startInitializing()
setContentPane()
followed by endLoading()
. The content pane should not be set before all elements of the content pane
were created (i.e. no components of the content pane should be manipulated by the worker thread after calling setContentPane()). This function
is guaranteed to be thread save.void startLoading()
startInitializing()
, only that in this case the UI is already initialized, but certain data has to be loaded e.g. after
some user input. The loading should also be done in a worker thread which is calling endLoading()
after finishing. This function
is guaranteed to be thread save. However, if the content pane was already set prior to a call to this function, the worker thread should not
manipulate any component of the content pane anymore. Instead, it should either create and set a new content pane (including all components of
the content pane) or only manipulate the content pane by using the UI thread (see SwingUtilities.invokeLater and
SwingUtilities.invokeAndWait()).void endLoading()
startInitializing()
or startLoading()
. This function is guaranteed to be thread save.void toFront()
void relocateFrameTo(YouScopeFrame targetFrame)
targetFrame
- The target frame calls to this frame should be relocated to.