|
org.netbeans.swing.tabcontrol 1.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Polygon
org.netbeans.swing.tabcontrol.plaf.EqualPolygon
public final class EqualPolygon
A Polygon which implements a proper equals/hashcode contract. In order to optimize drag and drop repainting, it is necessary that the Shape objects returned by getTabIndication() be able to be compared properly.
To ease migration of older code, this class also implements a couple methods of GeneralPath, which was used before. These methods just delegate to addPoint(), so the full functionality of GeneralPath is not replicated (specifically, a polygon must be contiguous and closed).
Field Summary |
---|
Fields inherited from class java.awt.Polygon |
---|
bounds, npoints, xpoints, ypoints |
Constructor Summary | |
---|---|
EqualPolygon()
Creates a new instance of EqualGeneralPath |
|
EqualPolygon(int[] x,
int[] y)
Non copy constructor based on fixed arrays. |
|
EqualPolygon(int[] x,
int[] y,
int n)
Copy constructor will copy the xpoints/ypoints arrays so the caller can later modify them without changing the polygon constructor here. |
|
EqualPolygon(Polygon p)
Copy constructor - takes either another EqualPolygon or a Polygon. |
|
EqualPolygon(Rectangle r)
Convenience constructor which takes a Rectangle |
Method Summary | |
---|---|
Object |
clone()
Creates a new EqualPolygon using the copy constructor - the resulting polygon may be modified without affecting the original. |
boolean |
equals(Object o)
Returns true if the argument is a Polygon (does not need to be EqualPolygon) and its point arrays and number of points matches. |
int |
hashCode()
Computes a hashCode based on the points arrays. |
void |
lineTo(int x,
int y)
Delegates to Polygon.addPoint() . |
void |
moveTo(int x,
int y)
Delegates to Polygon.addPoint() . |
String |
toString()
Overridden to produce a meaningful result. |
Methods inherited from class java.awt.Polygon |
---|
addPoint, contains, contains, contains, contains, contains, contains, getBoundingBox, getBounds, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, invalidate, reset, translate |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EqualPolygon()
public EqualPolygon(int[] x, int[] y, int n)
public EqualPolygon(Polygon p)
p
- public EqualPolygon(Rectangle r)
public EqualPolygon(int[] x, int[] y)
x.length
.
Method Detail |
---|
public void moveTo(int x, int y)
Polygon.addPoint()
.
x
- x coordinatey
- y coordinatepublic void lineTo(int x, int y)
Polygon.addPoint()
.
x
- x coordinatey
- y coordinatepublic Object clone()
public String toString()
public int hashCode()
public boolean equals(Object o)
o
- Another polygon
|
org.netbeans.swing.tabcontrol 1.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |