byucc.jhdl.apps.Viewers.Schematic
Class SchematicCanvas

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bybyucc.jhdl.apps.Viewers.Event.JHDLWidgetPanel
                      extended bybyucc.jhdl.apps.Viewers.laf.JHDLUIWidgetPanel
                          extended bybyucc.jhdl.apps.Viewers.Schematic.SchematicCanvas
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, JHDLMouseEventGenerator, JHDLWidgetEventListener, java.awt.MenuContainer, java.awt.print.Printable, java.beans.PropertyChangeListener, SchematicInterface, javax.swing.Scrollable, java.io.Serializable, SimulatorCallback

public class SchematicCanvas
extends JHDLUIWidgetPanel
implements SchematicInterface, SimulatorCallback, javax.swing.Scrollable, java.awt.print.Printable

This class is a custom Panel for displaying JHDL schematics. TODO: - Create a separate class that converts Strings to a color object.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.util.ArrayList _schematicActionListeners
          This maintains a list of all SchematicActionListeners registered to this panel.
protected  java.util.ArrayList _schematicCanvasListeners
          This maintains a list of all SchematicCanvasListeners registered to this panel.
protected  java.util.ArrayList _schematicMouseListeners
          This maintains a list of all SchematicMouseListeners registered to this panel.
protected  javax.swing.JViewport _viewport
          A reference to any viewport that may be controlling this Component.
 int allocFeedBack
          This keeps track of the number of feedback wires!!
 int[] allocHor
          In this file this variable is initialized to all zeros and not used.
 boolean[][][][] allocVert
          This is used for routing nets and remembering what spaces have been used.
static java.lang.String BEHAVIORALLY_MODELED_BACKGROUND
           
static java.lang.String CHILD_OF_BEHAVIORALLY_MODELED_BACKGROUND
           
protected  Cell circuit
          Pointer to the Cell that is currently being drawn.
 CellColorModel cm
           
 byucc.jhdl.apps.Viewers.Schematic.SchematicCanvas.CanvasMouseAdapter cma
          This is used to watch for mouse events
 int[] columnWidths
          The physical width each collumn needs to be to route the nets in collumn.
static java.lang.String DEFAULT_PRINT_SETUP_SHOW_DATE
          default value for printSetupShowDate; default is false
static java.lang.String DEFAULT_PRINT_SETUP_SHOW_DESIGN_NAME
          default value for printSetupShowDesignName; default is false
static java.lang.String DEFAULT_PRINT_SETUP_SHOW_PAGE_COORDINATES
          default value for printSetupShowPageCoordinates; default is true
static java.lang.String DEFAULT_PRINT_SETUP_ZOOM_ALL
          default value for printSetupZoomAll; default is false
protected static java.lang.String DEFAULT_PRINTING_OVERLAP
          Ensures that there is enough overlap between printed pages of a schematic to maintain continuity of the image, particularly when the printer itself cuts of portions of the image around the margins
protected static BVFormat defaultRadix
          This is the String to initialize the BVFormatradix for wire values.
protected  java.util.Vector drawLast
          This vector holds all selected nets so they'll be drawn last and on top.
 int maxHeight
          Default is 0
 int[] maxWidth
          This array contains the maximum width in pixels of the components in each collumn.
static java.lang.String MESSAGE
           
static java.lang.String NOT_NETLISTABLE_CELL
           
static java.lang.String NOT_SIMULATEABLE_CELL
           
static java.lang.String NOT_VISIBLE_CELL
           
 int numLevels
          This is the number of collumns of schematic nodes it takes to place the design
 int numRows
          Default is 0
static int numWireColumns
          specifies number of vertical routing paths between columns.
static int numWireRows
          specifies number of horizontal routing paths between rws
 int offset
          offset from edge of canvas to start drawing
 int[] physicalColumn
          The physical width each column in pixels.
 int[][] physicalRow
          This is used to etermine the horizontal spacing between cells
protected static int PREFERRED_HEIGHT_DEFAULT
          Helps the containing JScrollPane know how big the JViewport should be
protected static int PREFERRED_WIDTH_DEFAULT
          Helps the containing JScrollPane know how big the JViewport should be
protected  double printScaleX
          Stores the horizontal scale factor associated with the stored scaledPrintTransform
protected  double printScaleY
          Stores the vertical scale factor associated with the stored scaledPrintTransform
protected static PropertiesDialogComponent printSetupOverlap
          sets the amount that printed pages of the schematic will overlap.
protected static PropertiesDialogComponent printSetupShowDate
          if true, the date and time will show in the upper-left corner of schematics sent to printer
protected static PropertiesDialogComponent printSetupShowDesignName
          if true, the name of the printed design will show in the upper-left corner of schematics sent to printer
protected static PropertiesDialogComponent printSetupShowPageCoordinates
          if true, then the page coordinates of each page of a printed schematic will be printed in the upper-left corner
protected static PropertiesDialogComponent printSetupZoomAll
          if true, the schematic will be zoomed to fit on a single page.
protected  BVFormat radixFormat
          This is the BVFormat that will format the values on the wires of the schematic viewer
protected  java.awt.geom.AffineTransform scaledPrintTransform
          Because the Printable.print() method is called twice for each page and the first time it is called doesn't have the proper scale information for the printer, this AffineTransform is used to remember the scaled transform.
 SortedVector schematicNetlist
          Vector containing all the ?
 SortedVector schematicNodeList
          Vector containing all the SchematicNodes.
protected static int SCROLLABLE_BLOCK_INCREMENT_OVERLAP
          When doing block scrolling, this determines how much overlap from the previous view will still remain
protected static int SCROLLABLE_UNIT_INCREMENT
          The number of pixels to shift the image of the schematic when doing unit-increment scrolls
protected  SelectedCellList selectedCells
          List of selected cells.
 boolean selectingMultiple
          THe Canvas Mouse adapter uses this to remember if multiple items are being selected.
static java.lang.String SELECTION
           
 int totalWidth
          This is the width in pixels of the design
static java.lang.String WIRE_VALUES
           
 double zoom
          Schematic zoom factor.
 
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 byucc.jhdl.apps.Viewers.Schematic.SchematicInterface
ACTION_PRINT, ACTION_UNWATCH_SELECTED_WIRES, ACTION_VIEW_ALL, ACTION_VIEW_ALL_CELLS, ACTION_VIEW_CELL_PROPERTIES, ACTION_VIEW_PORT_WIRE_PROPERTIES, ACTION_WATCH_SELECTED_WIRES, ACTION_ZOOM_IN, ACTION_ZOOM_OUT, ZOOM_MAX, ZOOM_MIN
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SchematicCanvas(Cell p, javax.swing.JViewport vp)
          Deprecated.  
SchematicCanvas(Cell p, javax.swing.JViewport vp, JHDLHostWidgetInterface hwi)
          Constructs a new SchematicCanvas--New constructor, so that this panel can pass the JHDLHostWidgetInterface to its parent to get the call chain ready to be initialized.
 
Method Summary
 void addAffectingGroup(java.lang.String group)
           
protected  void addNetProperty(Net n, java.lang.String c, java.lang.String s)
          This function is used to find a schematic net and add a property, either color or string.
 void addSchematicActionListener(SchematicActionListener listener)
          Deprecated.  
 void addSchematicCanvasListener(SchematicCanvasListener listener)
          Adds a schematic canvas listener to the listener list.
 void addSchematicMouseListener(SchematicMouseListener listener)
          Adds a schematic mouse listener to the listener list.
 void adjustColumnWidths()
           
 void build()
           
protected  void clearSelectedCells()
           
protected  void clearSelectedWires()
           
 void clearSelectionList()
           
 void clearTransferBuffer()
           
 void constructAndPlace(Cell p, Netlist nl)
           
 java.lang.String[] getAffectingGroups()
           
 Cell getCell()
          This method provides access to the Cell for which this SchematicCanvas displays.
static javax.swing.ImageIcon getChipIcon()
          Return static chipIcon
 int getH()
           
 int[] getLocation(java.lang.String cName, java.lang.String pName)
           
 SchematicNode getNode(java.lang.String cName, java.lang.String pName)
           
 java.awt.Dimension getPreferredScrollableViewportSize()
           
 SchematicCanvas getSchematicCanvas()
          Part of the SchematicInterface interface
 java.awt.Dimension getSchematicCanvasPreferredSizeInRelationToViewportSize()
           
protected  SchematicNode getSchematicNode(Cell cell)
           
 int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
           
 SchematicNode getSelected(int x, int y)
           
 java.util.ArrayList getSelectedCells(int x, int y)
           
 java.util.Vector getSelectedWires()
           
 java.util.ArrayList getSelectedWires(int x, int y)
           
 java.util.Vector getTransferBuffer()
           
 int getW()
           
 double getZoom()
           
 void initLevels(int numLevels, int numRows)
           
 SchematicNode InList(java.lang.String name)
          Checks if a node already exists in the schematicNodeList.
 SchematicNode InList(java.lang.String cName, java.lang.String pName)
          since all ports have the same cellName, ports must be lookep up based on the name of the port as well.
 SchematicNet inNetlist(java.lang.String cName, java.lang.String pName)
           
 boolean isInPort(Cell c, java.lang.String pName)
           
 boolean isOutPort(Cell c, java.lang.String pName)
           
 boolean isTransferring()
           
 void JHDLWidgetEventPerformed(JHDLWidgetEvent e)
          Method called by {@link byucc.jhdl.apps.Viewers.Event.JHDLWidgetEventGenerator objects that this object is listening to.
 void paint(java.awt.Graphics g)
           
 int placeInputs(SchematicNode currNode, Cell p, int currLevel)
           
 void print()
           
 int print(java.awt.Graphics graphics, java.awt.print.PageFormat pFormat, int pageIndex)
          This is the implementation of the Printable interface to make printing simpler.
 void printJob(java.awt.Frame parent)
          Displays a print dialog to print this schematic
 void removeSchematicActionListener(SchematicActionListener listener)
          Deprecated.  
 void removeSchematicCanvasListener(SchematicCanvasListener listener)
          Removes a schematic canvas listener from the listener list.
 void removeSchematicMouseListener(SchematicMouseListener listener)
          Removes a schematic mouse listener from the listener list.
protected  void rerouteWires()
           
protected  void selectCells(java.util.ArrayList cl)
           
 void selectCellXY(int x, int y)
          Selects a cell based on the x and y coordinates of the mouse.
protected  boolean selectWire(Wire selWire)
          Selects a wire in schematic.
protected  void selectWires(java.util.ArrayList wl)
           
protected  boolean selectWireX(Wire selWire)
          Selects a wire in schematic.
 void setCellSelected(Cell cell, boolean b)
           
 void setColorModel(CellColorModel cm)
           
 void setDragging()
           
 void setH(int h)
           
 void setMouseOver(int x, int y)
          This function just updates the node or wire that hte nouse is over
 void setRadix(BVFormat rFormat)
          This function sets the BV format to display the wire values.
 void setViewAllCells(boolean vac)
          Set the viewAllCells flag.
 void setW(int w)
           
 void showPrintSetupDialog(java.awt.Frame parentWindow)
           
 void simulatorRefresh(int cycle, int phase)
          This method is called after each simulation run.
 void simulatorReset()
          This method will be called after the simulation has been reset.
 void simulatorUpdate(int cycle, int phase)
          This method is called after each simulation event.
 void stop()
           
 void updateAppUI()
           
 void updateUI()
           
 void updateValues()
           
 void viewFull()
           
 void viewNonDrivingCells(boolean vndc)
          Set the viewNonDrivingCells flag and update the view
 void viewNonNetlistCells(boolean vnnc)
          Set the viewNonNetlistCells flag and update the view
 void viewNonSimulateableCells(boolean vnsc)
          Set the viewNonSimulateableCells flag and update the view
 void viewNonVisibleCells(boolean vnvc)
          Set the viewNonVisibleCells flag and update the view
 void viewPortProperties(boolean vpwp)
          Set the viewPortWireProperties and update the view
 void viewProperties(boolean vp)
          Set the viewCellProperties and update the view
 void zoom(double zoom)
          Perform a zoom in or out on the schematic.
 void zoomIn()
          Zoom in by a factor of 2.
 void zoomOut()
          Zoom out by a factor of 2.
 
Methods inherited from class byucc.jhdl.apps.Viewers.laf.JHDLUIWidgetPanel
propertyChange
 
Methods inherited from class byucc.jhdl.apps.Viewers.Event.JHDLWidgetPanel
addJHDLMouseEventListener, fireJHDLMouseEvent, fireJHDLMouseEvent, removeJHDLMouseEventListener, setupJHDLEvents
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, 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
 

Field Detail

PREFERRED_WIDTH_DEFAULT

protected static final int PREFERRED_WIDTH_DEFAULT
Helps the containing JScrollPane know how big the JViewport should be

See Also:
Constant Field Values

PREFERRED_HEIGHT_DEFAULT

protected static final int PREFERRED_HEIGHT_DEFAULT
Helps the containing JScrollPane know how big the JViewport should be

See Also:
Constant Field Values

SCROLLABLE_UNIT_INCREMENT

protected static final int SCROLLABLE_UNIT_INCREMENT
The number of pixels to shift the image of the schematic when doing unit-increment scrolls

See Also:
Constant Field Values

SCROLLABLE_BLOCK_INCREMENT_OVERLAP

protected static final int SCROLLABLE_BLOCK_INCREMENT_OVERLAP
When doing block scrolling, this determines how much overlap from the previous view will still remain

See Also:
Constant Field Values

DEFAULT_PRINT_SETUP_SHOW_PAGE_COORDINATES

public static final java.lang.String DEFAULT_PRINT_SETUP_SHOW_PAGE_COORDINATES
default value for printSetupShowPageCoordinates; default is true

See Also:
Constant Field Values

DEFAULT_PRINT_SETUP_SHOW_DESIGN_NAME

public static final java.lang.String DEFAULT_PRINT_SETUP_SHOW_DESIGN_NAME
default value for printSetupShowDesignName; default is false

See Also:
Constant Field Values

DEFAULT_PRINT_SETUP_SHOW_DATE

public static final java.lang.String DEFAULT_PRINT_SETUP_SHOW_DATE
default value for printSetupShowDate; default is false

See Also:
Constant Field Values

DEFAULT_PRINT_SETUP_ZOOM_ALL

public static final java.lang.String DEFAULT_PRINT_SETUP_ZOOM_ALL
default value for printSetupZoomAll; default is false

See Also:
Constant Field Values

DEFAULT_PRINTING_OVERLAP

protected static final java.lang.String DEFAULT_PRINTING_OVERLAP
Ensures that there is enough overlap between printed pages of a schematic to maintain continuity of the image, particularly when the printer itself cuts of portions of the image around the margins

See Also:
Constant Field Values

printSetupShowPageCoordinates

protected static PropertiesDialogComponent printSetupShowPageCoordinates
if true, then the page coordinates of each page of a printed schematic will be printed in the upper-left corner


printSetupShowDesignName

protected static PropertiesDialogComponent printSetupShowDesignName
if true, the name of the printed design will show in the upper-left corner of schematics sent to printer


printSetupShowDate

protected static PropertiesDialogComponent printSetupShowDate
if true, the date and time will show in the upper-left corner of schematics sent to printer


printSetupZoomAll

protected static PropertiesDialogComponent printSetupZoomAll
if true, the schematic will be zoomed to fit on a single page.


printSetupOverlap

protected static PropertiesDialogComponent printSetupOverlap
sets the amount that printed pages of the schematic will overlap.


BEHAVIORALLY_MODELED_BACKGROUND

public static final java.lang.String BEHAVIORALLY_MODELED_BACKGROUND
See Also:
Constant Field Values

CHILD_OF_BEHAVIORALLY_MODELED_BACKGROUND

public static final java.lang.String CHILD_OF_BEHAVIORALLY_MODELED_BACKGROUND
See Also:
Constant Field Values

WIRE_VALUES

public static final java.lang.String WIRE_VALUES
See Also:
Constant Field Values

MESSAGE

public static final java.lang.String MESSAGE
See Also:
Constant Field Values

SELECTION

public static final java.lang.String SELECTION
See Also:
Constant Field Values

NOT_NETLISTABLE_CELL

public static final java.lang.String NOT_NETLISTABLE_CELL
See Also:
Constant Field Values

NOT_SIMULATEABLE_CELL

public static final java.lang.String NOT_SIMULATEABLE_CELL
See Also:
Constant Field Values

NOT_VISIBLE_CELL

public static final java.lang.String NOT_VISIBLE_CELL
See Also:
Constant Field Values

cm

public CellColorModel cm

numRows

public int numRows
Default is 0


maxHeight

public int maxHeight
Default is 0


schematicNodeList

public SortedVector schematicNodeList
Vector containing all the SchematicNodes.


schematicNetlist

public SortedVector schematicNetlist
Vector containing all the ?


zoom

public double zoom
Schematic zoom factor. Default is 1.0


numLevels

public int numLevels
This is the number of collumns of schematic nodes it takes to place the design


totalWidth

public int totalWidth
This is the width in pixels of the design


maxWidth

public int[] maxWidth
This array contains the maximum width in pixels of the components in each collumn. This is used to determin how wide each collumn of components should be.


physicalRow

public int[][] physicalRow
This is used to etermine the horizontal spacing between cells


physicalColumn

public int[] physicalColumn
The physical width each column in pixels.


columnWidths

public int[] columnWidths
The physical width each collumn needs to be to route the nets in collumn.


offset

public int offset
offset from edge of canvas to start drawing


allocVert

public boolean[][][][] allocVert
This is used for routing nets and remembering what spaces have been used.


allocHor

public int[] allocHor
In this file this variable is initialized to all zeros and not used. Since it is public I assume it is used elsewhere.


allocFeedBack

public int allocFeedBack
This keeps track of the number of feedback wires!!


numWireColumns

public static final int numWireColumns
specifies number of vertical routing paths between columns.

See Also:
Constant Field Values

numWireRows

public static final int numWireRows
specifies number of horizontal routing paths between rws

See Also:
Constant Field Values

cma

public byucc.jhdl.apps.Viewers.Schematic.SchematicCanvas.CanvasMouseAdapter cma
This is used to watch for mouse events


selectingMultiple

public boolean selectingMultiple
THe Canvas Mouse adapter uses this to remember if multiple items are being selected.


circuit

protected Cell circuit
Pointer to the Cell that is currently being drawn.


_viewport

protected javax.swing.JViewport _viewport
A reference to any viewport that may be controlling this Component. Instead of hardcoding this JPanel to a CircuitView, this object will keep a reference to any viewport. The viewport is needed to perform offset calculations when mouse clicks are made onto a portion of the shown schematic. TODO: allow _viewport to be a null (i.e. a panel not inside a viewport). in these cases, ignore all mouse issues that require the viewport.


defaultRadix

protected static final BVFormat defaultRadix
This is the String to initialize the BVFormatradix for wire values.


_schematicActionListeners

protected java.util.ArrayList _schematicActionListeners
This maintains a list of all SchematicActionListeners registered to this panel. All SchematicActionListeners will be called with relevent schematic actions are made.


_schematicCanvasListeners

protected java.util.ArrayList _schematicCanvasListeners
This maintains a list of all SchematicCanvasListeners registered to this panel. All SchematicCanvasListeners will be called with relevent schematic canvas events (e.g. zooming, printing) are made.


_schematicMouseListeners

protected java.util.ArrayList _schematicMouseListeners
This maintains a list of all SchematicMouseListeners registered to this panel. All SchematicMouseListeners will be called with relevent schematic mouse events are made.


selectedCells

protected SelectedCellList selectedCells
List of selected cells.


drawLast

protected java.util.Vector drawLast
This vector holds all selected nets so they'll be drawn last and on top.


radixFormat

protected BVFormat radixFormat
This is the BVFormat that will format the values on the wires of the schematic viewer


scaledPrintTransform

protected java.awt.geom.AffineTransform scaledPrintTransform
Because the Printable.print() method is called twice for each page and the first time it is called doesn't have the proper scale information for the printer, this AffineTransform is used to remember the scaled transform. This way, when a certain page is requested, then we can use the stored scaled transform to calculate whether the requested page exists or not.


printScaleX

protected double printScaleX
Stores the horizontal scale factor associated with the stored scaledPrintTransform


printScaleY

protected double printScaleY
Stores the vertical scale factor associated with the stored scaledPrintTransform

Constructor Detail

SchematicCanvas

public SchematicCanvas(Cell p,
                       javax.swing.JViewport vp)
Deprecated.  

This constructor has been changed to remove the Schematic Canvases dependancey on the Circuit Viewer. Now it only needs a Viewport.


SchematicCanvas

public SchematicCanvas(Cell p,
                       javax.swing.JViewport vp,
                       JHDLHostWidgetInterface hwi)
Constructs a new SchematicCanvas--New constructor, so that this panel can pass the JHDLHostWidgetInterface to its parent to get the call chain ready to be initialized.

Parameters:
p - The cell that this Panel will be initialized from.
vp - The ViewPort of the JScrollPane that contains this class.
hwi - The JHDLHostWidgetInterface this panel will send to its parent.
Method Detail

addAffectingGroup

public void addAffectingGroup(java.lang.String group)

updateAppUI

public void updateAppUI()
Specified by:
updateAppUI in class JHDLUIWidgetPanel

getAffectingGroups

public java.lang.String[] getAffectingGroups()
Specified by:
getAffectingGroups in class JHDLUIWidgetPanel

updateUI

public void updateUI()

addSchematicActionListener

public void addSchematicActionListener(SchematicActionListener listener)
Deprecated.  

Adds a schematic action listener to the listener list. This allows multiple classes to listen to schematic canvas events.

Specified by:
addSchematicActionListener in interface SchematicInterface

removeSchematicActionListener

public void removeSchematicActionListener(SchematicActionListener listener)
Deprecated.  

Removes a schematic action listener from the listener list.

Specified by:
removeSchematicActionListener in interface SchematicInterface

build

public void build()

viewNonDrivingCells

public void viewNonDrivingCells(boolean vndc)
Set the viewNonDrivingCells flag and update the view


viewNonNetlistCells

public void viewNonNetlistCells(boolean vnnc)
Set the viewNonNetlistCells flag and update the view


viewNonSimulateableCells

public void viewNonSimulateableCells(boolean vnsc)
Set the viewNonSimulateableCells flag and update the view


viewNonVisibleCells

public void viewNonVisibleCells(boolean vnvc)
Set the viewNonVisibleCells flag and update the view


viewProperties

public void viewProperties(boolean vp)
Set the viewCellProperties and update the view


viewPortProperties

public void viewPortProperties(boolean vpwp)
Set the viewPortWireProperties and update the view


setViewAllCells

public void setViewAllCells(boolean vac)
Set the viewAllCells flag.


getChipIcon

public static final javax.swing.ImageIcon getChipIcon()
Return static chipIcon


getSchematicCanvas

public SchematicCanvas getSchematicCanvas()
Part of the SchematicInterface interface

Specified by:
getSchematicCanvas in interface SchematicInterface

addSchematicCanvasListener

public void addSchematicCanvasListener(SchematicCanvasListener listener)
Adds a schematic canvas listener to the listener list. This allows multiple classes to listen to schematic canvas events like zooming.


removeSchematicCanvasListener

public void removeSchematicCanvasListener(SchematicCanvasListener listener)
Removes a schematic canvas listener from the listener list.


addSchematicMouseListener

public void addSchematicMouseListener(SchematicMouseListener listener)
Adds a schematic mouse listener to the listener list. This allows multiple classes to listen to schematic canvas events.


removeSchematicMouseListener

public void removeSchematicMouseListener(SchematicMouseListener listener)
Removes a schematic mouse listener from the listener list.


stop

public void stop()

getCell

public Cell getCell()
This method provides access to the Cell for which this SchematicCanvas displays. This is useful for GUI widgets that need to query the Cell to provide more information for display.


inNetlist

public SchematicNet inNetlist(java.lang.String cName,
                              java.lang.String pName)

selectWire

protected boolean selectWire(Wire selWire)
Selects a wire in schematic.


setRadix

public void setRadix(BVFormat rFormat)
This function sets the BV format to display the wire values.


addNetProperty

protected void addNetProperty(Net n,
                              java.lang.String c,
                              java.lang.String s)
This function is used to find a schematic net and add a property, either color or string.


adjustColumnWidths

public void adjustColumnWidths()

constructAndPlace

public void constructAndPlace(Cell p,
                              Netlist nl)

updateValues

public void updateValues()

InList

public SchematicNode InList(java.lang.String name)
Checks if a node already exists in the schematicNodeList.


InList

public SchematicNode InList(java.lang.String cName,
                            java.lang.String pName)
since all ports have the same cellName, ports must be lookep up based on the name of the port as well. This only refers to ports of the Cell being drawn since they are treated as Nodes in the Schematic


rerouteWires

protected void rerouteWires()

paint

public void paint(java.awt.Graphics g)

printJob

public void printJob(java.awt.Frame parent)
Displays a print dialog to print this schematic


print

public int print(java.awt.Graphics graphics,
                 java.awt.print.PageFormat pFormat,
                 int pageIndex)
This is the implementation of the Printable interface to make printing simpler.

Specified by:
print in interface java.awt.print.Printable
Parameters:
graphics - a Graphics object specific for printing. It happens to be a Graphics2D
pFormat - contains attributes about the page to print
pageIndex - the zero-based index of the page to print
Returns:
Printable.PAGE_EXISTS on success, or Printable.NO_SUCH_PAGE if pageIndex is greater than the number pages for the specified pFormat.

showPrintSetupDialog

public void showPrintSetupDialog(java.awt.Frame parentWindow)

placeInputs

public int placeInputs(SchematicNode currNode,
                       Cell p,
                       int currLevel)

isInPort

public boolean isInPort(Cell c,
                        java.lang.String pName)

isOutPort

public boolean isOutPort(Cell c,
                         java.lang.String pName)

getNode

public SchematicNode getNode(java.lang.String cName,
                             java.lang.String pName)

getLocation

public int[] getLocation(java.lang.String cName,
                         java.lang.String pName)

getSelected

public SchematicNode getSelected(int x,
                                 int y)

setMouseOver

public void setMouseOver(int x,
                         int y)
This function just updates the node or wire that hte nouse is over


selectCellXY

public void selectCellXY(int x,
                         int y)
Selects a cell based on the x and y coordinates of the mouse. This method is called by the mousePressed method in the CanvasMouseAdapther MouseListener interface.


isTransferring

public boolean isTransferring()

getTransferBuffer

public java.util.Vector getTransferBuffer()

clearTransferBuffer

public void clearTransferBuffer()

setCellSelected

public void setCellSelected(Cell cell,
                            boolean b)

clearSelectionList

public void clearSelectionList()

getZoom

public double getZoom()
Returns:
the current zoom factor for this canvas. Default is 1.0

zoom

public void zoom(double zoom)
Perform a zoom in or out on the schematic.

Parameters:
zoom - The zoom value of the component (must be positive). A value of 1.0 indicates the baseline. This method queries the viewport to calculate the new viewport position.

getSchematicCanvasPreferredSizeInRelationToViewportSize

public java.awt.Dimension getSchematicCanvasPreferredSizeInRelationToViewportSize()

print

public void print()

zoomIn

public void zoomIn()
Zoom in by a factor of 2.


zoomOut

public void zoomOut()
Zoom out by a factor of 2.


viewFull

public void viewFull()

getSelectedWires

public java.util.Vector getSelectedWires()

setColorModel

public void setColorModel(CellColorModel cm)

initLevels

public void initLevels(int numLevels,
                       int numRows)

setDragging

public void setDragging()

simulatorRefresh

public void simulatorRefresh(int cycle,
                             int phase)
Description copied from interface: SimulatorCallback
This method is called after each simulation run. A simulation run is a multiple clock/step execution issued by a testbench or jab. For example, if the user types 'cycle 50', this callback method will be called after the completed simulation of all 50 clock cycles. Unlike the simulatorUpdate method, this method will not be called on each simulation event. This method is useful for GUIs or display widgets that only need to be updated once the simulaton has paused.

Specified by:
simulatorRefresh in interface SimulatorCallback
Parameters:
cycle - The current cycle number of the simulator. This value is the same as the value generated by the call HWSystem.getTotalClockCount().
phase - The current phase of the simulator. This value is the same as the value generated by the call HWSystem.getCurrentStepCount().

simulatorUpdate

public void simulatorUpdate(int cycle,
                            int phase)
Description copied from interface: SimulatorCallback
This method is called after each simulation event. The granularity of the event is determined by the specific Simulator within the simulate() method of the Simulator. For the single-clock simulator, this corresponds to each cycle of simulation. For the multi-clock simulator, this corresponds to each step in the clock schedule of the simulator.

Specified by:
simulatorUpdate in interface SimulatorCallback
Parameters:
cycle - The current cycle number of the simulator. This value is the same as the value generated by the call HWSystem.getTotalClockCount().
phase - The current phase of the simulator. This value is the same as the value generated by the call HWSystem.getCurrentStepCount().

simulatorReset

public void simulatorReset()
Description copied from interface: SimulatorCallback
This method will be called after the simulation has been reset. Unlike the initialize method of the Initializeable interface, this method is called after every simulator reset. This method can be used to reset variables associated with watching the progress of a simulation. Note that the cycle and phase number is reset to zero before this call is made.

Specified by:
simulatorReset in interface SimulatorCallback

getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()
Specified by:
getPreferredScrollableViewportSize in interface javax.swing.Scrollable

getScrollableUnitIncrement

public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Specified by:
getScrollableUnitIncrement in interface javax.swing.Scrollable

getScrollableBlockIncrement

public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
                                       int orientation,
                                       int direction)
Specified by:
getScrollableBlockIncrement in interface javax.swing.Scrollable

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface javax.swing.Scrollable

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Specified by:
getScrollableTracksViewportHeight in interface javax.swing.Scrollable

getW

public int getW()

getH

public int getH()

setW

public void setW(int w)

setH

public void setH(int h)

JHDLWidgetEventPerformed

public void JHDLWidgetEventPerformed(JHDLWidgetEvent e)
Method called by {@link byucc.jhdl.apps.Viewers.Event.JHDLWidgetEventGenerator objects that this object is listening to. This method interprets the event and updates the display accordingly.

Specified by:
JHDLWidgetEventPerformed in interface JHDLWidgetEventListener
Parameters:
e - The passed in JHDLWidgetEvent object.

selectWireX

protected boolean selectWireX(Wire selWire)
Selects a wire in schematic.


selectWires

protected void selectWires(java.util.ArrayList wl)

selectCells

protected void selectCells(java.util.ArrayList cl)

getSelectedWires

public java.util.ArrayList getSelectedWires(int x,
                                            int y)

getSelectedCells

public java.util.ArrayList getSelectedCells(int x,
                                            int y)

clearSelectedCells

protected void clearSelectedCells()

clearSelectedWires

protected void clearSelectedWires()

getSchematicNode

protected SchematicNode getSchematicNode(Cell cell)


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.