Home

Method Detail

image

Contents

1. Field Summary Page BoolTree Element left 182 The Element representing the left input of this Element BoolTree Element right 182 The Element representing the right input of this Element Constructor Summary Page BoolTree Element BooleanQualifyer q 183 Constructs a new Element with the given Qualifyer Method Summary Page abstract boolean evaluate 183 Evaluates this Element BooleanQualifyer getQualifyer 184 Returns the Qualifyer of this element abstract boolean jsLeaf 183 Returns True if this Element represents an operand boolean isNegated 184 Returns True if the output of this element is negated or False otherwise boolean isNegatedLeft 184 Returns True if the left input of this element is negated or False otherwise boolean isNegatedRight 184 Returns True if the right input of this element is negated or False otherwise void setNegated boolean neg 183 Sets the negation of the output to neg void setNegateLeft boolean neg 183 Sets the negation of the left input to neg void setNegateRight boolean neg 183 Sets the negation of the right input to neg String toString 184 Returns a String containing the Boolean function this element and its children represent Field Detail left public BoolTree Element left The Element representing the left input of this Element right public BoolTree Ele
2. Getter for operands static getOperatorQualifyers 178 ArrayList lt QualifyerGate gt j 2 eae ae Returns all Qualifyers that represent a logical operator apart from NOT static BooleanQualifyer getQualifyerByChar char c 177 Returns the Qualifyer representing a character that represents an operand or operator Field Detail Q AND public static final QualifyerGate Q AND Qualifyer representing AND gate Q_DELLINE public static final ButtonQualifyer Q DELLINE Qualifyer representing DELETE LINE action 176 Q_LINE public static final ButtonQualifyer Q LINE Qualifyer representing CREATE LINE action Q_NAND public static final QualifyerGate Q NAND Qualifyer representing NAND gate Q_NOR public static final QualifyerGate Q NOR Qualifyer representing NOR gate Q_NOT public static final QualifyerGate Q NOT Qualifyer representing NOT gate Q_OR public static final QualifyerGate Q OR Qualifyer representing OR gate Q_REMOVE public static final ButtonQualifyer Q REMOVE Qualifyer representing REMOVE action Q_XOR public static final QualifyerGate Q XOR Qualifyer representing XOR gate Method Detail getQualifyerByChar public static BooleanQualifyer getQualifyerByChar char c Returns the Quali fyer representing a character that represents an operand or operator If no such Qualifyer exists and the character is a letter anew Qualif
3. GraphExercise public GraphExercise int attempts int points String function Constructs a new GraphExercise Parameters attempts Number of attempts a user is allowed to make on this exercise points Number of points this exercise is worth when solved at the first attempts function The Boolean function to that a user has to find an equal logic circuit 63 Method Detail getFunction public String getFunction Returns the Boolean function to that a user has to find a logic circuit Returns The Boolean function to that a user has to find a logic circuit setFunction public void setFunction String function Sets the Boolean function to that a user has to find a logic circuit Parameters function A Boolean function to that a user has to find a logic circuit setSolution public void setSolution Graph graph Sets a logical circuit as a solution that was found by a user Parameters graph a logical circuit as a solution that was found by a user getSolution public Graph getSolution Returns a logic circuit that was drawn by a user as a solution for this exercise Returns A logic circuit that was drawn by a user as a solution for this exercise getInstruction public String getInstruction Description copied from class Exercise Returns a message containing instructions what to do in this exercise Overrides getInstruction in class Exercise Returns A message co
4. int getCurrentExerciseNumber Returns the number of the Exercise currently displayed 157 ArrayList lt Exercise gt getExercises Returns the collection of Exercises managed by this service 157 Exercise getNextExercise Returns the next Exercise after currentExercise position 157 int getNumberSolved Returns the number of solved Exercises 160 int getNumberTried Returns the number of tried Exericses 160 int getPointsReached Returns the sum of all points that were reached yet 157 int getPointsTotal Returns the sum of all points that can be reached in total 158 Exercise getPreviousExercise Returns the Exercise before currentExercise position 157 int getTotalExerciseNumber Returns the total number of Exercises managed by this service 157 void giveUpCurrentExercise GateDrawer gui Controller controller Gives up the current Exercise 159 void load File file Loads a collection of Exercises from a given file 158 void loadForExecution File file Loads a collection of Exercises from a file for execution 160 void 154 loadForResults File file Loads a collection of Exercises from a file to display the results 160 void points int attempts
5. Creates and saves anew IncorrectGraphExercise with given graph function points and attempts newExercise 155 Inserts anew empty Exercise add th nd of exercises void next 158 Moves to the Exercise at currentPosition 1 void previous 158 Moves to the Exercise at currentPosition 1 void saveExercise ExerciseType mode Graph graph String 159 userFunction int points int attempts Creates and saves anew Exercise at the currentExercise position void saveExercise Graph graph int points int attempts 156 Creates and saves anew FunctionExercise with given graph points and attempts void saveExercise String function int points int attempts 156 Creates and saves a new GraphExercise with given function points and attempts void saveIncorrectFunctionExercise String function Graph graph 156 int points int attempts Creates and saves anew IncorrectFunctionExercise with given graph function points and attempts void saveIncorrectGraphExercise String function Graph graph int 156 Constructor Detail ExerciseService public ExerciseService Constructs a ExerciseService new ExerciseService exercises is initialized and editable is set to true public ExerciseService ArrayList lt Exercise gt exercises Constructs a Parameters new ExerciseService with an existing collection of Exericses exercises A collection of Exercises that should be managed by this
6. 62 domain exercise GraphExercise java lang Object L donai xercise Exercis L domain exercise GraphExercise All Implemented Interfaces Serializable Direct Known Subclasses IncorrectGraphExercise public class GraphExercise xtends Exercis the users solution are stored in this class Exercise in that a user has to draw a logic circuit equal to a given Boolean function The Boolean function and Field Summary Page static INSTRUCTION 63 ici The instruction what to do in this exercise Zeichne die quivalente Gatterschaltung Constructor Summary Page GraphExercise int attempts int points String function 63 Constructs a new GraphExercise Method Summary Page String getFunction 64 Returns the Boolean function to that a user has to find a logic circuit String getInstruction 64 Returns a message containing instructions what to do in this exercise Graph getSolution 64 Returns a logic circuit that was drawn by a user as a solution for this exercise void setFunction String function 64 Sets the Boolean function to that a user has to find a logic circuit void setSolution Graph graph 64 Sets a logical circuit as a solution that was found by a user Field Detail INSTRUCTION public static final String INSTRUCTION The instruction what to do in this exercise Zeichne die quivalente Gatterschaltung Constructor Detail
7. Es besteht die M glichkeit ein Aufgabenset zu l sen Dazu wird Aufgaben l sen aus dem Men ausgew hlt Die Aufgaben werden aus einer gex Datei geladen und einzeln angezeigt Es besteht nun die M glichkeit eine passende Funktion einzugeben oder Gatterschaltung zu konstruieren 34 berpr fen Eine eingegebene L sung berpr fen lassen Abgegebene L sungen werden gespeichert und angezeigt Wird die Aufgabe gel st werden Punkte vergeben abh ngig von der maximalen Punktezahl und der ben tigten Versuche Zeige L sung Die korrekte L sung f r eine Aufgabe wird angezeigt Es sind keine weiteren L sungsversuche mehr m glich Vor Zur ck Zeigt die n chste letzte Aufgabe an Abschlie en Schlie t das Aufgabenset ab Die Resultate werden automatisch in die Datei gesichert Ist die Datei nicht mehr verf gbar besteht die M glichkeit eine andere Datei auszuw hlen 6 5 5 Resultate anzeigen Die Resultate gel ster Aufgaben k nnen mittels des Eintrags Ergebnisse laden angezeigt werden Aus einer gex Datei werden die Resultate geladen und folgende Informationen angezeigt Aufgaben insgesamt Die Gesamtzahl der Aufgaben in diesem Set Punkte erreicht Die erreichten Punkte sowie die maximal erreichbaren Punkte Gel ste Aufgaben Die Anzahl der gel sten Aufgaben Versuchte Aufgaben Die Anzahl der vom Benutzer versuchten Aufgaben Mit vor zur ck kann zwischen den einzelnen Aufgaben des
8. Verbindung entfernen gel scht werden Alternativ kann aus der Toolbox das Symbol zum Entfernen von Verbindungen ausgew hlt und auf die zu l schende Verbindung geklickt werden Negationen Ein oder Ausg nge von Gatterbausteinen k nnen negiert werden Ein negierter Ein oder Aufgang ist an einem kleinen schwarzen Kreis neben dem Gatter zu erkennen Die Negation kann durch einen Rechtsklick auf den gew nschten Ein oder Ausgang festgelegt werden Gatterschaltungen editieren Eine Gatterschaltung die in der Zeichenebene angezeigt wird kann vom Benutzer bearbeitet werden Wie in a beschrieben k nnen Gatterbausteine und Linien hinzugef gt oder entfernt werden Zur Bearbeitung der Gatterschaltung stehen auch die folgenden Funktionalit ten zur Verf gung e Drag and Drop Gatterbausteine k nnen auf der Zeichenebene mittels Drag and Drop verschoben werden e Selektion Durch Dr cken der linken Maustaste und gleichzeitiges Ziehen der Maus kann ein Bereich auf der Zeichenebene markiert werden Verschiebe und L schaktionen k nnen nun gleichzeitig f r alle Elemente im selektierten Bereich durchgef hrt werden Selektierte Elemente k nnen mit der ENTF Taste gel scht werden Die Selektion kann durch einen Klick auf die Zeichenebene wieder aufgehoben werden 6 3 2 Gatterschaltung l schen Zum L schen einer ganzen Gatterschaltung steht eine entsprechende Schaltfl che in der Toolbox zur Verf gung Alternativ kann auch die gesa
9. public QualifyerOperand char operand Imagelcon icon ImageIcon selectedButtonlIcon Constructs a new QualifyerOperand Parameters operand A character of an Boolean operand that this qualifyer represents icon The icon of a button that is associated with this Boolean operator selectedButtonIcon The selected icon of a button that is associated with this Boolean operator Method Detail setValue public void setValue boolean v Sets the truth value of the operand that is represented by this qualifyer Parameters v The truth value of the operand that is represented by this qualifyer getValue public boolean getValue Returns the truth value of the operand that is represented by this qualifyer Returns The truth value of the operand that is represented by this qualifyer 97 Package gui Class Summary Page The toolbox of the program providing symbols for the elements that can be ButtonArea drawn on the DrawingArea as well as buttons for different functions and 98 actions that can be performed Dialog Shows a dialog window with a message 100 DrawingArea The area ofthe program where logic circuits are drawn 101 FileDialog Shows a dialog window for choosing a file 104 GateDrawer The main window of the GUI 106 GlobalKeyListener Keylistener for the whole program 114 Main The Main class of this project that instantiates a controller to start the program 116 Q
10. void export File file Exports the current graph as an image to a given file 144 void functionToGraph String function Draws a boolean function as a graph 144 void functionToTree Creates a boolean tree out of the user entered function 143 void generateGraph Randomly generates a new graph and draws it in drawingArea 144 Graph getGraph Returns the current graph 145 String getGraphAsFunction Returns the boolean function that corresponds the current graph 144 Graph getGraphCopy Returns a deep copy ofthe current graph 145 String getNewFunction Returns a new random boolean function 143 boolean isFunctionSatisfiable String function Tests if a given function is satisfiable 145 boolean isGraphSatisfiable Tests if the current graph is satisfiable 146 void load File file Loads graph and function from a given file 142 void mouseClicked MouseEvent event Handles a click in the drawingArea 143 141 void objectClicked DrawableComponent g Point mousePosition Handles a click on a drawableComponent 143 void randomValues Creates a random assignment for all operands 145 void repaint Passes a repaint request to the GUI 145 void save File file Saves the current state graph user entered function to a given file
11. DrawingArea java lang Object java awt Component L java awt Container Lz javax swing JComponent L javax swing JPanel gui DrawingArea All Implemented Interfaces Accessible Serializable ImageObserver MenuContainer public class DrawingArea extends JPanel The area of the program where logic circuits are drawn All calculations and changes are performed in DrawingService DrawingArea is just displaying the logic circuit Shows a popup to modify the current selection Constructor Summary Page DrawingArea Controller controller 102 Constructs an new DrawingArea Method Summary Page protected paintComponent Graphics g 103 volda void removeCurrentNode 103 Removes the Node that is currently displayed void removePopup 104 Removes the current popup void removeSelection 103 Removes the current selection void setCurrentLine GateConnection con 103 Sets a GateConnection that is currently constructed by the user and should be displayed void setCurrentNode Node node 103 Sets the current node that should be displayed void setGraph Graph graph 103 Sets the Graph that should be displayed void setGrid GridService grid 103 Sets the grid of the DrawingArea void setSelection Rectangle selection 103 Sets a selected area in the DrawingArea void showComponentPopup DrawableComponent dc 104 Shows a popup with options to modi
12. Operand public Operand QualifyerOperand qo int x int y int width int height Constructs a new Operand element at a specified position and with a specified dimension Parameters qo The Qualifyer defining the type of this component x The x coordinate of this component y The y coordinate of this component width The width of this component height The height of this component 91 Method Detail copy public Operand copy Description copied from class DrawableComponent Deep copy method for DrawableComponents The new component has the same coordinates and the same number of DockingPoints Hooked GateConnections won t be copied Overrides copy in class DrawableComponent Returns A deep copy ofthe DrawableComponent setBounds public void setBounds int x int y int width int height Description copied from class DrawableComponent Sets the bounds of the DrawableComponent Overrides setBounds in class DrawableComponent Parameters x The new x coordinate of the DrawableComponent y The new y coordinate of the DrawableComponent width The new width of the DrawableComponent height The new height of the DrawableComponent 92 Package domain qualifyers Class Summary Page BooleanQualifyer Represents an element of a Boolean function 93 g An element that can be passed to a QualifiedToggleButton containing ButtonQualifyer BR 94
13. The Qualifyer defining the type of this component x The x coordinate of this component y The y coordinate of this component width The width of this component height The height of this component 84 Method Detail copy public GateNot copy Description copied from class DrawableComponent Deep copy method for DrawableComponents The new component has the same coordinates and the same number of DockingPoints Hooked GateConnections won t be copied Overrides copy in class DrawableComponent Returns A deep copy of the DrawableComponent setBounds public void setBounds int x int y int width int height Description copied from class DrawableComponent Sets the bounds of the DrawableComponent Overrides setBounds in class DrawableComponent Parameters x The new x coordinate of the DrawableComponent y The new y coordinate of the DrawableComponent width The new width of the DrawableComponent height The new height of the DrawableComponent 85 domain gui GateOperator java lang Object L domain gui DrawableComponent L domain oui Gate L domain gui GateOperator All Implemented Interfaces Serializable public class GateOperator extends Gate Represents an operator in a logic circuit Constructor Summary Sets the bounds of the DrawableComponent Page GateOperator QualifyerGate gq 86 Constructs anew GateOp
14. componentResized public void componentResized ComponentEvent event Handles component resized event Calls resize with the new width and height of the DrawingArea Specified by componentResized in interface ComponentListener componentShown public void componentShown ComponentEvent event Handles component shown event Sets focus to DrawingArea Specified by component Shown in interface ComponentListener 153 service ExerciseService java lang Object L service ExerciseService public class ExerciseService extends Object This service manages all operations concerning Exercises Constructor Summary Page ExerciseService Constructs a new ExerciseService 155 Method Summary ExerciseService ArrayList lt Exercise gt xercises Constructs a new ExerciseService with an existing collection of Exericses 155 Page void deleteCurrentExercise Deletes the current Exercise 155 String evaluateCurrentExercise Graph graph String function Evaluates the current Exercise 158 void file finish File file Saves the collection of Exercises that is managed by this service to a given 159 void finishExecution Saves the collection of Exercises that is managed by this class to its original file 159 Exercise getCurrentExercise Returns Exercise at currentExercise position 157
15. public static final ExerciseType IncorGraph Change a given logic circuit so that is becomes equal to a given Boolean function DrawGates public static final ExerciseType DrawGates Find a logic circuit equal to a given Boolean function 59 Method Detail values public static ExerciseType values valueOf public static ExerciseType valueOf String name 60 domain exercise FunctionExercise java lang Object L donain xercise Exercis L domain exercise FunctionExercise All Implemented Interfaces Serializable Direct Known Subclasses IncorrectFunctionExercise public class FunctionExercise xtends Exercis Exercise in that a user has to find Boolean function equal to a given logic circuit The logic circuit and the found solution are stored in this class Field Summary Page Static INSTRUCTION 61 String The instruction what to do in this exercise Finde die Funktion zur Gatterschaltung Constructor Summary Page FunctionExercise int attempts int points Graph graph 61 Constructs anew FunctionExercise Method Summary Page Graph getGraph 62 Returns the logic circuit of this exercise String getInstruction 62 Returns the instruction for this exercise String getSolution 62 Returns a users solution of this exercise void setGraph Graph graph 62 Sets the logic circuit of this exercise void setSolution Strin
16. 3 6 BIDE NOON Eee 32 6 4 Logische Funktionen 444u4sssn4nsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 32 6 4 1 Werlebelegund u se s22 eae aeons e 32 6 4 2 Automatische Evaluation ccccccccceceeeesseeeceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee 32 5 4 3 Vergleichen ss 33 6 4 4 Gatterschaltung als Funktion darstellen een 33 6 4 5 Funktion als Gatterschaltung darstellen 4 044ssn4nn nn 33 6 5 6 Zuf llige Funktion oder Gatterschaltung generieren 33 6 5 7 Erf llbarkeit berpr fen 222244444000nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 33 6 5 AUTGaDEN 2 5 neun a a aa eee eae 33 6 5 1 Arten von Aufgaben are eete 33 6 5 2 AUTGaBENETZEUgeN una 34 6 5 3 Aufgaben bearbeitena na2aner ana 34 6 5 4 Aufgaben durchf hren 444444444400nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 34 6 5 5 Resultate anzeigen uuuus4444nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 35 7 Einsatzm glichkeiten im Unterricht u 22000000000nnRRnnnnnnnnn Hann nnnnnnnnnnn 36 8 Entwicklertageb ch u 41 Abbildungen cc nase aa 45 Literat r ame enter 46 ENET o e A E A a A E 47 Lebenslauf 1 Einleitung In meinem sp teren Beruf als Informatiklehrer wird es meine Aufgabe sein Sch lerinnen und Sch ler unter anderem in die Grundlagen der Informatik einzuf hren Dazu z hlt ni
17. Constructor Detail ButtonArea public ButtonArea GateDrawer parent Controller controller Constructs a new ButtonArea Parameters parent The parent GUI containing this toolbox controller The controller of this program Method Detail refreshValues public void refreshValues Sets the truth value of all operands to those specified by the user in the toolbox actionPerformed public void actionPerformed ActionEvent event Handles action events when a button in the toolbox is clicked Operations are passed to the parent GUI or directly to the controller Specified by actionPerformed in interface ActionListener setButtonsEnabled public void setButtonsEnabled boolean b Enables or disables all buttons that have nothing to do with the drawing of logic circuit in the toolbox Parameters b True if all buttons not regarding drawing of logic circuits should be enabled False otherwise setDrawingInputEnabled public void setDrawingInputEnabled boolean b Enables or disables all buttons that have to do with the drawing of logic circuit in the toolbox Parameters b True if all buttons regarding drawing of logic circuits should be enabled False otherwise itemStateChanged public void itemStateChanged ItemEvent arg0 Updates the truth values of all operands after one of them has changed in the toolbox Specified by itemStateChanged in interface ItemListener 99 gui Dialog java
18. Constructor Detail MenuBar public MenuBar GateDrawer gateDrawer Constructs a new Menubar for the program Parameters gateDrawer The main GUI of the program Method Detail actionPerformed public void actionPerformed ActionEvent e Handles action events when a menu item is selected All actions are performed by the parent GUI Specified by actionPerformed in interface ActionListener 133 Package gui popup Class Summary Page ConnectionPopup Shows a popup in the DrawingArea with options to edit a GateConnection 134 GatePopup Shows a popup in DrawingArea to edit a gate 134 Popup Shows a popup in DrawingArea to edit a part of it 135 SelectionPopup Shows a popup in DrawingArea to edit a selection 137 gui popup ConnectionPopup java lang Object L oii popup Popup gui popup ConnectionPopup All Implemented Interfaces ActionListener EventListener public class ConnectionPopup extends Popup Shows a popup in the DrawingArea with options to edit a GateConnection Constructor Summary Page ConnectionPopup GateConnection connection Controller controller Constructs anew ConnectionPopup 134 Method Summary Page void actionPerformed ActionEvent e Edits the GateConnection after the user has clicked on an option 134 Constructor Detail ConnectionPopup public Conne
19. GUI Anpassungen an Bildschirmaufl sungen Abbildungen S mtliche Abbildungen in dieser Arbeit wurden von mir selbst erstellt Die Abbildungen 6 9 wurden mit Hilfe des von mir entwickelten Programms erzeugt Abbildung 1 Anwendungsfalldiagramm Abbildung 2 Umsetzung des MVC Musters im Programm Abbildung 3 Umsetzung des DAO Musters im Programm Abbildung 4 Klassendiagramm des Pakets domain gui Abbildung 5 Screenshot des Programms Abbildung 6 Darstellung eines AND Operators durch NAND Gatter Abbildung 7 Ein Halbaddierer aufgebaut aus XOR und AND Gattern Abbildung 8 Zeigen einer De Morgan schen Regel mit Hilfe des Programms 45 Literatur Balzert Helmut Lehrbuch der Software Technik Band 1 Spektrum Akademischer Verlag Heidelberg 2000 Bundesministerium f r Unterricht Kunst und Kultur Hg Lehrplan f r den Wahlpflichtgegenstand Informatik in der AHS Oberstufe Wien 2004 Bundesministerium f r Unterricht Kunst und Kultur Hg Lehrplan Informatik f r die AHS Oberstufe Wien 2004 Free Software Foundation GNU General Public Licence Version 3 29 6 2007 http www gnu org licenses gpl 3 0 html abgerufen am 1 3 2012 Gerwinski Peter GNU General Public Licence Deutsche bersetzung der Version 3 29 6 2007 http www gnu de documents gpl de html abgerufen am 1 3 2012 Grossmann Schinagl Cenker Neuwirth Ledl Netzwerkanalyse Details http startistik csd univie ac at netz details jsp
20. GateDrawer Controller controller Constructs a new GateDrawer Method Summary 108 Page void abortExercise Aborts the current Exercise either creation or execution or displaying of result 110 void clearGraph Removes the current logic circuit 113 void clearGraphFunction Clears the graph function textfield 112 void clearTextFields Clears all textfields 112 void closeExerciseMenuBar Closes the current ExerciseMenuBar 113 void compareFunctionAndGraph Checks if the current logic circuit and the current user entered Boolean function are equal 113 void componentHidden ComponentEvent arg0 ComponentHidden event is ignored 114 void componentMoved ComponentEvent arg0 ComponentMoved event is ignored 114 void componentResized ComponentEvent arg0 On a ComponentResized event the font sizes of all textfields are adjusted 114 void componentShown ComponentEvent arg0 ComponentShown event is ignored 114 void createExercises Starts the creation of a new set of Exercises 110 void deleteExercise Deletes the current Exercise 110 void display String text Displays a message in jtaText 113 void doExercises Loads a new set of Exercises for execution 111 106 void editExercises Loads
21. Informatikunterricht angewendet werden Das Programm soll Sch lerinnen und Sch lern die M glichkeit geben das Bauen von Gatterschaltungen zu erlernen und zu ben 2 2 2 Zielgruppen Das Programm soll von Sch lerinnen und Sch lern des Informatikunterrichts verwendet werden Da Informatik in der f nften Klasse AHS beziehungsweise in unterschiedlichen Klassen in den BHS als Pflichtfach unterrichtet wird sind 9 Sch lerinnen und Sch ler der Oberstufe vor allem im Alter von etwa 15 Jahren Zielgruppe Vorausgesetzt werden Basiskenntnisse im Umgang mit dem Computer sowie die theoretischen Grundlagen Boolescher Algebra 2 2 3 Betriebsbedingungen Das Programm wird voraussichtlich nur w hrend des Informatikunterrichts in der Schule eventuell auch zu Hause verwendet werden Daher l uft das Programm vermutlich jeweils nur kurz also weniger als 2 Stunden Daher sollte der Betrieb des Programms keine Betreuung durch einen Administrator erfordern 2 3 Produktumgebung Das Programm wird mit Java geschrieben und l uft daher auf unterschiedlichen Plattformen Auf jeden Fall wird es unter folgenden Voraussetzungen laufen 2 3 1 Software e Betriebssystem Windows XP oder h her e Java Runtime Environment 1 6 oder h her 2 3 2 Hardware e Ein Rechner auf dem die oben genannte Software l uft 2 4 Produktfunktionen Funktionen die das Programm f r den Benutzer leistet e Eine Gatterschaltung zeichnen lassen Der Benutzer
22. Instantiates a new Controller to start the program Parameters args Parameters are ignored 117 gui QualifiedToggleButton java lang Object L ava awt Component L savas awe Container L avax swing JComponent L javax swing AbstractButton L javax swing JToggleButton L qui QualifiedToggleButton All Implemented Interfaces Accessible ItemSelectable SwingConstants Serializable ImageObserver MenuContainer public class QualifiedToggleButton extends JToggleButton A JToggleButton taking its data from a Qualifyer Returns the Qualifyer that defines the button Constructor Summary Page QualifiedToggleButton ButtonQualifyer qualifyer 118 Constructs a new QualifiedToggleButton Method Summary Page ButtonQualifyer getQualifyer 118 Constructor Detail QualifiedToggleButton public QualifiedToggleButton ButtonQualifyer qualifyer Constructs a new QualifiedToggleButton Parameters qualifyer The Qualifyer defining the button Method Detail getQualifyer public ButtonQualifyer getQualifyer Returns the Qualifyer that defines the button Returns The Qualifyer that defines the button 118 Package gui container Class Summary Page A Container for 4 different GUI elements a textfield for in or output of z a Boolean functions three buttons for generating a random function or circuit FunctionContainer en j 119 convert a circ
23. Physik und Informatik
24. Returns graphTree as a function or an empty String if graphTree is null evaluateFunction public boolean evaluateFunction String function Evaluates a boolean Function Logical values of the Qualifyers are taken for evaluation Evaluation is done in BoolTree evaluate Parameters function Function to evaluate Returns True if the function evaluates to true False otherwise evaluateGates public boolean evaluateGates DrawableComponent root Evaluates the Graph thats root DrawableComponent is specified Logical values of the Qualifyers are taken for evaluation Evaluation is done in BoolTree evaluate Parameters root The root DrawableComponent of the Graph that is to be evaluated Returns True if the Graph evaluates to true False otherwise 174 compare public boolean compare String functionl String function2 Compares two Boolean functions Comparison is done in BoolTree equals Parameters functionl First function to compare function2 Second function to compare Returns True if function1 is equal to function2 randomValues public void randomValues Creates random truth values for all operands isSatisfiable public boolean isSatisfiable String function Checks if a specified Boolean function is satisfiable Parameters function Function to check Returns True if the function is satisfiable False otherwise isSatisfiable public boolean isSatisfiable Graph gra
25. Sch lerInnen zu erzeugen durchzuf hren und zu bewerten Das Programm soll dabei helfen das Thema zu erschlie en ist jedoch explizit nicht als Lernpfad konzipiert Die vorliegende Arbeit dokumentiert das entstandene Programm sowie dessen Entwicklung Abschlie end werden noch m gliche Anwendungen des Programms im Unterricht besprochen 2 Pflichtenheft Im folgenden Pflichtenheft habe ich zu Beginn meiner Arbeit die zu erreichenden Ziele festgeschrieben Vor dem Start der Entwicklung wurde es von meinem Betreuer abgenommen Das Pflichtenheft wurde nach der Gliederung von Balzert verfasst 2 1 Zielbestimmungen Es soll eine Software erstellt werden die es Sch lerinnen und Sch lern im Unterricht erlaubt Gatterschaltungen zu konstruieren und verifizieren zu lassen 2 1 1 Musskriterien e Der Benutzer kann O eine Gatterschaltung bauen eine vom Computer vorgegebene Boolesche Funktion als Gatterschaltung nachbauen die Boolesche Funktion zur selbstgebauten Gatterschaltung errechnen lassen eine Boolesche Funktion f r eine bestimmte Belegung verifizieren lassen eine Boolesche Funktion eingeben und als Gatterschaltung vom Computer nachbauen lassen e Das Programm O O O stellt Gatterbausteine mit nationalen Symbolen zur Verf gung enth lt die Booleschen Funktionen und oder und nicht kann zwei verschiedene Eingangswerte f r die Gatter verarbeiten kann eine Boolesche Funktion bezi
26. container FunctionContainer getFunction setButtonsEnabled setEnabled setEval setFontSizes setFunction Constructor Detail UserFunctionContainer public UserFunctionContainer GateDrawer parent KeyListener keyListener Constructs a new UserFunctionContainer Parameters parent The parent GUI of this component keyListener A KeyListener for user input Method Detail actionPerformed public void actionPerformed ActionEvent e Handles action events on the buttons of this container Events are passed to the parent GUI Specified by actionPerformed in interface ActionListener 125 initializeComponent protected void initializeComponent Description copied from class FunctionContainer Initializations depending of the subtype Overrides initializeComponent in class FunctionContainer 126 Package gui menubar Class Summary Page CreateExerciseMenuBar Menubar for creating or editing a set of Exercises 127 DoExerciseMenuBar Menubar for executing a set of Exercises 128 A menu bar that provides options to create execute and edit or displays ExerciseMenuBar 130 oo information about Exercises ExerciseResultsMenuBar This menubar displays the results of an Exercise 131 MenuBar The menubar of this program 132 gui menubar CreateExerciseMenuBar java lang Object L java awt Component L java awt Contai
27. correctly at the first attempt Parameters pointsWorth The number of points this exercise is worth when solved correctly at the first attempt getPointsReached public int getPointsReached Returns the number of points a user reached when he solved the exercise Returns The number of points a user reached when he solved the exercise setPointsReached public void setPointsReached int pointsReached Sets the number of points a user reached when he solved the exercise Parameters pointsReached The number of points a user reached when he solved the exercise isTried public boolean isTried Defines if this exercise was already tried by a user Returns True if a user has already made an attempt on this exercise False otherwise setTried public void setTried boolean tried Sets tried to a given boolean value Parameters tried True if a user has already made an attempt on this exercise False otherwise 57 isAccomplished public boolean isAccomplished Returns True if a user has already accomplished this exercise Returns True if a user has already accomplished this exercise False otherwise setAccomplished public void setAccomplished boolean accomplished Sets accomplished to a given boolean value Parameters accomplished True if a user has already accomplished this exercise False otherwise giveUp public void giveUp Sets givenUp to True isGivenUp public boolean isGivenUp Returns Tr
28. ee is the super type of all elements of a logic circuit that are 74 drawn in DrawingArea apart from GateConnections DrawablesFactory Factory for DrawableComponents 77 Gate Element of a logic circuit representing operators including the NOT sign 78 GateConnection Represents a line connecting two components of a logic circuit 80 GateNot Represents a NOT sign in a logic circuit 83 GateOperator Represents an operator in a logic circuit 85 Node An area attached to a GateConnection that can be used to edit it 87 Operand Represents an operand in a logic circuit 90 Enum Summary Page DockType Defines the types of DockingPoints 72 domain gui DockingPoint java lang Object L domain gui DockingPoint All Implemented Interfaces Serializable public class DockingPoint extends Object implements Serializable DockingPoints represent input or output areas of DrawableComponents and work as hooks for GateConnections They can only be established between 2 DockingPoints so that each DrawableComponent has one two or three ofthem depending on the components type The exact position where a GateConnection starts or ends is calculated in GridService usinga DockingPoint To mark their position on a DrawableComponent each DockingPoint is associated with a DockType Field Summary Page int height 70 The height ofthis DockingPoint int width 70 The width of this DockingPoint int x 70 The x coordinate of this Dockin
29. gibt eine Boolesche Funktion ein und l sst vom Programm die entsprechende Gatterschaltung zeichnen e Eine Boolesche Funktion erstellen lassen Der Benutzer zeichnet eine Gatterschaltung und l sst vom Programm die entsprechende Boolesche Funktion anzeigen e Eine Boolesche Funktion eingeben und die quivalente Gatterschaltung zeichnen Der Benutzer gibt eine Boolesche Funktion ein und zeichnet die dazugeh rige Gatterschaltung Das Programm berpr ft die quivalenz der beiden 10 e Eine Gatterschaltung zu einer Booleschen Funktion zeichnen Das Programm erzeugt eine Boolesche Funktion und der Benutzer zeichnet eine quivalente Gatterschaltung e Eine Boolesche Funktion zu einer Gatterschaltung eingeben Das Programm erzeugt eine Gatterschaltung und der Benutzer gibt die dazu quivalente Boolesche Funktion ein e Eine Boolesche Funktion evaluieren Das Programm evaluiert eine Boolesche Funktion f r eine vom Benutzer vorgegebene Belegung der Eingangswerte Alle Eingaben des Benutzers k nnen vom Programm ausgewertet und Boolesche Funktion und Gatterschaltung auf quivalenz getestet werden 2 5 Produktdaten Das Produkt speichert vor jeder Beendigung die aktuell angezeigte Boolesche Funktion sowie die aktuelle Gatterschaltung In einem sp teren Erweiterungsschritt k nnen auch die Punkteergebnisse der Benutzer gespeichert werden 2 6 Produktleistungen Laufzeit Evaluierungen beziehungsweise Pr fungen auf quivalenz sol
30. icon of a button that is associated with this Boolean element 93 Method Detail getChar public char getChar Returns the character of an element in a Boolean function that is represented by this BooleanQualifyer Returns The character of an element in a Boolean function that is represented by this BooleanQualifyer equals public boolean equals Object o Returns True if the passed object represents the same part of a Boolean function Overrides equals inclass Object Parameters o The object that is to be compared to this object Returns True if the passed object represents the same part of a Boolean function False otherwise 94 domain qualifyers ButtonQualifyer java lang Object L domain qualifyers ButtonQualifyer All Implemented Interfaces Serializable Direct Known Subclasses BooleanQualifyer public class ButtonQualifyer extends Object implements Serializable An element that can be passed to a QualifiedToggleButton containing information that is displayed in the button Constructor Summary Page ButtonQualifyer ImageIcon buttonIcon ImageIcon selectedButtonIcon 95 Constructs anew ButtonQualifyer Method Summary Page Imagelcon getButtonIcon 95 Returns the icon of the button ImageIcon getSelectedButtonIcon 95 Returns the selected icon of the button Constructor Detail ButtonQualifyer public ButtonQualifyer Imagelcon
31. information that is displayed in the button QualifyerGate Represents an operator or a NOT sign in a Boolean function 95 QualifyerOperand Represents an operand in a Boolean function 97 domain qualifyers BooleanQualifyer java lang Object L domain qualifyers ButtonQualifyer L domain qualifyers BooleanQualifyer All Implemented Interfaces Serializable Direct Known Subclasses QualifyerGate QualifyerOperand public abstract class BooleanQualifyer extends ButtonQualifyer Represents an element of a Boolean function Used to define such an element that a DrawableComponent or a button stands for Constructor Summary Page BooleanQualifyer char c ImageIcon buttonIcon ImageIcon selectedButtonIcon 93 Constructs a new BooleanQualifyer Method Summary Page boolean equals Object o 94 Returns True if the passed object represents the same part of a Boolean function char getChar 94 Returns the character of an element in a Boolean function that is represented by this BooleanQualifyer Constructor Detail BooleanQualifyer public BooleanQualifyer char c Imagelcon buttonlcon Imagelcon selectedButtonlIcon Constructs anew BooleanQualifyer Parameters c buttonIcon The icon of a button that is associated with this Boolean element A character of an element in a Boolean function that is represented selectedButtonlIcon The selected
32. k nnen schwierigere Aufgaben gestellt werden Dazu geh rt zum Beispiel die Konstruktion einer Schaltung die nur aus NAND oder NOR Gattern besteht und dieselbe Funktion erf llt wie ein anderer Operator Als Beispiel wird im Folgenden gezeigt wie aus NAND Gattern eine AND Verkn pfung dargestellt werden kann wobei der Operand c mit log 1 belegt sein muss Abb 6 Darstellung eines AND Operators durch NAND Gatter Wird der Stoff vertieft etwa im Wahlpflichtgegenstand Informatik k nnen auch komplexere Schaltungen wie etwa ein Halb oder Volladdierer dargestellt werden Allerdings st t das Programm hier an seine Grenzen da die Evaluation einer Schaltung mit mehreren Ausg ngen nicht m glich ist Die Konstruktion ist jedoch kein Problem wie aus Abbildung 7 zu entnehmen ist ia x b Abb 7 Ein Halbaddierer aufgebaut aus XOR und AND Gattern M glich sind auch Aufgabenstellungen welche die Konstruktion einer Schaltung erfordern die unter einer gegebenen Wertebelegung wahr oder falsch wird Das 37 Programm vereinfacht auch die Erstellung einer Wahrheitstabelle durch Sch lerinnen und Sch ler F r eine Gatterschaltung oder eine Funktion m ssen nur noch alle m glichen Wertebelegungen eingestellt werden die Wahrheitswerte berechnet das Programm automatisch Damit erleichtert es auch die Beantwortung der Frage ob eine Boolesche Funktion eine Tautologie oder eine Kontradiktion ist Das Programm ist ebenfalls in der La
33. l sst das System die Erf llbarkeit einer Gatterschaltung berpr fen Ist die Gatterschaltung leer wird falsch zur ckgegeben Scenarios Hauptszenario Per Klick berpr ft das System ob eine Gatterschaltung erf llbar ist Das Ergebnis wird dem User angezeigt Nachbedingung Das System zeigt an ob die Gatterschaltung erf llbar ist 18 Stand des Programms abspeichern Kurzbeschreibung Der User l sst den aktuellen Stand des Systems abspeichern Scenarios Hauptszenario In einem eigenen Fenster w hlt der User eine Datei aus in welche der aktuelle Programmstand gespeichert werden soll Ist die Datei noch nicht vorhanden wird sie vom Programm neu angelegt Gespeichert werden die aktuell angezeigte Gatterschaltung sowie die eingegebene Funktion Alternativszenario Der User hat eine bereits existierende Datei ausgew hlt In diesem Fall wird nachgefragt ob die Datei berschrieben werden soll Stimmt der User zu wird fortgefahren Ansonsten wird das Speichern abgebrochen Fehlerszenario Tritt ein unvorhergesehener Fehler beim Schreiben in die Datei auf wird der User davon benachrichtigt Nachbedingung Der aktuelle Programmstand wurde in die vom User spezifizierte Datei gespeichert 19 Einen Programmstand aus einer Datei laden 20 Kurzbeschreibung Der User l sst einen Programmstand aus einer Datei laden Scenarios Hauptszenario In einem eigenen Fenster w hlt der User eine Datei aus aus welcher der neue P
34. lang Object L gui Dialog public class Dialog extends Object Shows a dialog window with a message void Constructor Summary Page Dialog 100 Method Summary Page staticlask String message String title 100 ame Shows a question dialog with yes no option for the user static info 101 en Shows a window with information about the program Static tellError String message String title 100 were Shows an error message with a given text static tellSuccess String message String title 100 Show an information window to display a success Constructor Detail Dialog public Dialog Method Detail tellError public static void tellError String message String title Shows an error message with a given text Parameters message Message to display title Title of the error window tellSuccess public static void tellSuccess String message String title Show an information window to display a success Parameters 100 message Message to display title Title ofthe information window ask public static boolean ask String message String title Shows a question dialog with yes no option for the user Parameters message Message to display title Title ofthe dialog Returns True if the user chose yes False otherwise info public static void info Shows a window with information about the program 101 gui
35. managed by this service Returns Total number of Exercises or 0 if no Exercise is initialized getCurrentExerciseNumber public int getCurrentExerciseNumber Returns the number of the Exercise currently displayed Returns Number of the current exercise or 0 if exercises is not initialized getExercises public ArrayList lt Exercise gt getExercises Returns the collection of Exercises managed by this service Returns Collection of Exercises managed by this service getPointsReached public int getPointsReached Returns the sum of all points that were reached yet Returns Sum of all reached points 157 getPointsTotal public int getPointsTotal Returns the sum of all points that can be reached in total Returns Sum of all reachable points evaluateCurrentExercise public String evaluateCurrentExercise Graph graph String function Evaluates the current Exercise The correct solution for an exercise is calculated and compared to the user s solution If the solution is correct the current Exercise is set to solved The solution is saved in the Exercise Whether the solution is correct or not the number of attempts is raised by one Evaluation is only done if the number of allowed attempts is not yet exceeded Parameters graph Graph that is currently displayed and might be part of the solution depending of the type of Exercise function Function that is currently displayed and
36. might be part o the solution depending of the type of Exercise Returns A String to display according to the result of the evaluation e Die Aufgabe wurde bereits aufgegeben Die Aufgabe wurde bereits erledigt Es wurden bereits so viele Versuche f r diese Aufgabe ben tigt wie m glich sind Die L sung ist korrekt Die L sung ist nicht korrekt previous public void previous Moves to the Exercise at currentPosition 1 next public void next Moves to the Exercise at currentPosition 1 load public void load File file throws Exception Loads a collection of Exercises from a given file Parameters file File to load Exercises from Throws Exception If an error occurs while reading the file 158 saveExercise public void saveExercise ExerciseType mode Graph graph String userFunction int points int attempts throws Exception Creates and saves anew Exercise atthe currentExercise position Parameters mode Thetype ofthe Exercise graph The logic circuit ofthe Exercise Can be null depending on the type userFunction The Boolean function of the Exercise Can be null depending on the type points The points this Exercise is worth attempts The attempts that may be made for solving this Exercise Throws Exception If one or more necessary parameters are null finish public void finish File file throws IllegalA
37. mit der dargestellten Gatterschaltung verkn pft Hier werden Aktionen gestartet die mit der Gatterschaltung zu tun haben F Men leiste Die Men leiste stellt grundlegende Programmfunktionen wie etwa Speichern oder Beenden zur Verf gung 28 Gate Drawer F Room DIEBE PJI wahr falsch Aufgaben wahr falsch wahr falsch wahr gt falsch wahr gt falsch Formel und Gatterschaltung sind nicht quivalent falsch Abb 5 Screenshot des Programms 6 3 Grundfunktionen 6 3 1 Gatterschaltung zeichnen F r das Zeichnen von Gatterschaltungen steht ein gro er Bereich im Programm zur Verf gung A F r die Auswahl der Gatterbausteine steht die Toolbox B am linken Rand des Programms zur Verf gung e Bedienelemente in der Toolbox In der Toolbox finden sich die vier grundlegenden Gatterarten die gezeichnet werden k nnen AND OR NOT und XOR NAND NOR und XNOR Gatter k nnen durch Negation von AND OR und XOR Gattern erzeugt werden Darunter befinden sich die Symbole zum Zeichnen von Linien zum Entfernen von Linien oder Gattern sowie zum L schen der Schaltung Als n chstes sind Symbole f r die Operanden der Schaltung zu finden Sie k nnen auf dieselbe Weise verwendet werden wie die anderen Elemente Ein gew hltes Element bleibt solange ausgew hlt bis ein anderes Element ausgew hlt wird 29 30 Platzieren von Gatterbausteinen Ist ein Baustein in der Toolb
38. protected J bClear 120 JButton P A A Clears a function or circuit protected 3 bDisplay ast JButton Displays a function as a circuit or vice versa 119 Displays a Boolean function in jtfFunction protected J bRandom 121 no Generates a random Boolean function or logic circuit protected jtfFunction 121 ee Textfield displaying a Boolean function protected lbEval 121 en Displays the truth value of a function or a circuit protected parent 121 gateDravwer The GUI of the program Constructor Summary Page FunctionContainer GateDrawer parent KeyListener keyListener 121 Constructs a new FunctionContainer Method Summary Page String getFunction 122 Returns the Boolean function that is displayed protected initializeComponent 121 abstract PE ye a soia Initializations depending of the subtype void setButtonsEnabled boolean b 122 Enables the jbDisplay and the jbRandom buttons void setEnabled boolean b 121 Sets all elements of this container enabled or disabled void setEval boolean b 122 Displays a truth value in lbEval void setFontSizes int size 122 Sets the font size of the textfield where the Boolean function is displayed void setFunction String function 122 Field Detail buttonPanel protected JPanel buttonPanel Contains the buttons evalFont protected Font evalFont Font for 1bEval functio
39. specified coordinates Point getNextPoint Point p 163 Returns the point that is next to the specified coordinates Point getNextPointFixx double x double y 164 Returns the point next to specified coordinates Point getNextPointFixyY double x double y 164 Returns the point next to specified coordinates Point getPoint int i int j 163 Returns the point at the array position specified by i and j Point getPoints 163 Returns the points of the grid void resize int width int height 165 Constructor Detail GridService public GridService int width int height int griddist int inset Constructs a new grid with given width height griddist and insets Parameters width The width of the grid height The height of the grid griddist The distance between two points of the grid inset The insets of the grid 162 GridService public GridService int griddist int inset Constructs a new grid with a given griddist and insets Width and height are 0 Parameters griddist The distance between two points of the grid inset The insets of the grid Method Detail getPoints public Point getPoints Returns the points of the grid Returns Points of the grid getPoint public Point getPoint int i int j Returns the point at the array position specified by i and j Parameters i The position in the points array in the first dimension j The position in t
40. the user entered function void setGateFunction String gateFunction 186 Set the Boolean function equaling the Graph void setGraph Graph graph 185 Constructor Detail SerializationContainer public SerializationContainer Method Detail getGraph public Graph getGraph Getter for the Graph Returns The Graph of this container setGraph public void setGraph Graph graph Setter for the Graph Parameters graph The new Graph of this container 185 getFunction public String getFunction Returns the user entered function Returns The user entered function setFunction public void setFunction String function Sets the user entered function Parameters function The new user entered function getGateFunction public String getGateFunction Returns the Boolean function equaling the Graph Returns The Boolean function equaling the Graph setGateFunction public void setGateFunction String gateFunction Set the Boolean function equalingthe Graph Parameters gateFunction The new Boolean function equaling the Graph 186 Lebenslauf Pers nliche Daten Name Geburtsdatum Staatsangeh rigkeit Ausbildung 1993 bis 1997 1997 bis 2005 2005 2005 bis 2006 2006 bis 2012 Markus Bauer 14 5 1987 sterreich Volksschule Wien Bundesrealgymnasium Wien XIX Krottenbachstra e Reifepr fung Zivildienst Universit t Wien Unterrichtsfach
41. 0 23 1 SDOMWARG es 10 2 3 2 ALON AN Cesena Mais otters peta tae es ner 10 2 4 Produktfunktioheni 22 22 10 BS PIOQUKII Ale a ee ee ee he Ae oe 11 2B Prod ktleist nge Diese cues tadc tacate lates ae a a ia 11 2 7 Benulzeroberllachen ran aaa 11 2 8 Qualit tsbestimmungen u 444444444400nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 2 9 Entwicklungsumgebung 44444444440000nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 29 1Software und Tools rn 12 2 9 2 HarldWaler eses eier 12 3 Anwendungst lleianannneean een 13 3 1 Anwendungsfalldiagramm 22444444444400nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 13 3 2 Anwendungsfallbeschreibungen s444444444444440nnnnnnnnnnnnnnnnnnnnnnnn 14 A Programmstruktur secure aaa u 24 5 Systemvoraussetzungen und Lizenzbedingungen urr2u0000000nnnnnnnnnnn 27 6 Benutzerhandb ch 00u 0 nun ununuwnn nn nun 28 6 KRIOGTEMINSTAN seen 28 6 2 Ubetsicht a an ae 28 5 3 Gelmdfuinklisnen zassreseeeshpaaiensh 29 6 3 1 Gatterschaltung zeichnen 2222444440000nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 29 6 3 2 Gatterschaltung l schen 42a 31 6 3 3 Boolesche Funktion eingeben uun4444422444nnnnnnnnnnnnnnnnnnnnnnn 31 6 34 SSIS IGM ae ern a ea a i a 31 Specie IE 0 gt VRRRREERSSERSERESPERNERRNEEREREAUEESERTNLEREERNEHENERENLERNEERSERENEEENENESERENLERSERENESESERTSEN 32 6
42. 135 gui popup Popup java lang Object L gui popup Popup All Implemented Interfaces ActionListener EventListener Direct Known Subclasses ConnectionPopup GatePopup SelectionPopup public abstract class Popup extends Object implements ActionListener Shows a popup in DrawingArea to edit a part of it Constructor Summary Sets the popup visible Page Popup Controller controller 136 Constructs a new Popup Method Summary Page JPopupMenu get Popup 137 Returns the actual popup boolean isVisible 136 Returns True if the popup is visible void setVisible boolean visible 136 Constructor Detail Popup public Popup Controller controller Constructs a new Popup Parameters controller The controller of this program Method Detail is Visible public boolean isVisible Returns True if the popup is visible False otherwise Returns True if the popup is visible False otherwise set Visible public void setVisible boolean visible Sets the popup visible Parameters visible True if the popup should be visible False if not 136 getPopup public JPopupMenu getPopup Returns the actual popup Returns The actual popup 137 gui popup SelectionPopup java lang Object L wid spopun Porup L gui popup SelectionPopup All Implemented Interfaces ActionListener EventListener public class SelectionPopup ex
43. 14 Boolesche Funktion als Gatterschaltung anzeigen lassen Kurzbeschreibung Der User l sst vom System die zu einer eingegebenen Booleschen Funktion quivalente Gatterschaltung generieren und anzeigen Scenarios Hauptszenario Per Klick erzeugt das System eine quivalente Gatterschaltung und zeigt diese an Nachbedingung Das System zeigt die generierte Gatterschaltung sowie ihren Wahrheitswert an 15 Gatterschaltung als Boolesche Funktion anzeigen lassen Kurzbeschreibung Der User l sst vom System die zu einer Gatterschaltung quivalente Boolesche Funktion generieren und anzeigen Scenarios Hauptszenario Per Klick erzeugt das System eine quivalente Boolesche Funktion und zeigt diese an Fehlerszenario Entspricht der Gatterschaltung keine g ltige Boolesche Funktion wird die Funktion so weit wie m glich konstruiert und angezeigt Nachbedingung Das System zeigt die generierte Funktion sowie ihren Wahrheitswert an 16 Boolesche Funktion auf Erf llbarkeit testen lassen Kurzbeschreibung Der User l sst das System die Erf llbarkeit einer Booleschen Funktion berpr fen Ist die Funktion leer wird falsch zur ckgegeben Scenarios Hauptszenario Per Klick berpr ft das System ob eine Boolesche Funktion erf llbar ist Das Ergebnis wird dem User angezeigt Nachbedingung Das System zeigt an ob die Funktion erf llbar ist 19 17 Gatterschaltung auf Erf llbarkeit testen lassen Kurzbeschreibung Der User
44. 142 void setCurrentMode ButtonQualifyer qualifyer Setter for the current mode 143 void setGraph Graph graph Sets the current graph in drawingService to a deep copy of the given graph 145 Constructor Detail Controller public Controller Constructs and initializes a new controller A new GUI gateDrawer is instantiated as well as a drawingService anda logicService Method Detail load public void load File file throws Exception Loads graph and function from a given file Fileaccess is done in fileDAO Parameters file File to load from Throws save Exception If the file is not found or content cannot be loaded from it public void save File file throws Exception Saves the current state graph user entered function to a given file Fileaccess is done in fileDAO Parameters file File to save the state to Throws Exception If a problem with the file occurs abortCurrentLine public void abortCurrentLine Aborts drawing of the current line Action is executed in the drawingService 142 objectClicked public void objectClicked DrawableComponent g Point mousePosition Handles a click on a drawableComponent Decides to draw a line or to remove a gate according to the current mode Parameters g DrawableComponent that was clicked by the user mousePosition Position on the drawingArea o
45. 168 er Icon of AND gate static GATE ICON NOT 168 ee Icon of NOT gate static GATE ICON OR 168 en Icon of OR gate static GATE ICON XOR 168 na Icon of XOR gate static ICON AND Icon for AND gate in the ButtonArea static ICON AND SELECTED 168 me Selected icon for AND gate in the ButtonArea static ICON ARROW DOWN 168 sia ae Arrow down icon static ICON ARROW UP 168 Poo Arrow up icon static ICON CHECK FUNCTION ae nn Icon for checking a Boolean function for satisfiability static ICON CHECK FUNCTION ROLLOVER 168 we Rollover icon for checking a Boolean function for satisfiability static ICON CHECK GRAPH 169 Red sot Icon for checking the logic circuit for satisfiability static ICON CHECK GRAPH ROLLOVER 169 Ma Rollover icon for checking the logic circuit for satisfiability static ICON CLEAR 169 nn Icon for deleting the logic circuit in the ButtonArea statie ICON CLEAR FUNCTION 2 Be es Icon for clearing a field static ICON CLEAR SELECTED aog mn Selected icon for deleting the logic circuit in the ButtonArea static ICON COMPARE 169 ee Icon for comparing a Boolean function to a logic circuit static ICON COMPARE ROLLOVER een Rollover icon for comparing a Boolean function to a logic circuit static ICON DELLINE 169 ee aeRa Icon for deleting a connection in the ButtonArea static ICON DELLINE SELECTED 163 ee Selected icon for deleting a connection in the ButtonArea static ICON EXIT Be Icon for exiting the progr
46. All fields indicating a user action such as selecting are set to false flush public void flush Removes all Gates and GateConnections from the DrawingArea The Graph is reinstantiated not just cleared All fields indicating a user action such as selecting are set to false drawOperand public int drawOperand OualifyerOperand qualifyer Draws an Operand if it is not already drawn Parameters qualifyer QualifyerOperand specifing the Operand Returns The index of the Operand drawGate public int drawGate QualifyerGate qg int leftID int rightID boolean negated boolean negatedLeft boolean negatedRight Draws a Gate and its Connections automatically The column of the gate is calculated by leftID and rightID column Parameters qg The qualifyer specifying what Gate to draw leftID Id of the Gate connected at the left DockingPoint rightID If of the Gate connected at the right DockingPoint negated True if the Out DockingPoint is negated False if not negatedLeft True if the In1 DockingPoint is negated False if not negatedRight True if the In1 DockingPoint is negated False if not Returns The id of the created Gate 150 setNegation public void setNegation int id boolean negation Sets the negation of the Out DockingPoint of a DrawableComponent Parameters id The id of the DrawableComponent negation True if the DockingPoint should be negated False if not drawConnection publ
47. BoolTree Evaluation is done in each Element of the tree For evaluation the logical truths of each operand is taken from its corresponding QualifyerOperand Returns True if this trees current logic truth is true False otherwise analyze public boolean analyze String function Analyzes a Boolean function If the given String represents a valid function a corresponding tree is built from it Building of the tree is done in buildTree String function Parameters function The Boolean function to analyze Returns True if the function was analyzed False otherwise toString public String toString Returns the Boolean function that is represented by this BoolTree If no tree has been built yet null is returned Overrides toString in class Object getOperands public HashSet lt QualifyerOperand gt getOperands Returns all operands that occur in this Bool Tree Returns All operands that occur in this Bool Tree 180 equals public boolean equals Object obj Checks iftwo BoolTrees represent the same Boolean function Overrides equals in class Object Parameters obj An objects that this Bool Tree is compared to Returns True if obj isa BoolTree and represents the same Boolean function as this BoolTree does False otherwise isSatisfiable public boolean isSatisfiable Checks ifthe Boolean function that is represented by this BoolTree is satisfiable Returns True if the function is satisfi
48. Event setToCurrentExercise public void setToCurrentExercise Description copied from class ExerciseMenuBar Displays information about the current Exercise such as points and attempts The current Exercise is taken from ExerciseService Overrides setToCurrentExercise in class ExerciseMenuBar paintComponent public void paintComponent Graphics g Overrides paintComponent in class JComponent 128 gui menubar DoExerciseMenuBar java lang Object java awt Component L java awt Container L javax swing JComponent L javax swing JMenuBar L gui menubar ExerciseMenuBar gui menubar DoExerciseMenuBar All Implemented Interfaces ActionListener EventListener Accessible MenuElement Serializable ImageObserver MenuContainer public class DoExerciseMenuBar xtends ExerciseMenuBar implements ActionListener Menubar for executing a set of Exercises Constructor Summary Page DoExerciseMenuBar GateDrawer gateDrawer ExerciseServic xerciseService 129 Constructs a new DoExerciseMenuBar Method Summary Page void actionPerformed ActionEvent e 129 Handles action events on the menu bar void setToCurrentExercise 129 Displays information about the current Exercise such as points and attempts Constructor Detail DoExerciseMenuBar public DoExerciseMenuBar GateDrawer gateDrawer ExerciseServic xerciseService Construct
49. Fortschritt in der Programmentwicklung Nicht aufgef hrt sind unz hlige kleinere Entwicklungen Verbesserungen und Erweiterungen die zusammen einen wesentlichen Teil des Programms ausmachen Das Tagebuch enth lt Strukturen und Elemente die in der finalen Programmversion nicht mehr zu finden sind aber seine Entwicklung dokumentieren 29 30 April 2011 4 Mai 2011 23 24 Mai 2011 8 Juni 2011 13 Juni 2011 14 15 November 2011 3 4 August 2011 8 11 August 2011 Erstellung des Pflichtenhefts Abnahme des Pflichtenhefts durch den Betreuer Recherche ber Java2D Java Graphics berlegungen zt Darstellung Boolescher Funktionen als Baumstruktu berlegungen zum Analysealgorithmus Erstellung erster Klassen und Anwendungsfall diagramme Abnahme der Diagramme durch den Betreuer Serialisierung zum persistenten Speichern von Objekten implementiert Implementierung einer Baumstruktur zur Darstellung und eines Algorithmus zur Zerlegung Boolescher Funktionen Entwicklung eines iterativen und eines rekursiven Algorithmus zur Zerlegung Boolescher Funktionen in eine Baumstruktur Hinzuf gen von Klassen f r unterschiedliche Gatterarten Verwendung des Factory Patterns zur Erzeugung der Klassen Modellierung der 41 14 August 2011 17 20 August 2011 21 22 August 2011 28 31 August 2011 1 September 2011 5 6 September 2011 22 28 September 2011 1 2 Novemb
50. Serienschaltung von Komponenten entspricht einer Verkn pfung mit AND Operatoren die Parallelschaltung einer mit OR Operatoren Entsprechende Schaltungen k nnen mit dem Programm dargestellt werden Eine m gliche Aufgabenstellung f r den Unterricht w re die Sch lerinnen und Sch ler eine Netzwerkschaltung konstruieren zu lassen die eine bestimmte Gesamizuverlassigkeit hat wenn die Ausfallswahrscheinlichkeiten der einzelnen Komponenten gegeben sind Auch au erhalb des unmittelbaren Informatikunterrichts finden sich Probleme die mit Hilfe einer Gatterschaltung verdeutlicht werden k nnen In der Physik etwa k nnen Bundesministerium f r Unterricht Kunst und Kultur Hg Lehrplan f r den Wahlpflichtgegenstand Informatik in der AHS Oberstufe Wien 2004 i Grossman Schinagl Cenker Neuwirth Ledl Netzwerkanalyse Details http startistik csd univie ac at netz details jsp abgerufen am 30 01 2012 39 elektrische Schaltkreise die auch zu den technischen Grundlagen der Informatik geh ren mittels Gattern modelliert werden Serien und Parallelschaltungen von elektrischen Bauteilen k nnen auf dieselbe Weise dargestellt werden wie oben f r Netzwerkkomponenten beschrieben 40 8 Entwicklertagebuch Das vorliegende Entwicklertagebuch soll wichtige Entwicklungsschritte in meinem Arbeitsverlauf dokumentieren Aufgef hrt sind wesentlichen Neuerungen und nderungen in der Programmstruktur sowie der jeweils aktuelle
51. Sets navigiert werden Im Programm wird die jeweilige Aufgabe sowie die L sung oder der Versuch angezeigt Au erdem werden angezeigt e Die Nummer der Aufgabe e Punkte Die erreichten Punkte bei dieser Aufgabe e Versuche Die Anzahl an ben tigten Versuchen f r diese Aufgabe e Gel st Ob die Aufgabe korrekt gel st worden ist Mit Schlie en wird die Anzeige der Resultate geschlossen und die Toolbar entfernt 35 7 Einsatzm glichkeiten im Unterricht Das Ziel dieser Arbeit war es ein Computerprogramm f r den sp teren Einsatz in der Schule zu entwickeln Entsprechend sollen nun einige M glichkeiten der Anwendung im Unterricht erl utert werden Da Informatikunterricht in der AHS nur in der neunten Schulstufe verpflichtend vorgesehen ist besteht die Zielgruppe aus Oberstufenklasse Im Lehrplan der 5 Klasse ist vorgesehen dass Sch lerinnen und Sch ler Einblicke in wesentliche Begriffe und Methoden der Informatik ihre typischen Denk und Arbeitsweisen ihre historische Entwicklung sowie ihre technischen und theoretischen Grundlagen gewinnen und Grundprinzipien von Automaten Algorithmen und Programmen kennen lernen sollen Theoretisch fu t die Informatik wesentlich auf Boolescher Algebra ohne die Computer nicht denkbar w ren Technisch umgesetzt wird diese bin re Logik durch Gatterschaltungen deren elementare Funktionalit ten zu den Grundlagen der Informatik geh ren Diese werden im Informatikunterr
52. Thema Boolesche Logik von Grund auf zu erlernen Vielmehr soll es aufbauend auf ein Grundwissen ber Boolesche Logik und Gatterschaltungen erg nzend im Unterricht eingesetzt werden Daf r enth lt das Programm eine Funktion mit Hilfe derer Aufgaben erstellt werden k nnen die dann von den Sch lerinnen und Sch lern bearbeitet werden Die Resultate werden ebenfalls im Programm dargestellt Die Umsetzung des Projekts erfolgte in der Programmiersprache Java Damit ist das Programm grunds tzlich plattformunabh ngig und kann zum Beispiel auch auf einem Linuxcomputer eingesetzt werden Gem dem Einsatzort Schule wurde bei der Entwicklung des Programms vor allem auf Robustheit und Korrektheit sowie Benutzerfreundlichkeit und Zuverl ssigkeit Wert gelegt Inhaltsverzeichnis T BiN e UNO sec anna una ana ann an a nn na aa AAEE raaa aueh au 7 2PIIICHIENNER vcsitatiniucinaseceacatanieinasndbunoweuereiumanbiutevawetunanit luscuaenenssiablainansanuuweubieniaiunss 8 2 1 Zielb8stinmungen eis 8 2 1 1 MussKrilenienen zes ieeaeaeeineehe 8 21 2 WUNSCHKIISTIEN 25er 9 2 1 3 Abgrenzungskriterien uu 4444444444Bnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 9 2 2 Produktens atz shite 2ER HRS a aaia 9 2 2 1 Anwendungsbereiche tu see ee ee 9 2 2 2 Ze UpPeNEn anna 9 2 2 3 Betriebsbedingungen uuu44444444444nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 10 2 3 Produktumgeb ng a ncssseserssaherahessaehalahaehunn hs 1
53. XOR gate in the ButtonArea static ICON XOR SELECTED 171 we Selected icon for XOR in the ButtonArea static IMAGE DOT 174 iaa Icon of a grid point static IMAGE NEGATION 172 TAIE Icon of a negated input or output of a gate static IMAGE NODE 172 age Icon of a Node static OPERAND ICON 172 mage Field Detail APPLICATION_ICON public static final Image APPLICATION_ICON Icon of this application 167 GATE_ICON_AND public static final ImageIcon GATE_ICON_ AND Icon of AND gate GATE_ICON_NOT public static final ImageIcon GATE_ICON_NOT Icon of NOT gate GATE_ICON_OR public static final ImageIcon GATE_ICON_OR Icon of OR gate GATE_ICON_XOR public static final ImageIcon GATE_ICON_XOR Icon of XOR gate ICON_AND public static final ImageIcon ICON_AND Icon for AND gate in the ButtonArea ICON_AND_SELECTED public static final ImageIcon ICON_AND SELECTED Selected icon for AND gate in the ButtonArea ICON_ARROW_DOWN public static final ImageIcon ICON_ARROW_DOWN Arrow down icon ICON_ARROW_UP public static final ImageIcon ICON_ARROW_UP Arrow up icon ICON_CHECK_FUNCTION public static final ImageIcon ICON_CHECK_FUNCTION Icon for checking a Boolean function for satisfiability ICON_CHECK_FUNCTION_ROLLOVER public static final ImageIcon ICON_CHECK_FUNCTION ROLLOVER Rollover icon for checking a Boolean function for satisfiability 168 ICON_CHECK_GRAPH public static final Ima
54. a file of Exercisesto editthem 113 void evaluateExercise Evaluates the current Exercise 111 void executeCurrentExercise Starts execution of the current Exericse 111 void exit Saves the current state of the program and exits 109 void export Exports a the current logic circuit as an image 109 void finishExerciseCreation Lets user choose a file where the current Exercise should be stored in and tells the ExerciseService to save the Exercise 111 void finishExerciseExecution Saves a set of Exercises after a user executed them 113 String generateFunction Shows a randomly generated Boolean function 112 DrawingArea getDrawingArea Returns the DrawingArea of the GUI 111 String getEnteredFunction Returns the Boolean function that the user has entered 111 void giveUpShowSolution The user gives up the current Exercise and the correct solution is shown 113 void isFunctionSatisfiable Tests if the current user entered Boolean function is satisfiable and displays the result 114 void isGraphSatisfiable Tests if the current logic circuit is satisfiable and displays the result 114 void load Load a program state from a file 109 void loadResults Loads a file with already executed Exercises and shows the results 113 voi
55. abgerufen am 30 01 2010 46 Javadoc Overview Package Summary Page dao 47 domain 51 domain exercise 54 domain gui 68 domain qualifyers 92 gui 98 gui container 118 gui menubar 126 gui popup 133 service 138 utils 178 Package dao Class Summary Page ExerciseDAO DAO for file access 48 FileDAO DAO for file access 49 dao ExerciseDAO java lang Object L dao ExerciseDAO public class ExerciseDAO extends Object DAO for file access Exercises are loaded from and saved to files by this DAO Constructor Summary Page ExerciseDAO 48 Method Summary Page static load File file 49 Arraylist lt Exercise gt Loads a list of Exercises from a given file static void save File file ArrayList lt Exercise gt exercises 48 Saves a list of Exercises to a given file Constructor Detail ExerciseDAO public ExerciseDA0 Method Detail save public static void save File file ArrayList lt Exercise gt exercises throws IllegalArgumentException Exception Saves a list of Exercises to a given file Parameters file The file where the Exercises should be stored exercises The Exercises to save Throws IllegalArgumentException lf exercises is null or fileis null Exception If any error occurs while writing to the file 48 load public s
56. able False otherwise createNewElement public BoolTree Element createNewElement BooleanQualifyer q Creates a new element of the tree depending on the Qualifyer passed e AQualifyerOperator will return a new Operator e Ifthe Qualifyer represents the NOT sign a new NOT is returned e AQualifyerOperand will return a new Operand Parameters q Qualifyer representing the same part of a Boolean function that the returned element represents Returns A new element of the BoolTree representing the same part of a Boolean function Qualifyer qdoes createNewElement public BoolTree Element createNewElement BooleanQualifyer q boolean negated Creates a new element of the tree depending on the Qualifyer passed e AQualifyerOperator will return a new Operator e Ifthe Qualifyer represents the NOT sign a new NOT is returned e AQualifyerOperand will return a new Operand Parameters q Qualifyer representing the same part of a Boolean function that the returned element represents negated If negated is True the output of the element will be negated Returns A new element of the BoolTree representing the same part of a Boolean function Qualifyer qdoes 181 utils BoolTree Element java lang Object L utils BoolTree Element Enclosing class BoolTree public abstract class BoolTree Element extends Object Element of the tree Each element represents either an operator or an operand
57. am static ICON EXPORT irn mageIcon Icon for exporting the logic circuit as an image 166 Icon of operand gate static ICON INFO 7 rn Icon for displaying program information static ICON LINE 170 mn Icon for creating a connection in the ButtonArea static ICON LINE SELECTED 170 en Selected icon for creating a connection in the ButtonArea static ICON LOAD DR a Icon for loading a program state static ICON NOT men Icon for NOT gate inthe ButtonArea static ICON NOT SELECTED 170 men Selected icon for NOT in the ButtonArea static ICON OPERAND 10 we Icon for operands in the ButtonArea static ICON OPERAND SELECTED don we Selected icon for operands in the ButtonArea static ICON OR Mage COR Icon for OR gate in the ButtonArea static ICON OR SELECTED 171 mean Selected icon for OR gate in the ButtonArea Static ICON RANDOM an er Icon for creating a random Boolean function or logic circuit static ICON RANDOM SMALL 171 peers Icon for creating random truth values static TCON RANDOM SMALL ROLLOVER Fa Medes OR Rollover icon for creating random truth values static ICON REMOVE 174 mage SE OF Icon for removing a gate in the ButtonArea static ICON REMOVE SELECTED 1d az Selected icon for removing a gate in the ButtonArea static ICON SAVE re ee Icon for saving the current program state static ICON XOR ss en Icon for
58. ar GateDrawer gui ExerciseServic xerciseService Constructs a new ExerciseResultsMenuBar All containing components are initialized and information about the first Exercise is displayed Parameters gui The parent GUI xerciseService The ExerciseService containing information about the Exercises to display Method Detail setToCurrentExercise public void setToCurrentExercise Updates the menubar to display information about the current Exercise Overrides setToCurrentExercise in class ExerciseMenuBar actionPerformed public void actionPerformed ActionEvent e Handles ActionEvents from this menubars components Specified by actionPerformed in interface ActionListener 132 gui menubar MenuBar java lang Object L java awt Component Lava awt Container L avax swing JComponent L javax swing JMenuBar L gui menubar MenuBar All Implemented Interfaces ActionListener EventListener Accessible MenuElement Serializable ImageObserver MenuContainer public class MenuBar extends JMenuBar implements ActionListener The menubar of this program Contains general functions such as loading saving and info Constructor Summary Page MenuBar GateDrawer gateDrawer 133 Constructs a new Menubar for the program Method Summary Page void actionPerformed ActionEvent e 133 Handles action events when a menu item is selected
59. arameters node Node that is dragged by the user mousexX New x position of the mouse mouseY New y position of the mouse oldMousex Old x position of the mouse oldMouseY Old y position of the mouse service Controller java lang Object L service Controller public class Controller extends Object The controller class is the main controller for the whole project It instantiates the GUI and most of the service classes Further more the controller handles GUI requests for services Constructor Summary Page Controller Constructs and initializes a new controller Method Summary 142 Page void abortCurrentLine Aborts drawing of the current line 142 void clear Clears the current Graph 143 boolean compareFunctionAndGraph Compares the current user entered function and graph from drawingService 143 void deleteComponent DrawableComponent component Handles a user request for deletion of a component in drawingArea 145 void deleteConnection GateConnection connection Handles a user request for deletion of a line in drawingArea 145 void deleteSelection Handles user request of deleting the current selection 144 boolean evaluateFunction Returns the logical value of the user entered boolean function 144 boolean evaluateGraph Returns the logical value of the current graph 144
60. ateExerciseMenuBar is shown removeExerciseMenuBar public void removeExerciseMenuBar Removes the current ExerciseMenuBar from the GUI packs and repaints the GUI abortExercise public void abortExercise Aborts the current Exercise either creation or execution or displaying of result User is asked if the Exercise should be aborted Only if the user wishes to the Exercise is aborted saveExercise public void saveExercise ExerciseType mode int points int attempts Saves the Exercise that is currently displayed while creating a new set of Exercises Creates a new ExerciseService if necessary Parameters mode The type of the Exercise points Points that this exercise is worth attempts The number of attempts that may be made while solving this task showCurrentExercise public void showCurrentExercise boolean showSolution Displays the current Exercise According to its type a function gates or both are shown Parameters showSolution True if the users solution should be displayed False otherwise newExercise public void newExercise Tells ExerciseService to create a new empty Exercise A new Exercise is created if the last Exercise is not empty All fields and the Graph are cleared so that an empty GUI is shown 110 deleteExercise public void deleteExercise Deletes the current Exercise The previous Exercise is shown or the first if no previous Exe
61. atic newComponent BooleanQualifyer qualifyer 78 Brawablecompenent Creates anew DrawableComponent static newDrawable DrawableComponent dc 78 pravablecomponent Creates a new DrawableComponent that is of the same type as a given one Method Detail newComponent public static DrawableComponent newComponent BooleanQualifyer qualifyer Creates a new DrawableComponent Parameters qualifyer The Qualifyer defining the new element Returns A new DrawableComponent newDrawable public static DrawableComponent newDrawable DrawableComponent dc Creates anew DrawableComponent that is ofthe same type as a given one Parameters dc The DrawableComponent of thats type the new DrawableComponent should be Returns Anew DrawableComponent that is of the same type as a given one 78 domain gui Gate java lang Object L domain gui DrawableComponent L domain gui Gate All Implemented Interfaces Serializable Direct Known Subclasses GateNot GateOperator public abstract class Gate extends DrawableComponent Element of a logic circuit representing operators including the NOT sign Fields inherited from class domain gui DrawableComponent height width x y Constructor Summary Page Gate QualifyerGate gq 79 Constructs a new Gate Gate QualifyerGate gq int x int y int width int height 79 Constructs a new Gate at position x y Method Summary Pa
62. blic void deleteComponent DrawableComponent component Handles a user request for deletion of a component in drawingArea Request is executed by drawingService Parameters component Component to delete getGraphCopy public Graph getGraphCopy Returns a deep copy of the current graph Deep copy is created in the graph itself Returns A new deep copy of the current graph getGraph public Graph getGraph Returns the current graph Changes made on this Graph are visible in the DrawingArea Returns The current graph setGraph public void setGraph Graph graph Sets the current graph in drawingService to a deep copy of the given graph Parameters graph Graph to set randomValues public void randomValues Creates a random assignment for all operands 145 isFunctionSatisfiable public boolean isFunctionSatisfiable String function Tests if a given function is satisfiable Testing is done in logicService Parameters function The Boolean Function that has to be tested Returns True if the function is satisfiable False otherwise isGraphSatisfiable public boolean isGraphSatisfiable Tests if the current graph is satisfiable Testing is done in logicService Returns True if the Graph is satisfiable False otherwise 146 service DrawingService java lang Object L service DrawingService All Implemented Interfaces ComponentListener EventListener public class DrawingSer
63. boolean operations in the program 172 QualifyerService Service that manages Qualifyers for the program 175 service ConnectionService java lang Object L service ConnectionService public class ConnectionService extends Object This service class handles all calculation concerning lines in the drawingArea Calculations are necessary when gates or lines are moved especially when the current node in drawingService is moved Constructor Summary Page ConnectionService int gateHeight GridService grid 139 Constructs a new ConnectionService with all necessary parameters for calculations Method Summary Page void dragCurrentNode Node node int mouseX int mouseY int oldMouseX int 140 oldMouseY Drags the line of a given Node from old mouseposition to new mouseposition void mergeLines ArrayList lt Line2D Double gt lines 140 Checks a list of lines if two consecutive lines are on the same level have the same x coordinates and merges them if so void resizeConnectionEnd GateConnection connection Point end 140 Moves the end of a GateConnection to the new Point end void resizeConnectionStart GateConnection connection Point start 140 Moves the start of a GateConnection to the new Point start Constructor Detail ConnectionService public ConnectionService int gateHeight GridService grid Constructs a new ConnectionService with all necessary parameters for calculation
64. buttonIcon ImageIcon selectedButtonIcon Constructs a new ButtonQualifyer Parameters buttonIcon The icon of the button selectedButtonlIcon The selected icon of the button Method Detail getButtonIcon public ImageIcon getButtonIcon Returns the icon of the button Returns The icon of the button getSelectedButtonIcon public ImageIcon getSelectedButtonIcon Returns the selected icon of the button Returns The selected icon of the button 95 domain qualifyers QualifyerGate java lang Object L isn aa ir at ler L domain qualifyers BooleanQualifyer L domain qualifyers QualifyerGate All Implemented Interfaces Serializable public class QualifyerGate extends BooleanQualifyer Represents an operator or a NOT sign in a Boolean function Sets the icon of the gate that this qualifyer represents Constructor Summary Page QualifyerGate char c ImageIcon GateIcon ImageIcon buttonIcon Imagelcon 96 selectedIcon Constructs anew QualifyerGate Method Summary Page Image getGatelcon 96 Returns the icon of the gate that this qualifyer represents void setSymbol ImageIcon symbol 96 Constructor Detail QualifyerGate public QualifyerGate char c Imagelcon Gatelcon ImageIcon buttonlcon ImageIcon selectedButtonlIcon Constructs a new Quali fyerGate Parameters c A character of an Boolean operator that this qualifyer represents Ga
65. chaltung mit einer Booleschen Funktion vergleichen Das System zeigt an ob die beiden quivalent sind Es ist dabei egal ob Funktion und Gatterschaltung per Hand eingegeben vom System generiert oder aus einer Datei geladen worden sind Fehlerszenario Falls keine Funktion und oder keine Gatterschaltung vorhanden sind wird falsch ausgegeben Nachbedingung Das System zeigt an ob Funktion und Gatterschaltung quivalent sind 12 Wertebelegung der Operanden festlegen Kurzbeschreibung Der User legt die Wahrheitswerte f r die verwendeten Operanden fest Scenarios Hauptszenario Per Klick legt der User f r jeden einzelnen Operanden einen Wahrheitswert fest Dieser Wahrheitswert gilt global f r jeden Operanden dieses Namens Gatterschaltung und Boolesche Funktion werden nach jeder nderung automatisch neu evaluiert Nachbedingung Das System zeigt alle Wahrheitswerte der Operanden sowie f r die Gatterschaltung und die Funktion an 13 Wertebelegung der Operanden generieren lassen 18 Kurzbeschreibung Der User l sst das System eine zuf llige Wertebelegung f r die verwendeten Operanden erzeugen Scenarios Hauptszenario Per Klick erzeugt das System zuf llige Wahrheitswerte f r alle Operanden und zeigt diese an Boolesche Funktion und Gatterschaltungen werden anschlie end neu evaluiert Nachbedingung Das System zeigt alle Wahrheitswerte der Operanden sowie f r die Gatterschaltung und die Funktion an
66. cher Ausdruck etwa quivalent zu aA b ist Grenzen sind mit dem Programm insofern gesetzt als dass es nicht in der Lage ist zwei Logikgatter auf quivalenz zu pr fen Bei der Erarbeitung von quivalenzen muss daher immer ein Teil als Funktion und einer als Gatterschaltung eingegeben werden Die Schaltung kann danach wieder als Funktion angezeigt werden Insofern sollte diese Einschr nkung nicht lernhinderlich sein sondern im Gegenteil die Vorstellung von der quivalenz der beiden Darstellungsformen f rdern 38 Formel und Gatterschaltung sind quivalent Abb 8 Zeigen einer De Morgan schen Regel mit Hilfe des Programms Im Lehrplan des Wahlpflichtgegenstandes Informatik f r die sechste bis achte Klasse sind Aufbau und Funktionsweise von Netzwerken sowie Erweiterung der theoretischen und technischen Grundlagen der Informatik vorgesehen In diesem Zusammenhang kann im Unterricht die Zuverl ssigkeit von Netzwerken thematisiert werden F r Netzwerke die aus mehreren Komponenten bestehen die in Hinsicht auf ihre Zuverl ssigkeit voneinander unabh ngig sind kann eine Gesamtzuverl ssigkeit berechnet werden Ist die Integrit t eines Netzwerks von der gleichzeitigen Funktion zweier Komponenten abh ngig so werden diese als in Serie geschaltet bezeichnet Ist die Netzwerkintegrit t nur von der Funktion zumindest einer der beiden Komponenten abh ngig so spricht man von einer Parallelschaltung der Komponenten Die
67. cht zuletzt die Boolesche Logik welche den theoretischen Unterbau der Informatik bildet F r den normalen Benutzer ist im Computeralltag von Booleschen Funktionen oder Logikgattern nichts mehr zu sehen Umso wichtiger finde ich es daher deren fundamentale Bedeutung f r die Informatik im Schulunterricht hervor zu streichen und sichtbar zu machen Wenngleich die Realisierung eines vollst ndigen Computersystems mittels Gatterschaltungen viel zu komplex f r den Unterricht ist k nnen durchaus einfache Prinzipien veranschaulicht werden So soll ein grundlegendes Verst ndnis f r die Arbeitsweise von Computersystemen oder zumindest eines Taschenrechners vermittelt werden Gleich am Anfang dieses Themas kann die Boolesche Logik stehen Nach diesem Konzept k nnen die technische Umsetzung Logikgatter sowie das bin re Zahlensystem besprochen werden Auf diese Weise soll Sch lerInnen zum Beispiel klar werden warum Information bin r codiert gespeichert wird Das Ziel meiner Diplomarbeit war es ein Computerprogramm zu entwickeln das den Lehrer im Schulunterricht bei der Vermittlung eines Teils der oben angef hrten Konzepte unterst tzt Dabei ist eine Anwendung entstanden die es erm glicht Gatterschaltungen zu konstruieren beziehungsweise zwischen den beiden Darstellungsformen Boolesche Funktion und Logikgatter zu wechseln Zus tzlich werden einige logische Funktionalit ten zur Verf gung gestellt sowie die M glichkeit geboten Aufgaben f r
68. cise IncorrectGraphExercise All Implemented Interfaces Serializable public class IncorrectGraphExercise extends GraphExercise Exercise in that a user has to correct a given logic circuit so that it becomes equal to a given Boolean function The Boolean function the incorrect logic circuit and the found solution are stored in this class Field Summary Page static INSTRUCTION 67 String The instruction what to do in this exercise Finde den Fehler in der Gatterschaltung Constructor Summary Page IncorrectGraphExercise int attempts int points String function Graph graph 67 Constructs anew IncorrectGraphExercise Method Summary Page Graph getGraph 68 Returns an incorrect logic circuit that the user has to change so that it becomes equal to the given Boolean function String getInstruction 68 Returns a message containing instructions what to do in this exercise void setGraph Graph graph 68 Sets an incorrect logic circuit that the user has to change so that it becomes equal to the given Boolean function Field Detail INSTRUCTION public static final String INSTRUCTION The instruction what to do in this exercise Finde den Fehler in der Gatterschaltung Constructor Detail IncorrectGraphExercise public IncorrectGraphExercise int attempts int points String function Graph graph Constructs a new IncorrectGraphExercis
69. ck Free Software Foundation GNU General Public Licence Version 3 29 6 2007 http www gnu org licenses gpl 3 0 html abgerufen am 1 3 2012 3 Nach Gerwinski Peter GNU General Public Licence Deutsche bersetzung der Version 3 29 6 2007 http www gnu de documents gpl de html abgerufen am 1 3 2012 27 6 Benutzerhandbuch 6 1 Programmstart Das Programm wird mit der mitgelieferten jar Datei gestartet F r die Eingabeaufforderung lautet der Befehl javaw jar GateDrawer jar Nach dem Start wird der vor der letzten Beendigung automatisch gespeicherte Programmstand angezeigt Wird kein Speicherstand gefunden wird eine leere Zeichenebene angezeigt 6 2 bersicht Das Programm besteht aus den folgenden Bereichen vgl auch Abbildung A Zeichenbereich Der Zeichenbereich dient der graphischen Darstellung von Gatterschaltungen Auf ihm werden vom User Gatterschaltungen gezeichnet oder vom Programm generiert B Toolbox In diesem Bereich k nnen Elemente f r den Bau einer Gatterschaltung ausgew hlt werden Au erdem werden hier die Wertebelegungen f r Operanden festgelegt und Aktionen gestartet C Textausgabe In diesem Feld gibt das Programm Resultate logischer Operationen sowie Anweisungen f r Aufgaben aus D Bereich f r Benutzereingaben In diesem Bereich kann der Benutzer Boolesche Funktionen eingeben generieren und als Gatterschaltung darstellen lassen E Bereich f r Gatterlogik Dieser Bereich ist
70. cted something in the DrawingArea 152 boolean isSelecting Returns if the user is currently selecting in the DrawingArea 152 void setDragged boolean b Sets dragged to b 149 void setGraph Graph graph Sets the currently displayed Graph to the passed Graph 151 void setNegation int id boolean negation Sets the negation of the Out DockingPoint ofa DrawableComponent 151 void setSelected boolean b Sets selected 152 void setSelecting boolean b Sets selecting 153 void updateConnection GateConnection connection Point start Point end Updates the passed connection 149 Constructor Detail DrawingService public DrawingService GateDrawer gui Controller controller Constructs a new DrawingService Anew empty Graph is instantiated and the listeners for the DrawingArea are set Parameters gui The GUI for this application Needed to get the DrawingArea controller ThemainController for this program acting as interface between GUI and service 148 Method Detail addComponent public DrawableComponent addComponent BooleanQualifyer qualifyer int x int y Adds a new DrawableComponent to the DrawingArea Parameters qualifyer The Qualifyer for the new DrawableComponent x The x coordinate of the DrawableComponent y The y coordinate of the DrawableComponent Returns The n
71. ctionPopup GateConnection connection Controller controller Constructs a new ConnectionPopup Parameters connection The connection to edit controller The controller of this program Method Detail actionPerformed public void actionPerformed ActionEvent e Editsthe GateConnection after the user has clicked on an option The popup is set invisible Specified by actionPerformed in interface ActionListener 134 gui popup GatePopup java lang Object L ai spopup Papup L gui popup GatePopup All Implemented Interfaces ActionListener EventListener public class GatePopup extends Popup Shows a popup in DrawingArea to edit a gate Edits the gate after user has clicked on an option Constructor Summary Page GatePopup DockingPoint owner Controller controller 135 Constructs a new GatePopup Method Summary Page void actionPerformed ActionEvent e 135 Constructor Detail GatePopup public GatePopup DockingPoint owner Controller controller Constructs a new GatePopup Parameters owner DockingPoint that is to be edited Popup is displayed over this DockingPoint controller The controler of this program Method Detail actionPerformed public void actionPerformed ActionEvent e Edits the gate after user has clicked on an option The popup is set invisible Specified by actionPerformed in interface ActionListener
72. d newExercise Tells ExerciseService to create a new empty Exercise 110 void refreshValues Refreshes the truth values of all operands to those that the user chose in the ButtonArea 111 void removeExerciseMenuBar Removes the current ExerciseMenuBar from the GUI packs and repaints the GUI 110 void save Shows a file dialogue to choose a file where the current state of the program should be saved to 112 void saveExercise ExerciseType mode int points int attempts Saves the Exercise that is currently displayed while creating a new set of Exercises Creates a new ExerciseService if necessary 110 void setGateFunction String function Sets the function equal to the logic circuit 112 void setUserFunction String function Sets the user entered Boolean function to a given function 112 void showCorrectSolution Displays the correct solution for the current Exercise 111 void showCurrentExercise boolean showSolution Displays the current Exercise 110 107 void showGeneratedGraph Shows a randomly generated logic circuit 113 void showGraphAsFunction Shows Boolean function equal to the current logic circuit 112 void showInfo Shows a window with information about the program 114 void updateEvaluations Updates the evaluations of the user
73. d False is returned Start DockingPoint will be the point that is of the DockType Out End point will be the point that is not of this type Parameters ende The second point defining the connection Must not be ofthe same DockType as start Returns True if the connection was finalized False otherwise especially if end is of the same DockType aS start getStart public DockingPoint getStart Returns the DockingPoint at that this connection starts Returns The DockingPoint at that this connection starts getEnd public DockingPoint getEnd Returns the DockingPoint at that this connection ends Returns The DockingPoint at that this connection ends containsPoint public boolean containsPoint Point p Returns True if this GateConnection contains a given point To be contained by this GateConnection the point has to be exactly on a line of this connection or close to it Parameters p The point to check Returns True if this GateConnection contains the point False otherwise getLines public ArrayList lt Line2D Double gt getLines Returns all singular lines this GateConnection consists of Returns All singular lines this GateConnection consists of setLines public void setLines ArrayList lt Line2D Double gt lines Sets the lines this GateConnection consists of Parameters lines The new lines this GateConnection consists of 82 getNewNode public Node getNewNode Point p int
74. data export public static void export File file BufferedImage image throws IllegalArgumentException Exception Exports a BufferedImage as a jpeg file Parameters file The file where the image should be stored image The image to export 50 Throws IllegalArgumentException If the given file is null Exception If any error occurs while saving the image load public static SerializationContainer load File file throws IllegalArgumentException Exception Loads a program state from a given file The data read is stored ina SerializationContainer Parameters file The file where the data should be loaded from Returns The loaded SerializationContainer Throws IllegalArgumentException If the file is null Exception If any error occurs while reading the file 51 Package domain Class Summary Page Graph A transfer object containing all data necessary to draw a logic circuit 52 domain Graph java lang Object L domain Graph All Implemented Interfaces Serializable public class Graph extends Object implements Serializable A transfer object containing all data necessary to draw a logic circuit It consists of DrawableComponents and GateConnections Constructor Summary Page Graph 52 Constructs anew Graph Graph Graph g 53 Constructs anew Graph and deep copies t
75. details on saving Parameters function The function of the IncorrectFunctionExercise graph The graph of the IncorrectFunctionExercise points Points the Exercise is worth attempts Attempts a user may try this Exercise savelncorrectGraphExercise public void saveIncorrectGraphExercise String function 156 Graph graph int points int attempts Exercise with given graph function points and Creates and saves anew IncorrectGraphl xercise for details on saving attempts See save Exercis Parameters function The function ofthe IncorrectGraphExercise graph The graph ofthe IncorrectGraphExercise points Points the Exercise is worth attempts Attempts a user may try this Exercise getCurrentExercise public Exercise getCurrentExercise Returns Exercise at currentExercise position Returns Exercise at currentExercise position or null if not existent getNextExercise public Exercise getNextExercise Returns the next Exercise after currentExercise position Returns Next Exercise after currentExercise position or null of not existent getPreviousExercise public Exercise getPreviousExercise Returns the Exercise before currentExercise position Returns Exercise before currentExercise position or null of not existent getTotalExerciseNumber public int getTotalExerciseNumber Returns the total number of Exercises
76. e Parameters attempts Number of attempts a user is allowed to make on this exercise points Number of points this exercise is worth when solved at the first attempts function The Boolean function to that a user has to find an equal logic circuit graph A logic circuit that is not equal to the Boolean function 67 Method Detail getGraph public Graph getGraph Returns an incorrect logic circuit that the user has to change so that it becomes equal to the given Boolean function Returns An incorrect logic circuit that the user has to change so that it becomes equal to the given Boolean function setGraph public void setGraph Graph graph Sets an incorrect logic circuit that the user has to change so that it becomes equal to the given Boolean function Parameters graph An incorrect logic circuit that the user has to change so that it becomes equal to the given Boolean function getInstruction public String getInstruction Description copied from class Exercise Returns a message containing instructions what to do in this exercise Overrides getInstruction in class GraphExercise Returns A message containing instructions what to do in this exercise 68 Package domain gui Class Summary Page ask DockingPoints represent input or output areas of DrawableComponents and 69 work as hooks for GateConnections ee a ee ik sada
77. e ButtonArea ICON_SAVE public static final ImageIcon ICON_SAVE Icon for saving the current program state ICON_XOR public static final ImageIcon ICON_XOR Icon for XOR gate inthe ButtonArea ICON_XOR_SELECTED public static final ImageIcon ICON_XOR_ SELECTED Selected icon for XOR in the ButtonArea IMAGE_DOT public static final Image IMAGE_DOT Icon of a grid point 171 IMAGE_NEGATION public static final Image IMAGE NEGATION Icon of a negated input or output of a gate IMAGE_NODE public static Image IMAGE NODE Icon of a Node OPERAND_ICON public static final Image OPERAND_ICON Icon of operand gate 172 service LogicService java lang Object L service LogicService public class LogicService extends Object Service managing all boolean operations in the program Constructor Summary Page LogicService 173 Method Summary Page boolean compare String function DrawableComponent rootGate 174 Compares a given boolean function and a Graph boolean compare String functionl String function2 174 Compares two Boolean functions boolean evaluateFunction String function 174 Evaluates a boolean Function boolean evaluateGates DrawableComponent root 174 Evaluates the Graph thats root DrawableComponent is specified BoolTree functionToTree String function 173 Builds a BoolTree out of a boolean function String getGraphF
78. e Gatterschaltung wird ohne die entfernte Verbindung angezeigt 7 Gatterschaltung l schen Kurzbeschreibung Der User l scht eine ganze bestehende Gatterschaltung Scenarios Hauptszenario Der User klickt auf das L schen Symbol oder markiert den gesamten Bereich und l scht den markierten Bereich Alle Gatter und Verbindungen werden gel scht Vorbedingung Es wurde keine Aktion ausgef hrt die zu einer Sperre der Zeichenebene f hrt Nachbedingung Es wird eine leere Zeichenebene angezeigt 8 Boolesche Funktion eingeben 16 Kurzbeschreibung Der User gibt eine Boolesche Funktion ein Scenarios Hauptszenario Der User gibt in ein daf r vorgesehenes Feld eine Boolesche Funktion ein F r die verschiedenen logischen Operatoren stehen eigene Tasten kombinationen zur Verf gung Das System zeigt den Wahrheitswert Vorbedingung Es wurde keine Aktion ausgef hrt die zu einer Sperre der Zeichenebene f hrt Nachbedingung Es wird eine leere Zeichenebene angezeigt 9 Gatterschaltung generieren lassen Kurzbeschreibung Der User l sst vom System eine Gatterschaltung generieren Scenarios Hauptszenario Per Klick l sst der User das System eine neue zuf llige Gatterschaltung generieren Vorbedingung Es wurde keine Aktion ausgef hrt die zu einer Sperre der Zeichenebene f hrt Nachbedingung Die generierte Schaltung wird angezeigt Der Wahrheitswert der Gatterschaltung f r die aktuelle Wertebelegung der Op
79. e aag QualifyerGate Gate newOperand go QualifyerOperand Operand newDrawable de DrawableComponent DrawableComponent DrawableComponent abstract qualifyer Qualifyer docks HashMap lt DockType DockingPoint gt DrawableComponent qualifyer Qualifyer x int y int width int height int DrawableComponent qualifyer Qualifyer copy DrawableComponent setBounds x int y int width int height int hasOutgoingConnection boolean initializeComponent na Operan abstrac Operand qg QualifyerOperand x int y int width int height int Operand qg QualifyerOperand copy Operand setBounds x int y int width int height int GateOperator GateOperator qg QualifyerGate x int y int width int height int GateOperator qg QualifyerGate copy GateOperator Abb 4 Klassendiagramm des Pakets domain gui 26 5 Systemvoraussetzungen und Lizenzbedingungen Das Programm l uft unter allen Systemen auf denen Java Runtime Environment ab Version 6 installiert ist Wie Java selbst ist das Programm auf jedem Betriebssystem lauff hig An Hardware wird ein Bildschirm mit einer Aufl sung von mindestens 1024x768 Pixeln ben tigt Das Programm wird unter der GNU General Public License ver ffentlicht Die Ver ffentlichung des Programmes erfolgt ohne irgendeine Garantie sogar ohne die implizite Garantie der Marktreife oder der Verwendbarkeit f r einen bestimmten Zwe
80. e number of DockingPoints Hooked GateConnections won t be copied Returns A deep copy ofthe DrawableComponent setBounds public void setBounds int x int y int width int height Sets the bounds of the DrawableComponent Parameters x The new x coordinate of the DrawableComponent y The new y coordinate of the DrawableComponent width The new width of the DrawableComponent height The new height of the DrawableComponent hasOutgoingConnection public boolean hasOutgoingConnection Returns True if a GateConnection is hooked into the Out DockingPoint of the DrawableComponent Returns True if a GateConnection is hooked into the Out DockingPoint of the DrawableComponent False otherwise setQualifyer public void setQualifyer BooleanQualifyer q Sets the Qualifyer ofthis DrawableComponent Parameters q The new Qualifyer of this DrawableComponent getQualifyer public BooleanQualifyer getQualifyer Returns the Qualifyer of this DrawableComponent Returns The Qualifyer of this DrawableComponent 76 getDocks public HashMap lt DockType DockingPoint gt getDocks Returns all DockingPointsthis DrawableComponent provides Returns All DockingPointsthis DrawableComponent provides 77 domain gui DrawablesFactory java lang Object L domain gui DrawablesFactory public class DrawablesFactory extends Object Factory for DrawableComponents Method Summary Page st
81. ed by a BoolTree and construction of anew BoolTree out of a Boolean function represented by a String are provided Returns the Boolean function that is represented by this BoolTree Nested Class Summary Page abstract BoolTree Element 181 cl Element of the tree Field Summary Page BoolTree Element root 180 The root element of this tree Constructor Summary Page BoolTree 180 Method Summary Page boolean analyze String function 180 Analyzes a Boolean function BoolTree Element createNewElement BooleanQualifyer q 181 Creates a new element of the tree depending on the Qualifyer passed BoolTree Element createNewElement BooleanQualifyer q boolean negated 181 Creates a new element of the tree depending on the Qualifyer passed boolean equals Object obj 181 Checks if two BoolTrees represent the same Boolean function boolean evaluate 180 Evaluates a BoolTree HashSet lt QualifyerOperand gt getOperands 180 Returns all operands that occur in this BoolTree boolean isSatisfiable 181 Checks ifthe Boolean function that is represented by this BoolTree is satisfiable String toString 180 179 Field Detail root public BoolTree Element root The root element of this tree Constructor Detail BoolTree public BoolTree Method Detail evaluate public boolean evaluate Evaluates a
82. ehungsweise eine Gatterschaltung f r eine Belegung der Eingangswerte auswerten kann eine Gatterschaltung und eine Boolesche Funktion auf quivalenz pr fen speichert bei Beendigung den aktuellen Stand des Programms also Gatterschaltung und Boolesche Funktion 2 Balzert Helmut Lehrbuch der Software Technik Band 1 Spektrum Akademischer Verlag Heidelberg 2000 S 115 118 8 e Weiteres o Gatterbausteine k nnen zwei Eingangswerte haben o Der Ausgang eines Gatters kann mit einem Eingang eines anderen Gatters verbunden sein o Boolesche Funktionen und Gatterschaltungen beinhalten maximal zwei Argumente 2 1 2 Wunschkriterien e Das Programm o enth lt weitere Boolesche Funktionen NAND NOR XOR Implikation quivalenz o kann Boolesche Funktionen und Gatterschaltungen mit beliebig vielen Argumenten enthalten o evaluiert die Kenntnisse des Benutzers in Form von Punkten o speichert die Ergebnisse des Benutzers als Datei o l dt Aufgaben Boolesche Funktionen als Datei o speichert Gatterschaltungen als Bilddatei wahlweise mit und ohne Boolescher Funktion o stellt Gatter wahlweise mit nationalen oder internationalen Symbolen dar 2 1 3 Abgrenzungskriterien e Das Programm soll Sch lerinnen und Sch ler nicht die Theorie Boolescher Algebra und Gatterschaltungen lehren ist also nicht als Lernpfad konzipiert 2 2 Produkteinsatz 2 2 1 Anwendungsbereiche Die Software soll im schulischen Bereich speziell im
83. eight public int getHeight Returns the height of this Node Returns The height of this Node setConnection public void setConnection GateConnection connection Sets the GateConnection that this Node is attached to Parameters connection The GateConnection that this Node is attached to 89 getConnection public GateConnection getConnection Returns the GateConnection that this Node is attached to Returns The GateConnection that this Node is attached to 90 domain gui Operand java lang Object L domain gui DrawableComponent L domain gui Operand All Implemented Interfaces Serializable public class Operand extends DrawableComponent implements Serializable Represents an operand in a logic circuit Constructor Summary Sets the bounds of the DrawableComponent Page Operand QualifyerOperand qo 91 Constructs a new Operand at the position 0 0 Operand QualifyerOperand qo int x int y int width int height 91 Constructs anew Operand element at a specified position and with a specified dimension Method Summary Page Operand copy 92 Deep copy method for DrawableComponents void setBounds int x int y int width int height 92 Constructor Detail Operand public Operand QualifyerOperand qo Constructs a new Operand at the position 0 0 Parameters qo The Qualifyer defining the type of this component
84. einer bestehenden Gatterschaltung hinzu Scenarios Hauptszenario Der User w hlt das Symbol f r Verbindung aus und klickt ein Start und ein End Gatter in der Zeichenebene an Zwischen den beiden Gattern entsteht eine Verbindung Fehlerszenario Der User klickt nacheinander auf zwei Gatter Eing nge oder zwei Gatter Ausg nge In diesem Fall wird keine neue Verbindung gezeichnet 15 Vorbedingung Es wurde keine Aktion ausgef hrt die zu einer Sperre der Zeichenebene f hrt Mindestens zwei Gatter befinden sich in der Zeichenebene Nachbedingung Eine eventuell bereits vorhandene Gatterschaltung sowie die neue Verbindung werden angezeigt 6 Verbindung aus Gatterschaltung entfernen Kurzbeschreibung Der User entfernt eine Verbindung aus einer bestehenden Gatterschaltung Scenarios Hauptszenario Der User klickt rechts auf eine Verbindung in einer Gatterschaltung und w hlt entfernen aus Die Verbindung wird gel scht die verbunden Gatter bleiben jedoch bestehen Alle markierten Gatter sowie ihre Verbindungen zu anderen Gattern werden gel scht Alternativszenario Alternativ kann der User das Verbindung l schen Symbol ausw hlen und dann auf eine Verbindung klicken was zum selben Ergebnis f hrt Vorbedingung Es wurde keine Aktion ausgef hrt die zu einer Sperre der Zeichenebene f hrt Die angezeigte Gatterschaltung enth lt mindestens eine Verbindung Nachbedingung Eine eventuell bereits vorhanden
85. eiste zur Verf gung Die Datei in welche das Bild exportiert wird kann ausgew hlt werden 6 4 Logische Funktionen 6 4 1 Wertebelegung Jedem logischen Operanden kann im Programm ein Wahrheitswert zugewiesen werden Der zugewiesene Wahrheitswert ist global g ltig und beeinflusst den Wahrheitswert einer Funktion oder einer Gatterschaltung F r Funktion und Gatterschaltung k nnen die Werte nicht getrennt festgelegt werden e Manuell In der Toolbox k nnen die Wahrheitswerte f r jeden Operanden festgelegt werden Dazu ist neben dem jeweiligen Operanden auf den gew nschten Wahrheitswert zu klicken Jede nderung wird automatisch und sofort vom Programm nachvollzogen e Zuf llig Es besteht die M glichkeit eine zuf llige Wertebelegung generieren zu lassen Dazu steht ein Button unterhalb der Wertetafel in der Toolbox zur Verf gung 6 4 2 Automatische Evaluation Zu jeder Zeit werden die Wahrheitswerte der Booleschen Funktion im Benutzerfeld D sowie der Gatterschaltung im Bereich f r Gatterlogik E angezeigt Sie werden 32 bei jeder nderung der Funktion der Schaltung oder der Wertebelegungen neu evaluiert 6 4 3 Vergleichen Eine Boolesche Funktion im Benutzerfeld und eine Gatterschaltung k nnen auf quivalenz berpr ft werden Daf r steht ein entsprechender Button in der Toolbox zur Verf gung Das Ergebnis wird in der Textausgabe C angezeigt 6 4 4 Gatterschaltung als Funktion darstellen Eine Gatterschalt
86. entHidden in interface ComponentListener componentMoved public void componentMoved ComponentEvent arg0 ComponentMoved event is ignored Specified by componentMoved in interface ComponentListener componentResized public void componentResized ComponentEvent arg0 On a ComponentResized event the font sizes of all textfields are adjusted Specified by componentResized in interface ComponentListener componentShown public void componentShown ComponentEvent arg0 ComponentShown event is ignored Specified by componentShown in interface ComponentListener 114 gui GlobalKeyListener java lang Object L gui GlobalKeyListener All Implemented Interfaces KeyListener EventListener Serializable public class GlobalKeyListener extends Object implements KeyListener Serializable Keylistener for the whole program Responsible for changing specific keys to operator signs When a key is typed its code is checked and may be changed to another one depending on its character Constructor Summary Page GlobalKeyListener Controller controller GateDrawer gui 115 Constructs a new GlobalKeyListener Method Summary Page void keyPressed KeyEvent e 115 KeyPressed event is ignored void keyReleased KeyEvent ke 115 When a key is released it is checked for ESC or DEL key void keyTyped KeyEvent ke 116 Constructor Detail GlobalKeyListener pub
87. entered Boolean function and the logic circuit 114 void userFunctionToGraph Shows a logic circuit equal to the current user entered Boolean function 112 void windowActivated WindowEvent arg0 WindowActivated Event is ignored 108 void windowClosed WindowEvent arg0 WindowClosed Event is ignored 108 void windowClosing WindowEvent arg0 Calls exit in GateDrawer 109 void windowDeactivated WindowEvent arg0 WindowDeactivated Event is ignored 109 void windowDeiconified WindowEvent arg0 WindowDeiconified Event is ignored 109 void windowIconified WindowEvent arg0 Windowlconified Event is ignored 109 void windowOpened WindowEvent arg0Q WindowOpened Event is ignored 109 Constructor Detail GateDrawer public GateDrawer Controller controller Constructs a new GateDrawer Initializes all GUI elements and aligns and displays them Parameters controller The main Controller of the program Method Detail windowActivated public void windowActivated WindowEvent arg0 WindowActivated Event is ignored Specified by windowActivated in interface WindowListener windowClosed public void windowClosed WindowEvent arg0 WindowClosed Event is ignored Specified by windowClosed in interface WindowListener 108 windowClosing public void windowClosing WindowEvent arg0 Calls ex
88. er Returns the Qualifyer of this element Returns The Qualifyer of this element isNegated Right public boolean isNegatedRight Returns True if the right input of this element is negated or False otherwise Returns True if the right input of this element is negated or False otherwise isNegatedLeft public boolean isNegatedLeft Returns True if the left input of this element is negated or False otherwise Returns True if the left input of this element is negated or False otherwise isNegated public boolean isNegated Returns True if the output of this element is negated or False otherwise Returns True if the output of this element is negated or False otherwise 184 utils SerializationContainer java lang Object L utils SerializationContainer All Implemented Interfaces Serializable public class SerializationContainer extends Object implements Serializable Transfer object used for serialization of the current state of the program This is a Graph object a Boolean function entered by the user and a Boolean function representing the Graph Setter for the Graph Constructor Summary Page SerializationContainer 185 Method Summary Page String getFunction 186 Returns the user entered function String getGateFunction 186 Returns the Boolean function equaling the Graph Graph getGraph 185 Getter for the Graph void setFunction String function 186 Sets
89. er 2011 3 5 November 2011 42 Gatter als JButtons Migration der bisherigen graphischen Oberfl che von AWT nach Swing da dieses Double Buffering unterst tzt Implementierung eines Algorithmus zum Vergleich Boolescher Funktionen Zeichnen von Gattern mit Hilfe von GridbagLayout implementiert Zeichnen von Gattern mit Hilfe von AbsoluteLayout implementiert Algorithmus zur automatischen Anordnung von vorgegeben Pl tzen f r Gatter implementiert Algorithmus f r das Zeichnen von Verbindungslinien mittels Drag and Drop implementiert Gatter bekommen DockingPoints an denen die Linien anschlie en Operanden als eigene Klasse hinzugef gt Algorithmus zur Konstruktion von Baumstrukturen aus Gatterschaltungen implementiert Verwendung des Proxy Patterns f r die Initialisierung von Gattern Grundlegende Neustrukturierung der Zeichenebene Verzicht auf fixe Pl tze f r Gatter und Operanden Stattdessen ein Grid auf dem Gatter und Operanden frei platziert werden k nnen Damit auch Verzicht auf Proxys Neue Implementierung eines Algorithmus zum Zeichnen und Verschieben von Verbindungslinien 7 9 November 2011 9 10 November 2011 11 November 2011 12 13 November 2011 23 November 2011 24 November 2011 25 27 November 2011 28 November 2011 29 November 2011 30 November 2011 1 Dezember 2011 3 Dezember 2011 8 9 J nner 2012 Gescheiterter Versuch auf Doc
90. er dragged it void drawConnection DockingPoint out DockingPoint in 151 Creates a GateConnection between the specified DockingPoints int drawGate QualifyerGate qg int leftID int rightID 150 boolean negated boolean negatedLeft boolean negatedRight Draws a Gate and its Connections automatically void drawLine DrawableComponent obj Point mousePosition 149 Draws a GateConnection between two DrawableComponents int drawOperand QualifyerOperand qualifyer 150 Draws an Operand if it is not already drawn BufferedImage export 151 Assembles an image from the Graph for export as an image void flush 150 Removes all Gates and GateConnections from the DrawingArea 147 ArrayList lt GateConnection gt getConnections Getter for GateConnections currently displayed in the DrawingArea 151 DrawableComponent getCurrentComponent Returns the currentComponent 152 ArrayList lt DrawableComponent gt getDrawables Getter for DrawableComponents currently displayed in the DrawingArea 151 Graph getGraph Returns the current Graph 152 Graph getGraphCopy Returns a deep copy ofthe Graph currently displayed in DrawingArea 152 getInset Returns the insets of the DrawingArea 152 boolean isDragged Returns if something is currently dragged 153 boolean isSelected Returns if the user has sele
91. er erstellt ein Set von Aufgaben Scenarios Hauptszenario Der User w hlt Aufgaben erstellen aus Eine Toolbar zum Erstellen von Aufgaben wird dem User angezeigt Er hat die M glichkeit mehrere Aufgaben unterschiedlicher Art zu erstellen Jeder Aufgabe k nnen Punkte und eine Anzahl an Versuchen zugewiesen werden Am Schluss werden die Aufgaben in einer Datei gespeichert die der User ausw hlt Alternativszenario Der User verwirft die Aufgaben und speichert sie nicht ab Die Toolbar wird entfernt und die kreierten Aufgaben werden verworfen Fehlerszenario Tritt ein unvorhergesehener Fehler beim Schreiben der Datei auf wird der User davon benachrichtigt 21 Nachbedingung Die kreierten Aufgaben wurden in eine Datei gespeichert Includes Aufgabe anzeigen lassen 22 Aufgaben bearbeiten Kurzbeschreibung Der User bearbeitet ein Set von Aufgaben Scenarios Hauptszenario Der User w hlt Aufgaben bearbeiten aus Aus einem eigenen Fenster w hlt er eine Datei aus in der Aufgaben gespeichert sind die er bearbeiten m chte Eine Toolbar zum Bearbeiten von Aufgaben wird angezeigt Es besteht die M glichkeit Aufgaben neu hinzuzuf gen bestehende Aufgaben zu l schen oder zu ndern Am Schluss werden die Aufgaben in einer Datei gespeichert die der User ausw hlt Alternativszenario Der User verwirft die Aufgaben und speichert sie nicht ab Die Toolbar wird entfernt und die kreierten Aufgaben werden verworfen Fehlersze
92. eranden wird angezeigt Nonfunctional Constraints Schaltungen m ssen zuf llig aus den verf gbaren Operatoren und Operanden generiert werden Eine bereits generierte Schaltung darf w hrend der Laufzeit nicht noch einmal vorkommen Die generierten Schaltungen sollen in ihrem Umfang das hei t der Anzahl der Operatoren und Operanden variieren 10 Boolesche Funktion generieren lassen Kurzbeschreibung Der User l sst vom System eine Boolesche Funktion generieren Scenarios Hauptszenario Per Klick l sst der User das System eine neue zuf llige Boolesche Funktion generieren Vorbedingung Es wurde keine Aktion ausgef hrt die zu einer Sperre der Funktionseingabe f hrt Nachbedingung Die generierte Boolesche Funktion wird angezeigt Der Wahrheitswert der Booleschen Funktion f r die aktuelle Wertebelegung der Operanden wird angezeigt 17 Nonfunctional Constraints Boolesche Funktionen m ssen zuf llig aus den verf gbaren Operatoren und Operanden generiert werden Eine bereits generierte Funktion darf w hrend der Laufzeit nicht noch einmal vorkommen Die generierten Funktionen sollen in ihrem Umfang das hei t der Anzahl der Operatoren und Operanden variieren 11 Gatterschaltung und Boolesche Funktion vergleichen lassen Kurzbeschreibung Der User l sst das System eine Gatterschaltung mit einer Booleschen Funktion vergleichen Scenarios Hauptszenario Per Klick l sst der User das System eine vorhandene Gatters
93. erator GateOperator QualifyerGate gq int x int y int width int height 86 Constructs a new GateOperator at a specified position and with a specified dimension Method Summary Page GateOperator copy 87 Deep copy method for DrawableComponents protected initializeComponent 87 nn Initializes as many DockingPoints as this DrawableComponent needs and stores them in docks void setBounds int x int y int width int height 87 Constructor Detail GateOperator public GateOperator QualifyerGate gq Constructs a new GateOperator Parameters gq The Qualifyer defining the type of this component GateOperator public GateOperator QualifyerGate gq int x int y int width int height Constructs a new GateOperator at a specified position and with a specified dimension Parameters gq The Qualifyer defining the type of this component x The x coordinate of this component y The y coordinate of this component width The width of this component height The height of this component 86 Method Detail initializeComponent protected void initializeComponent Description copied from class DrawableComponent Initializes as many DockingPoints as this DrawableComponent needs and stores them in docks DockingPoints are placed on the component according to their and the components types Overrides initializeComponent in class Gate copy public GateOperator copy Desc
94. ers x The x coordinate to look for a point y The y coordinate to look for a point Returns The point next to the specified coordinates getHalfWidthPoint public Point getHalfWidthPoint Point start Point end Returns the midpoint of a horizontal line defined by two points Parameters start The first point end The second point Returns The midpoint between start and end points getHalfHeightPoint public Point getHalfHeightPoint Point start Point end Returns the midpoint of a vertical line defined by two points Parameters start The first point end The second point Returns The midpoint between start and end points 164 resize public void resize int width int height Resizes the grid to the specified width and height Parameters width New width of the grid height New height of the grid getGridDist public int getGridDist Getter for griddist Returns The distance between two points of the grid getInset public int getInset Getter for insets Returns The insets of the grid 165 service ImageService java lang Object L service ImageService public class ImageService extends Object Manages all images used by the program All images can be accessed as public class members Field Summary aes static APPLICATION ICON 167 nen Icon of this application static GATE ICON AND
95. eto load Exercises from Throws Exception If an error occurs while reading from the file loadForResults public void loadForResults File file throws Exception Loads a collection of Exercises from a file to display the results Uses load File file Parameters file File to load Exercises from Throws Exception If an error occurs while reading from the file getNumberSolved public int getNumberSolved Returns the number of solved Exercises Returns Number of solved Exercises getNumberTried public int getNumberTried Returns the number of tried Exericses Returns Number of tried Exercises 160 FunctionService java lang Object L service FunctionService public class FunctionService extends Object This service is used to generate random boolean functions This class is implemented as a singleton Method Summary Page static getInstance 161 FunctionService i z x Oz Getter for the singular instance of this class String getNewFunction 161 Generates a new random function that has not yet been generated Method Detail getInstance public static FunctionService getInstance Getter for the singular instance of this class Returns The singular instance of this class getNewFunction public String getNewFunction Generates a new random function that has not yet been generated The generated function can be c
96. ew DrawableComponent drawLine public void drawLine DrawableComponent obj Point mousePosition Draws a GateConnection between two DrawableComponents If no line if currently being drawn a new line starting at the DockingPoint at mousePosition is drawn If a line is already being drawn its end point is set to the DockingPoint at mousePosition Parameters obj the DrawableComponent containing the DockingPoint that is used to draw the line mousePosition The position of the mouse click to find the correct DockingPoint updateConnection public void updateConnection GateConnection connection Point start Point end Updates the passed connection The new end of the line is at the current mouse position Parameters connection The GateConnection that should be updated start The start point of the line end The new end point of the line abortCurrentLine public void abortCurrentLine Aborts drawing of the current GateConnection deleteSelection public void deleteSelection Deletes the current selection 149 setDragged public void setDragged boolean b Sets dragged to b Parameters b True if the user currently drags False otherwise dragCurrentComponent public void dragCurrentComponent Moves the currentComponent when user dragged it clear public void clear Removes all Gates and GateConnections from the DrawingArea The Graph gets cleared without instantiating a new one
97. f the click mouseClicked public void mouseClicked MouseEvent event Handles a click in the drawingArea Decides to draw a line or to create a new gate or operand in the drawingArea according to the current mode Parameters event ClickEvent needed for the coordinates of the mouse click setCurrentMode public void setCurrentMode ButtonQualifyer qualifyer Setter for the current mode Parameters qualifyer Qualifyer defining the current mode compareFunctionAndGraph public boolean compareFunctionAndGraph Compares the current user entered function and graph from drawingService Action is executed in the logicService Returns e True if function and graph are equal e False if not getNewFunction public String getNewFunction Returns a new random boolean function Action is executed in functionService Returns A new randomly generated function clear public void clear Clears the current Graph Action is executed in drawingService functionToTree public void functionToTree Creates a boolean tree out of the user entered function Action is executed in logicService 143 getGraphAsFunction public String getGraphAsFunction Returns the boolean function that corresponds the current graph Action is executed in logicService Returns Function corresponding the current graph evaluateFunction public boolean evaluateFunction Returns the logical value of the user entered boolean fu
98. formed ActionEvent e 123 Handles action events on the buttons in this container protected initializeComponent 123 void TERT E Initializations depending of the subtype Constructor Detail GraphFunctionContainer public GraphFunctionContainer GateDrawer parent KeyListener keyListener Constructs a new GraphFunctionContainer Parameters parent The parent GUI holding this container keyListener A keylistener for formula input Method Detail initializeComponent protected void initializeComponent Description copied from class FunctionContainer Initializations depending of the subtype Overrides initializeComponent in class FunctionContainer actionPerformed public void actionPerformed ActionEvent e Handles action events on the buttons in this container Actions are passed to the parent GUI Specified by actionPerformed in interface ActionListener 123 gui container RoundEdgeContainer java lang Object L ava awt Component Lava awe Container L javax swing JComponent L avax swing JPanel L gui container RoundEdgeContainer All Implemented Interfaces Accessible Serializable ImageObserver MenuContainer public class RoundEdgeContainer extends JPanel Contains a part of the GUI and surrounds it with a round edged colored rectangle Paints the component Constructor Summary Page RoundEdgeContainer Color color Co
99. fy a component void showConnectionPopup Node currentNode 104 Shows a popup with options to modify the connection of the current node void showSelectionPopup 104 Constructor Detail DrawingArea public DrawingArea Controller controller Constructs an new DrawingArea Parameters 102 controller The controller of this program Method Detail setGraph public void setGraph Graph graph Sets the Graph that should be displayed Parameters graph The Graph that should be displayed setGrid public void setGrid GridService grid Sets the grid ofthe DrawingArea Parameters grid The new grid of the DrawingArea setCurrentNode public void setCurrentNode Node node Sets the current node that should be displayed Parameters node The Node to display removeCurrentNode public void removeCurrentNode Removes the Node that is currently displayed setCurrentLine public void setCurrentLine GateConnection con Sets a GateConnection that is currently constructed by the user and should be displayed Parameters con The GateConnection to display setSelection public void setSelection Rectangle selection Sets a selected area in the DrawingArea The selection is drawn as a rectangle Parameters selection Rectangle defining the selected area removeSelection public void removeSelection Removes the current selection paintComponent protected void pai
100. g function 62 Sets a users solution of this exercise Field Detail INSTRUCTION public static final String INSTRUCTION The instruction what to do in this exercise Finde die Funktion zur Gatterschaltung Constructor Detail FunctionExercise public FunctionExercise int attempts int points Graph graph Constructs a new FunctionExercise Parameters attempts Number of attempts a user is allowed to make on this exercise points Number of points this exercise is worth when solved at the first attempts graph The logic circuit to that an equal Boolean function has to be found by the user 61 Method Detail getGraph public Graph getGraph Returns the logic circuit of this exercise Returns The logic circuit of this exercise setGraph public void setGraph Graph graph Sets the logic circuit of this exercise Parameters graph The logic circuit of this exercise setSolution public void setSolution String function Sets a users solution of this exercise Parameters function A users solution of this exercise getSolution public String getSolution Returns a users solution of this exercise Returns A users solution of this exercise getInstruction public String getInstruction Returns the instruction for this exercise Overrides getInstruction in class Exercise Returns A message containing instructions what to do in this exercise
101. gPoint int y 70 The y coordinate of this DockingPoint Constructor Summary Page DockingPoint DockType type DrawableComponent parent 71 Constructs anew DockingPoint Method Summary Page void addConnection GateConnection con 71 Adds a GateConnection that hooks into this DockingPoint 69 void changeNegation Changes the negation of this DockingPoint 72 boolean contains Point point Returns True ifthis DockingPoint contains a given point or False otherwise 72 Rectangle getBounds Returns the bounds of this DockingPoint 71 ArrayList lt GateConnection gt getConnections Returns all GateConnections that are hooked into this DockingPoint 72 DrawableComponent getParent Returns the parent DrawableComponent that this dock belongs to 71 DockType getType Returns the type of this DockingPoint specifying its position on the parent DrawableComponent 71 boolean isNegated Returns True ifthis DockingPoint is negated 72 void removeConnection GateConnection connection Removes a GateConnection that is hooked into this DockingPoint 72 void setBounds Rectangle r Sets the bounds of this DockingPoint 71 void setNegated boolean neg Sets the negation of this DockingPoint 72 Field Detail height public int height The height of this DockingPoint width public in
102. ge protected initializeComponent 80 void eee Initializes as many DockingPoints as this DrawableComponent needs and stores them in docks Constructor Detail Gate public Gate QualifyerGate gq Constructs a new Gate Parameters gq The Qualifyer defining the type of the element Gate public Gate QualifyerGate gq int x int y int width int height Constructs a new Gate at position x y Parameters gq The Qualifyer defining the type of the element x The x coordinate of the Gate y The y coordinate of the Gate width The width of the Gate height The height of the Gate 79 Method Detail initializeComponent protected void initializeComponent Description copied from class DrawableComponent Initializes as many DockingPointsasthis DrawableComponent needs and stores them in docks DockingPoints are placed on the component according to their and the components types Overrides initializeComponent in class DrawableComponent 80 domain gui GateConnection java lang Object L domain gui GateConnection All Implemented Interfaces Serializable public class GateConnection extends Object implements Serializable Represents a line connecting two components of a logic circuit AGateConnection hooks into a DockingPoint that is provided by the component for this purpose The connection consists of anumber of single horizontal and vertical li
103. ge zu berpr fen ob ein logischer Ausdruck erf llbar ist Obwohl der Begriff der Erf llbarkeit zu den Grundlagen der Aussagenlogik geh rt und zun chst auch leicht nachzuvollziehen ist ist dessen Bedeutung f r konkrete Anwendungen im Unterricht sehr schwer zu vermitteln Die Komplexit tstheorie in welcher die Erf llbarkeit unter anderem angewandt wird kann bestenfalls im vertiefenden Wahlpflichtfach angeschnitten werden Dabei k nnte etwa die Erf llbarkeit aussagenlogischer Funktionen als Beispiel f r ein NP Problem herangezogen werden Da die Iteration aller m glichen Wertebelegungen die einzige M glichkeit ist die Erf llbarkeit einer Funktion zu berpr fen ermittelt auch das Programm die Erf llbarkeit auf diese Weise Mit Hilfe von Gatterschaltungen ist es auch m glich einfache Rechengesetze wie das Assoziativ oder Distributivgesetz zu veranschaulichen So ist der Ausdruck aA bAc gem dem Assoziativgesetz aquivalent zu aAb Ac Der Ausdruck a bvc ist quivalent zu aAb V aAc aber nicht zu aA bAc Die Sch lerinnen und Sch ler k nnen selbstst ndig jeweils einen Ausdruck als Gatterschaltung konstruieren und den anderen als Funktion eingeben Das Programm berpr ft dann die quivalenz der beiden Ausdr cke Auf diese Weise k nnen sogar die De Morgan schen Gesetze im Unterricht erarbeitet werden Die Sch lerinnen und Sch ler k nnen selbstst ndig durch trial and error und oder logisches Denken herausfinden wel
104. geIcon ICON_CHECK_ GRAPH Icon for checking the logic circuit for satisfiability ICON_CHECK_GRAPH_ROLLOVER public static final ImageIcon ICON_CHECK_ GRAPH ROLLOVER Rollover icon for checking the logic circuit for satisfiability ICON_CLEAR public static final ImageIcon ICON_CLEAR Icon for deleting the logic circuit in the ButtonArea ICON_CLEAR_FUNCTION public static final ImageIcon ICON_CLEAR_FUNCTION Icon for clearing a field ICON_CLEAR_SELECTED public static final ImageIcon ICON_CLEAR_SELECTED Selected icon for deleting the logic circuit in the ButtonArea ICON_COMPARE public static final ImageIcon ICON_COMPARE Icon for comparing a Boolean function to a logic circuit ICON_COMPARE_ROLLOVER public static final ImageIcon ICON_COMPARE ROLLOVER Rollover icon for comparing a Boolean function to a logic circuit ICON_DELLINE public static final ImageIcon ICON_DELLINE Icon for deleting a connection in the ButtonArea ICON_DELLINE_SELECTED public static final ImageIcon ICON_DELLINE_SELECTED Selected icon for deleting a connection in the ButtonArea ICON_EXIT public static final ImageIcon ICON_EXIT Icon for exiting the program 169 ICON_EXPORT public static final ImageIcon ICON_EXPORT Icon for exporting the logic circuit as an image ICON_INFO public static final ImageIcon ICON_INFO Icon for displaying program information ICON_LINE public static final ImageIcon ICON LINE Icon for creating a co
105. haltung Scenarios Hauptszenario Der User zeichnet eine neue Gatterschaltung Dazu stehen Symbole f r die unterschiedlichen Elemente wie Gatter Operanden und Verbindungen zur Verf gung Mit einem Mausklick positioniert der User ein Element auf der Zeichenebene Vorbedingung Es wurde keine Aktion ausgef hrt die zu einer Sperre der Zeichenebene f hrt Nachbedingung Die gezeichnete Gatterschaltung wird angezeigt Der Wahrheitswert der Gatterschaltung f r die aktuelle Wertebelegung der Operanden wird angezeigt Includes Gatterschaltung ndern 2 Gatterschaltung ndern 14 Kurzbeschreibung Der User ndert eine bereits vorhandene Gatterschaltung Scenarios Hauptszenario Der User ndert eine bestehende Gatterschaltung Dazu stehen Symbole f r die unterschiedlichen Elemente wie Gatter Operanden und Verbindungen zur Verf gung Mit einem Mausklick positioniert der User ein Element auf der Zeichenebene Mittels Drag and Drop k nnen Elemente neu positioniert werden Vorbedingung Es wurde keine Aktion ausgef hrt die zu einer Sperre der Zeichenebene f hrt Eine bestehende Schaltung wird angezeigt Nachbedingung Die ge nderte Schaltung wird angezeigt Der Wahrheitswert der Gatterschaltung f r die aktuelle Wertebelegung der Operanden wird angezeigt Includes Gatter zur Gatterschaltung hinzuf gen Gatter aus Gatterschaltung entfernen Verbindung zur Gatterschaltung hinzuf gen Verbindung aus Gatterschaltung entfe
106. he given Graph Method Summary Page void addComponent DrawableComponent component 54 Adds a DrawableComponent to the logic circuit void addConnection GateConnection connection 54 Adds a GateConnection to the logic circuit void clear 54 Clears the logic circuit void deleteComponent DrawableComponent component 53 Deletes a DrawableComponent from the logic circuit void deleteConnection ArrayList lt GateConnection gt connections 53 Deletes a list of GateConnections from the logic circuit void deleteConnection GateConnection connection 53 Deletes a GateConnection from the logic circuit ArrayList lt GateConnection gt getConnections 53 Returns the GateConnections of the logic circuit ArrayList lt DrawableComponent gt getDrawables 53 Returns the DrawableComponents of the logic circuit DrawableComponent getRootGate 53 Returns the root of the logic circuit Constructor Detail Graph public Graph Constructs a new Graph Lists drawables and connections are initialized 52 Graph public Graph Graph g Constructs a new Graph and deep copies the given Graph All GateConnections and DrawableComponents including their DockingPoints are deep copied Parameters g The Graph to copy Method Detail getDrawables public ArrayList lt DrawableComponent gt getDrawables Returns the DrawableComponents of the logic circuit Returns The DrawableComponents of the log
107. he points array in the second dimension Returns The point at the specified array position Or null if i or are out of bound getNextPoint public Point getNextPoint Point p Returns the point that is next to the specified coordinates The coordinates cannot be out of bound Parameters p A point Returns The point next to the given point getNextPoint public Point getNextPoint int x int y Returns the point that is next to the specified coordinates The coordinates cannot be out of bound Parameters x The x coordinate in the grid y The y coordinate in the grid Returns The point next to the given coordinates 163 getNextPoint public Point getNextPoint DockingPoint dock Returns a point next to a DockingPoint at that aGateConnection should start or end Parameters dock The DockingPoint where a GateConnection should start or end Returns A point in the grid getNextPointFixY public Point getNextPointFixY double x double y Returns the point next to specified coordinates The y coordinate is taken as fixed only the x coordinate is varied Parameters x The x coordinate to look for a point y The y coordinate to look for a point Returns The point next to the specified coordinates getNextPointFixX public Point getNextPointFixX double x double y Returns the point next to specified coordinates The x coordinate is taken as fixed onlythe y coordinate is varied Paramet
108. his DockingPoint 71 getConnections public ArrayList lt GateConnection gt getConnections Returns all GateConnections that are hooked into this DockingPoint Returns All GateConnections that are hooked into this DockingPoint isNegated public boolean isNegated Returns True if this DockingPoint is negated False otherwise Returns True if this DockingPoint is negated False otherwise setNegated public void setNegated boolean neg Sets the negation of this DockingPoint Parameters neg True if this DockingPoint should be negated False otherwise changeNegation public void changeNegation Changes the negation of this DockingPoint If its negation was True it becomes False now If it was False it becomes True removeConnection public void removeConnection GateConnection connection Removes a GateConnection that is hooked into this DockingPoint Parameters connection The GateConnection that should be removed from this DockingPoint contains public boolean contains Point point Returns True ifthis DockingPoint contains a given point or False otherwise Parameters point A point thats position is checked and compared to this DockingPoints position Returns True if this DockingPoint contains a given point False otherwise 72 domain gui DockType java lang Object L sava lang Enum lt DockType gt L domain gui DockType All Implemented Interfaces Comparable lt Doc
109. ic circuit getConnections public ArrayList lt GateConnection gt getConnections Returns the GateConnections of the logic circuit Returns The GateConnections of the logic circuit getRootGate public DrawableComponent getRootGate Returns the root of the logic circuit Root is a DrawableComponent with no connection at the Out DockingPoint Returns The root of the logic circuit deleteComponent public void deleteComponent DrawableComponent component Deletes a DrawableComponent from the logic circuit All its GateConnectionsare deleted as well Parameters component The DrawableComponent to delete deleteConnection public void deleteConnection ArrayList lt GateConnection gt connections Deletes a list of GateConnections from the logic circuit Parameters connections The GateConnectionsto delete deleteConnection public void deleteConnection GateConnection connection Deletes a GateConnection from the logic circuit 53 Parameters connection The GateConnection to delete addComponent public void addComponent DrawableComponent component Adds a DrawableComponent to the logic circuit Parameters component The component to add addConnection public void addConnection GateConnection connection Adds a GateConnection to the logic circuit Parameters connection The connection to add clear public void clear Clears the logic circuit All Drawab
110. ic void clearGraph Removes the current logic circuit giveUpShowSolution public void giveUpShowSolution The user gives up the current Exercise and the correct solution is shown editExercises public void editExercises Loads a file of Exercisesto editthem loadResults public void loadResults Loads a file with already executed Exercises and shows the results finishExerciseExecution public void finishExerciseExecution Saves a set of Exercises after a user executed them The Exercises are saved to the same file as they were loaded from Ifthe original file doesn t exist anymore the user can choose another one closeExerciseMenuBar public void closeExerciseMenuBar Closes the current ExerciseMenuBar User is asked whether to save the current state 113 showInfo public void showInfo Shows a window with information about the program updateEvaluations public void updateEvaluations Updates the evaluations of the user entered Boolean function and the logic circuit isFunctionSatisfiable public void isFunctionSatisfiable Tests ifthe current user entered Boolean function is satisfiable and displays the result isGraphSatisfiable public void isGraphSatisfiable Tests if the current logic circuit is satisfiable and displays the result componentHidden public void componentHidden ComponentEvent arg0 ComponentHidden event is ignored Specified by compon
111. ic void drawConnection DockingPoint out DockingPoint in Creates a GateConnection between the specified DockingPoints Parameters out The start DockingPoint in Theend DockingPoint export public BufferedImage export Assembles an image from the Graph for export as an image Returns The current graph as an image getDrawables public ArrayList lt DrawableComponent gt getDrawables Getter for DrawableComponents currently displayed in the DrawingArea Used for modifications of the current display Returns ArrayList of currently displayed DrawableComponents getConnections public ArrayList lt GateConnection gt getConnections Getter for GateConnections currently displayed in the DrawingArea Used for modifications of the current display Returns ArrayList of currently displayed GateConnections setGraph public void setGraph Graph graph Sets the currently displayed Graph to the passed Graph A deep copy will be made so changes on the original Graph will not be displayed Parameters graph Graph to display in the DrawingArea 151 deleteCurrentNodeLine public void deleteCurrentNodeLine Deletes the GateConnection contained by the currentNode getGraph public Graph getGraph Returns the current Graph Returns The current Graph getGraphCopy public Graph getGraphCopy Returns a deep copy of the Graph currently displayed in DrawingArea Changes in the returned Graph wil
112. icht h ufig vernachl ssigt sollten aber zumindest in der neunten Schulstufe ansatzweise vermittelt werden Entsprechend zeigt sich das Anwendungsgebiet der entwickelten Software deren Hauptaugenmerk auf der Darstellung logischer Ausdr cke als Boolesche Funktion oder Gatterschaltung sowie der Umwandlung zwischen den beiden Formen liegt Dazu geh rt prim r das Konstruieren von Logikgattern aber auch das Herauslesen Boolescher Funktionen aus Schaltungen Im Unterricht kann das Programm w hrend des gesamten Themenkreises Gatterschaltungen eingesetzt werden Sch lerinnen und Sch ler k nnen selbstst ndig Schaltungen zu Booleschen Funktionen erzeugen Umgekehrt k nnen auch die Booleschen Funktionen zu gegebenen Gatterschaltungen gefunden werden Zum einen soll damit die Konstruktion von Gatterschaltungen ge bt werden zum anderen aber auch ein Verst ndnis daf r vermittelt werden wie abstrakte mathematische Logik in einer technischen Konstruktion umgesetzt wird Dieser Schritt der im Anschluss an die reine Konstruktions bung einer bewussten Reflexion bedarf wird im Unterricht vernachl ssigt Er ist aber essentiell um den Sch lerinnen und Sch lern die Motivation f r diese ansonsten recht abstrakte bung bewusst werden zu lassen Bundesministerium f r Unterricht Kunst und Kultur Hg Lehrplan Informatik f r die AHS Oberstufe Wien 2004 S 2 36 Nachdem die Grundlagen der Konstruktion von Gatterschaltungen ge bt worden sind
113. ileNameExtensionFilter filter Shows a file chooser for saving a file with a given file extension If the chosen file already exists the user is asked whether he wants to overwrite it Parameters filter The file extension the file must have Returns The chosen file or null if the user chose nothing showLoadDialog public static File showLoadDialog FileNameExtensionFilter filter Shows a file chooser for loading a file with a given file extension Parameters filter The file extension the file must have Returns The chosen file or null if the user chose nothing showExportDialog public static File showExportDialog Shows a file chooser for exporting an image with file extension jpeg or jpg If the chosen file already exists the user is asked whether he wants to overwrite it Returns The chosen file or null if the user chose nothing 105 gui GateDrawer java lang Object L ava awt Component L java awt Container L java awt Window L java awt Frame L javax swing JFrame L gui GateDrawer All Implemented Interfaces WindowListener EventListener ComponentListener WindowConstants Accessible RootPaneContainer MenuContainer ImageObserver Serializable public class GateDrawer extends JFrame implements WindowListener ComponentListener The main window of the GUI Instantiates all the parts of the GUI and works as an interface between GUI and Controller Constructor Summary Page
114. ion The Boolean function that should be displayed setEval public void setEval boolean b Displays a truth value in lbEval Parameters b True if wahr should be displayed False if falsch should be displayed getFunction public String getFunction Returns the Boolean function that is displayed Returns The Boolean function that is displayed setButtonsEnabled public void setButtonsEnabled boolean b Enables the jbDisplay and the jbRandom buttons Parameters b True if the buttons should be enabled False otherwise setFontSizes public void setFontSizes int size Sets the font size of the textfield where the Boolean function is displayed Parameters size The new font size of the textfield 122 gui container GraphFunctionContainer java lang Object L java awt Component Lava awe Container L javax swing JComponent L javax swing JPanel L gui container FunctionContainer L gui container GraphFunctionContainer All Implemented Interfaces ActionListener EventListener Accessible Serializable ImageObserver MenuContainer public class GraphFunctionContainer extends FunctionContainer Container for Boolean function and some buttons for the logic circuit displayed in DrawingArea Constructor Summary Page GraphFunctionContainer GateDrawer parent KeyListener keyListener 123 Constructs anew GraphFunctionContainer Method Summary Page void actionPer
115. it in GateDrawer Specified by windowClosing in interface WindowListener windowDeactivated public void windowDeactivated WindowEvent arg0 WindowDeactivated Event is ignored Specified by windowDeactivated in interface WindowListener windowDeiconified public void windowDeiconified WindowEvent arg0 WindowDeiconified Event is ignored Specified by windowDeiconi fied in interface WindowListener windowlconified public void windowIconified WindowEvent arg0 Windowlconified Event is ignored Specified by windowlconi fied in interface WindowListener windowOpened public void windowOpened WindowEvent arg0 WindowOpened Event is ignored Specified by windowOpened in interface WindowListener exit public void exit Saves the current state of the program and exits The state is saved in autosave gser in the directory that the program is running in Saving is done in Controller export public void export Exports a the current logic circuit as an image Opens a file dialogue for the user to choose a file Export is done in Controller 109 load public void load Load a program state from a file Opens a file dialogue for the user to choose a file Loading is done in Controller createExercises public void createExercises Starts the creation of a new set of Exercises Therefore all current Exercise related activities are aborted A new ExerciseService is instantiated and a Cre
116. kType gt Serializable public enum DockType extends Enum lt DockType gt Defines the types of DockingPoints A type specifies a position on a DrawableComponent and if a DockingPoint represents an input or an output Enum Constant Summary Page Inl 73 The first upper input of a DrawableComponent In2 73 The second lower input of a DrawableComponent Out 73 The output of a DrawableComponent Method Summary Page static valueOf String name 73 DockType static vyalues 73 DockType Enum Constant Detail Ini public static final DockType Inl The first upper input of a DrawableComponent Only operator gates have an In1 DockingPoint In2 public static final DockType In2 The second lower input of a DrawableComponent Only operator gates apart from NOT have an In2 DockingPoint Out public static final DockType Out The output of a DrawableComponent Each DrawableComponent has an Out DockingPoint Method Detail values public static DockType values valueOf public static DockType valueOf String name 73 domain gui DrawableComponent java lang Object L domain gui DrawableComponent All Implemented Interfaces Serializable Direct Known Subclasses Gate Operand public abstract class DrawableComponent extends Object implements Serializable DrawableComponent is the super type of all elements of a logic circuit that are drawn in D
117. kingPoints zu verzichten Drag and Drop f r Gatter und Operanden Verbesserungen am Linienalgorithmus Algorithmus zum automatischen Zeichen von Gatterschaltungen implementiert Negationen f r Gatter grafisch und formal hinzugef gt Linienalgorithmus wesentlich verbessert Selektion von Gattern und Verbindungslinien hinzugef gt Export der Gatterschaltung als JPEG hinzugef gt Men leiste hinzugef gt Projekt auf das DAO Pattern umgestellt XOR NAND hinzugef gt und NOR als weitere Operatoren QualifyerManager als zentrale Verwaltung von Qualifyern hinzugef gt Linienalgorithmus fertiggestellt Hinzuf gen von Aufgaben Aufgabenverwaltung bernimmt ExerciseService notwendige GUI Elemente befinden sich in ExerciseMenuBar Hinzuf gen unterschiedlicher Aufgabenarten Erstellen von Aufgaben m glich Bearbeiten von Aufgaben m glich Umstellen auf Model View Controller Pattern Trennung von GUI und Logik Aufteilung der Programmlogik auf mehrere Serviceklassen 43 29 30 J nner 2012 13 15 Februar 2012 16 26 Februar 2012 44 Grundlegende Neustrukturierung der Zeichenebene Gatter werden nicht mehr als JButtons dargestellt Gatter und Verbindungslinien werden gemeinsam in einem Graph Objekt gespeichert Finales Grunddesign der GUI Textfelder f r Ein und Ausgabe Boolescher Funktionen neu platziert Feld zur Ausgabe von Texten hinzugef gt von Icons zur Gestaltung der
118. l not be displayed Returns A deep copy ofthe Graph currently displayed getInset public int getInset Returns the insets of the DrawingArea Returns The insets of the DrawingArea isSelecting public boolean isSelecting Returns if the user is currently selecting in the DrawingArea Returns True if the user currently selects False otherwise isSelected public boolean isSelected Returns if the user has selected something in the DrawingArea Returns True if something is currently selected False otherwise getCurrentComponent public DrawableComponent getCurrentComponent Returns the currentComponent Returns The currentComponent 152 setSelected public void setSelected boolean b Sets selected Parameters b True if the user has selected something False otherwise setSelecting public void setSelecting boolean b Sets selecting Parameters b True if the user is selecting something False otherwise isDragged public boolean isDragged Returns if something is currently dragged Returns True if something is currently dragged False otherwise componentHidden public void componentHidden ComponentEvent event Component hidden event is ignored Specified by componentHidden in interface ComponentListener componentMoved public void componentMoved ComponentEvent event Component moved event is ignored Specified by componentMoved in interface ComponentListener
119. leComponents and GateConnections are deleted 54 Package domain exercise Class Summary Page Exercise This class represents an exercise and hold all its data 55 FunctionExercise circuit Exercise in that a user has to find Boolean function equal to a given logic 60 GraphExercise function Exercise in that a user has to draw a logic circuit equal to a given Boolean 62 IncorrectFunctionExercise Exercise in that a user has to correct a given Boolean function so that it becomes equal to a given logic circuit 64 IncorrectGraphExercise Exercise in that a user has to correct a given logic circuit so that it becomes equal to a given Boolean function 66 domain exercise Exercise java lang Object L domain exercise Exercise All Implemented Interfaces Serializable Direct Known Subclasses FunctionExercise GraphExercise public abstract class Exercise extends Object implements Serializable This class represents an exercise and hold all its data Constructor Summary Page Exercise int attempts int points Constructs a new Exercise Method Summary 56 Page int getAttemptsAllowed Returns the number of attempts a user is allowed to make on this exercise 56 getAttemptsNeeded Returns the number of attempts a user already made on this exercise 56 abstract String getInstruction Returns a me
120. lic GlobalKeyListener Controller controller GateDrawer gui Constructs a new GlobalKeyListener Parameters controller The Controller of the program gui The GUI of the program Method Detail keyPressed public void keyPressed KeyEvent e KeyPressed event is ignored Specified by keyPressed in interface KeyListener 115 keyReleased public void keyReleased KeyEvent ke When a key is released it is checked for ESC or DEL key e ESC the drawing of the current line is aborted e DEL the current selection in DrawingArea is deleted Specified by keyReleased in interface KeyListener keyTyped public void keyTyped KeyEvent ke When a key is typed its code is checked and may be changed to another one depending on its character e becomes AND e becomes OR e becomes NOT e x becomes XOR e SHIFT becomes NAND SHIFT becomes NOR Specified by keyTyped in interface KeyListener 116 gui Main java lang Object L gui Main public class Main extends Object The Main class of this project that instantiates a controller to start the program Constructor Summary Page Main 117 Method Summary Page en main String args 117 Instantiates a new Controller to start the program Constructor Detail Main public Main Method Detail main public static void main String args
121. lten innerhalb von Sekundenbruchteilen erfolgen Akkumulation Fehlermeldungen etwa bei falschen Eingaben werden akkumuliert ausgegeben Toleranz Fehlerhafte Eingaben k nnen von dem Benutzer korrigiert werden 2 7 Benutzeroberfl che Die Benutzeroberfl che besteht aus einem einfachen Fenster welches alle Funktionen beinhaltet die der Benutzer in Anspruch nehmen kann Ein gr erer Bereich ist f r das Zeichnen von Gatterschaltungen vorgesehen F r die Ein und Ausgabe Boolescher Funktionen werden zwei getrennte Felder zur Verf gung stehen Sollten zus tzliche Funktionalit ten es erforderlich machen wird zum Erhalt der bersichtlichkeit ein Optionsmen integriert Das Zeichnen von Gattern wird mittels Drag and Drop realisiert F r die Eingabe von Booleschen Operatoren in der Eingabezeile wird eventuell eine eigene 11 Tastenbelegung notwendig sein Alternativ k nnen Buttons f r die einzelnen Symbole verwendet werden Die Oberfl che wird mit Java Swing beziehungsweise Java2D gestaltet 2 8 Qualit tsbestimmungen Sehr wichtig Wichtig Normal Unwichtig Korrektheit x Robustheit Zuverl ssigkeit Benutzerfreundlichkeit XxX X gt lt x Effizienz Kompatibilit t Portierbarkeit Erweiterbar Entsprechend dem Einsatz in der Schule wird auf die Entwicklung einer einfachen robusten und benutzerfreundlichen Software Wert gelegt Besonders wichtig ist selbstvers
122. ment right 182 The Element representing the right input of this Element Constructor Detail BoolTree Element public BoolTree Element BooleanQualifyer q Constructs a new Element with the given Qualifyer Parameters q The Qualifyer specifying what operator or operand this Element represents Method Detail setNegated public void setNegated boolean neg Sets the negation of the output to neg Parameters neg True if the output should be negated False otherwise setNegateLeft public void setNegateLeft boolean neg Sets the negation of the left input to neg Parameters neg True if the left input should be negated False otherwise setNegateRight public void setNegateRight boolean neg Sets the negation of the right input to neg Parameters neg True if the right input should be negated False otherwise evaluate public abstract boolean evaluate Evaluates this Element Returns True if the logic value of this Element is true False otherwise isLeaf public abstract boolean isLeaf Returns True if this Element represents an operand False if not Returns True if this Element represents an operand False if not 183 toString public String toString Returns a String containing the Boolean function this element and its children represent Overrides toString in class Object getQualifyer public BooleanQualifyer getQualify
123. mponent component 124 Constructs a new RoundEdgeContainer Method Summary Page protected paintComponent Graphics g 124 void Constructor Detail RoundEdgeContainer public RoundEdgeContainer Color color Component component Constructs a new RoundEdgeContainer Parameters color The color of the surrounding rectangle component The GUI element that should be contained Method Detail paintComponent protected void paintComponent Graphics g Paints the component Overrides paintComponent in class JComponent Parameters g The Graphics object where to paint the rectangle 124 gui container UserFunctionContainer java lang Object java awt Component L java awt Container L javax swing JComponent L javax swing JPanel L gui container FunctionContainer gui container UserFunctionContainer All Implemented Interfaces ActionListener EventListener Accessible Serializable ImageObserver MenuContainer public class UserFunctionContainer extends FunctionContainer Constructor Summary Page UserFunctionContainer GateDrawer parent KeyListener keyListener 125 Constructs a new UserFunctionContainer Method Summary Page void actionPerformed ActionEvent e 125 Handles action events on the buttons of this container protected initializeComponent 125 void Initializations depending of the subtype Methods inherited from class gui
124. mte Zeichenebene selektiert und gel scht werden 6 3 3 Boolesche Funktion eingeben Es besteht die M glichkeit eine Boolesche Funktion in das daf r vorgesehene Textfeld in D einzugeben F r die Eingabe der Operatoren sind die folgenden Tasten vorgesehen Tastenkombination Symbol Es A AND i v OR NOT x v XOR SHIFT A NAND SHIFT V NOR W hrend der Eingabe wird die Funktion laufend evaluiert und ihr Wahrheitswert f r die aktuelle Wertebelegung siehe 4 a darunter ausgegeben 6 3 4 Speichern Es besteht die M glichkeit den jeweils aktuellen Stand des Programms das hei t die angezeigte Gatterschaltung sowie die eingegebene Boolesche Funktion 31 abzuspeichern Dazu wird das Speichern Symbol aus der Men leiste F gedr ckt und eine Datei ausgew hlt Programmst nde werden in Dateien mit der Endung gser gespeichert Vor jedem Beenden wird automatisch der letzte Stand des Programms gesichert 6 3 5 Laden Gespeicherte Programmst nde k nnen durch Klicken auf das Laden Symbol in der Men leiste und anschlie endes Ausw hlen einer gser Datei geladen werden Der geladene Programmstand wird sofort angezeigt Zu jedem Programmstart wird der letzte Programmstand geladen so ein solcher verf gbar ist 6 3 6 Bildexport Eine Gatterschaltung kann in eine Bilddatei im JPEG Format exportiert werden Daf r steht ein entsprechendes Symbol in der Men l
125. nExercise public IncorrectFunctionExercise int attempts int points String function Graph graph Constructs a new IncorrectFunctionExercise Parameters attempts Number of attempts a user is allowed to make on this exercise points Number of points this exercise is worth when solved at the first attempts function Boolean function that is not equal to the logic circuit graph The logic circuit to that an equal Boolean function has to be found by the user 65 Method Detail getFunction public String getFunction Returns the Boolean function that has to be changed so that it becomes equal to the logic circuit Returns The Boolean function that has to be changed so that it becomes equal to the logic circuit setFunction public void setFunction String function Sets the Boolean function that has to be changed so that it becomes equal to the logic circuit Parameters function The Boolean function that has to be changed so that it becomes equal to the logic circuit getInstruction public String getInstruction Description copied from class FunctionExercise Returns the instruction for this exercise Overrides getInstruction in class FunctionExercise Returns A message containing instructions what to do in this exercise 66 domain exercise IncorrectGraphExercise java lang Object L donate xercise Exercis L domain exercise GraphExercise L domain exer
126. nFont protected Font functionFont Font for jtfFunction functionPanel protected JPanel functionPanel Contains the textfield and the label jbClear protected JButton jbClear Clears a function or circuit 120 JbDisplay protected JButton jbDisplay Displays a function as a circuit or vice versa jbRandom protected JButton jbRandom Generates a random Boolean function or logic circuit jtfFunction protected JTextField jtfFunction Textfield displaying a Boolean function IbEval protected JLabel lbEval Displays the truth value of a function or a circuit parent protected GateDrawer parent The GUI of the program Constructor Detail FunctionContainer public FunctionContainer GateDrawer parent KeyListener keyListener Constructs a new FunctionContainer Parameters parent The GUI of the program keyListener The keylistener for changing normal keys into operator signs Method Detail initializeComponent protected abstract void initializeComponent Initializations depending of the subtype setEnabled public void setEnabled boolean b Sets all elements of this container enabled or disabled Overrides setEnabled in class Jcomponent Parameters b True if all elements of this container should be enabled False otherwise 121 setFunction public void setFunction String function Displays a Boolean function in jtfFunction Parameters funct
127. nario Tritt ein unvorhergesehener Fehler beim Schreiben der Datei auf wird der User davon benachrichtigt Nachbedingung Die kreierten Aufgaben wurden in eine Datei gespeichert Includes Aufgabe anzeigen lassen 23 Aufgaben durchf hren 22 Kurzbeschreibung Der User f hrt ein Set von Aufgaben aus Scenarios Hauptszenario Der User w hlt Aufgaben ausf hren aus Aus einem eigenen Fenster w hlt er eine Datei aus in der Aufgaben gespeichert sind die er ausf hren m chte Eine Toolbar zum Durchf hren von Aufgaben wird angezeigt Jede Aufgabe wird einzeln angezeigt und durchgef hrt Der User kann seine L sung berpr fen und bewerten lassen Jede Aufgabe kann nur eine begrenzte Anzahl oft durchgef hrt werden Der User kann eine Aufgabe auch aufgeben und sich die korrekte L sung anzeigen lassen Am Schluss werden die Aufgaben in derselben Datei gespeichert aus der sie geladen wurden Fehlerszenario Tritt ein unvorhergesehener Fehler beim Schreiben der Datei auf wird der User davon benachrichtigt Fehlerszenario Die Datei aus welcher die Aufgaben geladen worden sind ist beim Speichern nicht mehr vorhanden Der User kann eine neue Datei ausw hlen in welche gespeichert wird Nachbedingung Die Aufgaben wurden mitsamt den Resultaten in eine Datei gespeichert Includes Aufgabe anzeigen lassen 24 Aufgabenresultate anzeigen Kurzbeschreibung Der User l sst sich Aufgabenresultate anzeigen Scenarios Hau
128. nction Action is executed in logicService Returns Logical value of the user entered function evaluateGraph public boolean evaluateGraph Returns the logical value of the current graph Action is executed in logicService Returns Logical value of the current graph generateGraph public void generateGraph Randomly generates a new graph and draws it in drawingArea Random generation is done in functionService Drawing is done in drawingService functionToGraph public void functionToGraph String function Draws a boolean function as a graph Drawing is done in method drawGraph and in drawingService Parameters function The function that should be drawn export public void export File file throws Exception Exports the current graph as an image to a given file Assembling of the image is done in drawingService File is saved in FileDAO Parameters file File to save the image to Throws Exception If an error with the file occurs deleteSelection public void deleteSelection Handles user request of deleting the current selection Deletion is done in drawingService 144 repaint public void repaint Passes a repaint request to the GUI deleteConnection public void deleteConnection GateConnection connection Handles a user request for deletion of a line in drawingArea Request is executed by drawingService Parameters connection Connection to delete deleteComponent pu
129. ner C javax swing JComponent I javax swing JMenuBar DR gui menubar ExerciseMenuBar gui menubar CreateExerciseMenuBar All Implemented Interfaces ActionListener EventListener Accessible MenuElement Serializable ImageObserver MenuContainer public class CreateExerciseMenuBar xtends ExerciseMenuBar implements ActionListener Menubar for creating or editing a set of Exercises Constructor Summary Page CreateExerciseMenuBar GateDrawer gateDrawer ExerciseServic xerciseService 127 Constructs anew CreateExerciseMenuBar Method Summary Page void actionPerformed ActionEvent e 128 Handles ActionEvents from this menubars components void paintComponent Graphics g 128 void setToCurrentExercise 128 Displays information about the current Exercise such as points and attempts Constructor Detail CreateExerciseMenuBar public CreateExerciseMenuBar GateDrawer gateDrawer ExerciseServic xerciseService Constructs a new CreateExerciseMenuBar Parameters gateDrawer The parent GUI xerciseService The ExerciseService containing the Exercises that are created or edited 127 Method Detail actionPerformed public void actionPerformed ActionEvent e Handles ActionEvents from this menubars components Specified by actionPerformed in interface ActionListener Parameters e The Action
130. nes Constructor Summary Page GateConnection DockingPoint start 81 Constructs anew GateConnection starting atthe given DockingPoint Method Summary Page boolean lIcontainsPoint Point p 82 Returns True if this GateConnection contains a given point DockingPoint getEnd 82 Returns the DockingPoint at that this connection ends ArrayList lt Line2D Double gt getLines 82 Returns all singular lines this GateConnection consists of Node getNewNode Point p int width int height 83 Creates a new Node at a line of this connection that is next to at a given point DockingPoint getStart 82 Returns the DockingPoint at that this connection starts boolean setEnd DockingPoint ende 81 Finalizes the construction of a GateConnection void setLines ArrayList lt Line2D Double gt lines 82 Sets the lines this GateConnection consists of Constructor Detail GateConnection public GateConnection DockingPoint start Constructs a new GateConnection starting at the given DockingPoint Parameters start The DockingPoint where this connection should start Method Detail setEnd public boolean setEnd DockingPoint ende Finalizes the construction of a GateConnection The connection is now established between the start and the end DockingPoint Start and end docks must not be of the same type If they are of the 81 same type the connection is not finished an
131. new Exercise Parameters attempts Number of attempts a user is allowed to make on this exercise points Number of points this exercise is worth when solved at the first attempts Method Detail getAttemptsAllowed public int getAttemptsAllowed Returns the number of attempts a user is allowed to make on this exercise Returns The number of attempts a user is allowed to make on this exercise setAttemptsAllowed public void setAttemptsAllowed int attemptsAllowed Sets the number of attempts a user is allowed to make on this exercise Parameters attemptsAllowed The number of attempts a user is allowed to make on this exercise getAttemptsNeeded public int getAttemptsNeeded Returns the number of attempts a user already made on this exercise Returns The number of attempts a user already made on this exercise 56 setAttemptsNeeded public void setAttemptsNeeded int attemptsNeeded Sets the number of attempts a user already made on this exercise Parameters attemptsNeeded Sets the number of attempts a user already made on this exercise getPoints Worth public int getPointsWorth Returns the number of points this exercise is worth when solved correctly at the first attempt Returns The number of points this exercise is worth when solved correctly at the first attempt setPoints Worth public void setPointsWorth int pointsWorth Sets the number of points this exercise is worth when solved
132. ng ist e Finde die Gatterschaltung Zu einer Funktion soll die quivalente Gatterschaltung konstruiert werden e Korrigiere die Gatterschaltung Eine Gatterschaltung soll so abge ndert werden dass sie quivalent zu einer gegebenen Funktion ist 6 5 2 Aufgaben erzeugen Zur Erzeugung von Aufgaben ist der entsprechende Eintrag Aufgaben kreieren auszuw hlen Die neu erschienene Toolbar stellt die notwendigen Funktionen zur Verf gung e Neue Aufgabe Eine neue Aufgabe wird am Ende angelegt Es kann immer nur eine neue Aufgabe erzeugt werden Eine weitere Aufgabe kann erst angelegt werden wenn die letzte Aufgabe gespeichert wurde e Aufgabe speichern Die aktuell bearbeitete Aufgabe speichern e Aufgabe l schen Die aktuell angezeigte Aufgabe l schen e Punkte Angabe wie viele Punkte die Aufgabe wert ist e Versuche Angabe wie viele Versuche ein Benutzer f r diese Aufgabe hat e Vor Zur ck Anzeige der n chsten vorherigen Aufgabe e Abschlie en Speichern des Aufgabensets in eine Datei e Schlie en Schlie en der Toolbar Angezeigt werden au erdem die Anzahl der erzeugten Aufgaben sowie die erreichbare Gesamtpunktezahl 6 5 3 Aufgaben bearbeiten Ein Set an Aufgaben kann nach dem Speichern erneut bearbeitet werden Dazu ist der Eintrag Aufgaben bearbeiten auszuw hlen Nun kann eine gex Datei mit Aufgaben geladen werden Die weitere Funktionalit t ist analog zu der in b 6 5 4 Aufgaben durchf hren
133. nnection in the ButtonArea ICON_LINE_SELECTED public static final ImageIcon ICON _ LINE SELECTED Selected icon for creating a connection in the ButtonArea ICON_LOAD public static final ImageIcon ICON_LOAD Icon for loading a program state ICON_NOT public static final ImageIcon ICON_NOT Icon for NOT gate in the ButtonArea ICON_NOT_SELECTED public static final ImageIcon ICON_NOT_ SELECTED Selected icon for NOTin the ButtonArea ICON_OPERAND public static final ImageIcon ICON_OPERAND Icon for operands in the ButtonArea ICON_OPERAND_SELECTED public static final ImageIcon ICON_OPERAND SELECTED Selected icon for operands in the ButtonArea ICON_OR public static final ImageIcon ICON_OR Icon for OR gate in the ButtonArea 170 ICON_OR_SELECTED public static final ImageIcon ICON_OR_ SELECTED Selected icon for OR gate in the ButtonArea ICON_RANDOM public static final ImageIcon ICON_RANDOM Icon for creating a random Boolean function or logic circuit ICON_RANDOM_SMALL public static final ImageIcon ICON_RANDOM SMALL Icon for creating random truth values ICON_RANDOM_SMALL_ROLLOVER public static final ImageIcon ICON _RANDOM SMALL ROLLOVER Rollover icon for creating random truth values ICON_REMOVE public static final ImageIcon ICON_REMOVE Icon for removing a gate in the ButtonArea ICON_REMOVE_SELECTED public static final ImageIcon ICON _REMOVE_ SELECTED Selected icon for removing a gate inth
134. ntComponent Graphics g 103 Overrides paintComponent in class JComponent showConnectionPopup public void showConnectionPopup Node currentNode Shows a popup with options to modify the connection of the current node Parameters currentNode The Node to edit showComponentPopup public void showComponentPopup DrawableComponent dc Shows a popup with options to modify acomponent Parameters dc The DrawableComponent to modify showSelectionPopup public void showSelectionPopup Shows a popup to modify the current selection removePopup public void removePopup Removes the current popup 104 gui FileDialog java lang Object L gui FileDialog public class FileDialog extends Object Shows a dialog window for choosing a file Constructor Summary Page FileDialog 105 Method Summary Page static showExportDialog 105 File 3 r 7 r Ww In Shows a file chooser for exporting an image with file extension jpeg or jpg static showLoadDialog FileNameExtensionFilter filter 105 File 7 4 s m 2 Shows a file chooser for loading a file with a given file extension static showSaveDialog FileNameExtensionFilter filter 105 File m x x A a A Shows a file chooser for saving a file with a given file extension Constructor Detail FileDialog public FileDialog Method Detail showSaveDialog public static File showSaveDialog F
135. ntaining instructions what to do in this exercise 64 domain exercise IncorrectFunctionExercise java lang Object L domain xercise Exercis L domain exercise FunctionExercise L domain exercise IncorrectFunctionExercise All Implemented Interfaces Serializable public class IncorrectFunctionExercise extends FunctionExercise Exercise in that a user has to correct a given Boolean function so that it becomes equal to a given logic circuit The logic circuit the incorrect function and the found solution are stored in this class Field Summary Page static INSTRUCTION 65 mens The instruction what to do in this exercise Finde den Fehler in der Funktion Constructor Summary Page IncorrectFunctionExercise int attempts int points String function Graph 65 graph Constructs anew IncorrectFunctionExercise Method Summary Page String getFunction 66 Returns the Boolean function that has to be changed so that it becomes equal to the logic circuit String getInstruction 66 Returns the instruction for this exercise void setFunction String function 66 Sets the Boolean function that has to be changed so that it becomes equal to the logic circuit Field Detail INSTRUCTION public static final String INSTRUCTION The instruction what to do in this exercise Finde den Fehler in der Funktion Constructor Detail IncorrectFunctio
136. omposed of 1 to 5 terms each containing 1 or 2 operands and 0 or 1 operators Two terms are connected by an operator The chances for functions with x terms are e 1term 20 2 terms 50 3 terms 20 4 terms 6 e 5terms 4 Returned functions are unique They have not been generated yet and will never again be returned Returns Returns a new random function 161 service GridService java lang Object L service GridService public class GridService extends Object This service manages the grid displayed in the DrawingArea Resizes the grid to the specified width and height Constructor Summary Page GridService int griddist int inset 163 Constructs a new grid with a given griddist and insets GridService int width int height int griddist int inset 162 Constructs a new grid with given width height griddist and insets Method Summary Page int getGridDist 165 Getter for griddist Point getHalfHeightPoint Point start Point end 164 Returns the midpoint of a vertical line defined by two points Point getHalfWidthPoint Point start Point end 164 Returns the midpoint of a horizontal line defined by two points int getInset 165 Getter for insets Point getNextPoint DockingPoint dock 164 Returns a point next to a DockingPoint at that aGateConnection should start or end Point getNextPoint int x int y 163 Returns the point that is next to the
137. ould be saved to Saving is done in Controller setUserFunction public void setUserFunction String function Sets the user entered Boolean function to a given function Parameters function a Boolean function setGateFunction public void setGateFunction String function Sets the function equal to the logic circuit Parameters function A Boolean function equal to the logic circuit clearTextFields public void clearTextFields Clears all textfields clearGraphFunction public void clearGraphFunction Clears the graph function textfield showGraphAsFunction public void showGraphAsFunction Shows Boolean function equal to the current logic circuit userFunctionToGraph public void userFunctionToGraph Shows a logic circuit equal to the current user entered Boolean function generateFunction public String generateFunction Shows a randomly generated Boolean function Generation is done in Controller Returns A randomly generated Boolean function 112 compareFunctionAndGraph public void compareFunctionAndGraph Checks ifthe current logic circuit and the current user entered Boolean function are equal The result is displayed display public void display String text Displays a message in jtaText Parameters text Message to display showGeneratedGraph public void showGeneratedGraph Shows a randomly generated logic circuit Generation is done in Controller clearGraph publ
138. ox ausgew hlt so kann er mit einem Klick auf eine freie Stelle in der Zeichenebene zur Schaltung hinzugef gt werden Der Baustein bleibt danach weiterhin selektiert sodass zus tzliche Elemente desselben Typs durch weitere Klicks hinzugef gt werden k nnen Die Bausteine richten sich auf der Zeichenebene am sichtbaren Gitter automatisch so aus dass die linke obere Ecke jeweils genau ber einem Gitterknoten liegt Entfernen von Gatterbausteinen Gatterbausteine k nnen durch einen Rechtsklick auf das Gatter und anschlie ende Auswahl der Option Gatter entfernen gel scht werden Alternativ kann aus der Toolbox das Symbol zum Entfernen von Bausteinen ausgew hlt und auf das zu entfernende Gatter geklickt werden Beim L schen von Bausteinen werden alle Verbindungen zum Baustein entfernt Erzeugen von Verbindungen Verbindungslinien zwischen Gatterbausteinen k nnen mit dem Linien Symbol aus der Toolbox erzeugt werden Ist das Element ausgew hlt kann eine Verbindung durch Klicken auf die gew nschten Gatter erzeugt werden Um einen Ausgang zu selektieren muss in den rechten Bereich eines Gatters geklickt werden f r einen Eingang auf den linken Bereich Es ist nicht m glich zwei Ein oder Ausg nge miteinander zu verbinden Um das Zeichnen der Verbindung abzubrechen kann die Taste ESC gedr ckt werden Entfernen von Verbindungen Gatterverbindungen k nnen durch einen Rechtsklick auf die Verbindung und anschlie ende Auswahl der Option
139. ph Checks if a specified Graph is satisfiable Parameters graph Graph to check Returns True if the Graph is satisfiable False otherwise 175 service QualifyerS java lang Obj ervice ect L service QualifyerService public class extends Objec QualifyerService t Service that manages Qualifyers for the program All Qualifyers can be accessed as public class members QualifyerService cannot be instantiated Field Summary Page static Q AND 176 QualifyerG rn F gnali yertate Qualifyer representing AND gate static Q DELLINE 176 Lat Auttengualiiyer Qualifyer representing DELETE LINE action static Q LINE 177 ButtonQualif ae Auktengualtiyer Qualifyer representing CREATE LINE action static Q NAND 177 QualifyerG en uali yersate Qualifyer representing NAND gate static Q NOR 177 Q Lat G A r Aa Qualifyer representing NOR gate static Q NOT 177 Q LIE Gat e Qualifyer representing NOT gate static Q OR 177 Qualifyercate 7 5 zZ Qualifyer representing OR gate static Q REMOVE 177 B Qualif ms Zuttongual EYEE Qualifyer representing REMOVE action static Q XOR 177 Tir P gual i tyersate Qualifyer representing XOR gate Method Summary Page static BooleanQualifyer exchangeQualifyer BooleanQualifyer qualifyer 178 Exchanges a Qualifyer for an equal Qualify static getOperandQualifyers 177 ArrayList lt QualifyerOperand gt
140. ptszenario Der User w hlt Resultate anzeigen aus Aus einem eigenen Fenster w hlt er eine Datei aus in der Aufgaben und Resultate gespeichert sind die er anzeigen m chte Eine Toolbar zum Anzeigen der Resultate wird angezeigt Jede Aufgabe wird mit ihren Resultaten einzeln angezeigt Au erdem wird eine Gesamtstatistik angezeigt wie viele Aufgaben versucht und gel st und wie viele Punkte erreicht worden sind Fehlerszenario Tritt ein unvorhergesehener Fehler beim Lesen der Datei auf wird der User davon benachrichtigt Includes Aufgabe anzeigen lassen 25 Aufgabe anzeigen lassen Kurzbeschreibung Eine Aufgabe aus einem Set von Aufgaben wird angezeigt Scenarios Hauptszenario Eine Aufgabe wird angezeigt Dazu geh rt eine Gatterschaltung und oder eine Boolesche Funktion Au erdem wird ein Aufgabentext angezeigt der die jeweilige Aufgabe beschreibt Ist eine Aufgabe von einem User gel st worden so wird auch die dazu gespeicherte L sung oder der L sungsversuch angezeigt Trigger Aufgaben werden erstellt oder durchgef hrt oder Resultate angezeigt Vorbedingung Ein Set aus zumindest einer Aufgabe ist im Programm vorhanden Nachbedingung Die gew hlte Aufgabe wird angezeigt 23 4 Programmstruktur F r die grundlegende Struktur des Programms wurden drei g ngige Softwareentwurfsmuster verwendet das Data Access Object Muster DAO Pattern das Model View Controller Muster MVC Pattern
141. rawableComponent void setQualifyer BooleanQualifyer q 76 74 Field Detail height public int height The x coordinate of the DrawableComponent width public int width The x coordinate ofthe DrawableComponent x public int x The x coordinate of the DrawableComponent y public int y The x coordinate of the DrawableComponent Constructor Detail DrawableComponent public DrawableComponent BooleanQualifyer qualifyer int x int y int width int height Constructs a new DrawableComponent at the position x y Parameters qualifyer Defines the type of the DrawableComponent x The x coordinate of the DrawableComponent y The y coordinate of the DrawableComponent width The width of the DrawableComponent height The height of the DrawableComponent DrawableComponent public DrawableComponent BooleanQualifyer qualifyer Constructs a new DrawableComponent at the position 0 0 Parameters qualifyer Defines the type of the DrawableComponent 75 Method Detail initializeComponent protected void initializeComponent Initializes as many DockingPoints as this DrawableComponent needs and stores them in docks DockingPoints are placed on the component according to their and the components types copy public abstract DrawableComponent copy Deep copy method for DrawableComponents The new component has the same coordinates and the sam
142. rawingArea apart from GateConnections A DrawableComponent can be either an operand or and operator DrawableComponents provide DockingPoints for GateConnections to hook up Sets the Qualifyer of this DrawableComponent Field Summary Page int height 75 The x coordinate of the DrawableComponent int width 75 The x coordinate of the DrawableComponent int x 75 The x coordinate of the DrawableComponent int y 75 The x coordinate of the DrawableComponent Constructor Summary Page DrawableComponent BooleanQualifyer qualifyer 75 Constructs a new DrawableComponent at the position 0 0 DrawableComponent BooleanQualifyer qualifyer int x int y int width int 75 height Constructs a new DrawableComponent at the position x y Method Summary Page abstract DrawableComponent copy 76 Deep copy method for DrawableComponents HashMap lt DockType DockingPoint gt getDocks 77 Returns all DockingPoints this DrawableComponent provides BooleanQualifyer getQualifyer 76 Returns the Qualifyer of this DrawableComponent boolean hasOutgoingConnection 76 Returns True if aGateConnection is hooked into the Out DockingPoint of the DrawableComponent protected void initializeComponent 76 Initializes as many DockingPoints as this DrawableComponent needs and stores them in docks void setBounds int x int y int width int height 76 Sets the bounds of the D
143. rcise exists finishExerciseCreation public void finishExerciseCreation Lets user choose a file where the current Exercise should be stored in and tells the ExerciseService to save the Exercise ExerciseCreationMenuBar is closed afterwards evaluateExercise public void evaluateExercise Evaluates the current Exercise Evaluation is done in ExerciseService doExercises public void doExercises Loads a new set of Exercises for execution Exercises are loaded from a file that the user chooses and a new ExerciseService and ExerciseMenu are instantiated executeCurrentExercise public void executeCurrentExercise Starts execution of the current Exericse Enables or disables buttons fields and drawing according to the type of the Exercise showCorrectSolution public void showCorrectSolution Displays the correct solution for the current Exercise getDrawingArea public DrawingArea getDrawingArea Returns the DrawingArea of the GUI Returns The DrawingArea of the GUI getEnteredFunction public String getEnteredFunction Returns the Boolean function that the user has entered Returns The Boolean function that the user has entered 111 refreshValues public void refreshValues Refreshes the truth values of all operands to those that the user chose in the ButtonArea save public void save Shows a file dialogue to choose a file where the current state of the program sh
144. rgumentException Exception Saves the collection of Exercises that is managed by this service to a given file Writing is done in ExerciseDAO Parameters file File to that the Exercises should be saved Throws IllegalArgumentException If the file is null or invalid Exception If an exception occurs while writing the collection to the file finishExecution public void finishExecution throws FileNotFoundException Exception Saves the collection of Exercises that is managed by this class to its original file This method is only called at the end of an execution to store the results in the original file Writing is done in ExerciseDAO Throws FileNotFoundException If the original file does not exist anymore Exception If an exception occurs while writing the collection to the file giveUpCurrentExercise public void giveUpCurrentExercise GateDrawer gui Controller controller Gives up the current Exercise If the Exercise was not already done giveUp is set to true in this Exercise The correct solution of this Exercise is displayed Parameters gui The GUI to display the correct solution controller The controller to set the Graph for the solution 159 loadForExecution public void loadForExecution File file throws Exception Loads a collection of Exercises from a file for execution Uses load File file Parameters file Fil
145. ription copied from class DrawableComponent Deep copy method for DrawableComponents The new component has the same coordinates and the same number of DockingPoints Hooked GateConnections won t be copied Overrides copy in class DrawableComponent Returns A deep copy ofthe DrawableComponent setBounds public void setBounds int x int y int width int height Description copied from class DrawableComponent Sets the bounds of the DrawableComponent Overrides setBounds in class DrawableComponent Parameters x The new x coordinate of the DrawableComponent y The new y coordinate of the DrawableComponent width The new width of the DrawableComponent height The new height of the DrawableComponent 87 domain gui Node java lang Object L java awt geom Point2D L java awt Point L domain gui Node All Implemented Interfaces Serializable Cloneable public class Node extends Point An area attached to a GateConnection that can be used to edit it A Node can be dragged which drags the line as well It can be clicked right as well to show a context menu for the particular GateConnection Sets the line that this Node is attached to Constructor Summary Page Node int x int y int width int height 88 Constructs a new Node at a specified position and with a specified size Method Summary Page boolean contains int px int py 89 Returns True if this Node con
146. rnen 3 Gatter zur Gatterschaltung hinzuf gen Kurzbeschreibung Der User f gt ein Gatter zu einer bestehenden Gatterschaltung hinzu Scenarios Hauptszenario Der User w hlt ein Symbol f r ein Gatter aus und klickt in die Zeichenebene An dieser Stelle wird ein neues Gatter eingef gt Fehlerszenario Der User klickt auf ein anderes Gatter oder eine Verbindung In diesem Fall wird kein neues Gatter eingef gt Vorbedingung Es wurde keine Aktion ausgef hrt die zu einer Sperre der Zeichenebene f hrt Nachbedingung Eine eventuell bereits vorhandene Gatterschaltung sowie das neue Gatter werden angezeigt 4 Gatter aus Gatterschaltung entfernen Kurzbeschreibung Der User entfernt ein Gatter aus einer bestehenden Gatterschaltung Scenarios Hauptszenario Der User klickt rechts auf ein Gatter in einer Gatterschaltung oder auf eine bestehende Selektion und w hlt entfernen aus Alle markierten Gatter sowie ihre Verbindungen zu anderen Gattern werden gel scht Alternativszenario Alternativ kann der User die DEL Taste dr cken was zum selben Ergebnis f hrt Vorbedingung Es wurde keine Aktion ausgef hrt die zu einer Sperre der Zeichenebene f hrt Mindestens ein Gatter befindet sich in der Zeichenebene Nachbedingung Eine eventuell bereits vorhandene Gatterschaltung wird ohne das die entfernte n Gatter angezeigt 5 Verbindung zur Gatterschaltung hinzuf gen Kurzbeschreibung Der User f gt eine Verbindung zu
147. rogrammstand geladen werden soll Geladen werden eine Gatterschaltung sowie eine Boolesche Funktion Der alte Programmstand wird gel scht Alternativszenario Der User w hlt keine Datei aus oder bricht die Auswahl ab In diesem Fall wird kein Programmstand geladen Der alte Programmstand bleibt erhalten Fehlerszenario Tritt ein unvorhergesehener Fehler beim Lesen der Datei auf wird der User davon benachrichtigt Nachbedingung Der neue Programmstand wird angezeigt der alte ist gel scht 20 Gatterschaltung als Bild exportieren Kurzbeschreibung Der User l sst die aktuelle Gatterschaltung als Bild exportieren Scenarios Hauptszenario In einem eigenen Fenster w hlt der User eine Datei aus in welche das Bild gespeichert werden soll Ist die Datei noch nicht vorhanden wird sie vom Programm neu angelegt Das System generiert ein Bild aus der Gatterschaltung und speichert dieses in der Datei ab Alternativszenario Der User w hlt keine Datei aus oder bricht die Auswahl ab In diesem Fall wird kein Bild erzeugt und exportiert Fehlerszenario Tritt ein unvorhergesehener Fehler beim Schreiben der Datei auf wird der User davon benachrichtigt Fehlerszenario Es existiert keine Gatterschaltung die exportiert werden k nnte Dem User wird eine entsprechende Nachricht angezeigt und der Vorgang wird beendet Nachbedingung Die aktuelle Gatterschaltung wurde als Bild exportiert 21 Aufgaben erstellen Kurzbeschreibung Der Us
148. s Parameters gateHeight The Height of a gate in the DrawingArea grid The GridService object handling the grid that is currently used by the DrawingService 139 Method Detail mergeLines public void mergeLines ArrayList lt Line2D Double gt lines Checks a list of lines if two consecutive lines are on the same level have the same x coordinates and merges them if so Parameters lines A list of lines to check resizeConnectionEnd public void resizeConnectionEnd GateConnection connection Point end Moves the end of a GateConnection to the new Point end The connection is reshaped and broken into additional lines if necessary Parameters connection The GateConnection to resize end The new end point ofthe connection resizeConnectionStart public void resizeConnectionStart GateConnection connection Point start Moves the start of aGateConnection to the new Point start The connection is reshaped and broken into additional lines if necessary Parameters connection The GateConnection to resize start The new start point of the connection dragCurrentNode public void dragCurrentNode Node node 140 int mouseX int mouseY int oldMouseX int oldMouseY Drags the line of a given Node from old mouseposition to new mouseposition Important the node holds the line that is dragged If this very line is deleted during dragging the node is updated with a new line P
149. s a new DoExerciseMenuBar Parameters gateDrawer The parent GUI xerciseService The service containing the Exercises Method Detail actionPerformed public void actionPerformed ActionEvent e Handles action events on the menu bar All actions are performed in GateDrawer or ExerciseService Specified by actionPerformed in interface ActionListener 129 setToCurrentExercise public void setToCurrentExercise Description copied from class ExerciseMenuBar Exercise suchas points and attempts The current Exercise Displays information about the current is taken from ExerciseService Overrides setToCurrentExercise in class ExerciseMenuBar 130 gui menubar ExerciseMenuBar java lang Object java awt Component Le java awt Container Lz javax swing JComponent L javax swing JMenuBar L gui menubar ExerciseMenuBar All Implemented Interfaces Accessible MenuElement Serializable ImageObserver MenuContainer Direct Known Subclasses CreateExerciseMenuBar DoExerciseMenuBar ExerciseResultsMenuBar public abstract class ExerciseMenuBar extends JMenuBar A menu bar that provides options to create execute and edit or displays information about Exercises Constructor Summary Displays information about the current Exercise such as points and attempts Page ExerciseMenuBar 131 Constructs a new ExerciseMenuBar Me
150. service Method Detail deleteCurrentExercise public void deleteCurrentExercise Deletes the current Exercise If no Exercise exists no changes are made newExercise public void newExercise Inserts anew empty Exercise add th nd of exercises currentExercise is set to xercises size 1 If the last Exercise is empty no changes are made 155 saveExercise public void saveExercise String function int points int attempts Exercise with given function points and attempts See Creates and saves a new Graph save Exercis xercise for details on saving Parameters function The function of the GraphExercise points Points the Exercise is worth attempts Attempts a user may try this Exercise saveExercise public void saveExercise Graph graph int points int attempts Exercise with given graph points and attempts See Creates and saves a new Function Exercis xercise for details on saving Sav Parameters graph The graph of the FunctionExercise points Points the Exercise is worth attempts Attempts a user may try this Exercise savelncorrectFunctionExercise public void saveIncorrectFunctionExercise String function Graph graph int points int attempts Exercise with given graph function points and Creates and saves anew IncorrectFunction attempts See save Exercis xercise for
151. sowie das Transfer Object Muster DAOs wurden als Schnittstelle zum Dateisystem eingesetzt um Programmst nde und Aufgaben aus Dateien einzulesen oder in Dateien zu speichern Au erdem wurde ein DAO verwendet um Gatterschaltungen als Bilder zu exportieren Gatterschaltungen setzen sich im Programm zum einen aus Gattern und zum anderen aus Verbindungslinien zusammen Diese werden getrennt gespeichert und bearbeitet Um sie in einem einzelnen Schritt bertragen zu k nnen werden sie gemeinsam in ein Datentransferobjekt gespeichert Zur Kommunikation mit einem DAO wird ebenfalls ein Transferobjekt verwendet in dem zus tzlich zur Schaltung auch zu speichernde oder zu ladende Boolesche Funktionen enthalten sind Das MVC Pattern pr gt die Grobstruktur des Programmes Es ist unterteilt in GUI Klassen die der Interaktion mit dem Benutzer dienen Serviceklassen welche die Programmlogik enthalten sowie Domainobjekte welche die Daten ber Schaltungen und Aufgaben enthalten Die folgenden Klassendiagramme veranschaulichen die Verwendung von Entwurfsmustern im Programm Im Sinne einer besseren Lesbarkeit wurde auf jegliche Beschreibung der Klassen verzichtet 24 ImageService ExerciseService DrawingArea CU g 1 1 QualifyerService Controller 1 1 LogicService ConnectionService 1 FormulaServicek GridService Abb 2 Umsetzung des MVC Musters im Programm ExerciseService ExerciseDAO loads sa
152. ssage containing instructions what to do in this exercise 58 int getPointsReached Returns the number of points a user reached when he solved the exercise 57 getPointsWorth Returns the number of points this exercise is worth when solved correctly at the first attempt 57 void giveUp Sets givenUp to True 58 boolean isAccomplished Returns True if a user has already accomplished this exercise 58 boolean isGivenUp Returns True if the user gave up on this exercise 58 55 boolean isTried Defines if this exercise was already tried by a user 57 void setAccomplished boolean accomplished Sets accomplished to a given boolean value 58 void setAttemptsAllowed int attemptsAllowed Sets the number of attempts a user is allowed to make on this exercise 56 void setAttemptsNeeded int attemptsNeeded Sets the number of attempts a user already made on this exercise 57 void setPointsReached int pointsReached Sets the number of points a user reached when he solved the exercise 57 void setPointsWorth int pointsWorth Sets the number of points this exercise is worth when solved correctly at the first attempt 57 void setTried boolean tried Sets tried to a given boolean value 57 Constructor Detail Exercise public Exercise int attempts int points Constructs a
153. t ndlich die Korrektheit des Programms 2 9 Entwicklungsumgebung 2 9 1 Software und Tools e Windows 7 e JDK 6 e Eclipse 3 6 2 9 2 Hardware e Laptop mit aktueller Ausstattung und 1900x1080 Pixel Aufl sung 12 3 Anwendungsf lle 3 1 Anwendungsfalldiagramm Boolesche Formel auf Erf llbarkeit testen lassen Gatterschaltung generieren lassen GateDrawer Gatterschaltung auf Erf llbarkeit testen lassen Wertebelegung der Operanden festlegen Boolesche Formel als Boolesche Formel Gatterschaltung anzeigen generieren lassen lassen Gatterschaltung als Boolesche Formel anzeigen lassen Boolesche Formel eingeben Gatterschaltung und Boolesche Formel vergleichen Einen Programmstand aus einer Datei laden Gatterschaltung als Bild exportieren Gatterschaltung l schen Gatterschaltung zeichnen uses uses Gatterschaltung andern USES Verbindung aus Gatterschaltung entfernen Abb 1 Anwendungsfalldiagramm Wertebelegung der Operanden generieren lassen Stand des Programms abspeichern Aufgaben uses durchf hren Aufgabe anzeigen lassen Aufgabenresultate Aufgaben erstellen anzeigen Gatter zur Gatterschaltung hinzuf gen V7 Aufgaben bearbeiten Gatter aus Gatterschaltung entfernen Verbindung zur Gatterschaltung hinzuf gen 13 3 2 Anwendungsfallbeschreibungen 1 Gatterschaltung zeichnen Kurzbeschreibung Der User zeichnet eine neue Gattersc
154. t width The width of this DockingPoint x public int x The x coordinate of this DockingPoint y public int y The y coordinate of this DockingPoint 70 Constructor Detail DockingPoint public DockingPoint DockType type DrawableComponent parent Constructs a new DockingPoint Parameters type The DockType marking the position on an DrawableComponent parent The parent DrawableComponent that this point belongs to Method Detail getBounds public Rectangle getBounds Returns the bounds of this DockingPoint Returns The bounds of this DockingPoint as a Rectangle setBounds public void setBounds Rectangle r Sets the bounds of this DockingPoint Parameters r The bounds of this DockingPoint asa Rectangle getParent public DrawableComponent getParent Returns the parent DrawableComponent that this dock belongs to Returns The parent DrawableComponent that this dock belongs to getType public DockType getType Returns the type of this DockingPoint specifying its position on the parent DrawableComponent Returns The type of this DockingPoint specifying its position on the parent DrawableComponent addConnection public void addConnection GateConnection con Adds a GateConnection that hooks into this DockingPoint If this DockingPoints type is not Out all previous connections are deleted Parameters con The GateConnection that hooks into t
155. tains a given point GateConnection getConnection 90 Returns the GateConnection that this Node is attached to int getHeight 89 Returns the height of this Node Line2D Double getLine 89 Returns the line that this Node is attached to int getWidth 89 Returns the width of this Node void setConnection GateConnection connection 89 Sets the GateConnection that this Node is attached to void setLine Line2D Double line 89 Constructor Detail Node public Node int x int y int width int height Constructs anew Node at a specified position and with a specified size Parameters x The x coordinate of the Node y The y coordinate of the Node width The width of the Node height The height of the Node 88 Method Detail setLine public void setLine Line2D Double line Sets the line that this Node is attached to Parameters line Aline that this Node should be attached to getLine public Line2D Double getLine Returns the line that this Node is attached to Returns The line that this Node is attached to contains public boolean contains int px int py Returns True if this Node contains a given point Parameters px The x coordinate of the point py The y coordinate of the point Returns True if this Node contains a given point False otherwise getWidth public int getWidth Returns the width of this Node Returns The width of this Node getH
156. tatic ArrayList lt Exercise gt load File file throws IllegalArgumentException Exception Loads a list of Exercises from a given file Parameters file The file from that the data should be loaded Returns List of loaded Exercises Throws IllegalArgumentException If file is null Exception If any error occurs while reading the file 49 dao FileDAO java lang Object L dao FileDAO public class FileDAO extends Object DAO for file access Loads and saves program states contained by a SerializationContainer from or to files Bufferedimages are saved as jpeg files Saves a SerializationContainer toa given file Constructor Summary Page FileDAO 50 Method Summary Page static voidjexport File file BufferedImage image 50 Exports a BufferedImage as a jpeg file static load File file 51 ee Ze Loads a program state from a given file static void save File file SerializationContainer save 50 Constructor Detail FileDAO public FileDAO Method Detail Save public static void save File file SerializationContainer save throws IllegalArgumentException Exception Saves a SerializationContainer toa given file Parameters file The file where the data should be stored save The data to save Throws IllegalArgumentException If the file is null Exception If any error occurs while writing the
157. telIcon Icon of the gate that this qualifyer represents buttonIcon The icon of a button that is associated with this Boolean operator selectedButtonIcon The selected icon of a button that is associated with this Boolean operator Method Detail getGatelcon public Image getGatelcon Returns the icon of the gate that this qualifyer represents Returns The icon of the gate that this qualifyer represents setSymbol public void setSymbol ImageIcon symbol Sets the icon of the gate that this qualifyer represents Parameters symbol The icon of the gate that this qualifyer represents 96 domain qualifyers QualifyerOperand java lang Object L domain qualifvers layer L domain qualifyers BooleanQualifyer L domain qualifyers QualifyerOperand All Implemented Interfaces Serializable public class QualifyerOperand extends BooleanQualifyer Represents an operand in a Boolean function Defines the truth value of this Boolean operand for the whole program Constructor Summary Page QualifyerOperand char operand ImageIcon icon ImageIcon selectedButtonIcon 97 Constructs a new QualifyerOperand Method Summary Page boolean getValue 97 Returns the truth value of the operand that is represented by this qualifyer void setValue boolean v 97 Sets the truth value of the operand that is represented by this qualifyer Constructor Detail QualifyerOperand
158. tends Popup Shows a popup in DrawingArea to edit a selection Constructor Summary Edits the selection if the user chose an option Page SelectionPopup Controller controller 138 Constructs anew SelectionPopup Method Summary Page void actionPerformed ActionEvent e 138 Constructor Detail SelectionPopup public SelectionPopup Controller controller Constructs a new SelectionPopup Parameters controller The controller of this program Method Detail actionPerformed public void actionPerformed ActionEvent e Edits the selection if the user chose an option The popup is set invisible Specified by actionPerformed in interface ActionListener 138 Package service Class Summary Page ConnectionService This service class handles all calculation concerning lines in the drawingArea 139 Controller The controller class is the main controller for the whole project 140 g g This service class handles everything connected with the drawing of logic circuits DrawingService 146 represented by Graphs ExerciseService This service manages all operations concerning Exercises 153 FunctionService This service is used to generate random boolean functions 160 GridService This service manages the grid displayed in the DrawingArea 161 ImageService Manages all images used by the program 165 LogicService Service managing all
159. thod Summary Page abstract setToCurrentExercise 131 void Constructor Detail ExerciseMenuBar public ExerciseMenuBar Constructs a new ExerciseMenuBar Method Detail setToCurrentExercise public abstract void setToCurrentExercise Displays information about the current Exercise such as points and attempts The current Exercise is taken from ExerciseService 131 gui menubar ExerciseResultsMenuBar java lang Object L java awt Component Lava awe Container L javax swing JComponent L javax swing JMenuBar L _gui menubar ExerciseMenuBar L qgui menubar ExerciseResultsMenuBar All Implemented Interfaces ActionListener EventListener Accessible MenuElement Serializable ImageObserver MenuContainer public class ExerciseResultsMenuBar xtends ExerciseMenuBar implements ActionListener This menubar displays the results of an Exercise Constructor Summary Page ExerciseResultsMenuBar GateDrawer gui ExerciseServic xerciseService 132 Constructs a new ExerciseResultsMenuBar Method Summary Page void actionPerformed ActionEvent e 132 Handles ActionEvents from this menubars components void setToCurrentExercise 132 Updates the menubar to display information about the current Exercise Constructor Detail ExerciseResultsMenuBar public ExerciseResultsMenuB
160. ualifiedToggleButton A JToggleButton taking its data from a Qualifyer 117 gui ButtonArea java lang Object L java awt Component L java awt Container L javax swing JComponent L javax swing JPanel L gui ButtonArea All Implemented Interfaces ActionListener EventListener ItemListener Accessible Serializable ImageObserver MenuContainer public class ButtonArea extends JPanel implements ActionListener ItemListener The toolbox of the program providing symbols for the elements that can be drawn on the DrawingArea as well as buttons for different functions and actions that can be performed toolbox Enables or disables all buttons that have to do with the drawing of logic circuit in the Constructor Summary Page ButtonArea GateDrawer parent Controller controller 99 Constructs a new ButtonArea Method Summary Page void actionPerformed ActionEvent event 99 Handles action events when a button in the toolbox is clicked void itemStateChanged ItemEvent arg0 99 Updates the truth values of all operands after one of them has changed in the toolbox void refreshValues 99 Sets the truth value of all operands to those specified by the user in the toolbox void setButtonsEnabled boolean b 99 Enables or disables all buttons that have nothing to do with the drawing of logic circuit in the toolbox void setDrawingInputEnabled boolean b 99 98
161. ue if the user gave up on this exercise Returns True if the user gave up on this exercise False otherwise getInstruction public abstract String getInstruction Returns a message containing instructions what to do in this exercise Returns A message containing instructions what to do in this exercise 58 domain exercise ExerciseType java lang Object L java lang Enum lt ExerciseType gt L domain exercise ExerciseType All Implemented Interfaces Comparable lt ExerciseType gt Serializable public enum ExerciseType extends Enum lt ExerciseType gt The types of Exercises Enum Constant Summary Page DrawGates 59 Find a logic circuit equal to a given Boolean function FindFunction 59 Find a Boolean function equal to a given logic circuit IncorFunction 59 Change a given Boolean function so that it becomes equal to a given logic circuit IncorGraph 59 Change a given logic circuit so that is becomes equal to a given Boolean function Method Summary Page static valueOf String name 60 ExerciseType static values 60 ExerciseType Enum Constant Detail FindFunction public static final ExerciseType FindFunction Find a Boolean function equal to a given logic circuit IncorFunction public static final ExerciseType IncorFunction Change a given Boolean function so that it becomes equal to a given logic circuit IncorGraph
162. uit in a function or vice versa and deleting the function or a circuit Container for Boolean function and some buttons for the logic circuit GraphFunctionContainer _ 122 displayed in DrawingArea Contains a part of the GUI and surrounds it with a round edged colored RoundEdgeContainer 124 rectangle UserFunctionContainer 125 gui container FunctionContainer java lang Object Ls java awt Component L java awt Container L javax swing JComponent L javax swing JPanel L gui container FunctionContainer All Implemented Interfaces ActionListener EventListener Accessible Serializable ImageObserver MenuContainer Direct Known Subclasses GraphFunctionContainer UserFunctionContainer public abstract class FunctionContainer extends JPanel implements ActionListener A Container for 4 different GUI elements a textfield for in or output of Boolean functions three buttons for generating a random function or circuit convert a circuit in a function or vice versa and deleting the function or a circuit The exact functionality is defined in subclasses and a label for displaying the truth value of the function or circuit Field Summary gas protected buttonPanel 120 JPanel 4 Contains the buttons protected evalFont Font Font for 1bEval protected functionFont 120 Font Font for jt fFunction protected functionPanel 120 JPanel z Contains the textfield and the label
163. unction 174 Returns graphTree as a function string BoolTree graphToTree DrawableComponent root 174 Builds a BoolTree out of a Graph boolean isSatisfiable Graph graph 175 Checks if a specified Graph is satisfiable boolean isSatisfiable String function 175 Checks if a specified Boolean function is satisfiable void randomValues 175 Creates random truth values for all operands Constructor Detail LogicService public LogicService Method Detail functionToTree public BoolTree functionToTree String function Builds a BoolTree out of a boolean function Construction of the tree and analysis of function is done in BoolTree Parameters function Function to analyze Returns The BoolTree representing function 173 graphToTree public BoolTree graphToTree DrawableComponent root Builds a Bool Tree out of a Graph Uses graphToTreeRecursive to build the tree Parameters root The root DrawableComponent of the Graph to analyze Returns The BoolTree representing a Graph compare public boolean compare String function DrawableComponent rootGate Compares a given boolean function and a Graph Parameters function Boolean function to compare rootGate Root DrawableComponent of the Graph that is to be compared Returns True if function and Graph are equal getGraphFunction public String getGraphFunction Returns graphTree as a function string
164. ung kann als eine Boolesche Funktion dargestellt werden Dazu gen gt ein Klick auf das Pfeilsymbol im Bereich der Gatterlogik 6 4 5 Funktion als Gatterschaltung darstellen Das Programm kann aus einer Booleschen Funktion eine Gatterschaltung generieren Daf r gen gt ein Klick auf das Pfeilsymbol im Benutzerfeld 6 5 6 Zuf llige Funktion oder Gatterschaltung generieren Das Programm kann zuf llige Boolesche Funktionen oder Gatterschaltungen generieren Dazu dienen die mittleren Buttons im Benutzerbereich oder in der Gatterlogik Eine einmal generierte Funktion oder Schaltung wird im selben Programmdurchlauf nicht noch einmal erzeugt 6 5 7 Erf llbarkeit berpr fen Boolesche Funktionen oder Gatterschaltungen k nnen auf ihre Erf llbarkeit getestet werden Daf r stehen zwei Buttons in der Toolbox zur Verf gung Das Ergebnis wird in der Textausgabe angezeigt 6 5 Aufgaben Das Programm verf gt ber die M glichkeit ein Set an Aufgaben zu erzeugen diese durchzuf hren und die Resultate anzuzeigen Aufgaben werden in Dateien mit der Endung gex gespeichert Alle Aufgabenoperationen finden sich unter Aufgaben in der Men leiste 6 5 1 Arten von Aufgaben Folgende Aufgabentypen stehen zur Auswahl e Finde die Funktion Zu einer Gatterschaltung soll die quivalente Funktion eingegeben werden 33 e Korrigiere die Funktion Eine Funktion soll so abge ndert werden dass sie aquivalent zu einer gegebenen Gatterschaltu
165. universit t wien DIPLOMARBEIT Titel der Diplomarbeit Entwicklung eines Programmes zur Konstruktion logischer Schaltungen f r den Informatikunterricht Verfasser Markus Bauer angestrebter akademischer Grad Magister der Naturwissenschaft Mag rer nat Wien 2012 Studienkennzahl It Studienblatt A 190 412 884 Studienrichtung It Studienblatt UF Physik und UF Informatik und Informatikmanagement Betreuer Univ Prof Dr Wilfried Grossmann Abstract Im Rahmen der Diplomarbeit wurde eine Software erstellt die im Informatikunterricht zum Thema Boolesche Logik eingesetzt werden kann Die Zielgruppe f r das Programm sind Sch lerinnen und Sch ler der Schulstufen in denen Informatik unterrichtet wird also haupts chlich im Alter zwischen 14 und 18 Jahren Die Software erm glicht es Sch lerinnen und Sch lern das Erstellen von Gatterschaltungen zu ben Benutzer des Programms haben die M glichkeit Gatterschaltungen selbst zu zeichnen oder vom Programm nach einer eingegebenen Booleschen Funktion zeichnen zu lassen Boolesche Funktionen k nnen entweder per Hand in das Programm eingegeben oder vom Programm aus einer gezeichneten Gatterschaltung berechnet werden Boolesche Funktionen sowie Gatterschaltungen k nnen von der Software verglichen und f r verschiedene Belegungen der Eingangsvariablen verifiziert werden In Abgrenzung zu einem reinen Lernprogramm soll es diese Software explizit nicht erm glichen das
166. ves Abb 3 Umsetzung des DAO Musters im Programm 25 Das folgende Klassendiagramm zeigt die Datentransferobjekte die im Paket domain gui zusammengefasst sind Aus diesen Elementen setzt sich eine Gatterschaltung zusammen GateConnection start DockingPoint end DockingPoint lines ArrayList lt Line2D Double gt GateConnection start DockingPoint setEnd end DockingPoint containsPoint x double y double boolean lineContainsPoint line Line2D Double x double y double boolean getLine x int y int Line2D Double getNewNode x int y int image Image Node type DockType connections ArrayList lt GateConnection gt parent DrawableComponent negated boolean x int y int width int DockingPoint type DockType parent DrawableComponent setBounds r Rectangle getBounds Rectangle addConection con GateConnection changeNegation removeConnection con GateConnection contains point Point boolean Out int Gate qg QualifyerGate x int In2 y int width int height int Gate qg QualifyerGate GateNot ag QualifyerGate x int y int width int height int GateNot ag QualifyerGate copy GateNot line Line2D Double img Image connection GateConnection Node image Image x int y int getWidth int getHeight int contains mouseX int mousey int boolean DrawablesF acto DrawablesFactory newGat
167. vice extends Object implements ComponentListener This service class handles everything connected with the drawing of logic circuits represented by Graphs Some specific services are delegated to other services handling of GateConnections ConnectionService and handling of the grid GridService The service acts as a ComponentListener for the drawingArea and therefore handles the resizing of the grid Constructor Summary Page DrawingService GateDrawer gui Controller controller 148 Constructs a new DrawingService Method Summary Page void abortCurrentLine 149 Aborts drawing of the current GateConnection DrawableComponent addComponent BooleanQualifyer qualifyer int x int y 149 Adds a new DrawableComponent to the DrawingArea void clear 150 Removes all Gates and GateConnections from the DrawingArea void componentHidden ComponentEvent event 153 Component hidden event is ignored void componentMoved ComponentEvent event 153 Component moved event is ignored void componentResized ComponentEvent event 153 Handles component resized event void componentShown ComponentEvent event 153 Handles component shown event void deleteCurrentNodeLine 152 Deletes the GateConnection contained by the currentNode void deleteSelection 149 Deletes the current selection void dragCurrentComponent 150 Moves the currentComponent when us
168. width int height Creates a new Node ata line of this connection that is next to at a given point Parameters p Point next to that the Node should be created width The width of the Node height The height of the Node Returns A new Node ata line of this connection that is next to at a given point 83 domain gui GateNot java lang Object L domain gui DrawableComponent L domain gui Gate L domain gui GateNot All Implemented Interfaces Serializable public class GateNot extends Gate Represents a NOT sign in a logic circuit Fields inherited from class domain gui DrawableComponent height width x y Constructor Summary Page GateNot QualifyerGate qg 84 Constructs anew NOT element GateNot QualifyerGate qg int x int y int width int height 84 Constructs anew NOT element at a specified position and with a specified dimension Method Summary Page GateNot copy 85 Deep copy method for DrawableComponents void setBounds int x int y int width int height 85 Sets the bounds of the DrawableComponent Constructor Detail GateNot public GateNot QualifyerGate qg Constructs anew NOT element Parameters qg The Qualifyer defining the type of this component GateNot public GateNot QualifyerGate qg int x int y int width int height Constructs anew NOT element at a specified position and with a specified dimension Parameters qg
169. yerOperand is created Parameters c character of an operator or operand Returns Qualifyer that represents the char 177 getOperandQualifyers public static ArrayList lt QualifyerOperand gt getOperandQualifyers Getter for operands Collection is initialized before return if not already is Returns Collection of all QualifyerOperands used in this program getOperatorQualifyers public static ArrayList lt QualifyerGate gt getOperatorQualifyers Returns all Qualifyers that represent a logical operator apart from NOT Returns All Qualifyers that represent a logical operator apart from NOT exchangeQualifyer public static BooleanQualifyer exchangeQualifyer BooleanQualifyer qualifyer Exchanges a Qualifyer for an equal Qualify This is necessary when a Qualifyer is loaded froma file Parameters qualifyer Qualifyer to exchange Returns A Qualifyer equal to the passed one 178 Package utils Class Summary Page BoolTree A BoolTree saves the information about a Boolean function 179 SerializationContainer Transfer object used for serialization of the current state of the program 184 utils BoolTree java lang Object L utils BoolTree public class BoolTree extends Object A BoolTree saves the information about a Boolean function The information is saved in a tree structure and a couple of logical operations such as comparison with another Boolean function represent

Download Pdf Manuals

image

Related Search

Related Contents

Guide du Technicien    Télécharger  Exposure 3010s2    Edelbrock 352-428 Automobile Parts User Manual  Page 1 Applications Innovations essentielles de VWR Série de  QMI PAINT SEALANT SELLANTE DE PINTURA  Maxwell® CSC RNA Blood Kit  

Copyright © All rights reserved.
Failed to retrieve file