drawables
Class DrawableSymbol

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

public class DrawableSymbol
extends FilledDrawable

Class for drawable symbols.

See Also:
Serialized Form

Field Summary
protected static DrawableText bufferedText
          Read drawable text.
static int CIRCLE
          Circle.
static int CIRCLEDOT
          Circle with point.
static int RING
          Ring.
static int SQUARE
          Square.
static int SQUAREDOT
          Square with point.
static int TRIANGLE
          Triangle.
static int UPDOWNARROW
          Up or down arrow.
protected  int x
          x-coordinate.
protected  int y
          y-coordinate.
 
Fields inherited from class drawables.FilledDrawable
filled
 
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 DrawableSymbol()
          Konstruktor.
  DrawableSymbol(int px, int py, java.lang.String presName)
          Konstruktor für Symbol.
  DrawableSymbol(int x, int y, java.lang.String presName, int pMinScale, int pMaxScale)
          Konstruktor für Symbol.
 
Method Summary
protected  void drawProtected(java.awt.Graphics g, int scale, int mode, int pvalue)
          Zeichnet das Symbol im Graphic Context g, vorausgesetzt der aktuelle Maßstab wird eingehalten.
 int getX()
          Gibt die x-Koordinate des Symbols zurück.
 int getY()
          Gibt die y-Koordinate des Symbols zurück.
 boolean interacts(int px, int py, int scale)
          Testet, ob das Symbol durch den übergebenen Punkt ausgewählt wird.
 void moveTo(int x, int y)
          Verschiebt Symbol auf die neue Position (x,y).
 EntryReadable read(EntryInput r)
          Liest das Symbol vom Entry-Input ein.
 void writeGML(EntryWriter out)
          Writes the primitive as GML tag.
protected  void writeProtected(EntryWriter out, int type)
          Writes the symbol.
 
Methods inherited from class drawables.FilledDrawable
isFilled, setFilling
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SQUARE

public static final int SQUARE
Square.

See Also:
Constant Field Values

CIRCLE

public static final int CIRCLE
Circle.

See Also:
Constant Field Values

SQUAREDOT

public static final int SQUAREDOT
Square with point.

See Also:
Constant Field Values

CIRCLEDOT

public static final int CIRCLEDOT
Circle with point.

See Also:
Constant Field Values

RING

public static final int RING
Ring.

See Also:
Constant Field Values

TRIANGLE

public static final int TRIANGLE
Triangle.

See Also:
Constant Field Values

UPDOWNARROW

public static final int UPDOWNARROW
Up or down arrow.

See Also:
Constant Field Values

x

protected int x
x-coordinate.


y

protected int y
y-coordinate.


bufferedText

protected static DrawableText bufferedText
Read drawable text. DEPRECATED!

Constructor Detail

DrawableSymbol

protected DrawableSymbol()
Konstruktor.


DrawableSymbol

public DrawableSymbol(int px,
                      int py,
                      java.lang.String presName)
Konstruktor für Symbol.

Parameters:
px - x-Koordinate
py - y-Koordinate
presName - Name des Darstellungsobjekts

DrawableSymbol

public DrawableSymbol(int x,
                      int y,
                      java.lang.String presName,
                      int pMinScale,
                      int pMaxScale)
Konstruktor für Symbol.

Parameters:
presName - Name des Darstellungsobjekts
pMinScale - Mindest-Maßstab zum Zeichnen
pMaxScale - Maximal-Maßstab zum Zeichnen
Method Detail

drawProtected

protected void drawProtected(java.awt.Graphics g,
                             int scale,
                             int mode,
                             int pvalue)
Zeichnet das Symbol 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
pvalue - presentation value

getX

public int getX()
Gibt die x-Koordinate des Symbols zurück.

Returns:
x-Koordinate

getY

public int getY()
Gibt die y-Koordinate des Symbols zurück.

Returns:
y-Koordinate

interacts

public boolean interacts(int px,
                         int py,
                         int scale)
Testet, ob das Symbol durch den übergebenen Punkt ausgewählt wird.

Overrides:
interacts in class Drawable
Parameters:
px - x-Koordinate in Basis-Koordinaten
py - y-Koordinate in Basis-Koordinaten
scale - akt. Maßstab
Returns:
ausgewählt?

moveTo

public void moveTo(int x,
                   int y)
Verschiebt Symbol auf die neue Position (x,y).

Parameters:
x - neue x-Koordinate
y - neue y-Koordinate

read

public EntryReadable read(EntryInput r)
Liest das Symbol vom Entry-Input ein. Erster Eintrag "type" (>1 veraltet!).
type == 0: x,y,presName
type == 1: minScale,maxScale
type == 4: value (nicht bei Typ 2 und 3)
type == 2: txt,textPres,hor,vert
type == 3: txtMinScale,txtMaxScale

Parameters:
r - Entry-Input
Returns:
eingelesenes Symbol bzw. null

writeGML

public void writeGML(EntryWriter out)
Writes the primitive as GML tag.

Overrides:
writeGML in class Drawable
Parameters:
out - entry writer

writeProtected

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

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