|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ezware.oxbow.swingbits.util.CompoundIcon
public class CompoundIcon
The CompoundIcon will paint two, or more, Icons as a single Icon. The Icons are painted in the order in which they are added. The Icons can be laid out
Nested Class Summary | |
---|---|
static class |
CompoundIcon.Layout
|
Field Summary | |
---|---|
static float |
BOTTOM
|
static float |
CENTER
|
static float |
LEFT
|
static float |
RIGHT
|
static float |
TOP
|
Constructor Summary | |
---|---|
CompoundIcon(CompoundIcon.Layout layout,
Icon... icons)
Convenience constructor for creating a CompoundIcon where the gap is 0 and the X/Y alignments will default to CENTER. |
|
CompoundIcon(CompoundIcon.Layout layout,
int gap,
float alignmentX,
float alignmentY,
Icon... icons)
Create a CompoundIcon specifying all the properties. |
|
CompoundIcon(CompoundIcon.Layout layout,
int gap,
Icon... icons)
Convenience constructor for creating a CompoundIcon where the X/Y alignments will default to CENTER. |
|
CompoundIcon(Icon... icons)
Convenience constructor for creating a CompoundIcon where the icons are laid out horizontally, the gap is 0 and the X/Y alignments will default to CENTER. |
Method Summary | |
---|---|
float |
getAlignmentX()
Get the alignment of the icon on the x-layout |
float |
getAlignmentY()
Get the alignment of the icon on the y-layout |
int |
getGap()
Get the gap between each icon |
Icon |
getIcon(int index)
Get the Icon at the specified index. |
int |
getIconCount()
Get the number of Icons contained in this CompoundIcon. |
int |
getIconHeight()
Gets the height of this icon. |
int |
getIconWidth()
Gets the width of this icon. |
CompoundIcon.Layout |
getLayout()
Get the layout along which each icon is painted. |
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
Paint the icons of this compound icon at the specified location |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float TOP
public static final float LEFT
public static final float CENTER
public static final float BOTTOM
public static final float RIGHT
Constructor Detail |
---|
public CompoundIcon(Icon... icons)
icons
- the Icons to be painted as part of the CompoundIconpublic CompoundIcon(CompoundIcon.Layout layout, Icon... icons)
layout
- the layout used to lay out the icons for painting.icons
- the Icons to be painted as part of the CompoundIconpublic CompoundIcon(CompoundIcon.Layout layout, int gap, Icon... icons)
layout
- the layout used to lay out the icons for paintinggap
- the gap between the iconsicons
- the Icons to be painted as part of the CompoundIconpublic CompoundIcon(CompoundIcon.Layout layout, int gap, float alignmentX, float alignmentY, Icon... icons)
layout
- the layout used to lay out the icons for paintinggap
- the gap between the iconsalignmentX
- the X alignment of the icons. Common values are LEFT, CENTER,
RIGHT. Can be any value between 0.0 and 1.0alignmentY
- the Y alignment of the icons. Common values are TOP, CENTER,
BOTTOM. Can be any value between 0.0 and 1.0icons
- the Icons to be painted as part of the CompoundIconMethod Detail |
---|
public CompoundIcon.Layout getLayout()
public int getGap()
public float getAlignmentX()
public float getAlignmentY()
public int getIconCount()
public Icon getIcon(int index)
index
- the index of the Icon to be returned
IndexOutOfBoundsException
- if the index is out of rangepublic int getIconWidth()
getIconWidth
in interface Icon
public int getIconHeight()
getIconHeight
in interface Icon
public void paintIcon(Component c, Graphics g, int x, int y)
paintIcon
in interface Icon
c
- The component on which the icon is paintedg
- the graphics contextx
- the X coordinate of the icon's top-left cornery
- the Y coordinate of the icon's top-left corner
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |