com.sun.electric.tool.user.waveform
Class Panel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.sun.electric.tool.user.waveform.Panel
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class Panel
extends javax.swing.JPanel
implements java.awt.event.MouseMotionListener, java.awt.event.MouseListener, java.awt.event.MouseWheelListener, java.awt.event.KeyListener

This class defines a single panel of WaveSignals with an associated list of signal names.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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
Panel(WaveformWindow waveWindow, boolean analog, Analysis.AnalysisType analysisType)
          Constructor creates a panel in a WaveformWindow.
 
Method Summary
 void addHighlightedSignal(WaveSignal ws, boolean repaintContents)
           
 void addHorizRulerPanel()
           
 void addSignal(WaveSignal sig, javax.swing.JButton but)
           
 void clearHighlightedSignals()
           
 void clearMeasurements()
          Method to remove all displayed measurements from the panel
 void closePanel()
           
 int convertXDataToScreen(double value)
          Method to scale a simulation X value to the X coordinate in this window.
 double convertXScreenToData(int x)
          Method to scale an X coordinate from screen space to data space.
 javax.swing.JButton findButton(WaveSignal ws)
           
 WaveSignal findWaveSignal(javax.swing.JButton but)
           
 WaveSignal findWaveSignal(Signal sig)
           
 void finished()
          Method to get rid of this Panel.
 void fitToSignal(Signal sSig)
          Method to make this Panel show a signal fully.
 Analysis.AnalysisType getAnalysisType()
           
static Panel getCurrentPanel()
           
static int getCurrentXPos()
           
 javax.swing.JButton getDigitalSignalButton()
           
 HorizRuler getHorizRuler()
           
 javax.swing.JPanel getLeftHalf()
           
 double getMaxXAxis()
          Method to return the high X axis value shown in this panel.
 double getMinXAxis()
          Method to return the low X axis value shown in this panel.
 int getNumSignals()
           
 int getPanelNumber()
           
 java.util.List<PolyBase> getPolysForPrinting()
          Method to find a list of PolyBase objects that describe Signals in this panel.
 javax.swing.JPanel getRightHalf()
           
 javax.swing.JPanel getSignalButtons()
           
 javax.swing.JScrollPane getSignalButtonsPane()
           
 java.util.List<WaveSignal> getSignals()
          Method to return a List of WaveSignals in this panel.
 int getVertAxisPos()
           
 WaveformWindow getWaveWindow()
           
 Signal getXAxisSignal()
           
 double getYAxisHighValue()
           
 double getYAxisLowValue()
           
 double getYAxisRange()
           
 void hidePanel()
           
 boolean isAnalog()
           
 boolean isHidden()
           
 boolean isPanelLogarithmicHorizontally()
           
 boolean isPanelLogarithmicVertically()
           
 boolean isSelected()
           
 void keyPressed(java.awt.event.KeyEvent evt)
          the KeyListener events
 void keyReleased(java.awt.event.KeyEvent evt)
           
 void keyTyped(java.awt.event.KeyEvent evt)
           
 void makeSelectedPanel(int x, int y)
          Method to make this the highlighted Panel.
 void mouseClicked(java.awt.event.MouseEvent evt)
           
 void mouseDragged(java.awt.event.MouseEvent evt)
           
 void mouseDraggedPan(java.awt.event.MouseEvent evt)
          Method to implement the Mouse Dragged event for panning.
 void mouseDraggedSelect(java.awt.event.MouseEvent evt)
          Method to implement the Mouse Dragged event for selection.
 void mouseDraggedZoom(java.awt.event.MouseEvent evt)
          Method to implement the Mouse Dragged event for zooming.
 void mouseEntered(java.awt.event.MouseEvent evt)
           
 void mouseExited(java.awt.event.MouseEvent evt)
           
 void mouseMoved(java.awt.event.MouseEvent evt)
          the MouseMotionListener events
 void mouseMovedPan(java.awt.event.MouseEvent evt)
           
 void mouseMovedSelect(java.awt.event.MouseEvent evt)
           
 void mouseMovedZoom(java.awt.event.MouseEvent evt)
           
 void mousePressed(java.awt.event.MouseEvent evt)
          the MouseListener events
 void mousePressedPan(java.awt.event.MouseEvent evt)
          Method to implement the Mouse Pressed event for panning.
 void mousePressedSelect(java.awt.event.MouseEvent evt)
          Method to implement the Mouse Pressed event for selection.
 void mousePressedZoom(java.awt.event.MouseEvent evt)
          Method to implement the Mouse Pressed event for zooming.
 void mouseReleased(java.awt.event.MouseEvent evt)
           
 void mouseReleasedPan(java.awt.event.MouseEvent evt)
          Method to implement the Mouse Released event for panning.
 void mouseReleasedSelect(java.awt.event.MouseEvent evt)
          Method to implement the Mouse Released event for selection.
 void mouseReleasedZoom(java.awt.event.MouseEvent evt)
          Method to implement the Mouse Released event for zooming.
 void mouseWheelMoved(java.awt.event.MouseWheelEvent evt)
          the MouseWheelListener events
 void paint(java.awt.Graphics g)
          Method to repaint this Panel.
 void removeAllSignals()
           
 void removeHighlightedSignal(WaveSignal ws, boolean repaintContents)
           
 void removeHorizRulerPanel()
           
 void removeSignal(javax.swing.JButton but)
           
 void repaintContents()
          Method to repaint the panel.
 void repaintWithRulers()
          Method to repaint this window and its associated ruler panel.
 void setAnalysisType(Analysis.AnalysisType a)
           
 void setHidden(boolean hidden)
           
 void setPanelLogarithmicHorizontally(boolean logarithmic)
           
 void setPanelLogarithmicVertically(boolean logarithmic)
           
 void setVertAxisPos(int x)
           
 void setXAxisRange(double leftEdge, double rightEdge)
          Method to set the X axis range in this panel.
 void setXAxisSignal(Signal sig)
           
 void setYAxisRange(double low, double high)
          Method to set the Y axis range in this panel.
 boolean wrongPanelType(Signal sSig)
          Method to ensure that a signal can be shown in this panel.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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, isOptimizedDrawingEnabled, 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, addImpl, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Panel

public Panel(WaveformWindow waveWindow,
             boolean analog,
             Analysis.AnalysisType analysisType)
Constructor creates a panel in a WaveformWindow.

Parameters:
waveWindow - the WaveformWindow in which to place this Panel.
analysisType - the type of data shown in this Panel.
Method Detail

getWaveWindow

public WaveformWindow getWaveWindow()

finished

public void finished()
Method to get rid of this Panel.


getLeftHalf

public javax.swing.JPanel getLeftHalf()

getRightHalf

public javax.swing.JPanel getRightHalf()

setPanelLogarithmicVertically

public void setPanelLogarithmicVertically(boolean logarithmic)

isAnalog

public boolean isAnalog()

getAnalysisType

public Analysis.AnalysisType getAnalysisType()

setAnalysisType

public void setAnalysisType(Analysis.AnalysisType a)

wrongPanelType

public boolean wrongPanelType(Signal sSig)
Method to ensure that a signal can be shown in this panel. Displays an error if not.

Parameters:
sSig - the signal being tested.
Returns:
true if the signal is wrong and cannot appear in this panel.

getSignalButtons

public javax.swing.JPanel getSignalButtons()

getSignalButtonsPane

public javax.swing.JScrollPane getSignalButtonsPane()

getDigitalSignalButton

public javax.swing.JButton getDigitalSignalButton()

getPanelNumber

public int getPanelNumber()

setPanelLogarithmicHorizontally

public void setPanelLogarithmicHorizontally(boolean logarithmic)

isPanelLogarithmicHorizontally

public boolean isPanelLogarithmicHorizontally()

isPanelLogarithmicVertically

public boolean isPanelLogarithmicVertically()

getVertAxisPos

public int getVertAxisPos()

setVertAxisPos

public void setVertAxisPos(int x)

getCurrentPanel

public static Panel getCurrentPanel()

getCurrentXPos

public static int getCurrentXPos()

addSignal

public void addSignal(WaveSignal sig,
                      javax.swing.JButton but)

removeSignal

public void removeSignal(javax.swing.JButton but)

removeAllSignals

public void removeAllSignals()

getSignals

public java.util.List<WaveSignal> getSignals()
Method to return a List of WaveSignals in this panel.

Returns:
a List of WaveSignals in this panel.

getNumSignals

public int getNumSignals()

findWaveSignal

public WaveSignal findWaveSignal(Signal sig)

findWaveSignal

public WaveSignal findWaveSignal(javax.swing.JButton but)

findButton

public javax.swing.JButton findButton(WaveSignal ws)

addHorizRulerPanel

public void addHorizRulerPanel()

removeHorizRulerPanel

public void removeHorizRulerPanel()

getHorizRuler

public HorizRuler getHorizRuler()

getXAxisSignal

public Signal getXAxisSignal()

setXAxisSignal

public void setXAxisSignal(Signal sig)

hidePanel

public void hidePanel()

closePanel

public void closePanel()

setXAxisRange

public void setXAxisRange(double leftEdge,
                          double rightEdge)
Method to set the X axis range in this panel. Since the panel may go backwards in time, these values aren't guaranteed to run from left to right.

Parameters:
leftEdge - the X axis value on the left side of the panel.
rightEdge - the X axis value on the right side of the panel.

getMinXAxis

public double getMinXAxis()
Method to return the low X axis value shown in this panel.

Returns:
the low X axis value shown in this panel.

getMaxXAxis

public double getMaxXAxis()
Method to return the high X axis value shown in this panel.

Returns:
the high X axis value shown in this panel.

fitToSignal

public void fitToSignal(Signal sSig)
Method to make this Panel show a signal fully.

Parameters:
sSig - the signal to show (must be analog)

setYAxisRange

public void setYAxisRange(double low,
                          double high)
Method to set the Y axis range in this panel.

Parameters:
low - the low Y axis value.
high - the high Y axis value.

getYAxisRange

public double getYAxisRange()

getYAxisLowValue

public double getYAxisLowValue()

getYAxisHighValue

public double getYAxisHighValue()

convertXDataToScreen

public int convertXDataToScreen(double value)
Method to scale a simulation X value to the X coordinate in this window.

Parameters:
value - the simulation X value.
Returns:
the X coordinate of that simulation value on the screen.

convertXScreenToData

public double convertXScreenToData(int x)
Method to scale an X coordinate from screen space to data space.

Parameters:
x - the X coordinate on the screen.
Returns:
the X value in the simulation corresponding to that screen coordinate.

repaintWithRulers

public void repaintWithRulers()
Method to repaint this window and its associated ruler panel.


repaintContents

public void repaintContents()
Method to repaint the panel. Rebuilds the offscreen image and schedules a repaint.


paint

public void paint(java.awt.Graphics g)
Method to repaint this Panel.

Overrides:
paint in class javax.swing.JComponent

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
the MouseListener events

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent evt)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent evt)
the MouseMotionListener events

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt)
the MouseWheelListener events

Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
the KeyListener events

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
Specified by:
keyTyped in interface java.awt.event.KeyListener

getPolysForPrinting

public java.util.List<PolyBase> getPolysForPrinting()
Method to find a list of PolyBase objects that describe Signals in this panel.

Returns:
a list of PolyBase objects.

clearMeasurements

public void clearMeasurements()
Method to remove all displayed measurements from the panel


mousePressedSelect

public void mousePressedSelect(java.awt.event.MouseEvent evt)
Method to implement the Mouse Pressed event for selection.


mouseReleasedSelect

public void mouseReleasedSelect(java.awt.event.MouseEvent evt)
Method to implement the Mouse Released event for selection.


mouseDraggedSelect

public void mouseDraggedSelect(java.awt.event.MouseEvent evt)
Method to implement the Mouse Dragged event for selection.


mouseMovedSelect

public void mouseMovedSelect(java.awt.event.MouseEvent evt)

clearHighlightedSignals

public void clearHighlightedSignals()

addHighlightedSignal

public void addHighlightedSignal(WaveSignal ws,
                                 boolean repaintContents)

removeHighlightedSignal

public void removeHighlightedSignal(WaveSignal ws,
                                    boolean repaintContents)

isHidden

public boolean isHidden()

setHidden

public void setHidden(boolean hidden)

makeSelectedPanel

public void makeSelectedPanel(int x,
                              int y)
Method to make this the highlighted Panel.


isSelected

public boolean isSelected()

mousePressedZoom

public void mousePressedZoom(java.awt.event.MouseEvent evt)
Method to implement the Mouse Pressed event for zooming.


mouseReleasedZoom

public void mouseReleasedZoom(java.awt.event.MouseEvent evt)
Method to implement the Mouse Released event for zooming.


mouseDraggedZoom

public void mouseDraggedZoom(java.awt.event.MouseEvent evt)
Method to implement the Mouse Dragged event for zooming.


mouseMovedZoom

public void mouseMovedZoom(java.awt.event.MouseEvent evt)

mousePressedPan

public void mousePressedPan(java.awt.event.MouseEvent evt)
Method to implement the Mouse Pressed event for panning.


mouseReleasedPan

public void mouseReleasedPan(java.awt.event.MouseEvent evt)
Method to implement the Mouse Released event for panning.


mouseDraggedPan

public void mouseDraggedPan(java.awt.event.MouseEvent evt)
Method to implement the Mouse Dragged event for panning.


mouseMovedPan

public void mouseMovedPan(java.awt.event.MouseEvent evt)