gishur.gui
Class Polygon_Primitive

java.lang.Object
  |
  +--java.awt.Polygon
        |
        +--gishur.gui.Polygon_Primitive
All Implemented Interfaces:
GraphicPrimitive, java.io.Serializable, java.awt.Shape

public class Polygon_Primitive
extends java.awt.Polygon
implements GraphicPrimitive

Polygon.

See Also:
Serialized Form

Fields inherited from class java.awt.Polygon
bounds, npoints, xpoints, ypoints
 
Constructor Summary
Polygon_Primitive()
           
Polygon_Primitive(int[] xpoints, int[] ypoints, int length)
           
Polygon_Primitive(java.awt.Point[] points)
           
Polygon_Primitive(java.awt.Point[] points, int start, int len)
           
Polygon_Primitive(java.awt.Polygon pol)
           
 
Method Summary
 java.awt.Rectangle getBounds()
          Liefert das kleinste umschließende (achsenparallele) Rechteck.
 java.awt.Point getCenter()
          Liefert das Zentrum.
static Polygon_Primitive getLinePolygon(int x1, int y1, int x2, int y2, int width)
          Liefert das die Linie eingrenzende Polygon zurück.
static Polygon_Primitive getLinePolygon(java.awt.Point p1, java.awt.Point p2, int width)
          Liefert das die Linie eingrenzende Polygon zurück.
 boolean in(int x, int y)
          Liegt der Punkt (x,y) im Primitiv (inkl.
 boolean onLine(int x, int y)
          Liefert true, falls der Punkt (x,y) auf dem Rand des Polygons liegt
 void paint(java.awt.Graphics g)
          Malt das Primitiv auf das Graphics g.
 java.lang.String toString()
           
 
Methods inherited from class java.awt.Polygon
addPoint, contains, contains, contains, contains, contains, contains, getBoundingBox, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gishur.gui.GraphicPrimitive
translate
 

Constructor Detail

Polygon_Primitive

public Polygon_Primitive()

Polygon_Primitive

public Polygon_Primitive(int[] xpoints,
                         int[] ypoints,
                         int length)

Polygon_Primitive

public Polygon_Primitive(java.awt.Polygon pol)

Polygon_Primitive

public Polygon_Primitive(java.awt.Point[] points)

Polygon_Primitive

public Polygon_Primitive(java.awt.Point[] points,
                         int start,
                         int len)
Method Detail

getLinePolygon

public static Polygon_Primitive getLinePolygon(int x1,
                                               int y1,
                                               int x2,
                                               int y2,
                                               int width)
Liefert das die Linie eingrenzende Polygon zurück.
Parameters:
x1,y1 - erster Segmentpunkt
x2,y2 - zweiter Segmentpunkt
width - Linienstärke
Returns:
umgrenzendes Polygon

getLinePolygon

public static Polygon_Primitive getLinePolygon(java.awt.Point p1,
                                               java.awt.Point p2,
                                               int width)
Liefert das die Linie eingrenzende Polygon zurück.
Parameters:
p1 - erster Segmentpunkt
p2 - zweiter Segmentpunkt
width - Linienstärke
Returns:
umgrenzendes Polygon

in

public boolean in(int x,
                  int y)
Liegt der Punkt (x,y) im Primitiv (inkl. Rand)
Specified by:
in in interface GraphicPrimitive
Returns:
true, falls (x,y) im Primitiv

onLine

public boolean onLine(int x,
                      int y)
Liefert true, falls der Punkt (x,y) auf dem Rand des Polygons liegt
Parameters:
x,y - zu testendes Punkt
Returns:
true, falls (x,y) auf dem Polygon

getBounds

public java.awt.Rectangle getBounds()
Liefert das kleinste umschließende (achsenparallele) Rechteck.
Specified by:
getBounds in interface GraphicPrimitive
Overrides:
getBounds in class java.awt.Polygon
Returns:
kleinstes umschließende Rechteck

getCenter

public java.awt.Point getCenter()
Liefert das Zentrum.
Specified by:
getCenter in interface GraphicPrimitive
Following copied from interface: gishur.gui.GraphicPrimitive
Returns:
Zentrum

paint

public void paint(java.awt.Graphics g)
Malt das Primitiv auf das Graphics g.
Specified by:
paint in interface GraphicPrimitive
Parameters:
Graphics, - auf dem gemalt wird.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object