16.11.2013 Aufrufe

Programmieren in Java - HostFiXX.de

Programmieren in Java - HostFiXX.de

Programmieren in Java - HostFiXX.de

MEHR ANZEIGEN
WENIGER ANZEIGEN

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

<strong>Programmieren</strong> <strong>in</strong> <strong>Java</strong><br />

<strong>Java</strong>2D erweitert das H<strong>in</strong>zufügen von Objekten um sog. Kompostionsregeln<br />

(bekannt als Porter-Duff-Regeln). Neben <strong>de</strong>r Porter-Duff-Komposition, die e<strong>in</strong><br />

Source-Objekt mit <strong>de</strong>r gesamten Zeichenfläche verknüpft, gibt es noch die sog.<br />

CAG-Komposition (Constructive Area Geometry). CAG verknüpft jeweils 2 (CAG-)<br />

Objekte zu e<strong>in</strong>em neuen CAG-Objekt.<br />

4.3.5 Farbmanagement unter <strong>Java</strong> 2D<br />

Die Klasse Color mit <strong>de</strong>m Interface Pa<strong>in</strong>t<br />

E<strong>in</strong> Objekt <strong>de</strong>r Klasse Color stellt e<strong>in</strong>e Farbe im RGB-Farbschema dar. Color<br />

implementiert das neue Interface Pa<strong>in</strong>t (Zeichenfarbe).<br />

><br />

Pa<strong>in</strong>t<br />

public static Color black;<br />

public static Color blue;<br />

public static Color cyan;<br />

…<br />

public static Color white;<br />

public static Color yellow;<br />

Color GradientPa<strong>in</strong>t TexturePa<strong>in</strong>t<br />

><br />

public Color(float r, float g, float b)<br />

public Color(<strong>in</strong>t rgb)<br />

public Color(<strong>in</strong>t rgba,boolean hasalppha)<br />

public Color(<strong>in</strong>t r,<strong>in</strong>t g,<strong>in</strong>t b)<br />

public Color(<strong>in</strong>t r,<strong>in</strong>tg,<strong>in</strong>t b,<strong>in</strong>t a)<br />

><br />

public Color brighter()<br />

public Color darker()<br />

public boolean equals()<br />

public <strong>in</strong>t getAlpha()<br />

public <strong>in</strong>t getBlue()<br />

…<br />

public static Color getColor(Str<strong>in</strong>g nm)<br />

public static getHSBColor(float h,float s,<br />

float b)<br />

public <strong>in</strong>t getRGB()<br />

public <strong>in</strong>t getTransparency()<br />

public static <strong>in</strong>t HSBtoRGB(float hue,<br />

float saturation,float brightness)<br />

public static float RGBtoHSB(<strong>in</strong>t r,<strong>in</strong>t g,<strong>in</strong>t b,<br />

float[] hsbwerte)<br />

public Str<strong>in</strong>g toStr<strong>in</strong>g()<br />

301

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!