class EventLogManagerController.DefaultInternalFrameAdapter extends 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
Constructor and Description |
---|
DefaultInternalFrameAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
internalFrameActivated(InternalFrameEvent e)
Invoked when an internal frame is activated.
|
void |
internalFrameClosed(InternalFrameEvent e)
Invoked when an internal frame has been closed.
|
void |
internalFrameClosing(InternalFrameEvent e)
Invoked when an internal frame is in the process of being closed.
|
void |
internalFrameDeiconified(InternalFrameEvent e)
Invoked when an internal frame is de-iconified.
|
void |
internalFrameIconified(InternalFrameEvent e)
Invoked when an internal frame is iconified.
|
internalFrameDeactivated, internalFrameOpened
public void internalFrameIconified(InternalFrameEvent e)
This method set as not visible the JInternalFrame
frame
that generates this event, making it invisible inside the
contentArea
internalFrameIconified
in interface InternalFrameListener
internalFrameIconified
in class InternalFrameAdapter
e
- the event generated by the JInternalFrame
frameJInternalFrame
,
InternalFrameEvent
public void internalFrameDeiconified(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 InternalFrameListener
internalFrameDeiconified
in class InternalFrameAdapter
e
- the event generated by the JInternalFrame
frameJInternalFrame
,
InternalFrameEvent
public void internalFrameClosing(InternalFrameEvent e)
This method first checks if the internal frame is an EventLogEditor
, in that
case it looks if this frame has been modified by the user or not: in the first case, it
asks if the user wants to save or not the document before closing; in the second one, checks if the
associated file still exists and decides to close or to ask to save again the document depending on this.
If the internal frame is not an EventLogEditor
, the method then checks if is a FootprintMatrixInfo
.
If it is, the method checks if the document has already been exported or not: in the first case, it checks if the associated file
still exists and decides to close or to ask to export again the document depending on this; in the second one, it asks directly
if the user wants to export or not the document before closing.
If the frame to close is not an FootprintMatrixInfo
either, the method closes directly the internal frame, because
there is not any specific action to do before closing for a generic internal frame.
This method decides the closing or not of the target internal frame, depending on these cases, and it will override the close
operation of the frame accordingly (setting it as DISPOSE_ON_CLOSE
or DO_NOTHING_ON_CLOSE
).
internalFrameClosing
in interface InternalFrameListener
internalFrameClosing
in class InternalFrameAdapter
e
- the event generated by the JInternalFrame
frameEventLogEditor
,
JInternalFrame
,
InternalFrameEvent
public void internalFrameClosed(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 InternalFrameListener
internalFrameClosed
in class InternalFrameAdapter
e
- the event generated by the JInternalFrame
frameJInternalFrame
,
InternalFrameEvent
,
FooterAreaButton
public void internalFrameActivated(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 InternalFrameListener
internalFrameActivated
in class InternalFrameAdapter
e
- the event generated by the JInternalFrame
frameJInternalFrame
,
InternalFrameEvent
,
FooterAreaButton