public class ReachabilityConfigUI extends UI
ConfigType enumeration.javax.swing.JFrame.AccessibleJFramejava.awt.Window.AccessibleAWTWindow, java.awt.Window.Type| Modifier and Type | Field and Description |
|---|---|
private de.hawhamburg.livingplace.messaging.activemq.wrapper.LPPublisher |
changeConfig
The
LPPublisher to send the users configuration via the ActiveMQ topic
REACHABILITY_CONFIG_CHANGE_TOPIC. |
private java.util.Map<java.lang.String,java.lang.String> |
config
The last known configuration.
|
private javax.swing.JPanel |
contentPane
The content pane of this user interface as
JPanel. |
private ConfigType |
internalType
The type of configuration pane.
|
private java.util.Map<java.lang.String,PropertyDescription> |
propertyDesc
The last known property description.
|
private de.hawhamburg.livingplace.messaging.activemq.wrapper.LPPublisher |
requestConfig
The
LPPublisher to send the get configuration request REACHABILITY_CONFIG_REQUEST_TOPIC. |
private static long |
serialVersionUID
Some unique serial version id.
|
private java.lang.String |
serviceStateReference
The current service state reference.
|
private java.util.Set<ReachabilityConfigUIResultListener> |
updaters
Current active updater.
|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabledCROSSHAIR_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_CURSORBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
ReachabilityConfigUI(javax.swing.JFrame parentWindow,
ConfigType type)
Initializes, starts and builds a new
ReachabilityConfigUI which provides an overview over a certain area
of configuration parameters related to the reachability agent. |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
private void |
addConfigRow(java.lang.String key,
PropertyDescription desc)
Adds a new row to the users interface, containing the properties type, its value and the possibility to change
it.
|
protected void |
addMenu()
This method adds a menu to the user interface.
|
private void |
addSubmitRow()
Add a new button to submit the data as row to the user interface.
|
private void |
addTopicRow(java.lang.String topic)
Adds a new topic row to the user interface.
|
private java.util.Map<java.lang.String,java.lang.String> |
fetchFromComboxBox(javax.swing.JComboBox<java.lang.String> list)
Fetches the properties value from a given
JComboBox and returns it as Map of String to
String. |
private java.util.Map<java.lang.String,java.lang.String> |
fetchFromTextArea(javax.swing.JTextArea textarea)
Fetches the properties value from a given
JTextArea and returns it as Map of String to
String. |
private java.util.Map<java.lang.String,java.lang.String> |
fetchFromTextField(javax.swing.JTextField textfield)
Fetches the properties value from a given
JTextField and returns it as Map of String to
String. |
JsonRAPropertiesChange |
getChangeMsg(java.util.Map<java.lang.String,java.lang.String> properties)
Builds up a
JsonRAPropertiesChange message to change the values of certain properties. |
private java.awt.GridLayout |
getGrid(int rowsIn)
Returns a user interface grid.
|
JsonRAPropertiesRequest |
getRequestMsg()
Builds up a
JsonRAPropertiesRequest message to request the current settings for the actual
ConfigType. |
void |
keyReleased(java.awt.event.KeyEvent arg0) |
void |
refresh(boolean refresh)
Builds the user interface.
|
void |
refresh(java.util.Map<java.lang.String,java.lang.String> props,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropertyDescription>> desc,
java.lang.String ssr,
ReachabilityConfigUIResultListener updater)
Fills the panel with (new) informations.
|
private void |
requestConfiguration()
Requests the current configuration for the actual
ConfigType by sending a JSON message on the AMQ request
topic. |
private void |
sendConfigChange(java.util.Map<java.lang.String,java.lang.String> changed)
Sends a new
JsonRAPropertiesChange message to change one or more properties to the certain
ConfigType by using getChangeMsg(Map) and the ConnectionUtil. |
void |
shutDown()
Shuts the object down.
|
addBody, autoPosition, build, fixBounds, getBody, getCommonConfigValue, getConfigValue, getConfigValueAsInteger, getFrameConfigValue, getFrameConfigValueAsInteger, getGrid, getId, getParentWindow, getTimer, getWindowHeight, getWindowWidth, infoDialog, isStandalone, keyPressed, keyTyped, killWindow, loadConfig, loadLocalConfig, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, refresh, setWindowHeight, setWindowWidth, stopTimer, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpenedaddImpl, 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, updateaddNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedaddPropertyChangeListener, 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, toFrontadd, 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, validateTreeaction, 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, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisActiveprivate static final long serialVersionUID
private javax.swing.JPanel contentPane
JPanel.private ConfigType internalType
private java.lang.String serviceStateReference
private java.util.Map<java.lang.String,java.lang.String> config
private java.util.Map<java.lang.String,PropertyDescription> propertyDesc
private java.util.Set<ReachabilityConfigUIResultListener> updaters
private de.hawhamburg.livingplace.messaging.activemq.wrapper.LPPublisher changeConfig
LPPublisher to send the users configuration via the ActiveMQ topic
REACHABILITY_CONFIG_CHANGE_TOPIC.private de.hawhamburg.livingplace.messaging.activemq.wrapper.LPPublisher requestConfig
LPPublisher to send the get configuration request REACHABILITY_CONFIG_REQUEST_TOPIC.public ReachabilityConfigUI(javax.swing.JFrame parentWindow,
ConfigType type)
ReachabilityConfigUI which provides an overview over a certain area
of configuration parameters related to the reachability agent. The user is given also the ability to change these
parameters and therefore adapt the system to his or her personal preferences. Furthermore it opens the ActiveMQ
connections for communicating with the reachability agent by using JSON messages.parentWindow - The window from which this interface was created as JFrame.type - The type of configuration parameters. One out of ConfigType.protected final void addMenu()
private java.awt.GridLayout getGrid(int rowsIn)
rowsIn - Amount of rows to be displayedprivate void addConfigRow(java.lang.String key,
PropertyDescription desc)
key - The properties name as String.desc - The display parameters of the property as PropertyDescription.private void addTopicRow(java.lang.String topic)
topic - The topics name as String.private void addSubmitRow()
public final void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListeneractionPerformed in class UIe - An ActionEvent.ActionListener.actionPerformed(java.awt.event.ActionEvent)public final void keyReleased(java.awt.event.KeyEvent arg0)
keyReleased in interface java.awt.event.KeyListenerkeyReleased in class UIarg0 - A KeyEvent.KeyListener.keyReleased(java.awt.event.KeyEvent)private java.util.Map<java.lang.String,java.lang.String> fetchFromComboxBox(javax.swing.JComboBox<java.lang.String> list)
JComboBox and returns it as Map of String to
String.list - The JComboBox object including options as list of String.JComboBox as Map of
String to String.private java.util.Map<java.lang.String,java.lang.String> fetchFromTextArea(javax.swing.JTextArea textarea)
JTextArea and returns it as Map of String to
String.textarea - The JTextArea object including the properties new value as
String.JTextArea as Map of
String to String.private java.util.Map<java.lang.String,java.lang.String> fetchFromTextField(javax.swing.JTextField textfield)
JTextField and returns it as Map of String to
String.textfield - The JTextField object including the properties new value as
String.JTextField as Map of
String to String.private void sendConfigChange(java.util.Map<java.lang.String,java.lang.String> changed)
JsonRAPropertiesChange message to change one or more properties to the certain
ConfigType by using getChangeMsg(Map) and the ConnectionUtil.changed - The changed properties as Map of String to String which contains
the property names and their new values.public final void shutDown()
StopableObjectshutDown in interface StopableObjectshutDown in class UIStopableObject.shutDown()public final void refresh(boolean refresh)
public final void refresh(java.util.Map<java.lang.String,java.lang.String> props,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,PropertyDescription>> desc,
java.lang.String ssr,
ReachabilityConfigUIResultListener updater)
refresh(boolean) method or an ReachabilityConfigUIResultListener for actual
configuration informations on refresh.props - A Map of String to String which shall be
rendered changeable as content.desc - A Map of String to Map of String to
PropertyDescription which describes the grouping, output texts and order of the
properties.ssr - The service state reference for change requests as String.updater - The updater object to be removed from the list of known updater threads
(updaters).private void requestConfiguration()
ConfigType by sending a JSON message on the AMQ request
topic. Additionally starts a new ReachabilityConfigUIResultListener thread to listen for the response.public final JsonRAPropertiesChange getChangeMsg(java.util.Map<java.lang.String,java.lang.String> properties)
JsonRAPropertiesChange message to change the values of certain properties.properties - The properties which shall be changed as Map of property to value.JsonRAPropertiesChange message.public final JsonRAPropertiesRequest getRequestMsg()
JsonRAPropertiesRequest message to request the current settings for the actual
ConfigType.JsonRAPropertiesRequest message for all properties of the current
ConfigType.