|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--org.smartui.SmartComponent | +--org.smartui.Label3D
The Label3D class is used to replace the awt's Label component with many new properties used in popular user interface.
It can be shown in multiline, auto-wrap your text.
It can be shown with outline,shadow,and 3D features
And it is lightweight, can be transparent.
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
int |
align
|
boolean |
autosize
|
static int |
BOTTOM
The vert align style, used when align the total text only valid when not autosize |
int |
hAlign
|
static int |
HCENTER
The horz align style, used when align the total text only valid when not autosize |
static int |
LEFT
The horz align style, used when align the total text only valid when not autosize |
static int |
LINECENTER
The align style, used when align one line |
int |
lineGap
|
static int |
LINELEFT
The align style, used when align one line |
static int |
LINERIGHT
The align style, used when align one line |
int |
lineWidth
|
static int |
NORMAL
The style of the text being showned |
static int |
OUTLINE
The style of the text being showned |
java.awt.Color |
outlineColor
|
static int |
RAISE3D
The style of the text being showned |
static int |
RIGHT
The horz align style, used when align the total text only valid when not autosize |
int |
separateLength
|
java.awt.Color |
shadowColor
|
int |
shadowHeight
|
int |
style
|
static int |
SUNK3D
The style of the text being showned |
java.lang.String |
text
|
static int |
TOP
The vert align style, used when align the total text only valid when not autosize |
int |
vAlign
|
static int |
VCENTER
The vert align style, used when align the total text only valid when not autosize |
Fields inherited from class org.smartui.SmartComponent |
cliprect, transparent |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Label3D()
Create a new instance with default text and fontsize |
|
Label3D(int fontsize)
Creates a new instance |
|
Label3D(java.lang.String text)
Creates a new instance |
|
Label3D(java.lang.String text,
int fontsize)
Creates a new instance |
|
Label3D(java.lang.String text,
int fontsize,
int style)
Creates a new instance |
Method Summary | |
protected void |
doPaint(java.awt.Graphics g,
int x,
int y,
java.awt.Dimension dim)
|
java.awt.Dimension |
getMinimumSize()
Gets the mininimum size of this component. |
java.awt.Dimension |
getPreferredSize()
Gets the preferred size of this component. if autosize is true, it will auto calc the size. |
java.awt.Dimension |
getTextDimension()
Returns the size of this text according the component's current font and the maxwords It is called when the object excute sizeToFit or getPreferredSize and paint |
void |
paint(java.awt.Graphics g)
Paint the component |
void |
propertyChanged()
|
boolean |
rejustSize(java.awt.Graphics g)
|
void |
setAlign(int align,
int hAlign,
int vAlign)
Set all aligns |
void |
setFont(java.awt.Font f)
Set the Font |
void |
setLabel3D(java.lang.String text,
int fontsize,
int style)
Set the label3D |
void |
sizeToFit()
It will set the autosize be true and relayout the parent |
Methods inherited from class org.smartui.SmartComponent |
getBackground, getFather, getFont, getForeground, getParent, isShowing, isValid, setFather, update |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFontMetrics, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int LINELEFT
public static final int LINECENTER
public static final int LINERIGHT
public static final int LEFT
public static final int HCENTER
public static final int RIGHT
public static final int TOP
public static final int VCENTER
public static final int BOTTOM
public static final int NORMAL
public static final int SUNK3D
public static final int RAISE3D
public static final int OUTLINE
public int style
public java.awt.Color outlineColor
public int shadowHeight
public java.awt.Color shadowColor
public int align
public int hAlign
public int vAlign
public int lineWidth
public int separateLength
public int lineGap
public boolean autosize
public java.lang.String text
Constructor Detail |
public Label3D()
public Label3D(java.lang.String text)
text
- is the text to be shown.public Label3D(int fontsize)
fontsize
- is the font size of the text to be shown.public Label3D(java.lang.String text, int fontsize)
text
- is the text to be shown.fontsize
- is the font size of the text to be shown.public Label3D(java.lang.String text, int fontsize, int style)
text
- is the text to be shown.fontsize
- is the font size of the text to be shown.style
- is the style of the text to be shown.Method Detail |
public void setAlign(int align, int hAlign, int vAlign)
public void setLabel3D(java.lang.String text, int fontsize, int style)
public void setFont(java.awt.Font f)
setFont
in class java.awt.Component
public void propertyChanged()
propertyChanged
in class SmartComponent
public java.awt.Dimension getTextDimension()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class SmartComponent
Component
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Component
getPreferredSize()
public void sizeToFit()
public void paint(java.awt.Graphics g)
paint
in class SmartComponent
public boolean rejustSize(java.awt.Graphics g)
protected void doPaint(java.awt.Graphics g, int x, int y, java.awt.Dimension dim)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |