|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.comedia.ui.CEncodedIcon
Presents an icon with transparent encoded image. The class contains a bunch of predefined icons and can draw disabled icons.
Usage examples:
panel.setLayout(new GridLayout(3, 3)); panel.add(new JButton(CEncodedIcon.BIG_RIGHT_ARROW)); panel.add(new JButton(CEncodedIcon.MANY_SIGN)); panel.add(new JButton(CEncodedIcon.ONE_SIGN)); panel.add(new JButton(CEncodedIcon.PEN_SIGN)); panel.add(new JButton(CEncodedIcon.SMALL_LEFT_ARROW)); panel.add(new JButton(CEncodedIcon.SMALL_RIGHT_ARROW)); panel.add(new JButton(CEncodedIcon.STAR_SIGN)); CEncodedIcon icon = new CEncodedIcon(new int[] {0x60, 0x60, 0xf0, 0x60, 0x60}, 6, 5); icon.setColor(Color.blue); panel.add(new JButton(icon));
Field Summary | |
static CEncodedIcon |
BIG_RIGHT_ARROW
The big right arrow sign. |
static CEncodedIcon |
FIRST_SIGN
The first sign. |
static CEncodedIcon |
LAST_NEW_SIGN
The last new sign. |
static CEncodedIcon |
LAST_SIGN
The last sign. |
static CEncodedIcon |
MANY_SIGN
The many units sign. |
static CEncodedIcon |
NEXT_SIGN
The next sign. |
static CEncodedIcon |
ONE_SIGN
The one unit sign. |
static CEncodedIcon |
PEN_SIGN
The writing pen sign. |
static CEncodedIcon |
PRIOR_SIGN
The prior sign. |
static CEncodedIcon |
SMALL_DOWN_ARROW
The big down arrow sign. |
static CEncodedIcon |
SMALL_LEFT_ARROW
The small left arrow sign. |
static CEncodedIcon |
SMALL_RIGHT_ARROW
The small right arrow sign. |
static CEncodedIcon |
SMALL_UP_ARROW
The big up arrow sign. |
static CEncodedIcon |
STAR_SIGN
The star sign. |
Constructor Summary | |
CEncodedIcon(int[] image,
int width,
int height)
Constructs this image and assignes main properties. |
Method Summary | |
java.awt.Color |
getColor()
Gets the current icon color. |
int |
getIconHeight()
Gets the current image height. |
int |
getIconWidth()
Gets the current image width. |
int[] |
getImageArray()
Gets an image binary array of this icon. |
boolean |
isEnabled()
Checks the current enabled status. |
static void |
main(java.lang.String[] args)
The main routine to run this module as standalone application. |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Paints the current image in the screen. |
void |
setColor(java.awt.Color color)
Sets a new icon color. |
void |
setEnabled(boolean enabled)
Sets a new enabled status. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final CEncodedIcon FIRST_SIGN
public static final CEncodedIcon PRIOR_SIGN
public static final CEncodedIcon LAST_SIGN
public static final CEncodedIcon LAST_NEW_SIGN
public static final CEncodedIcon NEXT_SIGN
public static final CEncodedIcon BIG_RIGHT_ARROW
public static final CEncodedIcon SMALL_DOWN_ARROW
public static final CEncodedIcon SMALL_UP_ARROW
public static final CEncodedIcon STAR_SIGN
public static final CEncodedIcon PEN_SIGN
public static final CEncodedIcon SMALL_LEFT_ARROW
public static final CEncodedIcon SMALL_RIGHT_ARROW
public static final CEncodedIcon ONE_SIGN
public static final CEncodedIcon MANY_SIGN
Constructor Detail |
public CEncodedIcon(int[] image, int width, int height)
Method Detail |
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
c
- a component to paint.g
- a current graphical context.x
- x coordinate of image.y
- y coordinate of image.public int[] getImageArray()
an
- image binary array of this icon.public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
color
- a new icon color.public boolean isEnabled()
public void setEnabled(boolean enabled)
color
- a new enabled status.public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |