|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
de.avetana.bluetooth.util.ServiceFinderPane
COPYRIGHT:
(c) Copyright 2004 Avetana GmbH ALL RIGHTS RESERVED.
This file is part of the Avetana bluetooth API for Linux.
The Avetana bluetooth API for Linux is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The Avetana bluetooth API is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
The development of the Avetana bluetooth API is based on the work of
Christian Lorenz (see the Javabluetooth Stack at http://www.javabluetooth.org) for some classes,
on the work of the jbluez team (see http://jbluez.sourceforge.net/) and
on the work of the bluez team (see the BlueZ linux Stack at http://www.bluez.org) for the C code.
Classes, part of classes, C functions or part of C functions programmed by these teams and/or persons
are explicitly mentioned.
Description:
JPanel that finds every bluetooth device with Services matching a search kriteria. The search kriteria (an Array of UUIDs)
is given by the programmer as a parameter of the ServiceFinder constructor. If this parameterr is null, the ServiceFinder
class will then look for every Services accepting RFCOMM connections.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
static ProgressDialog |
m_dialog
|
javax.swing.JButton |
m_refresh
|
javax.swing.JButton |
m_select
|
ServiceDescriptor |
selected
|
| 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 javax.bluetooth.DiscoveryListener |
INQUIRY_COMPLETED, INQUIRY_ERROR, INQUIRY_TERMINATED, SERVICE_SEARCH_COMPLETED, SERVICE_SEARCH_DEVICE_NOT_REACHABLE, SERVICE_SEARCH_ERROR, SERVICE_SEARCH_NO_RECORDS, SERVICE_SEARCH_TERMINATED |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
ServiceFinderPane(java.awt.Window owner,
java.lang.String localPrefName,
UUID[] a_search)
Constructs a new ServiceFinderPane object |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addMouseListenerToTree(java.awt.event.MouseListener listener)
Adds a mouse listener to the nested JTree |
void |
cancel()
Called, when the cancel button is hit on the ProgressDialog |
void |
deviceDiscovered(RemoteDevice btDevice,
DeviceClass cod)
Reaction of the class when a new device is discovered |
void |
doInquiry()
Starts the HCI inquiry. |
void |
expandAll()
Expands all the leafs of the tree in order to make them visible |
java.util.Vector |
getAllServices()
|
javax.swing.JPanel |
getCommandPanel()
Returns the JPanel containg all commands (JButtons) |
ServiceDescriptor |
getSelectedService()
Returns the description of the selected service |
void |
inform(java.lang.String message)
Shows an information message in the progress dialog |
void |
initStack()
Inits the local BT stack |
void |
initTree()
Inits the JTree component |
void |
inquiryCompleted(int discType)
Called when an inquiry is completed. |
void |
servicesDiscovered(int transID,
ServiceRecord[] servRecord)
Reaction of the class when new services are discovered |
void |
serviceSearchCompleted(int transID,
int respCode)
Called when a service search is completed or was terminated because of an error. |
void |
setLocalPref(java.lang.String localPrefName,
UUID[] a_search)
Sets the local search and storing preferences and reloads them. |
void |
valueChanged(javax.swing.event.TreeSelectionEvent e)
|
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
public ServiceDescriptor selected
public static volatile ProgressDialog m_dialog
public javax.swing.JButton m_refresh
public javax.swing.JButton m_select
| Constructor Detail |
public ServiceFinderPane(java.awt.Window owner,
java.lang.String localPrefName,
UUID[] a_search)
throws java.lang.Exception
owner - The window owner of the JPanellocalPrefName - The list of all services found are stored in the local user preferences. Each preference
stored has a name. This variable allows the user to set this namea_search - The search kriteria (an array of UUIds)
java.lang.Exception| Method Detail |
public void addMouseListenerToTree(java.awt.event.MouseListener listener)
listener - The mouse listener to be added
public void setLocalPref(java.lang.String localPrefName,
UUID[] a_search)
localPrefName - The storing preferencesa_search - The new search kriteriapublic javax.swing.JPanel getCommandPanel()
public void cancel()
cancel in interface Cancelable
public void initStack()
throws java.lang.Exception
java.lang.Exceptionpublic void initTree()
public void deviceDiscovered(RemoteDevice btDevice,
DeviceClass cod)
deviceDiscovered in interface DiscoveryListenerbtDevice - The new Remote devicecod - The device classDiscoveryAgent.startInquiry(int, javax.bluetooth.DiscoveryListener)
public void servicesDiscovered(int transID,
ServiceRecord[] servRecord)
servicesDiscovered in interface DiscoveryListenertransID - The SDP transaction IDservRecord - The new services discoveredDiscoveryAgent.searchServices(int[], javax.bluetooth.UUID[], javax.bluetooth.RemoteDevice, javax.bluetooth.DiscoveryListener)public void inform(java.lang.String message)
message - The information messagepublic void doInquiry()
public java.util.Vector getAllServices()
public ServiceDescriptor getSelectedService()
public void expandAll()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void valueChanged(javax.swing.event.TreeSelectionEvent e)
valueChanged in interface javax.swing.event.TreeSelectionListenerpublic void inquiryCompleted(int discType)
DiscoveryListenerdiscType will be
INQUIRY_COMPLETED if the inquiry ended normally or
INQUIRY_TERMINATED if the inquiry was canceled by a call to
DiscoveryAgent.cancelInquiry(). The discType
will be INQUIRY_ERROR if an error occurred while
processing the inquiry causing the inquiry to end abnormally.
inquiryCompleted in interface DiscoveryListenerdiscType - the type of request that was completed; either
INQUIRY_COMPLETED, INQUIRY_TERMINATED, or INQUIRY_ERRORDiscoveryListener.INQUIRY_COMPLETED,
DiscoveryListener.INQUIRY_TERMINATED,
DiscoveryListener.INQUIRY_ERROR
public void serviceSearchCompleted(int transID,
int respCode)
DiscoveryListenerrespCode argument include SERVICE_SEARCH_COMPLETED, SERVICE_SEARCH_TERMINATED,
SERVICE_SEARCH_ERROR, SERVICE_SEARCH_NO_RECORDS and
SERVICE_SEARCH_DEVICE_NOT_REACHABLE. The following
table describes when each respCode will be used: respCode | Reason |
|---|---|
SERVICE_SEARCH_COMPLETED |
if the service search completed normally |
SERVICE_SEARCH_TERMINATED |
if the service search request was cancelled by a call to
DiscoveryAgent.cancelServiceSearch() |
SERVICE_SEARCH_ERROR |
if an error occurred while processing the request |
SERVICE_SEARCH_NO_RECORDS |
if no records were found during the service search |
SERVICE_SEARCH_DEVICE_NOT_REACHABLE |
if the device specified in the search request could not be reached or the local device could not establish a connection to the remote device |
serviceSearchCompleted in interface DiscoveryListenertransID - the transaction ID identifying the request which initiated the service searchrespCode - the response code that indicates the status of the transaction
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||