Object Oriented Programming (OOP) Mini Project

151 downloads 6301 Views 309KB Size Report
May 27, 2016 - The source code of the mini project should cover next OOP topics: ... source code with JavaDoc comments, generate HTML documentation and.
Object Oriented Programming (OOP) Mini Project (max 15 marks - 15% from overall) GUIDELINES FOR THE MINI PROJECT i.

This mini project can be developed individually or in a team, containing maximum THREE students.

ii. The source code of the mini project should cover next OOP topics:  definition of classes and objects  using overloaded constructors  inheritance and methods overriding  polymorphism  event handling (from mouse and keyboard)  exception handling  using Java graphical libs for visual representation of the class  development of a window (frame) based graphical user interface iii. Document your source code with JavaDoc comments, generate HTML documentation and develop a short power point presentation (8-12 slides). iv. Everybody should participate in the code development and give answers on questions during presentation. v. Softcopy of your source code and report must be submitted to Kalam and presented to your lecturer on week 14 (23th – 27th May 2016). vi. Choose ONE task from the lists below (Programming charts and diagrams or Development visual components). Please coordinate yourself in order to reserve a unique per session task (hint, create a group in FB). vii. Please discuss with your lecturer, if you have any questions. Instructions. Solving a problem to be done using object-oriented approach. Each project to be developed by creating several classes that have properties and methods. Please allocate a basic class (classes) and use it for inheritance. E.g. a visual component inherits a basic class, which has such the properties as position, size, colour, etc., as well as methods to display it on the screen, hide, move, resize, etc. The class you are developing, will inherit the properties and methods of the basic class and complements them by own specific properties and methods. Your class should handle events form mouse and keyboard. Event handlers of mouse and keyboard should call the appropriate methods of the class. For example, a class may have the method Scale(); used to repaint an object if a user change it size. Geometrical classes may implement specific methods like Move(); Rotate(); and others. Give to a user a possibility to change properties of objects of your class through the graphical interface. GUI should be implemented with graphical libs of Java. An interface with objects of your class can be implemented by using standard visual Java components - toolbars, status bars, main and context menus, etc. Programming charts and diagrams All charts and diagrams should be aesthetically designed, have explanatory captions that contain corresponding numerical values (please have a look on chart and diagrams of MS Excel for inspiration). If a user creates several charts (instances of the class), they should be shown in a different colour and style. Entering numerical data for charts and diagrams to be done by using dialogs, tables, setting mathematical formulas or random distributions of numbers.

1. Develop a class TGraph that builds a functional dependence (graph) of certain numerical data. The interface should provide the possibility to change colour and style of a graph. 2. Develop a class TPointGraph that builds a dot (point-by-point) graph by specific numeric data. The interface should provide the possibility to change markers (dots) of the graph. 3. Develop a class THistogram that builds a bar chart (histogram). The height of each bar is proportional to some entered by a user numerical value. 4. Develop a class TBarHistogram that allows building a chart, which consists of a single bar, split into rectangles, the lengths of which are proportional to user’s specified numerical values. 5. Develop a class TSector, which shows a pie chart as a circle, split into sectors, proportional to the entered by user numerical values. Use different colours and fill styles. Develop labels to chart sectors, which should show corresponding numerical values. 6. Develop a class TCircle to show a “doughnut” chart – a ring, split into sectors, proportional to the entered by user numerical values. Use different colours and fill styles. Develop captions to the chart sectors, which should show corresponding numerical values. 7. Develop a class TBubble that builds the bubble chart – a few circles, which radiuses are proportional to the entered by a user numerical values. Use different colours and fill styles. Develop captions for the circles, which should show corresponding numerical values. 8. Develop a class TPetal that builds a “radar” chart, where the data values are given on several radial lines started from a single point. Develop captions for these lines, which should show corresponding numerical values. 9. Develop a class TArrow that allows users to visualize a module and a direction of a vector. Visually, a vector is shown as an arrow. 10. Develop a class TCylinder that allows you to build a cylindrical chart – several cylinders, whose heights (or radiuses) are proportional to the entered numerical values. Use different colours and fill styles. Develop captions to the cylinders that show corresponding numerical values. 11. Develop a class TCone that allows you to build a conical chart – a few cones, which heights are proportional to the entered numerical values. Use different colours and fill styles. Develop labels to the cones, which show corresponding numerical values. 12. Develop a class TPyramid that allows you to build a pyramidal chart; the heights of pyramids are proportional to the entered by user numerical values. Use different colours and fill styles. Make labels to the chart, which show corresponding numerical values. 13. Develop a class TColorGraph. An intensity of the grey colour of a screen pixel is proportional to a given function from the screen coordinates x and y (such type of the chart is useful for physical simulation; e.g. in such a way an intensity of distribution of an amplitude of a wave can be modelled). 14. Develop a class TGraph, intended for plotting trigonometric functions like sin, cos, and tg. Methods of TGraph should allow changing the location of the graph, its range, domain and scale. 15. Develop a class TGraph3d that builds three-dimensional graph of a function, e.g. z (x, y) = 100(cos (x y) + x sin (y). For it, build dependency z (x, y) at changing value of x and a constant value of y, then slightly shift the origin down and to the left, increase value of y, and build the dependency again. By repeating this procedure, you will gradually build 3D chart of the function z(x, y).

Development visual components Every task from the list below is the development of your own version of a Java visual component (widget). 16. Develop a simple version of a main menu TMainMenu. 17. Develop a simple context menu TPopupMenu. 18. Develop a simple text label component TLabel. 19. Develop a simple one-line component for text editing TEdit. 20. Develop a simple multiline text editor TMemo. 21. Develop a simple button component with a label TButton. 22. Develop a simple button component with an image TImageButton. 23. Develop a simple toggle button TCheckBox. 24. Develop a simple radio button TRadioButton. 25. Develop a simple component TListBox, which displays the list of strings. 26. Develop a simple table component TStringTable to represent a spreadsheet. 27. Develop a simple component TImage to display a picture. 28. Develop a simple component TShape, which allows you to show and manipulate by geometrical shapes (e.g. circle, bar, triangle). 29. Develop a simple status bar component TStatusBar. 30. Develop a simple toolbar component TToolBar. 31. Develop a simple class TScrollBox to scroll components of a window (frame).

32. Develop a simple component TCalendar to work with dates. 33. Develop a simple component TWatch to work with time. 34. Develop a simple component TCalculator, allowing a user to compute arithmetical operations.