verinec.importer.analysis.sniffer
Class StartSniffer.ConfigPanel.ConfigCard

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by verinec.importer.analysis.sniffer.StartSniffer.ConfigPanel.ConfigCard
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
StartSniffer.ConfigPanel.DeviceConfigCard, StartSniffer.ConfigPanel.GlobalConfigCard
Enclosing class:
StartSniffer.ConfigPanel

public abstract class StartSniffer.ConfigPanel.ConfigCard
extends JPanel

Base class for configuration cards. Each interface has its card to be configured and one card is used for global configuration. They are controlled by the javax.swing.CardLayout and a JComboBox to choose the active card.

Author:
david.buchmann at unifr.ch
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  JCheckBox chkActive
          Checkbox to decide if this card is active.
protected  JPanel content
          Content panel.
(package private)  JComboBox hoursBox
           
(package private)  JComboBox minBox
           
(package private)  ButtonGroup modeSelection
           
protected  JRadioButton packetButton
          Button to choose mode
(package private)  JTextField packetField
           
(package private)  JComboBox secBox
           
protected  JRadioButton simButton
          Button to choose mode
protected  JRadioButton timeButton
          Button to choose mode
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
StartSniffer.ConfigPanel.ConfigCard()
          Common constructor for a config card.
 
Method Summary
protected abstract  JCheckBox getActivator()
          Factory method to create the enable checkbox.
 int getCount()
          Get the number for capturing.
 int getMode()
          The current mode this card is set to.
 boolean isActive()
          Test whether this card is set enabled or not.
 boolean isConfigValid()
          Check whether configuration represented by this panel is valid.
 void setCount(int c)
          Set the count for this card.
 void setMode(int mode)
          Set the mode for this card.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

content

protected JPanel content
Content panel.


packetButton

protected JRadioButton packetButton
Button to choose mode


timeButton

protected JRadioButton timeButton
Button to choose mode


simButton

protected JRadioButton simButton
Button to choose mode


chkActive

protected JCheckBox chkActive
Checkbox to decide if this card is active.


modeSelection

ButtonGroup modeSelection

secBox

JComboBox secBox

minBox

JComboBox minBox

hoursBox

JComboBox hoursBox

packetField

JTextField packetField
Constructor Detail

StartSniffer.ConfigPanel.ConfigCard

public StartSniffer.ConfigPanel.ConfigCard()
Common constructor for a config card. Uses getActivator() internally.

Method Detail

isActive

public boolean isActive()
Test whether this card is set enabled or not.

Returns:
Whether this card is enabled.

getMode

public int getMode()
The current mode this card is set to. One of PACKET, TIME, SIMULATE, NONE

Returns:
A mode constant as defined in ConfigCard.

getCount

public int getCount()
Get the number for capturing. Depending on the mode, this is the number of packets to capture or the duration to capture in seconds. In simulation mode, the constant value StartSniffer.ConfigPanel.SIMULATION_PACKET_COUNT is returned.

Returns:
Number of packets or duration in seconds.

getActivator

protected abstract JCheckBox getActivator()
Factory method to create the enable checkbox. (Either "use global settings" or "use this device for sniffing".)

Returns:
A checkbox with a caption.

setMode

public void setMode(int mode)
Set the mode for this card.

Parameters:
mode - One of the constants PACKETS, TIME or SIMULATE.

setCount

public void setCount(int c)
Set the count for this card. Depending on the mode, this is the number of packets to capture or the amount of seconds to scan.

Parameters:
c - The count, interpreted according to the mode.

isConfigValid

public boolean isConfigValid()
Check whether configuration represented by this panel is valid.

Returns:
True if valid, false otherwise

Copyright © 2005 Verinec, DIUF