|
|||||||
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 | +--java.awt.Window | +--java.awt.Frame | +--CircuitDiagram
This class implements the window for each circuit diagram that's open. It contains the frame, menu, and workspace, logic and fileio objects that make up the circuit diagram. All of the mouse event handling is done here, passing calls to the workspace, logic and fileio objects as necessary.
Inner Class Summary | |
(package private) class |
CircuitDiagram.CDCloser
This class handles closing the CircuitDiagram window when it's done manually, instead of through a menu command |
(package private) class |
CircuitDiagram.MenuListener
This class handles the actions sent to the various CircuitDiagram menu commands. |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AWTTreeLock |
Field Summary | |
(package private) FileIO |
fileio
The associated fileio |
(package private) java.lang.String |
filename
This CircuitDiagram's default title |
(package private) int |
id
This CircuitDiagram's id |
(package private) Logic |
logic
The associated logic |
(package private) GateBuilder |
parent
The parent GateBuilder to make global calls on |
(package private) Workspace |
workspace
The associated workspace |
Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR,
DEFAULT_CURSOR,
E_RESIZE_CURSOR,
HAND_CURSOR,
icon,
ICONIFIED,
mbManagement,
menuBar,
MOVE_CURSOR,
N_RESIZE_CURSOR,
NE_RESIZE_CURSOR,
NORMAL,
NW_RESIZE_CURSOR,
ownedWindows,
resizable,
S_RESIZE_CURSOR,
SE_RESIZE_CURSOR,
SW_RESIZE_CURSOR,
TEXT_CURSOR,
title,
W_RESIZE_CURSOR,
WAIT_CURSOR |
Fields inherited from class java.awt.Window |
inputContext,
OPENED,
ownedWindowList,
state,
warningString,
windowListener |
Fields inherited from class java.awt.Container |
component,
containerListener,
layoutMgr,
ncomponents |
Fields inherited from class java.awt.Component |
actionListenerK,
adjustmentListenerK,
appContext,
background,
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
componentListener,
componentListenerK,
componentOrientation,
containerListenerK,
cursor,
dropTarget,
enabled,
eventMask,
focusListener,
focusListenerK,
font,
foreground,
hasFocus,
height,
incRate,
inputMethodListener,
inputMethodListenerK,
isInc,
isPacked,
itemListenerK,
keyListener,
keyListenerK,
LEFT_ALIGNMENT,
locale,
LOCK,
minSize,
mouseListener,
mouseListenerK,
mouseMotionListener,
mouseMotionListenerK,
newEventsOnly,
ownedWindowK,
parent,
peer,
peerFont,
popups,
prefSize,
RIGHT_ALIGNMENT,
textListenerK,
TOP_ALIGNMENT,
valid,
visible,
width,
windowListenerK,
x,
y |
Constructor Summary | |
(package private) |
CircuitDiagram(GateBuilder _parent,
int _id,
java.awt.Point _offset,
boolean _show)
This constructor creates a circuit diagram window and all the associated objects - workspace, logic, and fileio. |
Method Summary | |
java.lang.Object |
addObject(int type,
int x,
int y,
Macro macro,
int attr)
Top-level call for adding an object to the CircuitDiagram. |
void |
calculate()
Executed when calculate is selected from the macros menu |
void |
close()
Executed when close is selected from the file menu |
boolean |
connectObjects(java.lang.Object target1,
java.lang.Object target2,
boolean force)
Top-level call for connecting two objects in the CircuitDiagram |
boolean |
disconnectObjects(java.lang.Object target1,
java.lang.Object target2)
Top-level call for disconnecting two objects in the CircuitDiagram |
void |
exportMacro()
Executed when exportmacro is selected from the macros menu |
void |
focusGained(java.awt.event.FocusEvent e)
Executed on focusGained. |
void |
focusLost(java.awt.event.FocusEvent e)
Executed on focusLost. |
void |
generalHelp()
Executed when General is selected from the help menu |
java.util.Vector |
getMacros()
Returns the macro vector |
java.awt.Dimension |
getMaximumSize()
Returns the max size of the CircuitDiagram. |
int |
getNextGateID()
An accessor for the nextGateID variable |
java.util.Vector |
getObjects()
Returns the object vector |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of the CircuitDiagram. |
void |
importMacro()
Executed when importmacro is selected from the macros menu |
void |
importMacro(java.lang.String loaded)
Executed when a builtin macro is loaded. |
void |
incNextGateID()
An accessor which increments nextGateID |
void |
macrosHelp()
Executed when Macros is selected from the help menu |
void |
mouseClicked(java.awt.event.MouseEvent e)
Executed on a mouseClick. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Executed on a mouseDragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Executed on a mouseEntered. |
void |
mouseExited(java.awt.event.MouseEvent e)
Executed on a mouseExited. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Executed on a mouseMoved. |
void |
mousePressed(java.awt.event.MouseEvent e)
Executed on a mousePressed. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Executed on a mouseReleased. |
void |
moveObject(java.lang.Object target,
int x,
int y)
Top-level call for moving an object in the Workspace |
void |
newFile()
Executed when new is selected from the file menu |
void |
open()
Executed when open is selected from the file menu |
void |
openUrl()
Executed when open url is selected from the file menu |
void |
print()
Executed when print is selected from the file menu |
void |
quit()
Executed when quit is selected from the file menu |
void |
removeObject(java.lang.Object target)
Top-level call for removing an object from the CircuitDiagram |
void |
repaint()
Calls update as soon as possible. |
void |
save()
Executed when save is selected from the file menu |
void |
saveAs()
Executed when saveas is selected from the file menu |
void |
saveChanges()
Helper function that only saves if changes have been made |
void |
setFilename(java.lang.String _filename)
Sets the filename for the current circuit diagram, and makes the title bar read the new name. |
void |
toggleInput(java.lang.Object target)
Top-level call for toggling the value of an input object |
void |
toolsHelp()
Executed when Tools is selected from the help menu |
void |
updateMacros(java.lang.String path)
Takes a path to a macro file and puts it in the macros menu if it's not already there, and adds it to the macro cache |
Methods inherited from class java.awt.Frame |
|
Methods inherited from class java.awt.Window |
addOwnedWindow,
addWindowListener,
applyResourceBundle,
applyResourceBundle,
connectOwnedWindow,
dispatchEventImpl,
dispose,
eventEnabled,
getFocusOwner,
getInputContext,
getLocale,
getOwnedWindows,
getOwner,
getToolkit,
getWarningString,
hide,
isActive,
isShowing,
nextFocus,
pack,
postEvent,
postWindowEvent,
preProcessKeyEvent,
processEvent,
processWindowEvent,
removeOwnedWindow,
removeWindowListener,
setCursor,
setFocusOwner,
show,
toBack,
toFront,
transferFocus |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
applyOrientation,
countComponents,
deliverEvent,
dispatchEventToSelf,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents_NoClientCode,
getComponents,
getCursorTarget,
getInsets,
getLayout,
getMinimumSize,
getMouseEventTarget,
getWindow,
insets,
invalidate,
invalidateTree,
isAncestorOf,
layout,
lightweightPrint,
list,
list,
locate,
minimumSize,
paint,
paintComponents,
postsOldMouseEvents,
preferredSize,
print,
printComponents,
processContainerEvent,
proxyEnableEvents,
proxyRequestFocus,
remove,
remove,
removeAll,
removeContainerListener,
setFont,
setLayout,
update,
updateCursor,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
areInputMethodsEnabled,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont_NoClientCode,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputMethodRequests,
getIntrinsicCursor,
getLocation,
getLocation,
getLocationOnScreen,
getName,
getNativeContainer,
getParent_NoClientCode,
getParent,
getPeer,
getSize,
getSize,
getToolkitImpl,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
imageUpdate,
inside,
isDisplayable,
isDoubleBuffered,
isEnabled,
isEnabledImpl,
isFocusTraversable,
isLightweight,
isOpaque,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
requestFocus,
reshape,
resize,
resize,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setEnabled,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
GateBuilder parent
int id
Workspace workspace
Logic logic
FileIO fileio
java.lang.String filename
Constructor Detail |
CircuitDiagram(GateBuilder _parent, int _id, java.awt.Point _offset, boolean _show)
_parent
- the GateBuilder that created this CircuitDiagram_id
- the CircuitDiagram's id number_offset
- the window location from the upperleft corner_show
- true to display the window, false to not.Method Detail |
public void updateMacros(java.lang.String path)
path
- the path to the macro to addpublic void repaint()
public java.awt.Dimension getMaximumSize()
public java.awt.Dimension getPreferredSize()
public int getNextGateID()
public void incNextGateID()
public java.util.Vector getObjects()
public java.util.Vector getMacros()
public void setFilename(java.lang.String _filename)
_filename
- the new filenamepublic java.lang.Object addObject(int type, int x, int y, Macro macro, int attr)
type
- an integer type from the Tool classx
- the x coordinate of the new objecty
- the y coordinate of the new objectmacroGroup
- the macro to associate the new object withattr
- optional attribute intpublic void removeObject(java.lang.Object target)
target
- the object to removepublic boolean connectObjects(java.lang.Object target1, java.lang.Object target2, boolean force)
target1
- the source objecttarget2
- the destination objectforce
- force making the connection or notpublic boolean disconnectObjects(java.lang.Object target1, java.lang.Object target2)
target1
- the source objecttarget2
- the destination objectpublic void moveObject(java.lang.Object target, int x, int y)
target
- the object to movex
- the destination x coordinatey
- the destination y coordinatepublic void toggleInput(java.lang.Object target)
target
- the input objectpublic void newFile()
public void open()
public void openUrl()
public void close()
public void saveChanges()
public void save()
public void saveAs()
public void print()
public void quit()
public void importMacro()
public void importMacro(java.lang.String loaded)
loaded
- the name of the cached macro to loadpublic void exportMacro()
public void calculate()
public void generalHelp()
public void toolsHelp()
public void macrosHelp()
public void mouseClicked(java.awt.event.MouseEvent e)
e
- the mouseEventpublic void mouseEntered(java.awt.event.MouseEvent e)
e
- the mouseEventpublic void mouseExited(java.awt.event.MouseEvent e)
e
- the mouseEventpublic void mousePressed(java.awt.event.MouseEvent e)
e
- the mouseEventpublic void mouseReleased(java.awt.event.MouseEvent e)
e
- the mouseEventpublic void mouseDragged(java.awt.event.MouseEvent e)
e
- the mouseEventpublic void mouseMoved(java.awt.event.MouseEvent e)
e
- the mouseEventpublic void focusGained(java.awt.event.FocusEvent e)
e
- the focusEventpublic void focusLost(java.awt.event.FocusEvent e)
e
- the focusEvent
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |