public class X10Buttons 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) 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).
|
private static String |
DEFAULT_TRANSMITTER
Description of the Field
|
(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) KPanel |
dragableMiniViewPanel
The wrapper panel holding all in this JWindow.
|
(package private) MouseMotionAdapter |
dragMiniViewMotionListener
Listener for changing the location of this window
|
private String[] |
houseCodes_
Holds the Hose code values for the House Code Spinner *
|
private JSpinner |
houseSpinner_
Description of the Field
|
(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.
|
(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) KButton |
miniButtonClose_
The button to close this mini app window.
|
(package private) KPanel |
miniButtonPanel_
The panel holding the X10 buttons
|
(package private) KButton |
miniButtonView_
The button to Min/Max this mini app window
|
(package private) KButton |
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) KPanel |
miniViewPanel
The Button area wrapper inside the dragableMiniViewPanel.
|
(package private) KPanel |
miniViewWindowControlPanel
The Control area at the top of the window.
|
private int |
numButtons_
Class var holding the number of x10 buttons *
|
(package private) KPanel |
onOffPanel_
The panel holding the on/off toggle button
|
(package private) JToggleButton |
onOffToggle_
The toggle controlling if the next X10 command will be on or Off.
|
(package private) static MouseListener |
popupListener_
Popup menu Mouse Listener.
|
private String |
portDescriptor_
Description of the Field
|
private SpinnerListModel |
spinnerModel_
The Spinner model used in the Hose Code Spinner *
|
private static String |
SYSTEM_FILE_SEPERATOR
Constant holding the users file seperator. ("/" or "\")
|
(package private) KButton |
x10BrightButton_
A dim button.
|
(package private) KButton[] |
x10controlButton_
An array of the x10 buttons.
|
(package private) KButton |
x10DimButton_
A dim button.
|
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 |
---|
X10Buttons()
Constructor *
|
X10Buttons(boolean invisible)
Constructor *
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Handles all the Actions originating from the Control Buttons.
|
private KButton |
createButton(int controlNumber)
Creates a button using only text inside
|
private KButton |
createIconButton(int controlNumber)
Creates a button using a Icon with a preset imagename
|
private void |
enableDeviceButtons(boolean state)
Description of the Method
|
private void |
initWindowPanels()
Inits the gui widgets *
|
static void |
main(String[] arg)
The main program for the X10Buttons class.
|
void |
sendX10Command(String x10Command,
String x10HouseCode,
String x10DeviceNumber)
Abstracts the actual sending of the X10 Command.
|
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 final String SYSTEM_FILE_SEPERATOR
private static final String DEFAULT_TRANSMITTER
private static String className_
static Color mainBackColour_
static Color displayBackColour_
static Color displayTextColour_
static JPopupMenu mainMenu
static MouseListener popupListener_
KPanel dragableMiniViewPanel
KPanel miniViewPanel
KPanel miniViewWindowControlPanel
KButton miniDragButton
KButton miniButtonView_
KButton miniButtonClose_
KPanel miniButtonPanel_
KPanel onOffPanel_
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_
private String portDescriptor_
private String[] houseCodes_
private SpinnerListModel spinnerModel_
private JSpinner houseSpinner_
String buttonImageExtension_
String buttonImagepath_
ColouredLabel miniDragLabel
KButton[] x10controlButton_
KButton x10DimButton_
KButton x10BrightButton_
JToggleButton onOffToggle_
MouseAdapter miniViewMouseListener
MouseMotionAdapter dragMiniViewMotionListener
X10Buttons()
X10Buttons(boolean invisible)
public static void main(String[] arg)
arg
- The command line argumentspublic void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
e
- The action event to handlepublic void sendX10Command(String x10Command, String x10HouseCode, String x10DeviceNumber)
x10Command
- This is either 'on' or 'off'x10HouseCode
- send an uppercase house codex10DeviceNumber
- send the device nuymber as a string... ie. 'String.valueOf( 1 );'private KButton createIconButton(int controlNumber)
controlNumber
- Description of the Parameterprivate KButton createButton(int controlNumber)
controlNumber
- Description of the Parameterprivate 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