drawables
Class DrawableText

java.lang.Object
  |
  +--drawables.Drawable
        |
        +--drawables.DrawableText
All Implemented Interfaces:
EntryReadable, java.io.Serializable

public class DrawableText
extends Drawable

Class for drawable texts.

See Also:
Serialized Form

Field Summary
static int BASELINE
          vertikale Ausrichtung an der Basislinie.
static int BOLD
          fetter Text-Stil.
static int BOLDITALIC
          fett kursiver Text-Stil.
static int CENTER
          mittige horizontale Ausrichtung.
static int CENTERLINE
          mittige vertikale Ausrichtung.
static int ITALIC
          kursiver Text-Stil.
static int LEFT
          linksbündige horizontale Ausrichtung.
static int MAXSIZE
          maximale Textgröße in Punkt.
static int MINSIZE
          minimale Textgröße in Punkt.
static int NORMAL
          normaler Text-Stil.
static int RIGHT
          rechtsbündige horizontale Ausrichtung.
static int TOPLINE
          vertikale Ausrichtung am Oberrand.
 
Fields inherited from class drawables.Drawable
AREALAYER, BITMAPLAYER, container, DEFMAXSCALE, DEFMINSCALE, layer, LINELAYER, maxScale, mbr, minScale, nextOfLayer, obj, POINTLAYER, pres, selected, TEXTLAYER
 
Constructor Summary
protected DrawableText()
          Konstruktor.
  DrawableText(int px, int py, java.lang.String s)
          Konstruktor.
  DrawableText(int x, int y, java.lang.String s, java.lang.String presName, int h, int v)
          Konstruktor.
  DrawableText(int x, int y, java.lang.String s, java.lang.String presName, int h, int v, int pMinScale, int pMaxScale)
          Konstruktor.
 
Method Summary
static java.lang.String correctString(java.lang.String input)
          Korrigiert eingelesenen String.
protected  void drawProtected(java.awt.Graphics g, int scale, int mode, int value)
          Zeichnet den Text im Graphic Context g, vorausgesetzt der aktuelle Maßstab wird eingehalten.
 java.lang.String getOrigString()
          Gibt originalen Text zurück.
 java.lang.String getString()
          Gibt den Text in ANSI- bzw.
 boolean interacts(int px, int py, int scale)
          Tests whether the primitive is selected by a given point or not.
static boolean isUnicodeUsed()
          Gibt zurück, ob die Ausgabe in Unicode oder ANSI erfolgen soll.
 EntryReadable read(EntryInput r)
          Liest den Text vom Entry-Input ein.
static java.awt.Font setFont(java.awt.Graphics g, int style, int size)
          Setzt den gewünschten Font im Graphik-Kontext.
 void setText(java.lang.String text)
          Sets the text attribute of the drawable text.
static void setUnicode(boolean u)
          Setzt, ob die Ausgabe in Unicode oder ANSI erfolgen soll.
protected static java.lang.String toOutputString(java.lang.String in)
          Konvertiert den Eingabe-String in Abhängigkeit vom akt.
protected  void writeProtected(EntryWriter out, int type)
          Writes the text.
 
Methods inherited from class drawables.Drawable
computeDistance, computeDistanceTo, contains, draw, draw, draw, draw, getContainer, getId, getLayer, getMaxScale, getMBR, getMinScale, getNextOfLayer, getObject, getPresentation, getPresentation, getType, intersects, intersects, intersects, isContainedBy, isVisible, readCoord, readCoord, readDrawable, readDrawable, setContainer, setLayer, setMaxScale, setMBR, setMinScale, setNextOfLayer, setObject, setPresentation, setSelection, toString, write, writeCoord, writeCoord, writeGML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
normaler Text-Stil.

See Also:
Constant Field Values

BOLD

public static final int BOLD
fetter Text-Stil.

See Also:
Constant Field Values

ITALIC

public static final int ITALIC
kursiver Text-Stil.

See Also:
Constant Field Values

BOLDITALIC

public static final int BOLDITALIC
fett kursiver Text-Stil.

See Also:
Constant Field Values

LEFT

public static final int LEFT
linksbündige horizontale Ausrichtung.

See Also:
Constant Field Values

CENTER

public static final int CENTER
mittige horizontale Ausrichtung.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
rechtsbündige horizontale Ausrichtung.

See Also:
Constant Field Values

TOPLINE

public static final int TOPLINE
vertikale Ausrichtung am Oberrand.

See Also:
Constant Field Values

CENTERLINE

public static final int CENTERLINE
mittige vertikale Ausrichtung.

See Also:
Constant Field Values

BASELINE

public static final int BASELINE
vertikale Ausrichtung an der Basislinie.

See Also:
Constant Field Values

MINSIZE

public static final int MINSIZE
minimale Textgröße in Punkt.

See Also:
Constant Field Values

MAXSIZE

public static final int MAXSIZE
maximale Textgröße in Punkt.

See Also:
Constant Field Values
Constructor Detail

DrawableText

protected DrawableText()
Konstruktor.


DrawableText

public DrawableText(int px,
                    int py,
                    java.lang.String s)
Konstruktor.

Parameters:
px - x-Position
py - y-Position
s - Text

DrawableText

public DrawableText(int x,
                    int y,
                    java.lang.String s,
                    java.lang.String presName,
                    int h,
                    int v)
Konstruktor.

Parameters:
s - Text
presName - Name des Darstellungsobjekts
h - horizontale Ausrichtung
v - vertikale Ausrichtung

DrawableText

public DrawableText(int x,
                    int y,
                    java.lang.String s,
                    java.lang.String presName,
                    int h,
                    int v,
                    int pMinScale,
                    int pMaxScale)
Konstruktor.

Parameters:
s - Text
presName - Name des Darstellungsobjekts
h - horizontale Ausrichtung
v - vertikale Ausrichtung
pMinScale - Mindest-Maßstab zum Zeichnen
pMaxScale - Maximal-Maßstab zum Zeichnen
Method Detail

correctString

public static java.lang.String correctString(java.lang.String input)
Korrigiert eingelesenen String. Dies ist für den MS Internet Explorer notwendig, der einige Zeichen falsch übernimmt.

Parameters:
input - eingelesener String
Returns:
korrigierter String

drawProtected

protected void drawProtected(java.awt.Graphics g,
                             int scale,
                             int mode,
                             int value)
Zeichnet den Text im Graphic Context g, vorausgesetzt der aktuelle Maßstab wird eingehalten.

Specified by:
drawProtected in class Drawable
Parameters:
g - aktueller Graphic Context
scale - aktueller Maßstab
mode - aktueller Darstellungsmodus
value - Darstellungswert

getOrigString

public java.lang.String getOrigString()
Gibt originalen Text zurück.

Returns:
orig. Text

getString

public java.lang.String getString()
Gibt den Text in ANSI- bzw. Unicode-Darstellung zurück.

Returns:
Text

interacts

public boolean interacts(int px,
                         int py,
                         int scale)
Description copied from class: Drawable
Tests whether the primitive is selected by a given point or not. The default implementation is based on the mbr of the primitive.

Overrides:
interacts in class Drawable
Parameters:
px - x-coordinate of the point
py - y-coordinate of the point
scale - actuals scale
Returns:
selected?

isUnicodeUsed

public static boolean isUnicodeUsed()
Gibt zurück, ob die Ausgabe in Unicode oder ANSI erfolgen soll.

Returns:
Unicode?

read

public EntryReadable read(EntryInput r)
Liest den Text vom Entry-Input ein. Erster Eintrag "type".
type == 0: x,y,text
type == 1: presName,hor,vert
type == 2: minScale,maxScale

Parameters:
r - Entry-Input
Returns:
eingelesener Text bzw. null

setFont

public static java.awt.Font setFont(java.awt.Graphics g,
                                    int style,
                                    int size)
Setzt den gewünschten Font im Graphik-Kontext.

Parameters:
g - Graphik-Kontext
style - Stil
size - Größe in Punkt

setText

public void setText(java.lang.String text)
Sets the text attribute of the drawable text.

Parameters:
text - new text

setUnicode

public static void setUnicode(boolean u)
Setzt, ob die Ausgabe in Unicode oder ANSI erfolgen soll.

Parameters:
u - Unicode?

toOutputString

protected static java.lang.String toOutputString(java.lang.String in)
Konvertiert den Eingabe-String in Abhängigkeit vom akt. Modus in eine ANSI- bzw. Unicode-Darstellung

Parameters:
in - Eingabe-String
Returns:
konvertierter String

writeProtected

protected void writeProtected(EntryWriter out,
                              int type)
Writes the text.

Specified by:
writeProtected in class Drawable
Parameters:
out - entry writer
type - type of the output; meaning see read