|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--drawables.Drawable
|
+--drawables.FilledDrawable
|
+--drawables.DrawablePolygon
Class for drawable polygons.
| Field Summary | |
protected int |
num
Number of coordinates. |
protected int[] |
outX
Output buffer for x-coordinates. |
protected int[] |
outY
Output buffer for y-coordinates. |
protected int[] |
xCoords
x-coordinates. |
protected int[] |
yCoords
y-coordinates. |
| 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 | |
DrawablePolygon()
Constructor. |
|
DrawablePolygon(int npoints,
int[] xpoints,
int[] ypoints)
Constructor for non-filled polygons with holes. |
|
DrawablePolygon(int npoints,
int[] xpoints,
int[] ypoints,
boolean filled,
java.lang.String presName)
Constructor for polygons. |
|
DrawablePolygon(int npoints,
int[] xpoints,
int[] ypoints,
boolean filled,
java.lang.String presName,
int minScale,
int maxScale)
Constructor for polygons. |
|
| Method Summary | |
static java.awt.Rectangle |
computeMBR(int num,
int[] xCoords,
int[] yCoords)
Computes the minimum bounding box for coordinate arrays. |
protected void |
drawProtected(java.awt.Graphics g,
int scale,
int mode,
int value)
Draws the polygon using a given GraphicContext, if the scale is observed. |
int |
getNumberOfPoints()
Returns the number of points. |
EntryReadable |
read(java.io.DataInputStream r)
Reads the polygon from the data input stream. |
EntryReadable |
read(EntryInput r)
Reads the polygon from the EntryInput. |
void |
write(java.io.DataOutputStream out,
int type)
Writes the polygon to the data output stream. |
void |
writeGML(EntryWriter out)
Writes the primitive as GML tag. |
protected void |
writeProtected(EntryWriter out,
int type)
Writes the polygon to the EntryWriter. |
| 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, interacts, 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 |
protected int[] xCoords
protected int[] yCoords
protected int num
protected int[] outX
protected int[] outY
| Constructor Detail |
public DrawablePolygon()
public DrawablePolygon(int npoints,
int[] xpoints,
int[] ypoints)
npoints - number of pointsxpoints - x-coordinates (will not be duplicated!)ypoints - y-coordinaten (will not be duplicated!)
public DrawablePolygon(int npoints,
int[] xpoints,
int[] ypoints,
boolean filled,
java.lang.String presName)
npoints - number of pointsxpoints - x-coordinates (will not be duplicated!)ypoints - y-coordinaten (will not be duplicated!)filled - polygon filled?presName - name of the presentation object
public DrawablePolygon(int npoints,
int[] xpoints,
int[] ypoints,
boolean filled,
java.lang.String presName,
int minScale,
int maxScale)
npoints - number of pointsxpoints - x-coordinates (will not be duplicated!)ypoints - y-coordinaten (will not be duplicated!)filled - polygon filled?presName - name of the presentation objectminScale - least detailed scale where the drawable is visiblemaxScale - most detailed scale where the drawable is visible| Method Detail |
public static java.awt.Rectangle computeMBR(int num,
int[] xCoords,
int[] yCoords)
num - number of pointsxCoords - x-coordinatesyCoords - y-coordinates
protected void drawProtected(java.awt.Graphics g,
int scale,
int mode,
int value)
drawProtected in class Drawableg - graphical contextscale - actual scalemode - actual modevalue - presentation valuepublic int getNumberOfPoints()
public EntryReadable read(java.io.DataInputStream r)
throws java.io.IOException
r - data input stream
java.io.IOExceptionpublic EntryReadable read(EntryInput r)
r - EntryInput
public void write(java.io.DataOutputStream out,
int type)
out - data output streamtype - type of the output; meaning see read-operationpublic void writeGML(EntryWriter out)
writeGML in class Drawableout - entry writer
protected void writeProtected(EntryWriter out,
int type)
writeProtected in class Drawableout - entry writertype - type of the output; meaning see read-operation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||