|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
org.tentackle.print.PrintLabel
org.tentackle.print.NumberPrintLabel
public abstract class NumberPrintLabel
Abstract printing bean for formatting numbers.
Must be subclassed for the concrete data type.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JLabel |
|---|
JLabel.AccessibleJLabel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected DecimalFormat |
format
the decimal format |
| Fields inherited from class org.tentackle.print.PrintLabel |
|---|
value |
| Fields inherited from class javax.swing.JLabel |
|---|
labelFor |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
NumberPrintLabel()
Creates a number print label with minimum width. |
|
NumberPrintLabel(int columns)
Creates a number print label. |
|
| Method Summary | |
|---|---|
abstract String |
doFormat(Object value)
Renders an object according a format. This function does *not* set the text in the field. |
String |
getFormat()
Gets the decimal format string. |
int |
getScale()
Gets the current scale. |
boolean |
isBlankZero()
Gets zero suppression. |
void |
setBlankZero(boolean blankZero)
Sets zero suppression. |
void |
setFormat(String pattern)
Sets the decimal format. |
void |
setPrintValue(Object value)
convert the number to the Form (re-implemented from PrintLabel) |
void |
setScale(int scale)
Changes the format according to the given scale. |
| Methods inherited from class org.tentackle.print.PrintLabel |
|---|
getColumns, getColumnWidth, getPreferredHeight, getPreferredSize, getPreferredWidth, getPrintValue, setBounds, setBounds, setColumns, setFont, setPreferredHeight, setPreferredWidth, setSize, setSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected DecimalFormat format
| Constructor Detail |
|---|
public NumberPrintLabel(int columns)
columns - the width in columns, 0 = minimum widthpublic NumberPrintLabel()
| Method Detail |
|---|
public void setPrintValue(Object value)
setPrintValue in interface PrintComponentsetPrintValue in class PrintLabelvalue - the value objectpublic abstract String doFormat(Object value)
value - the object to format
public void setFormat(String pattern)
pattern - the format stringpublic String getFormat()
public void setScale(int scale)
scale - the number of digits after the commapublic int getScale()
public void setBlankZero(boolean blankZero)
blankZero - true if zero will result in an empty fieldpublic boolean isBlankZero()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||