jmri.jmrit.throttle
Class ThrottleFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLayeredPane
                  extended by javax.swing.JDesktopPane
                      extended by jmri.jmrit.throttle.ThrottleFrame
All Implemented Interfaces:
ComponentListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, AddressListener

public class ThrottleFrame
extends JDesktopPane
implements ComponentListener, AddressListener

Should be named ThrottlePanel but was already existing with that name and don't want to break dependencies (particularly in Jython code)

Author:
Glen Oberhauser, Andrew Berridge Copyright 2010
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDesktopPane
JDesktopPane.AccessibleJDesktopPane
 
Nested classes/interfaces inherited from class javax.swing.JLayeredPane
JLayeredPane.AccessibleJLayeredPane
 
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JDesktopPane
LIVE_DRAG_MODE, OUTLINE_DRAG_MODE
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
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
ThrottleFrame(ThrottleWindow tw)
           
 
Method Summary
 void componentHidden(ComponentEvent e)
           
 void componentMoved(ComponentEvent e)
           
 void componentResized(ComponentEvent e)
           
 void componentShown(ComponentEvent e)
           
 void dispose()
          Handle my own destruction.
 AddressPanel getAddressPanel()
           
 ControlPanel getControlPanel()
           
static String getDefaultThrottleFilename()
           
static String getDefaultThrottleFolder()
           
 FunctionPanel getFunctionPanel()
           
 String getLastUsedSaveFile()
           
 RosterEntry getRosterEntry()
           
 ThrottleWindow getThrottleWindow()
           
 String getTitle()
           
 Element getXml()
          Collect the prefs of this object into XML Element Window prefs ControlPanel FunctionPanel AddressPanel
 Element getXmlFile()
           
 void loadThrottle(String sfile)
           
 void makeAllComponentsInBounds()
           
 void notifyAddressChosen(int newAddress, boolean isLong)
          Receive notification that a new address has been selected.
 void notifyAddressReleased(int address, boolean isLong)
          Receive notification that an address has been released/dispatched
 void notifyAddressThrottleFound(DccThrottle throttle)
          Receive notification that a throttle has been found
 void saveRosterChanges()
           
 void saveThrottle()
           
 void saveThrottleAs()
           
static void setDefaultThrottleLocation(String location)
           
 void setFrameTitle()
          setFrameTitle - set the frame title based on type, text and address
 void setLastUsedSaveFile(String lusf)
           
 void setLocation(int x, int y)
          Sets the location of a throttle frame on the screen according to x and y coordinates
 void setTitle(String txt)
           
static void setTransparent(JComponent jcomp)
           
static void setTransparent(JComponent jcomp, boolean transparency)
           
static void setTransparentBackground(Component[] comps)
           
static void setTransparentBackground(JComponent jcomp)
           
 void setXml(Element e)
          Set the preferences based on the XML Element.
 void switchMode()
           
 void toFront()
           
 JInternalFrame ynstrument(String path)
           
 
Methods inherited from class javax.swing.JDesktopPane
addImpl, getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getSelectedFrame, getUI, getUIClassID, paramString, remove, removeAll, selectFrame, setComponentZOrder, setDesktopManager, setDragMode, setSelectedFrame, setUI, updateUI
 
Methods inherited from class javax.swing.JLayeredPane
getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, setLayer, setLayer, setPosition
 
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, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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, 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, removeContainerListener, 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, 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
 

Constructor Detail

ThrottleFrame

public ThrottleFrame(ThrottleWindow tw)
Method Detail

getDefaultThrottleFolder

public static String getDefaultThrottleFolder()

getDefaultThrottleFilename

public static String getDefaultThrottleFilename()

setDefaultThrottleLocation

public static void setDefaultThrottleLocation(String location)

getThrottleWindow

public ThrottleWindow getThrottleWindow()

getControlPanel

public ControlPanel getControlPanel()

getFunctionPanel

public FunctionPanel getFunctionPanel()

getAddressPanel

public AddressPanel getAddressPanel()

getRosterEntry

public RosterEntry getRosterEntry()

toFront

public void toFront()

setLocation

public void setLocation(int x,
                        int y)
Sets the location of a throttle frame on the screen according to x and y coordinates

Overrides:
setLocation in class Component
See Also:
Component.setLocation(int, int)

setTitle

public void setTitle(String txt)

getTitle

public String getTitle()

loadThrottle

public void loadThrottle(String sfile)

ynstrument

public JInternalFrame ynstrument(String path)

makeAllComponentsInBounds

public void makeAllComponentsInBounds()

switchMode

public void switchMode()

dispose

public void dispose()
Handle my own destruction.
  1. dispose of sub windows.
  2. notify my manager of my demise.


saveRosterChanges

public void saveRosterChanges()

getXml

public Element getXml()
Collect the prefs of this object into XML Element

Returns:
the XML of this object.

getXmlFile

public Element getXmlFile()

setXml

public void setXml(Element e)
Set the preferences based on the XML Element.

Parameters:
e - The Element for this object.

setFrameTitle

public void setFrameTitle()
setFrameTitle - set the frame title based on type, text and address


componentHidden

public void componentHidden(ComponentEvent e)
Specified by:
componentHidden in interface ComponentListener

componentMoved

public void componentMoved(ComponentEvent e)
Specified by:
componentMoved in interface ComponentListener

componentResized

public void componentResized(ComponentEvent e)
Specified by:
componentResized in interface ComponentListener

componentShown

public void componentShown(ComponentEvent e)
Specified by:
componentShown in interface ComponentListener

saveThrottle

public void saveThrottle()

saveThrottleAs

public void saveThrottleAs()

notifyAddressChosen

public void notifyAddressChosen(int newAddress,
                                boolean isLong)
Description copied from interface: AddressListener
Receive notification that a new address has been selected.

Specified by:
notifyAddressChosen in interface AddressListener
Parameters:
newAddress - The address that is now selected.

notifyAddressReleased

public void notifyAddressReleased(int address,
                                  boolean isLong)
Description copied from interface: AddressListener
Receive notification that an address has been released/dispatched

Specified by:
notifyAddressReleased in interface AddressListener
Parameters:
address - The address released/dispatched

notifyAddressThrottleFound

public void notifyAddressThrottleFound(DccThrottle throttle)
Description copied from interface: AddressListener
Receive notification that a throttle has been found

Specified by:
notifyAddressThrottleFound in interface AddressListener
Parameters:
throttle - The throttle

getLastUsedSaveFile

public String getLastUsedSaveFile()

setLastUsedSaveFile

public void setLastUsedSaveFile(String lusf)

setTransparentBackground

public static void setTransparentBackground(JComponent jcomp)

setTransparentBackground

public static void setTransparentBackground(Component[] comps)

setTransparent

public static void setTransparent(JComponent jcomp)

setTransparent

public static void setTransparent(JComponent jcomp,
                                  boolean transparency)


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads