Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.javatools.ui
Class PolygonIcon

java.lang.Object
  extended by java.awt.Polygon
      extended by oracle.javatools.ui.PolygonIcon
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, javax.swing.Icon

public class PolygonIcon
extends java.awt.Polygon
implements javax.swing.Icon

A polygon which implements the icon interface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.Polygon
bounds, npoints, xpoints, ypoints
 
Constructor Summary
PolygonIcon()
          Creates a polygon icon to be drawn with the the foreground color of the containing component and with no margin.
PolygonIcon(java.awt.Color color)
          Creates a polygon icon to be drawn with a specified foreground color and with no margin.
PolygonIcon(java.awt.Color color, int[] xpoints, int[] ypoints, int npoints)
          Creates a polygon icon to be drawn with a specified foreground color and points and with no margin.
PolygonIcon(java.awt.Color color, int top, int left, int bottom, int right)
          Creates a polygon icon to be drawn with specified foreground color and margin.
PolygonIcon(java.awt.Color color, int top, int left, int bottom, int right, int[] xpoints, int[] ypoints, int npoints)
          Creates a polygon icon to be drawn with specified foreground color, margin and points.
PolygonIcon(int[] xpoints, int[] ypoints, int npoints)
          Creates a polygon icon to be drawn with the the foreground color of the containing component, with no margin, and with the specified points.
PolygonIcon(int top, int left, int bottom, int right)
          Creates a polygon icon to be drawn with the foreground color of the containing component and with a specified margin.
PolygonIcon(int top, int left, int bottom, int right, int[] xpoints, int[] ypoints, int npoints)
          Creates a polygon icon to be drawn with the foreground color of the containing component and with specified margin and points.
 
Method Summary
 void addPoints(int[] xpoints, int[] ypoints, int npoints)
          Adds points to this polygon.
 java.awt.Color getColor()
           
protected  java.awt.Color getColor(java.awt.Component c)
           
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 void setColor(java.awt.Color color)
          Sets the foreground color, or null to use the foreground color of the containing component.
 void setMargin(int top, int left, int bottom, int right)
          Sets the margin.
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonIcon

public PolygonIcon()
Creates a polygon icon to be drawn with the the foreground color of the containing component and with no margin.


PolygonIcon

public PolygonIcon(int[] xpoints,
                   int[] ypoints,
                   int npoints)
Creates a polygon icon to be drawn with the the foreground color of the containing component, with no margin, and with the specified points.


PolygonIcon

public PolygonIcon(java.awt.Color color)
Creates a polygon icon to be drawn with a specified foreground color and with no margin.


PolygonIcon

public PolygonIcon(java.awt.Color color,
                   int[] xpoints,
                   int[] ypoints,
                   int npoints)
Creates a polygon icon to be drawn with a specified foreground color and points and with no margin.


PolygonIcon

public PolygonIcon(int top,
                   int left,
                   int bottom,
                   int right)
Creates a polygon icon to be drawn with the foreground color of the containing component and with a specified margin.


PolygonIcon

public PolygonIcon(int top,
                   int left,
                   int bottom,
                   int right,
                   int[] xpoints,
                   int[] ypoints,
                   int npoints)
Creates a polygon icon to be drawn with the foreground color of the containing component and with specified margin and points.


PolygonIcon

public PolygonIcon(java.awt.Color color,
                   int top,
                   int left,
                   int bottom,
                   int right)
Creates a polygon icon to be drawn with specified foreground color and margin.


PolygonIcon

public PolygonIcon(java.awt.Color color,
                   int top,
                   int left,
                   int bottom,
                   int right,
                   int[] xpoints,
                   int[] ypoints,
                   int npoints)
Creates a polygon icon to be drawn with specified foreground color, margin and points.

Method Detail

setColor

public void setColor(java.awt.Color color)
Sets the foreground color, or null to use the foreground color of the containing component.


addPoints

public void addPoints(int[] xpoints,
                      int[] ypoints,
                      int npoints)
Adds points to this polygon.

Parameters:
xpoints - An array of x ordinates, one for each point to add.
ypoints - An array of y ordinates, one for each point to add.
npoints - The number of points to add.

setMargin

public void setMargin(int top,
                      int left,
                      int bottom,
                      int right)
Sets the margin. The margin is unpainted space between the bounding rectangle of the polygon and the bounds of the icon.


getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

getColor

public java.awt.Color getColor()

getColor

protected java.awt.Color getColor(java.awt.Component c)

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.