public class EventLogManagerView extends JFrame
JFrame
,
Serialized FormJFrame.AccessibleJFrame
Frame.AccessibleAWTFrame
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
private JDesktopPane |
contentArea
The
JDesktopPane that defines the main
central area of the application. |
private JPanel |
discoveryTab
The
JPanel that defines the second tab of
the menu and contains all the buttons of the Discovery tab. |
private JFileChooser |
fileChooser
This is the object that manage the user's files selection
in many situation, such as opening a file or saving a content
in a destination file.
|
private JPanel |
fileTab
The
JPanel that defines the first tab of
the menu and contains all the buttons of the File tab. |
private JPanel |
footerArea
The
JPanel that defines the bar at the
bottom of the JFrame frame. |
private ButtonGroup |
footerAreaButtonsGroup
|
private JPanel |
infoTab
The
JPanel that defines the third tab of the
menu and contains all the buttons of the Info tab. |
private JTabbedPane |
menuArea
The
JTabbedPane that contains all the
tabs of the menu and their components. |
private static long |
serialVersionUID
Auto-Generated Serial Version UID for this class.
|
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
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
EventLogManagerView()
Constructs a new
EventLogManagerView , initialising its
instance variables and calling the method initGUI() . |
Modifier and Type | Method and Description |
---|---|
void |
addKeyEventDispatcher(KeyEventDispatcher dispatcher)
Adds a
KeyEventDispatcher to the KeyboardFocusManager of this frame. |
JDesktopPane |
getContentArea()
This method returns the
JDesktopPane contentArea GUI component. |
JPanel |
getDiscoveryTab()
This method returns the
JPanel discoveryTab GUI component. |
JFileChooser |
getFileChooser()
This method returns the
JFileChooser fileChooser component. |
JPanel |
getFileTab()
This method returns the
JPanel fileTab GUI component. |
JPanel |
getFooterArea()
This method returns the
JPanel footerArea GUI component. |
ButtonGroup |
getFooterAreaButtonsGroup()
This method returns the
ButtonGroup footerAreaButtonsGroup
GUI utility component. |
JPanel |
getInfoTab()
This method returns the
JPanel infoTab GUI component. |
JTabbedPane |
getMenuArea()
This method returns the
JTabbedPane menuArea GUI component. |
private void |
initGUI()
Initialises the GUI by setting all its components.
|
EventLogEditor |
newEventLogEditor(String title,
int internalFrameID)
|
void |
newFiltersDialog(String title,
EventLogEditor editor,
ActionListener listener)
Shows a non-modal dialog with the passed title, associated with the passed
EventLogEditor
(the dialog will be closed automatically by the editor when needed and only one dialog associated to
a specific editor can be opened, if a new one gets opened, the old one gets closed). |
FooterAreaButton |
newFooterAreaButton(String text,
int internalFrameID)
Adds a new
FooterAreaButton button inside the footerArea
with the specified settings, included the identifier of the JInternalFrame
to manage. |
FootprintMatrixInfo |
newFootprintMatrixInfo(String title,
int internalFrameID)
Adds a new
FootprintMatrixInfo object, extension of the
JInternalFrame class, inside the contentArea . |
JInternalFrame |
newInternalFrame(String title,
int internalFrameID)
Adds a new generic
JInternalFrame object inside the contentArea . |
private MenuAreaButton |
newMenuAreaButton(String buttonText,
String buttonIconURL,
String buttonToolTip,
String buttonActionCommand)
Creates a new
MenuAreaButton button with text,
icon (optional), tool tip and action command. |
void |
setBusyState(boolean isBusy)
Switches the Operative System cursor icon between
DEFAULT
and WAIT , depending on the value passed as parameter
(true to express the busy state of the application,
false to switch back to the default state). |
void |
showDialog(String title,
Container contentPane,
boolean modal)
Shows a non-modal dialog with the passed title and that contains the passed content pane.
|
void |
showErrorMessage(String errorMessage)
This method displays the passed error message string in a dialog on the application frame.
|
String |
showFileSelectionDialog(String dialogTitle,
String selectedFile,
FileFilter... filesFilter)
This method shows a dialog for selecting a file.
|
void |
showInfoMessage(String infoMessage)
This method displays the passed info message string in a dialog on the application frame.
|
int |
showOptionDialog(Object message,
String title,
int messageType,
Object[] options,
Object initialValue)
Opens a dialog that displays the passed message and then makes the user
decides between an array of options.
|
void |
showPopup(JButton targetButton,
List<String> itemList,
ActionListener itemListener)
Shows a pop-up menu connected with the passed
JButton , using as names for the items
the ones that are inside the List and adding to them the passed ActionListener . |
void |
showWarningMessage(String warningMessage)
This method displays the passed warning message string in a dialog on the application frame.
|
void |
start()
Starts the GUI by setting its main
JFrame frame visible. |
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
getFont, postEvent
private static final long serialVersionUID
private JTabbedPane menuArea
JTabbedPane
that contains all the
tabs of the menu and their components.JTabbedPane
private JPanel fileTab
JPanel
that defines the first tab of
the menu and contains all the buttons of the File tab.JPanel
private JPanel discoveryTab
JPanel
that defines the second tab of
the menu and contains all the buttons of the Discovery tab.JPanel
private JPanel infoTab
JPanel
that defines the third tab of the
menu and contains all the buttons of the Info tab.JPanel
private JDesktopPane contentArea
JDesktopPane
that defines the main
central area of the application. Inside this area the
application opens all the JInternalFrame
frames.JDesktopPane
,
JInternalFrame
private JPanel footerArea
JPanel
that defines the bar at the
bottom of the JFrame
frame. This bar contains all the
FooterAreaButton
buttons associated to the opened JInternalFrame
frames.JPanel
,
JFrame
,
JInternalFrame
private ButtonGroup footerAreaButtonsGroup
ButtonGroup
private JFileChooser fileChooser
This object remembers user's directory choice and shows the last directory visited at the next file selection.
JFileChooser
public EventLogManagerView()
EventLogManagerView
, initialising its
instance variables and calling the method initGUI()
.public JTabbedPane getMenuArea()
JTabbedPane
menuArea
GUI component.menuArea
GUI component.public JPanel getFileTab()
JPanel
fileTab
GUI component.fileTab
GUI component.public JPanel getDiscoveryTab()
JPanel
discoveryTab
GUI component.discoveryTab
GUI component.public JPanel getInfoTab()
JPanel
infoTab
GUI component.infoTab
GUI component.public JDesktopPane getContentArea()
JDesktopPane
contentArea
GUI component.contentArea
GUI component.public JPanel getFooterArea()
JPanel
footerArea
GUI component.footerArea
GUI component.public ButtonGroup getFooterAreaButtonsGroup()
ButtonGroup
footerAreaButtonsGroup
GUI utility component.footerAreaButtonsGroup
GUI utility component.public JFileChooser getFileChooser()
JFileChooser
fileChooser
component.JFileChooser
component.public void start()
JFrame
frame visible.JFrame
private void initGUI()
private MenuAreaButton newMenuAreaButton(String buttonText, String buttonIconURL, String buttonToolTip, String buttonActionCommand)
MenuAreaButton
button with text,
icon (optional), tool tip and action command.buttonText
- the text of the buttonbuttonIconURL
- the URL of the image to display on the buttonbuttonToolTip
- the tool tip to displaybuttonActionCommand
- the action command of the buttonMenuAreaButton
button.public EventLogEditor newEventLogEditor(String title, int internalFrameID)
EventLogEditor
object, extension of the
JInternalFrame
class, inside the contentArea
.
This method also sets the internal frame dimension, calculating it
based on the available space in the contentArea
, and position,
calling the DesktopManager to position the frame.
One of the passed parameter is the internal frame identifier to set, this is
needed for creating a connection between this frame and its associated FooterAreaButton
.
title
- the title of the internal frameinternalFrameID
- the identifier of the EventLogEditor
EventLogEditor
object created.EventLogEditor
,
FooterAreaButton
,
JInternalFrame
public FootprintMatrixInfo newFootprintMatrixInfo(String title, int internalFrameID)
FootprintMatrixInfo
object, extension of the
JInternalFrame
class, inside the contentArea
.
This method also sets the internal frame dimension, calculating it
based on the available space in the contentArea
, and position,
calling the DesktopManager to position the frame.
One of the passed parameter is the internal frame identifier to set, this is
needed for creating a connection between this frame and its associated FooterAreaButton
.
title
- the title of the internal frameinternalFrameID
- the identifier of the FootprintMatrixInfo
FootprintMatrixInfo
object created.FootprintMatrixInfo
,
FooterAreaButton
,
JInternalFrame
public JInternalFrame newInternalFrame(String title, int internalFrameID)
JInternalFrame
object inside the contentArea
.
This method also sets the internal frame dimension, calculating it
based on the available space in the contentArea
, and position,
calling the DesktopManager to position the frame.
One of the passed parameter is the internal frame identifier to set, this is
needed for creating a connection between this frame and its associated FooterAreaButton
.
title
- the title of the internal frameinternalFrameID
- the identifier of the JInternalFrame
JInternalFrame
object created.JInternalFrame
public FooterAreaButton newFooterAreaButton(String text, int internalFrameID)
FooterAreaButton
button inside the footerArea
with the specified settings, included the identifier of the JInternalFrame
to manage.text
- the text of the buttoninternalFrameID
- the identifier of the JInternalFrame
to manageFooterAreaButton
button created.public int showOptionDialog(Object message, String title, int messageType, Object[] options, Object initialValue)
message
- the message to displaytitle
- the title for the dialogmessageType
- an integer designating the kind of message this is, primarily used to determine
the icon from the pluggable Look and Feel: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGEoptions
- an array of objects indicating the possible choices the user can make;
if the objects are components, they are rendered properly; non-String objects are rendered using their
toString methods; if this parameter is null
, the options YES/NO/CANCEL are usedinitialValue
- the object that represents the default selection for the dialog; only meaningful
if options is used; can be null
public String showFileSelectionDialog(String dialogTitle, String selectedFile, FileFilter... filesFilter)
dialogTitle
- the title of the dialog and the text of the approve buttonselectedFile
- the name of the file to set as selected on the dialog, null
for no selectionfilesFilter
- the filters (zero, one or more, passing zero, one or more FileNameExtensionFilter
objects, or an array containing them, to this method) to use for displaying the list of files in the dialognull
otherwise.public void newFiltersDialog(String title, EventLogEditor editor, ActionListener listener)
EventLogEditor
(the dialog will be closed automatically by the editor when needed and only one dialog associated to
a specific editor can be opened, if a new one gets opened, the old one gets closed).
The dialog will contain a FilterPanel
object, that is calculated based on the editor
FootprintFilter
, to show to the user the possible selections.
To the FilterPanel
, the passed ActionListener
will be set.
title
- the String
representing the title of the dialog boxeditor
- the EventLogEditor
that will be the owner of the dialoglistener
- the ActionListener
to set for the FilterPanel
buttonsEventLogEditor
,
FilterPanel
,
FootprintFilter
public void showDialog(String title, Container contentPane, boolean modal)
title
- the String
representing the title of the dialog boxcontentPane
- the Container
representing the content pane to show inside the dialog boxmodal
- specifies whether dialog blocks user input to other top-level windows when shown. If true
, the modality type
property is set to DEFAULT_MODALITY_TYPE
otherwise the dialog is modelesspublic void showPopup(JButton targetButton, List<String> itemList, ActionListener itemListener)
JButton
, using as names for the items
the ones that are inside the List
and adding to them the passed ActionListener
.targetButton
- the JButton
that will be the graphical owner of the pop-up menuitemList
- the List
containing the String
representing the JMenuItem
namesitemListener
- the ActionListener
to associate to each JMenuItem
of the pop-up menuJButton
,
LinkedList
,
ActionListener
,
JPopupMenu
,
JMenuItem
public void showInfoMessage(String infoMessage)
It defines already the title of the dialog ("Event Logs Manager Info System") and its
type (INFORMATION_MESSAGE
).
infoMessage
- the info message to displaypublic void showWarningMessage(String warningMessage)
It defines already the title of the dialog ("Event Logs Manager Warning System") and its
type (WARNING_MESSAGE
).
warningMessage
- the warning message to displaypublic void showErrorMessage(String errorMessage)
It defines already the title of the dialog ("Event Logs Manager Error System") and its
type (ERROR_MESSAGE
).
errorMessage
- the error message to displaypublic void setBusyState(boolean isBusy)
DEFAULT
and WAIT
, depending on the value passed as parameter
(true
to express the busy state of the application,
false
to switch back to the default state).
This method helps to show to the user a busy state of the application
using the cursor icon. Every time an operation could take more than few
seconds, this method should be called before (with a true
value) and after it (with a false
one).
isBusy
- the state of the application, true
if busy to do some long operation, false
otherwisepublic void addKeyEventDispatcher(KeyEventDispatcher dispatcher)
KeyEventDispatcher
to the KeyboardFocusManager
of this frame.dispatcher
- the KeyEventDispatcher
to add to the KeyboardFocusManager
of the frameKeyEventDispatcher
,
KeyboardFocusManager