|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--edu.buffalo.fs7.qsymbol2.GatePanel
The GatePanel class is the central class in the qsymbol2 package. It is responsible to bring up a quantum circuit (provided by the GateTable class) with qubit controls, step gauge and computation controls. Basically, everything you see besides the toolbar in the jaQuzzi program is provided by this class.
This class is responsible to add and remove qubits (since it has to update the GateTable as well as the QubitPanel) and therefore implements the MathlibEventListener interface.
It as well implements other interfaces to react to changes in the GateTable or QubitPanel.
GateTable,
QubitPanel, Serialized Form| Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| Field Summary | |
static java.lang.String |
avgTimePerGate
string constant for averageTimerperGate property |
protected java.awt.GridBagConstraints |
c
|
protected boolean |
calcFidelity
true if the fidelity is to be calculated |
static java.lang.String |
elapsedTime
string constant for elapsed time property |
static java.lang.String |
fidelity
string constant for fidelity property |
GateTable |
gates
the GateTable |
protected java.awt.GridBagLayout |
gridbag
|
QubitPanel |
inQubits
holds the qubitPanel for setting init values to the qubits |
protected Mathlib |
mathlib
the mathlib |
protected javax.swing.JProgressBar |
progressBar
|
static java.lang.String |
qubits
string constant for qubits variable |
static java.lang.String |
qubitUpdate
string constant for qubitUpdate property |
protected boolean |
quietMode
true if the graphical output is should be supressed |
static java.lang.String |
refQubits
string constant for second qubits variable in case of calculating fidelity |
static java.lang.String |
remainingTimeEstimate
string constant for remainingTimeEstimate property |
protected boolean |
run
true if a computation thread is running |
protected javax.swing.JButton |
runButton
|
protected javax.swing.JLabel |
statusBar
|
protected javax.swing.JLabel |
statusBarLabel
|
static java.lang.String |
step
string constant for step property |
static java.lang.String |
stepCount
string constant for stepCount property |
static java.lang.String |
table
string constant for table property |
protected javax.swing.JScrollPane |
viewPort
|
| 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 | |
GatePanel(Mathlib mathlib,
boolean quietMode)
create a GatePanel class. |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
method of the ActionListener interface. |
void |
addGateContainer()
generates an add gateContainer event which causes the GatePanel class to modify the GateTable. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
wrapping method |
void |
addQubit()
generates an add qubit event which causes the GatePanel class to modify the QubitPanel and the GateTable. |
void |
addVariable(MathlibEvent e)
method of the MathlibEventListener interface. |
void |
adjustRowHeight()
adjusts the row height so that all qubits fit into the panel. |
void |
changeVariable(MathlibEvent e)
method of the MathlibEventListener interface. |
void |
componentHidden(java.awt.event.ComponentEvent e)
implementing ComponentListener interface. nothing is done here. |
void |
componentMoved(java.awt.event.ComponentEvent e)
implementing ComponentListener interface. nothing is done here. |
void |
componentResized(java.awt.event.ComponentEvent e)
implementing ComponentListener interface. |
void |
componentShown(java.awt.event.ComponentEvent e)
implementing ComponentListener interface. nothing is done here. |
protected javax.swing.JToolBar |
createToolbar2()
creates the computation controll toolbar |
void |
decreaseColumnWidth()
method to decrease the column width of the columns in the GateTable. |
protected void |
fireTimingProperties()
update the timing properties. |
double |
getCircuitProperty(java.lang.String property)
this method retrieves information from a GateProperty object named "circuit_properties" kept as a variable in the mathlib class. |
void |
increaseColumnWidth()
method to increase the column width of the columns in the GateTable. |
void |
insertGateContainer(int col)
generates an insert gateContainer event which causes the GatePanel class to modify the GateTable. |
void |
insertQubit(int row)
generates an insert qubit event which causes the GatePanel class to modify the QubitPanel and the GateTable. |
void |
itemStateChanged(java.awt.event.ItemEvent e)
method of the ItemListener interface. |
void |
qubitUpdate()
updates the statusbar and sets the icon for the computation control panel correctly. |
void |
removeGateContainer(int col)
generates a remove gateContainer event which causes the GatePanel class to modify the GateTable. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
wrapping method |
void |
removeQubit(int row)
generates an remove qubit event which causes the GatePanel class to modify the QubitPanel and the GateTable. |
void |
removeVariable(MathlibEvent e)
method of the MathlibEventListener interface. |
void |
renameGateContainer(int col,
java.lang.String newName)
generates a rename gateContainer event which causes the GatePanel class to modify the GateTable. |
void |
reset()
resets the gatePanel and the computation |
void |
resize()
is a workaround for JAVA bug 4226181, but I think it is not used anymore in the application. |
void |
run()
runs a computation. |
void |
setCircuitProperty(java.lang.String property,
double value)
sets a property to a GateProperty object "circuit_properties" kept as a variable in the mathlib class. |
void |
setFidelity(boolean calcFidelity)
method sets whether the fidelity of during a calculation should be calculated or not. |
void |
stepBackward()
wraps the stepBackward method of the GateTable class. |
void |
stepForward()
wraps the stepForward method of the GateTable class. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUIClassID, paramString, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String qubits
public static final java.lang.String refQubits
public static final java.lang.String fidelity
public static final java.lang.String elapsedTime
public static final java.lang.String step
public static final java.lang.String stepCount
public static final java.lang.String avgTimePerGate
public static final java.lang.String remainingTimeEstimate
public static final java.lang.String table
public static final java.lang.String qubitUpdate
protected java.awt.GridBagLayout gridbag
protected java.awt.GridBagConstraints c
public QubitPanel inQubits
protected javax.swing.JLabel statusBarLabel
protected javax.swing.JLabel statusBar
protected javax.swing.JButton runButton
protected boolean run
protected boolean calcFidelity
protected javax.swing.JProgressBar progressBar
protected javax.swing.JScrollPane viewPort
public GateTable gates
protected Mathlib mathlib
protected boolean quietMode
| Constructor Detail |
public GatePanel(Mathlib mathlib,
boolean quietMode)
| Method Detail |
protected javax.swing.JToolBar createToolbar2()
public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden in interface java.awt.event.ComponentListenerpublic void componentMoved(java.awt.event.ComponentEvent e)
componentMoved in interface java.awt.event.ComponentListenerpublic void componentShown(java.awt.event.ComponentEvent e)
componentShown in interface java.awt.event.ComponentListenerpublic void componentResized(java.awt.event.ComponentEvent e)
componentResized in interface java.awt.event.ComponentListenerpublic void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged in interface java.awt.event.ItemListenerQubitPanelpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void run()
GateTable.gotoStep(Braket, Braket, int)public double getCircuitProperty(java.lang.String property)
property - name of the property, e.g. "mode"
public void setCircuitProperty(java.lang.String property,
double value)
public void stepForward()
GateTable.stepForward(Braket, Braket)public void stepBackward()
GateTable.stepBackward(Braket, Braket)public void setFidelity(boolean calcFidelity)
public void addQubit()
public void insertQubit(int row)
public void removeQubit(int row)
public void insertGateContainer(int col)
public void addGateContainer()
public void removeGateContainer(int col)
public void renameGateContainer(int col,
java.lang.String newName)
public void addVariable(MathlibEvent e)
addVariable in interface MathlibEventListenerpublic void changeVariable(MathlibEvent e)
changeVariable in interface MathlibEventListenerpublic void removeVariable(MathlibEvent e)
removeVariable in interface MathlibEventListenerpublic void increaseColumnWidth()
public void decreaseColumnWidth()
public void adjustRowHeight()
public void resize()
public void reset()
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
addPropertyChangeListener in class javax.swing.JComponentpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
removePropertyChangeListener in class javax.swing.JComponentprotected void fireTimingProperties()
public void qubitUpdate()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||