com.sun.electric.tool.user.ui
Class WindowFrame

java.lang.Object
  extended by java.util.Observable
      extended by com.sun.electric.tool.user.ui.WindowFrame

public class WindowFrame
extends java.util.Observable

This class defines an edit window, with a cell explorer on the left side.


Nested Class Summary
static class WindowFrame.CellHistory
          Class to track CellHistory and associated values.
static class WindowFrame.CurTechControlListener
          Class to handle changes the "Technology" selection of either the Layer tab or the Component tab of the side bar.
static class WindowFrame.DisplayAttributes
           
 
Field Summary
static java.awt.event.KeyListener curKeyListener
          current key listener
static java.awt.event.MouseListener curMouseListener
          current mouse listener
static java.awt.event.MouseMotionListener curMouseMotionListener
          current mouse motion listener
static java.awt.event.MouseWheelListener curMouseWheelListener
          current mouse wheel listener
 
Constructor Summary
WindowFrame()
           
 
Method Summary
 void addToHistory(Cell cell, VarContext context, WindowFrame.DisplayAttributes da)
          Adds to cellHistory record list.
static void autoTechnologySwitch(Cell cell, WindowFrame wf)
          Method to automatically switch to the proper technology for a Cell.
 void cellHistoryGoBack()
          Go back in history list.
 void cellHistoryGoForward()
          Go forward in history list.
 java.lang.String composeTitle(Cell cell, java.lang.String prefix, int pageNo)
          Centralized version of naming windows.
static WindowFrame createEditWindow(Cell cell)
          Method to create a new circuit-editing window on the screen that displays a Cell.
static WindowFrame createWaveformWindow(Stimuli sd)
          Method to create a new waveform window on the screen given the simulation data.
 int findCellHistoryIndex(Cell cell, VarContext context)
          Method to find a CellHistory index that shows a given cell and context.
static WindowFrame findFromIndex(int index)
          Method to find the WindowFrame associated with an index number.
 void finished()
          Method to record that this WindowFrame has been closed.
 void finishWindowFrameInformation(WindowContent wnd, Cell cell)
          Method to finish with frame pointers.
 boolean generatedEvent(java.awt.AWTEvent e)
          Returns true if this window frame or it's components generated this event.
 java.util.List<WindowFrame.CellHistory> getCellHistoryList()
          Method to return the list of cell histories associated with this WindowFrame.
 int getCellHistoryLocation()
          Method to return the current position in the cell history list.
 java.awt.Component getComponent()
           
 WindowContent getContent()
          Method to get the content of this window.
static Cell getCurrentCell()
          Method to return the current Cell.
static WindowFrame getCurrentWindowFrame()
          Method to get the current WindowFrame.
static WindowFrame getCurrentWindowFrame(boolean makeNewFrame)
          Method to get the current WindowFrame.
 javax.swing.JMenu getDynamicMenu()
           
 ExplorerTree getExplorerTab()
          Method to return the Explorer tab associated with this WindowFrame.
 TopLevel getFrame()
          Method to return the TopLevel associated with this WindowFrame.
 int getIndex()
          Method to get the unique index number of this WindowFrame.
 javax.swing.JInternalFrame getInternalFrame()
          Method to return the JInternalFrame associated with this WindowFrame.
 LayerTab getLayersTab()
          Method to return the layer visibility tab associated with this WindowFrame.
static java.util.EventListener getListener()
          Method to get the current listener that responds to clicks in any window.
static int getNumWindows()
          Method to return the number of WindowFrames.
 PaletteFrame getPaletteTab()
          Method to return the component palette associated with this WindowFrame.
 java.lang.String getTitle()
          Method to get the description on the window frame
 int getUsageClock()
          Method to return the usage clock of this WindowFrame.
 WaveformWindow getWaveformWindow()
          Method to return the WaveformWindow associated with this frame.
static java.util.Iterator<WindowFrame> getWindows()
          Method to return an Iterator over all WindowFrames.
 boolean isFocusOwner()
           
 void loadComponentMenuForTechnology()
          Set the Technology popup in the component tab and the layers tab to the current technology.
 java.util.List<javax.swing.tree.MutableTreeNode> loadDefaultExplorerTree()
           
 void moveEditWindow(java.awt.GraphicsConfiguration gc)
           
static Cell needCurCell()
          Method to insist on a current Cell.
static void removeLibraryReferences(Library lib)
           
static void repaintAllWindows()
           
 void requestFocus()
          Method to request focus on this window
 void saveCurrentCellHistoryState()
          Records current cell state into history Assumes record pointed to by cellHistoryLocation is history record for the current cell/context.
 void setCellByHistory(int location)
          Restores cell state from history record
 void setCellWindow(Cell cell, WindowFrame.CellHistory history)
          Method to show a cell in the right-part of this WindowFrame.
 void setCursor(java.awt.Cursor cursor)
          Method to set the cursor that is displayed in the WindowFrame.
 void setDynamicMenu(javax.swing.JMenu menu)
          Method to set the dynamic menu where
static void setListener(java.util.EventListener listener)
          Method to set the current listener that responds to clicks in any window.
static void setSideBarLocation(boolean onLeft)
           
 void setTitle(java.lang.String title)
          Method to set the description on the window frame
 void setWindowSize(java.awt.Rectangle frameRect)
           
static void show3DHighlight()
          Method to access 3D view and highligh elements if view is available
static void showFrame(WindowFrame wf)
          Use by highlight tools to bring the frame to the front.
static void updateTechnologyLists()
          Method to update all technology popup selectors.
static void wantToOpenCurrentLibrary(boolean openLib, Cell cell)
          Method to force the explorer tree to show the current library or signals list.
static void wantToRedoLibraryTree()
          Method to request that the library tree be reloaded.
 void wantToRedoSignalTree()
           
static void wantToRedoTitleNames()
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

curMouseListener

public static java.awt.event.MouseListener curMouseListener
current mouse listener


curMouseMotionListener

public static java.awt.event.MouseMotionListener curMouseMotionListener
current mouse motion listener


curMouseWheelListener

public static java.awt.event.MouseWheelListener curMouseWheelListener
current mouse wheel listener


curKeyListener

public static java.awt.event.KeyListener curKeyListener
current key listener

Constructor Detail

WindowFrame

public WindowFrame()
Method Detail

showFrame

public static void showFrame(WindowFrame wf)
Use by highlight tools to bring the frame to the front.

Parameters:
wf -

repaintAllWindows

public static void repaintAllWindows()

setDynamicMenu

public void setDynamicMenu(javax.swing.JMenu menu)
Method to set the dynamic menu where

Parameters:
menu -

getDynamicMenu

public javax.swing.JMenu getDynamicMenu()

createEditWindow

public static WindowFrame createEditWindow(Cell cell)
Method to create a new circuit-editing window on the screen that displays a Cell.

Parameters:
cell - the cell to display.
Returns:
the WindowFrame that shows the Cell.

getIndex

public int getIndex()
Method to get the unique index number of this WindowFrame.

Returns:
the unique index number of this WindowFrame.

findFromIndex

public static WindowFrame findFromIndex(int index)
Method to find the WindowFrame associated with an index number.

Parameters:
index - the index number.
Returns:
the associated WindowFrame (null if none found).

finishWindowFrameInformation

public void finishWindowFrameInformation(WindowContent wnd,
                                         Cell cell)
Method to finish with frame pointers.


show3DHighlight

public static void show3DHighlight()
Method to access 3D view and highligh elements if view is available


createWaveformWindow

public static WindowFrame createWaveformWindow(Stimuli sd)
Method to create a new waveform window on the screen given the simulation data.

Parameters:
sd - the simulation data to use in the waveform window.
Returns:
the WindowFrame that shows the waveforms.

updateTechnologyLists

public static void updateTechnologyLists()
Method to update all technology popup selectors. Called when a new technology has been created.


loadDefaultExplorerTree

public java.util.List<javax.swing.tree.MutableTreeNode> loadDefaultExplorerTree()

loadComponentMenuForTechnology

public void loadComponentMenuForTechnology()
Set the Technology popup in the component tab and the layers tab to the current technology.


getComponent

public java.awt.Component getComponent()

getUsageClock

public int getUsageClock()
Method to return the usage clock of this WindowFrame. Each activation of the WindowFrame increments the value, so the WindowFrame with the highest value is the one most recently activated.

Returns:
the usage clock of this WindowFrame.

setCellWindow

public void setCellWindow(Cell cell,
                          WindowFrame.CellHistory history)
Method to show a cell in the right-part of this WindowFrame. Handles both circuit cells and text cells.

Parameters:
cell - the Cell to display.

moveEditWindow

public void moveEditWindow(java.awt.GraphicsConfiguration gc)

wantToOpenCurrentLibrary

public static void wantToOpenCurrentLibrary(boolean openLib,
                                            Cell cell)
Method to force the explorer tree to show the current library or signals list.

Parameters:
openLib - true to open the current library, false to open the signals list.
cell - cell to select in ExplorerTree

wantToRedoLibraryTree

public static void wantToRedoLibraryTree()
Method to request that the library tree be reloaded.


wantToRedoSignalTree

public void wantToRedoSignalTree()

setSideBarLocation

public static void setSideBarLocation(boolean onLeft)

getContent

public WindowContent getContent()
Method to get the content of this window. The content is the object in the right side (EditWindow, WaveformWindow, etc.)

Returns:
the content of this window.

getCurrentWindowFrame

public static WindowFrame getCurrentWindowFrame()
Method to get the current WindowFrame. If there is no current WindowFrame, then it will create a new EditWindow window frame.

Returns:
the current WindowFrame.

getCurrentWindowFrame

public static WindowFrame getCurrentWindowFrame(boolean makeNewFrame)
Method to get the current WindowFrame. If 'makeNewFrame' is true, then this will make a new EditWindow window frame if there is no current frame. If 'makeNewFrame' is false, this will return null if there is no current WindowFrame.

Parameters:
makeNewFrame - whether or not to make a new WindowFrame if no current frame
Returns:
the current WindowFrame. May return null if 'makeNewFrame' is false.

setListener

public static void setListener(java.util.EventListener listener)
Method to set the current listener that responds to clicks in any window. There is a single listener in effect everywhere, usually controlled by the toolbar.

Parameters:
listener - the new lister to be in effect.

getListener

public static java.util.EventListener getListener()
Method to get the current listener that responds to clicks in any window. There is a single listener in effect everywhere, usually controlled by the toolbar.

Returns:
the current listener.

getCurrentCell

public static Cell getCurrentCell()
Method to return the current Cell.


needCurCell

public static Cell needCurCell()
Method to insist on a current Cell. Prints an error message if there is no current Cell.

Returns:
the current Cell in the current Library. Returns NULL if there is no current Cell.

setCursor

public void setCursor(java.awt.Cursor cursor)
Method to set the cursor that is displayed in the WindowFrame.

Parameters:
cursor - the cursor to display here.

removeLibraryReferences

public static void removeLibraryReferences(Library lib)

requestFocus

public void requestFocus()
Method to request focus on this window


isFocusOwner

public boolean isFocusOwner()

wantToRedoTitleNames

public static void wantToRedoTitleNames()

setWindowSize

public void setWindowSize(java.awt.Rectangle frameRect)

finished

public void finished()
Method to record that this WindowFrame has been closed. This method is called from the event handlers on the windows.


getWaveformWindow

public WaveformWindow getWaveformWindow()
Method to return the WaveformWindow associated with this frame.

Returns:
the WaveformWindow associated with this frame.

getExplorerTab

public ExplorerTree getExplorerTab()
Method to return the Explorer tab associated with this WindowFrame.

Returns:
the Explorer tab associated with this WindowFrame.

getPaletteTab

public PaletteFrame getPaletteTab()
Method to return the component palette associated with this WindowFrame.

Returns:
the component palette associated with this WindowFrame.

getLayersTab

public LayerTab getLayersTab()
Method to return the layer visibility tab associated with this WindowFrame.

Returns:
the layer visibility tab associated with this WindowFrame.

getFrame

public TopLevel getFrame()
Method to return the TopLevel associated with this WindowFrame. In SDI mode this returns this WindowFrame's TopLevel Frame. In MDI mode there is only one TopLevel frame, so this method will return that Frame.

Returns:
the TopLevel associated with this WindowFrame.

getInternalFrame

public javax.swing.JInternalFrame getInternalFrame()
Method to return the JInternalFrame associated with this WindowFrame. In SDI mode this returns null.

Returns:
the JInternalFrame associated with this WindowFrame.

generatedEvent

public boolean generatedEvent(java.awt.AWTEvent e)
Returns true if this window frame or it's components generated this event.

Parameters:
e - the event generated
Returns:
true if this window frame or it's components generated this event, false otherwise.

getNumWindows

public static int getNumWindows()
Method to return the number of WindowFrames.

Returns:
the number of WindowFrames.

getWindows

public static java.util.Iterator<WindowFrame> getWindows()
Method to return an Iterator over all WindowFrames.

Returns:
an Iterator over all WindowFrames.

composeTitle

public java.lang.String composeTitle(Cell cell,
                                     java.lang.String prefix,
                                     int pageNo)
Centralized version of naming windows. Might move it to class that would replace WindowContext

Parameters:
cell - the cell in the window.
prefix - a prefix for the title.

setTitle

public void setTitle(java.lang.String title)
Method to set the description on the window frame


getTitle

public java.lang.String getTitle()
Method to get the description on the window frame


autoTechnologySwitch

public static void autoTechnologySwitch(Cell cell,
                                        WindowFrame wf)
Method to automatically switch to the proper technology for a Cell.

Parameters:
cell - the cell being displayed. If technology auto-switching is on, make sure the right technology is displayed for the Cell.

getCellHistoryList

public java.util.List<WindowFrame.CellHistory> getCellHistoryList()
Method to return the list of cell histories associated with this WindowFrame.

Returns:
the list of cell histories associated with this WindowFrame.

getCellHistoryLocation

public int getCellHistoryLocation()
Method to return the current position in the cell history list.

Returns:
the current position in the cell history list.

cellHistoryGoBack

public void cellHistoryGoBack()
Go back in history list.


cellHistoryGoForward

public void cellHistoryGoForward()
Go forward in history list.


addToHistory

public void addToHistory(Cell cell,
                         VarContext context,
                         WindowFrame.DisplayAttributes da)
Adds to cellHistory record list. Should only be called via non-history traversing modifications to history. (such as Edit->New Cell).


saveCurrentCellHistoryState

public void saveCurrentCellHistoryState()
Records current cell state into history Assumes record pointed to by cellHistoryLocation is history record for the current cell/context.


setCellByHistory

public void setCellByHistory(int location)
Restores cell state from history record


findCellHistoryIndex

public int findCellHistoryIndex(Cell cell,
                                VarContext context)
Method to find a CellHistory index that shows a given cell and context.

Parameters:
cell - the cell to find.
context - the cell context to find.
Returns:
the CellHistory index associated with that cell/context (-1 if not found).