Professional Documents
Culture Documents
Drawing of 2-d Primitives
Drawing of 2-d Primitives
Drawing of 2-d Primitives
PRIMITIVES
Project
About DRDO
Technology Areas
ABOUT DRDO :
Responsible for the development of technology for use by the military. Design, develop and lead to production state-ofthe-art sensors, weapon systems, platforms and allied equipment for our Defence Services.
TECHNOLOGY AREAS :
Aeronautics Engineering
Materials
Missiles
Armaments
Life Science
Naval System
Combat Engineering
Electronics
Language Used
Graphics Object
Components Of Project
LANGUAGE USED :
C++
JAVA
Green Project James Gosling Oak 1992 green Project Spun Off 1994 Focus targeted to Web technology 1994 Oak renamed to JAVA 1995 - Java was first publicly released.
JAMES GOSLING
James Gosling is generally credited as the inventor of the Java programming language He was the first designer of Java and implemented its original compiler and virtual machine He is also known as the Father of Java
FEATURES OF JAVA :Simple Familiar Secure Portable Object-oriented Multithreaded Interpreted Distributed Dynamic
Line
Oval
Polygon
Rectangle
Arc
String
LINE:
Lines are drawn by means of the drawLine( ) method, shown here: void drawLine(int startX, int startY, int endX, int endY) drawLine( ) displays a line in the current drawing color that begins at startX, startY and ends at endX, endY.
RECTANGLE:
The drawRect( ) and fillRect( ) methods display an outlined and filled rectangle, respectively. They are shown here: void drawRect(int top, int left, int width, int height) void fillRect(int top, int left, int width, int height)
To draw an ellipse, use drawOval( ). To fill an ellipse, use fillOval( ). These methods are shown here: void drawOval(int top, int left, int width, int height) void fillOval(int top, int left, int width, int height)
ARC:
Arcs can be drawn with drawArc( ) and fillArc(), shown here: void drawArc(int top, int left, int width, int height, int startAngle, int sweepAngle) void fillArc(int top, int left, int width, int height, int startAngle, int sweepAngle)
POLYGON:
It is possible to draw arbitrarily shaped figures using drawPolygon( ) and fillPolygon( ), shown here:
COMPONENTS OF PROJECT:
Applet
Frame
Event Handling
APPLET
Applets are small applications that are accessed on an Internet server, transported over the Internet, automatically installed, and run as part of a Web document. Applets are used to provide interactive features to web applications that cannot be provided by HTML alone. They can capture mouse input and also have controls like buttons or check boxes. In response to the user action an applet can change the provided graphic content. This makes applets well suitable for demonstration, visualization and teaching.
FRAMES:
It is a subclass of Window and has a title bar, menu bar, borders, and resizing corners. Two of Frames constructors: Frame( ) Frame(String title)
EVENT HANDLING:
With event-driven programming, events are detected by a program and handled appropriately Events: moving the mouse clicking the button pressing a key sliding the scrollbar thumb choosing an item from a menu
Prepare to accept events import package java.awt.event Start listening for events include appropriate methods Respond to events implement appropriate abstract method
3. RESPOND TO EVENTS
The appropriate abstract methods are implemented. Example: actionPerformed() is automatically called whenever the user clicks the button. Thus, implement actionPerformed() to respond to the button event.