1 Editor Gráfico Alcides Calsavara. 2 Interface Forma Cor Desenho.

Slides:



Advertisements
Similar presentations
Light (or the ELECTROMAGNETIC SPECTRUM)
Advertisements

Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
Laboratory Study II October, Java Programming Assignment  Write a program to calculate and output the distance traveled by a car on a tank of.
PHY-102 SAPIntroductory GraphicsSlide 1 Introductory Graphics In this section we will learn how about how to draw graphics on the screen in Java:  Drawing.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
COLORING WITH NUMBERS. NumbersNumbers NumbersNumbers
© red ©
Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
Key For All Figures CYAN NODE = DBF ORANGE = PRO BROWN = Gov’t YELLOW = Pharma GRAY = VC WHITE = Other Triangle = New Entrant Circle = Incumbent Node size.
2D Graphics in Java COMP53 Nov 14, Applets and Applications Java applications are stand-alone programs – start execution with main() – runs in JVM.
A Simple Applet --- Digital Clock import java.awt.*; import java.util.Calendar; public class DigitalColok extends java.applet.Applet implements Runnable.
1 Classe Graphics Alcides Calsavara. 2 Uso com Applets u parâmetro do método paint –public void paint ( Graphics g ) u utilizado como base para o desenho.
COLOURS.
Graphics. Graphics Features in Java Topics to be covered Topics to be covered Graphics Basics Graphics Basics Coordinate System Coordinate System Graphics,
Agenda For Feb Finish up Unit 3 Exercises on page Unit 4 Exercises on page 33. Question #2 3. Create a Happy Face Java Applet (due next class).
CSE 219 Computer Science III Images. HW1 Has been posted on Blackboard Making a Game of Life with limited options.
Line Graphics Summary 1.drawLine(xStart, yStart, xEnd, yEnd); 2.drawRect(x, y, width, height); 3.drawRoundRect(x, y, width, height, cornerWidth, cornerHeight);
WHITE YELLOW GREEN BLUE RED PINK BLACK BROWN ORANGE.
10/5: Primitives, the for loop Primitive data types –why we mention them Return to counter-controlled repetition.
Kids S1 Vocabulary U1 Colors. Listen and say the color:
Chapter 7 Graphics. © Daly and Wrigley Objectives Use Graphic Components: ▫ Strings ▫ Lines ▫ Rectangles ▫ Ovals ▫ Arcs Change the color and font of elements.
Graphics & Java 2D Drawing Two Dimensional Shapes Controlling Fonts Controlling Colors.
Hello, I am Vincent. I am a painter. I like to draw.
Homework Assignment You are going to research any artist of your choosing from any time period or genre. You are going to complete a one page double- spaced.
If you say 8 color the ones in your picture purple. If you say 9 color the ones in your picture blue.
(C) 2010 Pearson Education, Inc. All rights reserved.  Class Graphics (from package java.awt) provides various methods for drawing text and shapes onto.
Color & Light Benjamin Hammel image by refeia
Colors of Pigment The primary colors of pigment are magenta, cyan, and yellow. [
R O Y G B V ellowreenrangelueiolet LONG SHORT ed low energy high energy.
Chapter 2: Graphics In Java Basics of classes –instance variables –methods –overriding methods Graphics class (drawing routines) Other classes –Color –Font.
2/25: the switch selection structure looking at Interest.java –NumberFormat –Locale –JTextArea –use of postincrement –Math.pow( rate, year ) switch.
10/4: the for loop & the switch structure Primitive data types –why we mention them Return to counter-controlled repetition.
Monkey, Monkey In the Tree. Monkey, monkey in the tree Throw the yellow coconut down to me!
GRAPHING RELATIONSHIPS For each graph, determine the graphing relationship and record it on a white board.
Introduction to Graphics. Graphical objects To draw pictures, we will use three classes of objects: –DrawingPanel : A window on the screen. –Graphics.
HSB to RGB to HEX.
Olga Vareli No!No! No!No! Yes!Yes! Black Olga Vareli.
COLORCOLOR. The Color Spectrum The spread of colors from white light when passed through a prism or diffraction grating. –Red, Orange, Yellow, Green,
 There are 3 primary colors of light RED, GREEN, & BLUE  When these colors of light are mixed… White Light is produced  This process is called color.
Java Applets Getting Started. Import Files In order to run the applet properly, we have to import some files into our class. These files are: –import.
Crazy colors By teacher john. Basic colors! White Black red blue Light green yellow orange purple Grey Light blue green.
Guess the colour Mix the colours Evaluation Group with work.
C o l o u r s Created by – Ganesh Satimeshram.
Safety Colors Quiz.
Red, socks, yellow, jacket, coat, orange, skirt, black, hat, green, blue, jeans, brown, T-shirt, shoes, white, pink.
Watch Pete the Cat here:
Casual Cotton Salwar Material Collection
LIGHT & COLOR.
Colors/Color Words.
Like.
Name: _______________________________
Colour Theories.
Average Number of Photons
CSE 113 A January 26 – 30, 2009.
Two ways to discuss color 1) Addition 2) Subtraction
Can I color yellow?. Can I color yellow?
Safety Colors Quiz.
Colors/Color Words.
I see colors..
What Color is it?.
©
January 26 – 30, 2009 CSE 113 B.
C c Cc is for cat. © ©
©
Created for CVCA Physics by Dick Heckathorn 31 May 2K+4
Created By Dick Heckathorn 25 June 2K+3
Created for CVCA Physics by Dick Heckathorn 31 May 2K+4
Let’s Learn the Basic Colors
Presentation transcript:

1 Editor Gráfico Alcides Calsavara

2 Interface Forma Cor Desenho

3 Hierarquia de classes Figura Poligono RetanguloTriangulo Circulo Segmento De Reta Forma Arco

4 Uso da classe Graphics formamétodo RetangulofillRect TriangulofillPolygon CirculofillOval ArcodrawArc Segmento de RetadrawLine

5 Exemplo de exibição class Retangulo extends Poligono {... public void exibe ( Graphics g ) { g.setColor ( cor ); g.fillRect ( x, y, largura, altura ); }... }

6 Aplicação de polimorfismo public class Editor extends Applet { private Forma [ ] objeto; private int n; // número de objetos... public void paint ( Graphics g ) {... for ( int i = 0 ; i < n ; i++ ) objeto[i].exibe ( g ); }

7 Implementação do método exibe alternativa 1: método abstrato abstract class Forma { private Color cor ; private int x ; private int y ;... abstract public void exibe ( Graphics g ) ; } class Retangulo extends Poligono {... public void exibe ( Graphics g ) { g.setColor ( cor ); g.fillRect ( x, y, largura, altura ); }

8 Implementação do método exibe alternativa 2: métodos encadeados abstract class Forma { private Color cor ; private int x ; private int y ;... public void exibe ( Graphics g ) { g.setColor ( cor ) ;... } } class Retangulo extends Poligono {... public void exibe ( Graphics g ) { super.exibe ( g ) ; g.fillRect ( x, y, largura, altura ) ; }

9 Cores pré-definidas na classe Color black blue cyan darkGray gray green lightGray magenta orange pink red white yellow Color cor; cor = Color.orange; cor = Color.red; abstract class Forma { private Color cor ;... public Forma ( Color c,... ) { cor = c;... }... }