public class ISY99Buttons extends JWindow implements ActionListener
JWindow.AccessibleJWindow
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
private int |
appXpos
the x position of the app window
|
private int |
appYpos
the y position of the app window
|
(package private) JButton |
brightButton_
A dim button.
|
(package private) String |
buttonImageExtension_
The Extension for the button images *
|
(package private) String |
buttonImagepath_
The Extension for the button images *
|
private static String |
className_
A Class holder for its name (used in Logging).
|
(package private) JButton[] |
controlButton_
An array of the buttons.
|
(package private) JButton |
dimButton_
A dim button.
|
(package private) JPanel |
dimPanel_
The panel holding the on/off toggle button
|
(package private) static Color |
displayBackColour_
The colour used to back the display area.
|
private int |
displayCols_
the number of columns of buttons to display in the app window
|
private int |
displayRows_
the number of rows of buttons to display in the app window
|
(package private) static Color |
displayTextColour_
The display area text colour.
|
(package private) JPanel |
dragableMiniViewPanel
The wrapper panel holding all in this JWindow.
|
(package private) MouseMotionAdapter |
dragMiniViewMotionListener
Listener for changing the location of this window
|
private boolean |
finishedStartup_ |
(package private) ImageIcon |
iconBright_
The object holding the bright icon.
|
(package private) ImageIcon |
iconDim_
The object holding the dim icon.
|
(package private) ImageIcon |
iconMiniClose_
The object holding the close icon.
|
(package private) ImageIcon |
iconMiniView_
The object holding the min/max icon.
|
(package private) String |
IMAGE_DIR
The dir where the images are located.
|
protected char |
INSTEON_MASTER_MODE |
protected char |
INSTEON_SLAVE_MODE |
private String[] |
insteonAddresses_ |
private String[] |
insteonResponderAddresses_ |
private String[] |
insteonResponderNames_ |
private String |
lastDevice_
The last device button pressed - used for dim/bright.
|
(package private) static Color |
mainBackColour_
The colour used for all panels except the display area.
|
(package private) static JPopupMenu |
mainMenu
The Main Popup menu
|
(package private) JButton |
miniButtonClose_
The button to close this mini app window.
|
(package private) JPanel |
miniButtonPanel_
The panel holding the X10 buttons
|
(package private) JButton |
miniButtonView_
The button to Min/Max this mini app window
|
(package private) JButton |
miniDragButton
The window header / draggable button.
|
(package private) ColouredLabel |
miniDragLabel
This is this apps draggable - Title bar.
|
(package private) MouseAdapter |
miniViewMouseListener
Listener for when the mouse is pressed on the fake window frame title bar
button.
|
(package private) JPanel |
miniViewPanel
The Button area wrapper inside the dragableMiniViewPanel.
|
(package private) JPanel |
miniViewWindowControlPanel
The Control area at the top of the window.
|
private IsyInsteonClient |
myISY |
private Thread |
nodeWatcherThread_
The thread that watches for changes to the nodes being displayed.
|
private int |
numButtons_
Class var holding the number of buttons *
|
(package private) ImageIcon |
offIcon |
(package private) ImageIcon |
onIcon |
(package private) JToggleButton |
onOffToggle_
The toggle controlling if the next command will be on or Off.
|
(package private) static MouseListener |
popupListener_
Popup menu Mouse Listener.
|
private Thread |
startupThread_
The thread that the isyDevice runs in.
|
private boolean |
stillRunning_ |
static String |
SYSTEM_FILE_SEPERATOR
A holder for this clients System File Separator.
|
static String |
SYSTEM_LINE_SEPERATOR
A holder for this clients System line termination separator.
|
private int |
XDifference_
The X amount the current window was just dragged.
|
private int |
xPosition_
the x position of the mini window
|
private int |
YDifference_
The Y amount the current window was just dragged
|
private int |
yPosition_
the y position of the mini window
|
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ISY99Buttons()
Constructor BUT does NOT start up the Client Connection.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Handles all the Actions originating from the Control Buttons.
|
private int |
countMyControlableNodes()
Counts all the NON-ContolLinc Responder Nodes that the ISY is aware of.
|
private int |
countMyNodes()
Counts all the NON-ContolLinc Nodes that the ISY is aware of.
|
private JButton |
createButtonFromAddress(String controlAddress)
Creates a text button using the node name as the button text, and the node's address as the toolTipText.
|
private JButton |
createButtonFromName(String controlName)
Creates a text button using the node name as the button text, and the node's address as the toolTipText.
|
private void |
enableDeviceButtons(boolean state)
Description of the Method
|
protected char |
getMode(String mode)
Returns the mode based on the input
|
protected Enumeration<UDNode> |
getMyControlableNodes()
Returns all NON-ControlLinc or Non-SwitchLinc
UDNode s that are associated in the client. |
protected Enumeration<UDNode> |
getMyNodes()
Returns all
UDNode s that are associated in the client. |
protected UDNode |
getNode(String nodeName)
Returns a
UDGroup or a UDNode based on the
given name |
protected UDNode |
getNodeFromAddress(String address)
Returns a
UDGroup or a UDNode based on the
given address |
protected String |
getNodeNameFromAddress(String address)
Duh!
|
protected Enumeration<UDNode> |
getNodes()
Returns all
UDNode s that are associated in the client. |
protected String |
getStatus(UDNode node)
Returns the current value of an Insteon Device (its state)
|
private void |
initGui()
Gets The Window Up
|
private void |
initWindowPanels()
Inits the gui widgets - buttons, layouts, etc.
|
protected void |
isyCleanup()
Cleans up any ISY cleanup procedures in prep for exit.
|
private void |
loadButtonNodeAddresses()
Puts all the Node Address that are responders at this ISY into the insteonResponderAddresses_ array so they can get assigned to buttons.
|
private void |
loadButtonNodeNames()
Puts all the Node Names that are responders at this ISY into the insteonResponderNamees_ array so they can get assigned to buttons.
|
private void |
loadNodeAddresses()
Puts all the Node Address at this ISY into the insteonAddresses_ array.
|
static void |
main(String[] arg)
The main program for the ISY99Buttons class.
|
void |
processCommand(String command)
Abstracts the actual sending of the ISY Command.
|
protected void |
processInsteonCommand(String cmd,
StringTokenizer tk)
Processes an Insteon command
|
protected void |
processStatus(StringTokenizer tk)
Returns the current value of Insteon Devicse (its state)
|
boolean |
startIsy()
Gets the issyClient running and waits till its running.
|
boolean |
stillRunning()
Indicates if this class thread is still running
|
protected void |
syntaxError()
Notifies the user of a syntax error
|
private void |
watchMyNodes()
Forks a thread and watches myIsy for updates to the nodes being watched.
|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update, windowInit
addNotify, 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, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBackground, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setOpacity, setShape, 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, remove, 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
private static String className_
public static final String SYSTEM_FILE_SEPERATOR
public static final String SYSTEM_LINE_SEPERATOR
private IsyInsteonClient myISY
private boolean stillRunning_
private boolean finishedStartup_
private String[] insteonAddresses_
private String[] insteonResponderAddresses_
private String[] insteonResponderNames_
private String lastDevice_
static Color mainBackColour_
static Color displayBackColour_
static Color displayTextColour_
static JPopupMenu mainMenu
static MouseListener popupListener_
JPanel dragableMiniViewPanel
JPanel miniViewPanel
JPanel miniViewWindowControlPanel
JButton miniDragButton
JButton miniButtonView_
JButton miniButtonClose_
JPanel miniButtonPanel_
ImageIcon iconMiniView_
ImageIcon iconMiniClose_
ImageIcon iconBright_
private int XDifference_
private int YDifference_
private int xPosition_
private int yPosition_
private int appXpos
private int appYpos
private int displayRows_
private int displayCols_
private int numButtons_
String buttonImageExtension_
String buttonImagepath_
ColouredLabel miniDragLabel
JButton[] controlButton_
JButton dimButton_
JButton brightButton_
JToggleButton onOffToggle_
MouseAdapter miniViewMouseListener
MouseMotionAdapter dragMiniViewMotionListener
private Thread startupThread_
private Thread nodeWatcherThread_
protected char INSTEON_MASTER_MODE
protected char INSTEON_SLAVE_MODE
public ISY99Buttons()
public boolean stillRunning()
public boolean startIsy()
protected void isyCleanup()
protected void syntaxError()
public static void main(String[] arg)
arg
- The command line argumentsprivate void initGui()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
e
- The action event to handleprotected Enumeration<UDNode> getNodes()
UDNode
s that are associated in the client.protected Enumeration<UDNode> getMyNodes()
UDNode
s that are associated in the client.protected Enumeration<UDNode> getMyControlableNodes()
UDNode
s that are associated in the client.private void watchMyNodes()
private int countMyNodes()
private int countMyControlableNodes()
private void loadNodeAddresses()
private void loadButtonNodeAddresses()
private void loadButtonNodeNames()
protected void processStatus(StringTokenizer tk)
tk
- - the StringTokenzierprotected String getStatus(UDNode node)
node
- - the UDNode to queryprotected String getNodeNameFromAddress(String address)
the
- node's address to query.protected UDNode getNodeFromAddress(String address)
UDGroup
or a UDNode
based on the
given addressaddress
- - the address of the node/scene to be retrievedprotected UDNode getNode(String nodeName)
UDGroup
or a UDNode
based on the
given nameaddress
- - the address of the node/scene to be retrievedprotected char getMode(String mode)
mode
- protected void processInsteonCommand(String cmd, StringTokenizer tk)
cmd
- - the command to be processedtk
- - the StringTokenizerpublic void processCommand(String command)
command
- This apps Command (not necessarily an Insteon Command (but could Be)private JButton createButtonFromName(String controlName)
controlAddress
- is the address of the Insteon Device to set this button up for.private JButton createButtonFromAddress(String controlAddress)
controlAddress
- is the address of the Insteon Device to set this button up for.private void initWindowPanels()
private void enableDeviceButtons(boolean state)
state
- Description of the ParameterWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses