public class FilterPanel extends JPanel implements ItemListener
JPanel
to define a particular Swing panel,
that decides its elements dynamically by looking at the values of the
FootprintFilter
object associated with the EventLogEditor
passed to the constructor.
The class reads from this FootprintFilter
all the information needed
and creates a panel that shows them, making the user able to modify this information
and the Controller to install a listener to wait for user'actions on the panel buttons.
FootprintFilter
,
EventLogEditor
,
Serialized FormJPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
(package private) ArrayList<JButton> |
buttonList
The
ArrayList of all the JButton used inside this
panel. |
(package private) JComboBox<String> |
classifierMenu
The
JComboBox that contains all the registered classifiers. |
(package private) HashMap<String,Boolean> |
endEvents
The
HashMap that contains all the possible end events
and their selection. |
(package private) EventLogEditor |
eventLogEditor
The
EventLogEditor selected for showing this panel. |
(package private) FootprintFilter |
footprintFilter
The
FootprintFilter associated with the eventLogEditor
that contains all the information for creating this panel. |
(package private) JTextField |
minTraceOccurrenceField
The
JTextField that contains the value of the minimum number of trace occurrences. |
private static long |
serialVersionUID
Auto-Generated Serial Version UID for this class.
|
(package private) HashMap<String,Boolean> |
startEvents
The
HashMap that contains all the possible start events
and their selection. |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
FilterPanel(EventLogEditor editor)
Creates a
FilterPanel associated with the passed EventLogEditor . |
Modifier and Type | Method and Description |
---|---|
void |
addButtonActionListener(ActionListener listener)
|
Collection<XEventClassifier> |
getClassifiers()
Returns the
Collection of XEventClassifier registered for the log inside the EventLogEditor . |
HashMap<String,Boolean> |
getEndEvents()
Returns the
HashMap that contains all the possible end events and their selection in a boolean value. |
EventLogEditor |
getEventLogEditor()
Returns the
EventLogEditor owner of this panel. |
String |
getMinTraceOccurrenceValue()
Returns the minimum trace occurrences set inside the
minTraceOccurrenceField . |
XEventClassifier |
getSelectedClassifier()
Returns the selected
XEventClassifier inside the classifierMenu . |
HashMap<String,Boolean> |
getStartEvents()
Returns the
HashMap that contains all the possible start events and their selection in a boolean value. |
void |
itemStateChanged(ItemEvent e)
Invoked when an item has been selected or deselected by the user.
|
private void |
panelSettings()
Creates the panel view using the information inside the
footprintFilter . |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private static final long serialVersionUID
EventLogEditor eventLogEditor
EventLogEditor
selected for showing this panel.
The event log editor will be the owner of this panel and the
panel will be created based on the information inside the editor
FootprintFilter
.
EventLogEditor
,
FootprintFilter
FootprintFilter footprintFilter
FootprintFilter
associated with the eventLogEditor
that contains all the information for creating this panel.FootprintFilter
ArrayList<JButton> buttonList
ArrayList
of all the JButton
used inside this
panel.
This list is useful to associate dynamically to all the buttons inside of it
an ActionListener
to manage them. A button that needs to be associated
with an action listener just needs to be inside this list to be automatically connected
with the specified ActionListener
by the
addButtonActionListener(ActionListener)
.ArrayList
,
JButton
,
ActionListener
JTextField minTraceOccurrenceField
JTextField
that contains the value of the minimum number of trace occurrences.JTextField
JComboBox<String> classifierMenu
JComboBox
that contains all the registered classifiers.JComboBox
HashMap<String,Boolean> startEvents
HashMap
that contains all the possible start events
and their selection.HashMap
public FilterPanel(EventLogEditor editor)
FilterPanel
associated with the passed EventLogEditor
.editor
- the EventLogEditor
that will be the owner of this panel and from where to read the information to build the panelEventLogEditor
private void panelSettings()
footprintFilter
.
The panel will be incomplete if the filter is incomplete (and therefore showing
only the minTraceOccurrenceField
), complete otherwise (showing in
this case not only the minTraceOccurrenceField
, but also the
classifierMenu
and a list of check buttons based on the startEvents
and endEvents
maps).
public EventLogEditor getEventLogEditor()
EventLogEditor
owner of this panel.EventLogEditor
owner of this panel.public String getMinTraceOccurrenceValue()
minTraceOccurrenceField
.minTraceOccurrenceField
.public XEventClassifier getSelectedClassifier()
XEventClassifier
inside the classifierMenu
.XEventClassifier
inside the classifierMenu
.public Collection<XEventClassifier> getClassifiers()
Collection
of XEventClassifier
registered for the log inside the EventLogEditor
.Collection
of XEventClassifier
registered for the log inside the EventLogEditor
.public HashMap<String,Boolean> getStartEvents()
HashMap
that contains all the possible start events and their selection in a boolean value.HashMap
that contains all the possible start events and their selection in a boolean value.public HashMap<String,Boolean> getEndEvents()
HashMap
that contains all the possible end events and their selection in a boolean value.HashMap
that contains all the possible end events and their selection in a boolean value.public void addButtonActionListener(ActionListener listener)
ActionListener
to all the JButton
of the panel, that are
inside the buttonList
.
The method also sets a "owner" propriety to every button, associated with this class, to define the button owner (that is this panel).
listener
- the ActionListener
for all the JButton
of the panelpublic void itemStateChanged(ItemEvent e)
The method gets the check box that generates the event, then depending on its action command (that defines the event name associated with this check box), it implements the relative operation.
If the check box has been selected, the method updates its value to true
in the start events map or in the end events map, depending where the event resides.
if the check box has been deselected instead, the method updates its value to false
in the start events map or in the end events map, depending where the event resides.
itemStateChanged
in interface ItemListener