java 数据库 r n_讲解:Database|R|SQL|Java
講解:Database|R|SQL|JavaCOMP2396 Object-oriented programming and JavaAssignment 5: GUIDue date: 15 Apr, 2020 23:59IntroductionThis assignment tests about the Java GUI knowledge. You are asked to write a graphics objecteditor program to complete 3 tasks.With the program, users can draw line, circle, triangle and quadrilateral. The created graphics canbe selected, then user can move, copy, delete, randomly color the graphics object.You need to write JavaDoc for all non-private classes and non-private class members.Here is the detail of 3 tasks:Task 1: DrawObjectEditorCreate the java file DrawObjectEditor.java as follow:You need to create graphics objects with the following classes in Java AWT:java.awt.geom.Line2Djava.awt.geom.Ellipse2Djava.awt.PolygonYou also have to handle mouse events using MouseMotionListener and/or MouseListener.You can use the contains() method defined in classes Line2D, Ellipse2D and Polygon to check ifthe mouse’s position is contained inside the graphics object boundary.import java.awt.*;import javax.swing.JFrame;public class DrawObjectEditor extend JFrame{}The DrawObjectEditor is started with a grey background color editor panel of size 400 x 450 asfollow:You are not required to follow exactly the same position of the JButton objects as in the abovefigure, but should look similar to it.Task 2: Object Creation FunctionWhen the Line button, the Circle button, the Triangle button or the Quadrilateral button is pressed,the user can create the object in the editor panel and the color of the corresponding button willchange to grey and not clickable before the object is created:To draw a line, the user clicks the starting point. The starting point then displays a dot. The userthen clicks the end point and the line will be drawn:Starting Point (x1, y1)Ending Point (x2, y2)To draw a circle, the user clicks the center of the circle. The center displays a dot. The user thenclicks the radius to draw a circle:Center (x1, y1)Radius (x2, y2)To draw a triangle, the user clicks the top corner point, bottom left corner point and then thebottom right corner as follow:Top left corner (x1, y1)Bottom right corner (x3, y3)Bottom left corner (x2, y2)To draw a Quadrilateral, the user clicks the top left corner point, bottom 代寫Database|代寫R語言程序|代做數據庫SQL|幫做Java程序left corner point, thebottom right corner and then the top right corner point as follow:NOTE: You can assume that all objects created by the user will NOT overlapping with each other.Top left corner (x1, y1)Bottom right corner (x3, y3)Bottom left corner (x2, y2)Top right corner (x4, y4)Task 3: Select, Move, Delete, Copy and Random Color function1. When the user presses the Select button, the user can select an object in the editor panel byclicking the area within the object. The Select button color will change to grey and not clickablebefore an object has been selected.2. When an object has been selected, the color of the selected object border will change to green.The user can then perform operations such as move or delete. The operation buttons [Move,Delete, Copy, Random Color] should become clickable.3. When an object has been selected, the user can press the Move button to move the object bypress and release.4. When an object has been selected, user can click the Delete button to delete the selected objectin the editor panel.5. When an object has been selected, the user can press the Copy button to copy the selectedobject. Your program should display the copied object near the original object (No strictrequirement for the position of it, just don’t make it too far away). The copied object shouldjust like other objects, and can be selected, moved, deleted, copied and colored.6. When an object has been selected, user can click the Random Color button to fill thegeometric object with random color. The colored object should just like other objects, and canbe selected, moved, deleted, copied and re-colored.Submission? Please submit your files to Moodle.? Make sure you have submitted .java files but not .class files.? You may create additional classes to complete the tasks.? Late submission is not allowed.Grading? 95% marks are given to the functionality of your program.5% --- GUI90% (10% for each function):1.Draw Line / 2.Draw Circle / 3.Draw Triangle / 4.Draw Quadrilateral / 5.Selectfunction / 6.Move function / 7.Delete function / 8.Copy function / 9.Random Colorfunction? 5% marks are given to your JavaDoc.A complete JavaDoc includes documentation of every classes, member fields and methods that arenot private.轉自:http://www.6daixie.com/contents/9/5074.html
總結
以上是生活随笔為你收集整理的java 数据库 r n_讲解:Database|R|SQL|Java的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: cad在线转低版本_【设计专业干货】史上
- 下一篇: 学习笔记:Windows 下Keras安