You are on page 1of 5

INSTITUTO TECNOLÓGICO DE ESTUDIOS SUPERIORES DE LOS CABOS

NOMBRE DEL FORMATO: Practicas de laboratorio RESPONSABLE: Dirección académica y de investigación CÓDIGO: F-DA- 01-003 HOJA: 1 de 5 REVISIÓN: 4

Desarrollo de la Práctica
Unidad de aprendizaje: Graficación 2D Nombre de la practica: Aplicaciones graficas 2D Propósito: Que conozca y aprenda a utilizar las librerías 2D de Java Escenario: Centro de Computo Duración: 2 Semanas Practica número: 1

Materiales

Maquinaria y equipo

Herramientas

-

- Lapiz, Pluma Libros, Manuales

-

Computadora

-

Linux / Windows Server

intersects. Whenever you move the mouse. or is outside of the rectangle. Display a circle. or outside?) Write a program that displays a rectangle with upper-left corner point at (40. intersects. The circle’s upper-left corner of the bounding rectangle is at the mouse point. pressing the up/down arrow key increases/decreases the circle radius by 5 pixels by. (ce) Exercise 2 detects whether a circle contains. Enter the values in the text fields x and y and press the Translate button to translate the rectangle to a new location. 3 (Translation) Write a program that displays a rectangle with upper-left corner point at (40. as shown in Figure 49.INSTITUTO TECNOLÓGICO DE ESTUDIOS SUPERIORES DE LOS CABOS NOMBRE DEL FORMATO: Practicas de laboratorio RESPONSABLE: Dirección académica y de investigación CÓDIGO: F-DA. width 100. 40). and height 40. 2 (Contains. 20). 40).01003 HOJA: 2 de 5 REVISIÓN: 4 Procedimiento El alumno desarrollará los siguientes problemas en 2D utilizando Java FX y Swing: 1 (Inside a rectangle?) Write a program that displays a rectangle with upper-left corner point at (20. display a message indicating whether the mouse point is inside the rectangle. and height 60.28a. as shown in Figure 49. or is outside a rectangle. as shown in Figure 49.27a–b. width 40. width 50. and height 100. (a-b) Exercise 1 detects whether a point is inside a rectangle. .27ce. Display a message at the mouse point to indicate whether the circle contains. intersects.

as shown in Figure 49. The center of the ellipse is at (0. (b) Exercise 4 rotates coordinates. as shown in Figure 49. .28b. 7 (Characters around circle) Write a program that displays a string around the circle. (a) Exercise 6 displays strings vertically.01003 HOJA: 3 de 5 REVISIÓN: 4 (a) Exercise 3 translates coordinates.29c. (c) Exercise 8 displays a sine function. The center of the ellipse is at (0. as shown in Figure 49. 5 (Scale graphics) Write a program that displays an ellipse. 4 (Rotation) Write a program that displays an ellipse. 0) with width 60 and height 40. Enter the value in the text field Angle and press the Rotate button to rotate the ellipse to a new location. 50). 8 (Plot the sine function) Write a program that plots the sine function. (b) Exercise 7 displays characters around the circle.29b. Enter the scaling factors in the text fields and press the Scale button to scale the ellipse. 0) with width 60 and height 40. Use the translate method to move the origin to (150.28c. (c) Exercise 5 scales coordinates. as shown in Figure 49.INSTITUTO TECNOLÓGICO DE ESTUDIOS SUPERIORES DE LOS CABOS NOMBRE DEL FORMATO: Practicas de laboratorio RESPONSABLE: Dirección académica y de investigación CÓDIGO: F-DA.29a. 70). Use the translate method to move the origin to (100. as shown in Figure 49. 6 (Vertical strings) Write a program that displays three strings vertically.

Use dashed strokes to draw the dashed arc.31c.01003 HOJA: 4 de 5 REVISIÓN: 4 9 (Plot the log function) Write a program that plots the log function. as shown in Figure 49. n.30a. (a) Exercise 9 displays the log function. nlogn. and n2 functions) Write a program that plots the log. .INSTITUTO TECNOLÓGICO DE ESTUDIOS SUPERIORES DE LOS CABOS NOMBRE DEL FORMATO: Practicas de laboratorio RESPONSABLE: Dirección académica y de investigación CÓDIGO: F-DA. 10 (Plot the n2 function) Write a program that plots the n2 function.31b. (a) Exercise 11 displays several functions. 12 (Sunshine) Write a program that displays a circle filled with a gradient color to animate a sun and display light rays coming out from the sun using dashed lines. n. 13 (Display a cylinder) Write a program that displays a cylinder. 11 (Plot the log.31a. (c) Exercise 13 displays a cylinder. (b) Exercise 10 displays the n2 function. nlogn.30b. as shown in Figure 49. and n2 functions. as shown in Figure 49. as shown in Figure 49. as shown in Figure 49. (b) Exercise 12 displays the sunshine.

and (50.32c. (200. 80). (b) Exercise 15 displays symmetric difference of two areas.32(b). 110). 17 (Geometry: strategic point of a polygon) Write a program to enable the user to drag and move the vertices and the program dynamically redisplay the polygon and its strategic point. .32a. as shown in Figure 49. 100). (c) Exercise 16 displays two eyes. 20). as shown in Figure 49. (a) Exercise 14 displays a filled cylinder.INSTITUTO TECNOLÓGICO DE ESTUDIOS SUPERIORES DE LOS CABOS NOMBRE DEL FORMATO: Practicas de laboratorio RESPONSABLE: Dirección académica y de investigación CÓDIGO: F-DA. Draw the areas and fill the symmetric difference of the areas. 25).key to increase/decrease the size and press the RIGHT/LEFT arrow key to rotate left or right. The program can scale and rotate the painting. 15 (Area geometry) Write a program that creates two areas: a circle and a path consisting of two cubic curves. (170. The user can press the CTRL and +/. (100. as shown in Figure 49.01003 HOJA: 5 de 5 REVISIÓN: 4 14 (Filled cylinder) Write a program that displays a filled cylinder. 16 (Eyes) Write a program that displays two eyes in an oval. Assume the five points of the polygon are initially located at (25. as shown in Figure 49.33. 18 (Scale and rotate graphics) Write an program that enables the user to scale and rotate the STOP sign.