|
||||||||||
| 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.JTable
org.tentackle.ui.FormTable
org.tentackle.print.PrintTable
public class PrintTable
Printable FormTable that looks nice when printed.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JTable |
|---|
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode |
| 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 |
|---|
| Fields inherited from class org.tentackle.ui.FormTable |
|---|
CELLTRAVERSAL_AUTOEDIT, CELLTRAVERSAL_COLUMN, CELLTRAVERSAL_NOLINEWRAP, CELLTRAVERSAL_NONE, CELLTRAVERSAL_NOTABLEWRAP, CELLTRAVERSAL_ROW, CELLTRAVERSAL_SKIPNOEDIT, CELLTRAVERSAL_WRAPINLINE, CLICK_ACTION, ENTER_ACTION |
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PrintTable()
Creates a printable formtable |
|
PrintTable(TableModel model)
Creates a printable formtable for a given data model. |
|
| Method Summary | |
|---|---|
Dimension |
getPreferredSize()
If the preferredSize has been set to a
non-null value just returns it. |
void |
print(Graphics g)
Overridden to print the header. |
void |
setPreferredSize(Dimension preferredSize)
Sets the preferred size of this component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PrintTable()
public PrintTable(TableModel model)
model - the data model| Method Detail |
|---|
public Dimension getPreferredSize()
preferredSize has been set to a
non-null value just returns it.
If the UI delegate's getPreferredSize
method returns a non null value then return that;
otherwise defer to the component's layout manager.
Overridden to gain room for the header
getPreferredSize in class JComponentpreferredSize propertyJComponent.setPreferredSize(java.awt.Dimension),
ComponentUIpublic void setPreferredSize(Dimension preferredSize)
preferredSize is null, the UI will
be asked for the preferred size.
Overridden to adjust for the extra height of the header
setPreferredSize in class JComponentpreferredSize - The new preferred size, or nullComponent.getPreferredSize(),
Component.isPreferredSizeSet()public void print(Graphics g)
Invoke this method to print the component to the specified
Graphics. This method will result in invocations
of printComponent, printBorder and
printChildren. It is recommended that you override
one of the previously mentioned methods rather than this one if
your intention is to customize the way printing looks. However,
it can be useful to override this method should you want to prepare
state before invoking the superclass behavior. As an example,
if you wanted to change the component's background color before
printing, you could do the following:
public void print(Graphics g) {
Color orig = getBackground();
setBackground(Color.WHITE);
// wrap in try/finally so that we always restore the state
try {
super.print(g);
} finally {
setBackground(orig);
}
}
Alternatively, or for components that delegate painting to other objects,
you can query during painting whether or not the component is in the
midst of a print operation. The isPaintingForPrint method provides
this ability and its return value will be changed by this method: to
true immediately before rendering and to false
immediately after. With each change a property change event is fired on
this component with the name "paintingForPrint".
This method sets the component's state such that the double buffer
will not be used: painting will be done directly on the passed in
Graphics.
print in class JComponentg - the Graphics context in which to paintJComponent.printComponent(java.awt.Graphics),
JComponent.printBorder(java.awt.Graphics),
JComponent.printChildren(java.awt.Graphics),
JComponent.isPaintingForPrint()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||