|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--drawables.Drawable
Basic class for drawable primitives.
| Field Summary | |
static byte |
AREALAYER
Standard layer for areal primitives. |
static byte |
BITMAPLAYER
Standard layer for (not scalable) bitmaps. |
protected DrawableObjects |
container
Container of the primitive. |
static int |
DEFMAXSCALE
Default for the most detailed scale. |
static int |
DEFMINSCALE
Default for the least detailed scale. |
protected byte |
layer
Layer. |
static byte |
LINELAYER
Standard layer for line primitives. |
protected int |
maxScale
The most detailed scale for drawing. |
protected java.awt.Rectangle |
mbr
The minimum bounding rectangle. |
protected int |
minScale
The least detailed scale for drawing. |
protected Drawable |
nextOfLayer
Next primitive of the same layer. |
protected DrawableObject |
obj
The corresponding drawable object. |
static byte |
POINTLAYER
Standard layer for point primitives. |
protected DrawablePresentation |
pres
The corresponding presentation object. |
protected boolean |
selected
Is the primitive selected? |
static byte |
TEXTLAYER
Standard layer for text primitives. |
| Constructor Summary | |
Drawable()
|
|
| Method Summary | |
static double |
computeDistance(int x1,
int y1,
int x2,
int y2)
Computes the distance between two points. |
double |
computeDistanceTo(int x,
int y)
Computes the distance of the drawing primitive to a point. |
boolean |
contains(java.awt.Rectangle rect)
Tests whether the drawable primitive contains a given rectangle. |
void |
draw(java.awt.Graphics g)
Draws the primitive and the linked primitives. |
void |
draw(java.awt.Graphics g,
int scale)
Draws the primitive and the linked primitives. |
void |
draw(java.awt.Graphics g,
java.awt.Rectangle r)
Draws the primitive and the linked primitives. |
void |
draw(java.awt.Graphics g,
java.awt.Rectangle r,
int scale)
Draws the primitive. |
protected abstract void |
drawProtected(java.awt.Graphics g,
int scale,
int mode,
int value)
Implements the draw method of a primitive. |
DrawableObjects |
getContainer()
Returns the container. |
long |
getId()
Returns the identifier of the corresponding object (or 0). |
int |
getLayer()
Returns the layer of the primitive. |
int |
getMaxScale()
Returns the most detailed scale for drawing. |
java.awt.Rectangle |
getMBR()
Returns the minimum bounding rectangle of the primitive. |
int |
getMinScale()
Returns the least detailed scale for drawing. |
Drawable |
getNextOfLayer()
Returns the next primitive of the same layer. |
DrawableObject |
getObject()
Returns the corresponding drawable object. |
DrawablePresentation |
getPresentation()
Returns the basic presentation object. |
DrawablePresentation |
getPresentation(int scale,
int mode,
int value)
Returns the presentation object for a given scale, mode and value. |
java.lang.Object |
getType()
Returns the class of the primitive as Object. |
boolean |
interacts(int x,
int y,
int scale)
Tests whether the primitive is selected by a given point or not. |
boolean |
intersects(Drawable prim)
Tests whether the drawable primitive intersects another primitive. |
boolean |
intersects(java.lang.Object prim)
Tests whether the drawable primitive intersects another primitive which is passed as Object. |
boolean |
intersects(java.awt.Rectangle r)
Tests whether the drawable primitive intersects a given rectangle. |
boolean |
isContainedBy(java.awt.Rectangle rect)
Tests whether the drawable primitive is contained by a given rectangle. |
boolean |
isVisible(int scale)
Test whether the drawing primitive is visible or not. |
protected static int |
readCoord(java.io.DataInputStream in)
Reads a coordinate. |
protected static int |
readCoord(EntryInput in)
Reads a coordinate. |
static Drawable |
readDrawable(java.io.DataInputStream r,
char primType)
Reads a new primitive from an entry input. |
static Drawable |
readDrawable(EntryInput r,
java.lang.String primType)
Reads a new primitive from an entry input. |
void |
setContainer(DrawableObjects container)
Sets the containe of the primitive. |
void |
setLayer(int layer)
Sets the layer. |
void |
setMaxScale(int scale)
Sets the most detailed scale for drawing. |
void |
setMBR(java.awt.Rectangle newMBR)
Sets the minimum bounding rectangle of the primitive. |
void |
setMinScale(int scale)
Returns the least detailed scale for drawing. |
void |
setNextOfLayer(Drawable next)
Sets the next primitive of the same layer. |
void |
setObject(DrawableObject obj)
Sets the corresponding object. |
void |
setPresentation(DrawablePresentation pres)
Sets the corresponding presentation object. |
void |
setSelection(boolean on)
Selects or deselect the primitive. |
java.lang.String |
toString()
Returns a string representation. |
void |
write(EntryWriter out,
int type)
Writes the primitive. |
protected static void |
writeCoord(java.io.DataOutputStream out,
int coord)
Writes a coordinate. |
protected static void |
writeCoord(EntryWriter out,
int coord)
Writes a coordinate. |
void |
writeGML(EntryWriter out)
Writes the primitive as GML tag. |
protected abstract void |
writeProtected(EntryWriter out,
int type)
Writes the primitive. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.EntryReadable |
read |
| Field Detail |
public static final byte AREALAYER
public static final byte LINELAYER
public static final byte POINTLAYER
public static final byte TEXTLAYER
public static final byte BITMAPLAYER
public static final int DEFMINSCALE
public static final int DEFMAXSCALE
protected java.awt.Rectangle mbr
protected int minScale
protected int maxScale
protected byte layer
protected boolean selected
protected DrawablePresentation pres
protected DrawableObject obj
protected DrawableObjects container
protected Drawable nextOfLayer
| Constructor Detail |
public Drawable()
| Method Detail |
public static double computeDistance(int x1,
int y1,
int x2,
int y2)
x1 - x-coordinate of the 1st pointy1 - y-coordinate of the 1st pointx2 - x-coordinate of the 2nd pointy2 - y-coordinate of the 2nd point
public double computeDistanceTo(int x,
int y)
x - x-coordinate of the pointy - x-coordinate of the point
public boolean contains(java.awt.Rectangle rect)
rect - the rectangle
public void draw(java.awt.Graphics g)
g - graphical context
public void draw(java.awt.Graphics g,
int scale)
g - graphical contextscale - actual scale
public void draw(java.awt.Graphics g,
java.awt.Rectangle r)
g - graphical contextr - clipping rectangle
public void draw(java.awt.Graphics g,
java.awt.Rectangle r,
int scale)
g - graphical contextr - clipping rectanglescale - actual scale
protected abstract void drawProtected(java.awt.Graphics g,
int scale,
int mode,
int value)
g - graphical contextmode - actual presentation modevalue - presentation valuepublic DrawableObjects getContainer()
public long getId()
public int getLayer()
public int getMaxScale()
public java.awt.Rectangle getMBR()
public int getMinScale()
public Drawable getNextOfLayer()
public DrawableObject getObject()
public DrawablePresentation getPresentation()
public DrawablePresentation getPresentation(int scale,
int mode,
int value)
scale - the scalemode - the presentation modevalue - the presentation value
public java.lang.Object getType()
public boolean interacts(int x,
int y,
int scale)
x - x-coordinate of the pointy - y-coordinate of the pointscale - actuals scale
public boolean intersects(Drawable prim)
public boolean intersects(java.awt.Rectangle r)
r - the rectangle
public boolean intersects(java.lang.Object prim)
prim - the other drawable primitive
public boolean isContainedBy(java.awt.Rectangle rect)
rect - the rectangle
public boolean isVisible(int scale)
scale - actual scale (negative value => returns true)
protected static int readCoord(java.io.DataInputStream in)
throws java.io.IOException
in - data input stream
java.io.IOExceptionprotected static int readCoord(EntryInput in)
in - entry input
public static Drawable readDrawable(java.io.DataInputStream r,
char primType)
throws java.io.IOException
r - data input streamprimType - the type of the primitive
java.io.IOException
public static Drawable readDrawable(EntryInput r,
java.lang.String primType)
r - entry inputprimType - the type of the primitive
public void setContainer(DrawableObjects container)
container - the containerpublic void setLayer(int layer)
layer - new layerpublic void setMaxScale(int scale)
scale - the scalepublic void setMBR(java.awt.Rectangle newMBR)
newMBR - the MBRpublic void setMinScale(int scale)
scale - the scalepublic void setNextOfLayer(Drawable next)
public void setObject(DrawableObject obj)
obj - the new objectpublic void setPresentation(DrawablePresentation pres)
pres - the new presentation objectpublic void setSelection(boolean on)
on - selected?public java.lang.String toString()
toString in class java.lang.Object
public void write(EntryWriter out,
int type)
out - entry writertype - type of the output (meaning depends on the concrete subclass)
protected static void writeCoord(java.io.DataOutputStream out,
int coord)
out - data output streamcoord - the x- or y-coordinate
protected static void writeCoord(EntryWriter out,
int coord)
out - entry writercoord - the x- or y-coordinatepublic void writeGML(EntryWriter out)
out - entry writer
protected abstract void writeProtected(EntryWriter out,
int type)
out - entry writertype - type of the output (meaning depends on the concrete subclass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||