|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
com.sshtools.ui.awt.ImageTextLabel
public class ImageTextLabel
A label that can display both graphics and text, somewhat similar to swings JLabel.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Canvas |
|---|
java.awt.Canvas.AccessibleAWTCanvas |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
CENTER_ALIGNMENT
Center alignment |
static int |
EMPTY
Empty space (takes up 2 pixels) |
static int |
FLAT
Flat (takes up 1 pixel) |
static int |
LEFT_ALIGNMENT
Left alignment |
static int |
LOWERED_BEVEL
Lowered bevel border (takes up 2 pixels) |
static int |
NONE
No border. |
static int |
RAISED_BEVEL
Raised bevel border (takes up 2 pixels) |
static int |
RAISED_ROUNDED
Raised bevel border (takes up 2 pixels) |
static int |
RIGHT_ALIGNMENT
Center alignment |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ImageTextLabel()
|
|
ImageTextLabel(java.awt.Image image,
java.lang.String text)
|
|
| Method Summary | |
|---|---|
void |
addNotify()
|
void |
doLayout()
|
java.awt.Color |
getBorderDarkShadowColor()
|
java.awt.Color |
getBorderShadowColor()
|
java.awt.Image |
getImage()
Get the image |
java.awt.Insets |
getInsets()
Return insets sufficient for bevel and label drawing space. |
java.awt.Insets |
getMargin()
|
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
java.lang.String |
getText()
Get the text to display |
int |
getTextImageGap()
Get the gap (in pixels) between the image and text. |
boolean |
isTextVisible()
Get whether or not the text is visible |
void |
paint(java.awt.Graphics g1)
|
void |
paintBorder(java.awt.Graphics g)
|
protected void |
renderComponent(java.awt.Graphics g,
java.awt.Dimension d,
boolean enabled)
|
void |
setBorderDarkShadowColor(java.awt.Color borderDarkShadowColor)
|
void |
setBorderShadowColor(java.awt.Color borderShadowColor)
|
void |
setBorderType(int borderType)
Set the border type. |
void |
setFont(java.awt.Font font)
|
void |
setHorizontalAlignment(int horizontalAlignment)
|
void |
setImage(java.awt.Image image)
Set the image |
void |
setMargin(java.awt.Insets margin)
|
void |
setText(java.lang.String text)
Set the text to display |
void |
setTextImageGap(int textImageGap)
Set the gap (in pixels) between the image and text. |
void |
setTextVisible(boolean textVisible)
Set whether or not the text is visible |
void |
update(java.awt.Graphics g)
|
| Methods inherited from class java.awt.Canvas |
|---|
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NONE
public static final int LOWERED_BEVEL
public static final int RAISED_BEVEL
public static final int EMPTY
public static final int RAISED_ROUNDED
public static final int FLAT
public static final int LEFT_ALIGNMENT
public static final int CENTER_ALIGNMENT
public static final int RIGHT_ALIGNMENT
| Constructor Detail |
|---|
public ImageTextLabel()
public ImageTextLabel(java.awt.Image image,
java.lang.String text)
| Method Detail |
|---|
public void addNotify()
addNotify in class java.awt.Canvaspublic void setTextVisible(boolean textVisible)
textVisible - text visiblepublic boolean isTextVisible()
public void setMargin(java.awt.Insets margin)
public java.awt.Insets getMargin()
public void paint(java.awt.Graphics g1)
paint in class java.awt.Canvas
protected void renderComponent(java.awt.Graphics g,
java.awt.Dimension d,
boolean enabled)
public void setFont(java.awt.Font font)
setFont in class java.awt.Componentpublic void doLayout()
doLayout in class java.awt.Componentpublic void setTextImageGap(int textImageGap)
textImageGap - gap in pixels between text and imagepublic int getTextImageGap()
public java.awt.Image getImage()
public void setImage(java.awt.Image image)
image - imagepublic java.awt.Color getBorderShadowColor()
public void setBorderShadowColor(java.awt.Color borderShadowColor)
public java.awt.Color getBorderDarkShadowColor()
public void setBorderDarkShadowColor(java.awt.Color borderDarkShadowColor)
public void setText(java.lang.String text)
text - textpublic java.lang.String getText()
text - textpublic void setBorderType(int borderType)
ImageTextLabel.NONEImageTextLabel.LOWEREDImageTextLabel.RAISED
borderType - border typepublic java.awt.Insets getInsets()
public void paintBorder(java.awt.Graphics g)
public void update(java.awt.Graphics g)
update in class java.awt.Canvaspublic java.awt.Dimension getPreferredSize()
getPreferredSize in class java.awt.Componentpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class java.awt.Componentpublic void setHorizontalAlignment(int horizontalAlignment)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||