com.tradeideas.external
Interface PanelPair

All Known Implementing Classes:
WindowMaster

public interface PanelPair

This represents most of the windows that TI can display. This includes the ability to save itself as part of a layout. This interface is aimed at the main program. TI cannot make a window like this on its own. E*TRADE will make the main body of the window. TI will fill in two parts of the window, and E*TRADE will fill in the third part, the part on the top right.


Nested Class Summary
static interface PanelPair.PopupListener
          This allows the main program to customize the popup menu.
static interface PanelPair.SymbolLinkingListener
          The allows the end user to send a symbol to all linked windows.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          This is the standard way to create bound properties.
 void dispose()
          The main program should tell a window when it is being disposed.
 javax.swing.JPanel getClient()
           
 javax.swing.JPopupMenu getPopup()
          This returns the current popup menu.
 javax.swing.JPanel getTopSmall()
           
 java.lang.String getWindowName()
          This is a bound property.
 void loadFromLayout(java.lang.String serialized)
          This is the inverse of saveToLayout().
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          This is the standard way to create bound properties.
 java.lang.String saveToLayout()
          This stores enough information that we can recreate the window later.
 void setPopupListener(PanelPair.PopupListener listener)
          Call this to listen to popup events.
 void setSymbolLinkingListener(PanelPair.SymbolLinkingListener listener)
          Set the listener for symbol linking events.
 

Method Detail

getTopSmall

javax.swing.JPanel getTopSmall()
Returns:
This is the panel to display on the top left of the window. This should appear on the same row as linking and help.

getClient

javax.swing.JPanel getClient()
Returns:
This is the panel to display in the main/client part of the window. This should be below the header panel. This should grow and shrink any time the window as a whole grows and shrinks.

getWindowName

java.lang.String getWindowName()
This is a bound property. You can listen for changes in the normal way. This should be displayed as the title of the window.

Returns:
The current window name. This is never null.

addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
This is the standard way to create bound properties. The window name is a bound property.

Parameters:
listener - The PropertyChangeListener to be added

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
This is the standard way to create bound properties. The window name is a bound property.

Parameters:
listener - The PropertyChangeListener to be removed

setSymbolLinkingListener

void setSymbolLinkingListener(PanelPair.SymbolLinkingListener listener)
Set the listener for symbol linking events. When a user double-clicks on a symbol (or similar) we will send out the symbol this way. If you call this multiple times, you will replace the previous values.

Parameters:
listener - This is the listener. Set this to null to stop listening.

setPopupListener

void setPopupListener(PanelPair.PopupListener listener)
Call this to listen to popup events. If you call this multiple times, you will replace the previous values.

Parameters:
listener - This is the new listener. Set this to null to stop listening.

getPopup

javax.swing.JPopupMenu getPopup()
This returns the current popup menu. This value can change at any time based on the user's actions. This is useful if the user clicks on the special icon on the header which displays the popup.

Returns:
This returns the current popup menu. This might be null if no popup is appropriate at the current time.

dispose

void dispose()
The main program should tell a window when it is being disposed. Most windows listen to external data, so they will not be automatically garbage collected.


saveToLayout

java.lang.String saveToLayout()
This stores enough information that we can recreate the window later. This is useful for saving to a layout, or for duplicating a window. This value should be consistent with TI Pro as much as possible, to increase sharing and help TI support.

Returns:
A serialized version of the window contents.

loadFromLayout

void loadFromLayout(java.lang.String serialized)
This is the inverse of saveToLayout(). This allows us to load a string created by saveToLayout(). As much as possible this should be compatible with TI Pro. The main difference is that TI Pro would allow a layout file to contain multiple windows, but this will only affect the current window. As much as possible this should be tolerant of bad input files. It is possible that these files are being shared between different versions of the software.

Parameters:
serialized - The output of saveToLayout(), or a complete window or layout file saved by TI Pro.