Aufgabe 6
Download easy-painter.0.0.3.jar
Aufgabe 6.a
java.lang.Math
java.lang.String
java.util.Collections
java.util.ArrayList
java.util.Arrays
java.awt.Color
java.awt.Dimension
java.awt.Graphics
java.util.Scanner
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | package de.bht.programming1.exercise06; import java.awt.*; import java.util.ArrayList; import java.util.Scanner; public class SimpleClassInspection { public static void main(String[] args) { // java.lang.Math // private constructor, public methods String s = new String("beliebige Zeichenkette"); // java.util.Collections // abstract class ArrayList<Integer> list = new ArrayList<Integer>(); // java.util.Arrays // private constructor, public methods Color c = new Color(0xff0000); // color red Dimension rectangle = new Dimension(10, 10); // java.awt.Graphics // abstract class Scanner sin = new Scanner("Text"); } } |
Aufgabe 6.b
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | /** * Draws a line, using the current color, between the points * <code>(x1, y1)</code> and <code>(x2, y2) * in this graphics context's coordinate system. * @param x1 the first point's <i>x</i> coordinate. * @param y1 the first point's <i>y</i> coordinate. * @param x2 the second point's <i>x</i> coordinate. * @param y2 the second point's <i>y</i> coordinate. */ public abstract void drawLine(int x1, int y1, int x2, int y2); /** * Draws the text given by the specified string, using this * graphics context's current font and color. The baseline of the * leftmost character is at position (<i>x</i>, <i>y</i>) in this * graphics context's coordinate system. * @param str the string to be drawn. * @param x the <i>x</i> coordinate. * @param y the <i>y</i> coordinate. * @throws NullPointerException if <code>str</code> is <code>null</code>. * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawChars */ public abstract void drawString(String str, int x, int y); /** * Sets this graphics context's current color to the specified * color. All subsequent graphics operations using this graphics * context use this specified color. * @param c the new rendering color. * @see java.awt.Color * @see java.awt.Graphics#getColor */ public abstract void setColor(Color c); /** * Fills an oval bounded by the specified rectangle with the * current color. * @param x the <i>x</i> coordinate of the upper left corner * of the oval to be filled. * @param y the <i>y</i> coordinate of the upper left corner * of the oval to be filled. * @param width the width of the oval to be filled. * @param height the height of the oval to be filled. * @see java.awt.Graphics#drawOval */ public abstract void fillOval(int x, int y, int width, int height); |
Aufgabe 6.b
1 2 3 4 5 6 7 8 9 10 | package de.bht.programming1.exercise06; import pr1.easy.painter.v03.Painter; public class Test { public static void main(String[] args) { Painter.main(null); } } |
Aufgabe 6.c Framework missing.
Leave a Reply