private class EventLogsManagerController.DefaultInternalFrameAdapter
extends javax.swing.event.InternalFrameAdapter
InternalFrameAdapter
for creating a
specific adapter for the JInternalFrame
frames.
It defines the behaviour of a JInternalFrame
frame when it
changes its status to maximised, minimised, activated or closed, overriding the
respective methods of the InternalFrameAdapter
class.
When the JInternalFrame
frame gets minimised, it disappears
completely from the JDesktopPane
panel; when it get maximised,
it appears again. When it gets closed, we delete also its
FooterAreaButton
button,
when it gets activated, we set as selected also its
FooterAreaButton
button.
InternalFrameAdapter
,
InternalFrameEvent
,
JInternalFrame
,
JDesktopPane
Modifier | Constructor and Description |
---|---|
private |
DefaultInternalFrameAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
internalFrameActivated(javax.swing.event.InternalFrameEvent e)
Invoked when an internal frame is activated.
|
void |
internalFrameClosed(javax.swing.event.InternalFrameEvent e)
Invoked when an internal frame has been closed.
|
void |
internalFrameClosing(javax.swing.event.InternalFrameEvent e)
Invoked when an internal frame is in the process of being closed.
|
void |
internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
Invoked when an internal frame is de-iconified.
|
void |
internalFrameIconified(javax.swing.event.InternalFrameEvent e)
Invoked when an internal frame is iconified.
|
public void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
This method set as not visible the JInternalFrame
frame
that generates this event, making it invisible inside the
contentArea
internalFrameIconified
in interface javax.swing.event.InternalFrameListener
internalFrameIconified
in class javax.swing.event.InternalFrameAdapter
e
- the event generated by the JInternalFrame
frameJInternalFrame
,
InternalFrameEvent
public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
This method set as visible the JInternalFrame
frame
that generates this event, making it visible inside the
contentArea
,
and it also tries to set the frame as selected.
internalFrameDeiconified
in interface javax.swing.event.InternalFrameListener
internalFrameDeiconified
in class javax.swing.event.InternalFrameAdapter
e
- the event generated by the JInternalFrame
frameJInternalFrame
,
InternalFrameEvent
public void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
This method first checks if the internal frame is an EventLogEditor
, in that
case it looks if the frame content has already been saved or not: in the first case, it sets the
default close operation of the frame as DISPOSE_ON_CLOSE
. In the second one,
it asks if the user wants to save or not the document before closing, then if the answer is YES,
the method tries to save the document and at the end sets the frame as DISPOSE_ON_CLOSE
if it successfully saved the content, as DO_NOTHING_ON_CLOSE
otherwise. If instead
the answer is NO, it sets the frame as DISPOSE_ON_CLOSE
; if at last the answer is
CANCEL or the user have closed the dialog, it sets the frame as DO_NOTHING_ON_CLOSE
.
If the internal frame is not an EventLogEditor
, the method asks as a default
solution if the user wants to export the content of the frame before closing it. This solution acts in
the same way as the preceding one (the managing of the user's decision to save or not the
EventLogEditor
) discussed above. This default solution is used because if the frame is not
an EventLogEditor
(that is the only internal frame with modifiable textual content by
the user), it means that the internal frame that generates the event has a "read only non textual"
content that cannot be saved from the standard save procedure in a text file, but require the
export procedure to be saved correctly.
internalFrameClosing
in interface javax.swing.event.InternalFrameListener
internalFrameClosing
in class javax.swing.event.InternalFrameAdapter
e
- the event generated by the JInternalFrame
frameEventLogEditor
,
JInternalFrame
,
InternalFrameEvent
public void internalFrameClosed(javax.swing.event.InternalFrameEvent e)
This method removes the JInternalFrame
frame that generates this event from the
contentArea
,
then it searches the FooterAreaButton
button linked to
this internal frame and removes it from the
footerArea
.
internalFrameClosed
in interface javax.swing.event.InternalFrameListener
internalFrameClosed
in class javax.swing.event.InternalFrameAdapter
e
- the event generated by the JInternalFrame
frameJInternalFrame
,
InternalFrameEvent
,
FooterAreaButton
public void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
This method searches the FooterAreaButton
button linked to
the JInternalFrame
frame that generates this event and sets it as selected in the
footerArea
.
internalFrameActivated
in interface javax.swing.event.InternalFrameListener
internalFrameActivated
in class javax.swing.event.InternalFrameAdapter
e
- the event generated by the JInternalFrame
frameJInternalFrame
,
InternalFrameEvent
,
FooterAreaButton