jdbreport.grid
Class JReportGrid

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTable
                  extended by jdbreport.grid.JReportGrid
All Implemented Interfaces:
and.finder.Finder, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable, TableRowModelListener, HeighCalculator, ReportColumnModelListener

public class JReportGrid
extends JTable
implements TableRowModelListener, PropertyChangeListener, HeighCalculator, ReportColumnModelListener, and.finder.Finder

Version:
2.0 18.04.2012
Author:
Andrey Kholmanskih
See Also:
Serialized Form

Nested Class Summary
protected static class JReportGrid.AbstractReportRenderer
           
static class JReportGrid.DateRenderer
           
static class JReportGrid.HTMLEditor
           
static class JReportGrid.HTMLReportRenderer
           
static class JReportGrid.PageNumberRenderer
          PageNumber Renderer
static class JReportGrid.StyledEditor
          Default editors
static class JReportGrid.TextReportRenderer
           
 
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
protected  ReportCellRenderer htmlReportRenderer
           
static int ROW_MARGIN
           
protected  ReportCellRenderer textReportRenderer
           
protected  UndoListener undoListener
           
 
Fields inherited from class javax.swing.JTable
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader
 
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
JReportGrid()
           
JReportGrid(TableModel tm)
           
 
Method Summary
 void addAction(Action action)
           
 void addBorder(boolean[] positions)
          Sets the borders at the specified positions for the selected cells
 void addCellSelectListener(CellSelectListener l)
           
 void addCellValueChangeListener(CellValueChangeListener l)
           
 void addColumns()
           
 void addRows(int count, int index)
           
 void addUndoListener(UndoListener l)
           
 void autoHeightCell()
          Auto height row
 int calcRowHeight(ReportModel model, Cell cell, int row, int column)
           
protected  boolean canEdit(Cell cell)
           
protected  boolean canUndo()
           
 void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
           
 void columnMoved(TableColumnModelEvent e)
           
 void columnMoving(TableColumnModelEvent e)
           
protected  void configureEnclosingScrollPane()
           
 int convertColumnIndexToModel(int viewColumnIndex)
           
 void copy()
           
 String copy(GridRect selectionRect)
           
 Image copyImage(GridRect selectionRect)
           
 String copyText(GridRect selectionRect)
           
protected  CellPropertiesDlg createCellProperties()
           
protected  ClipboardParser createClipboardWriter()
           
protected  TableColumnModel createDefaultColumnModel()
           
 void createDefaultColumnsFromModel()
           
protected  void createDefaultEditors()
           
protected  void createDefaultRenderers()
           
protected  RowHeader createDefaultRowHeader()
           
protected  JTableHeader createDefaultTableHeader()
           
 DefaultHandler createGridHandler(XMLReader reader)
           
 GridParser createGridWriter()
           
protected  DefaultHandler createPasteHandler(XMLReader reader, int selectRow, int selectCol)
           
 void cut()
           
 void decDecimals()
          Decrements decimal position of the numeric value for selected cells.
 void delete()
           
 void deleteIcon()
           
 boolean downCell()
           
 void editingStopped(ChangeEvent e)
           
 void endUpdate()
           
 boolean find(and.finder.FindParams findParams)
           
 void fireCellSelectChanged()
           
 void fireCellSelectChanged(CellSelectChangedEvent e)
           
protected  void fireCellValueChanged(CellValueChangedEvent e)
           
 TableCellEditor getCellEditor(int row, int column)
           
 Rectangle getCellRect(int row, int column, boolean includeSpacing)
           
 TableCellRenderer getCellRenderer(Cell cell)
           
 TableCellRenderer getCellRenderer(int row, int column)
           
 CellStyle getCellStyle(Object index)
          Returns the CellStyle by index
protected  and.finder.Finder getFinder()
           
 ReportCellRenderer getHTMLReportRenderer()
           
 Printable getPrintable(JTable.PrintMode printMode, MessageFormat headerFormat, MessageFormat footerFormat)
           
 PrintRequestAttributeSet getPrintAttributes()
           
 ReportModel getReportModel()
           
 Printable getReportPrintable(boolean isPreview)
           
 RowHeader getRowHeader()
           
 int getRowHeight(int row)
           
 int getRowMargin()
           
 String getRowName(int row)
          Returns the row's header value
 int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
           
 Cell getSelectedCell()
          Returns the first selected cell
 GridRect getSelectionRect()
           
 StringMetrics getStringMetrics()
           
 TableRowModel getTableRowModel()
           
 ReportCellRenderer getTextReportRenderer()
           
 String getUIClassID()
           
 void horizontalPageBreak()
           
 void incDecimals()
          Increments decimal position of the numeric value for selected cells.
 boolean incrementalFind(and.finder.FindParams findParams)
           
protected  void initializeLocalVars()
           
 void insertIcon()
           
 boolean isCellSelected(int row, int column)
           
 boolean isPrintLeftToRight()
          Direction of an output of pages on the printer.
 boolean isPrintState()
           
 boolean isShowGrid()
           
 void loadFragment(Reader reader, int selectRow, int selectCol)
           
 boolean nextCell()
           
 void pageSetup()
           
 void paste()
           
 void paste(String data, int selectRow, int selectCol)
           
 void pasteImage(Image image, int selectedRow, int selectedColumn)
           
 void pasteText(String data, int selectedRow, int selectedColumn)
           
 Component prepareEditor(TableCellEditor editor, int row, int column)
           
 boolean print()
           
 boolean print(boolean showPrintDialog, PrintRequestAttributeSet attr)
           
 void propertyChange(PropertyChangeEvent evt)
           
protected  void pushUndo(UndoItem undo)
           
 void removeAction(Action action)
           
 void removeBorder(boolean[] positions)
          Removes the borders at the specified positions for the selected cells
 void removeCellSelectListener(CellSelectListener l)
           
 void removeCellValueChangeListener(CellValueChangeListener l)
           
 void removeColumns()
           
 void removeRows(int count, int index)
           
 void removeUndoListener(UndoListener l)
           
 boolean rightCell()
           
 void rowAdded(TableRowModelEvent e)
          Tells listeners that a row was added to the model.
 int rowAtPoint(Point point)
           
 void rowMarginChanged(ChangeEvent e)
          Tells listeners that a row was moved due to a margin change.
 void rowMoved(TableRowModelEvent e)
          Tells listeners that a row was repositioned.
 void rowRemoved(TableRowModelEvent e)
          Tells listeners that a row was removed from the model.
 void rowResized(TableRowModelEvent e)
          Tells listeners that a row was resized.
 void rowSelectionChanged(ListSelectionEvent e)
          Tells listeners that the selection model of the TableRowModel changed.
 void rowUpdated(TableRowModelEvent e)
          Tells listeners that a rows was change.
 void saveIcon()
           
 void scaleIcon()
           
 void setCellBackground(Color color)
          Sets background color for the selected cells
 void setColumnsWidth(int minColumn, int maxColumn, int width)
           
 void setFontName(String fontName)
          Sets the font's name for the selected cells.
 void setFontSize(int fontSize)
          Sets the font's size for the selected cells
 void setFontStyle(int fontStyle)
          Changes the font's style for the selected cells on the inverse one
 void setHorzAlign(int align)
          Sets the horizontal alignment for the selected cells The horizontal alignment is a constant that may be LEFT, RIGHT, CENTER or JUSTIFY
protected  void setLazyRenderer(Class<?> c, String s)
           
 void setModel(TableModel dataModel)
           
 void setRowHeader(RowHeader rowHeader)
           
 void setRowHeight(int rowHeight)
           
 void setRowHeight(int row, int rowHeight)
           
 void setRowModel(TableRowModel rowModel)
          Sets the TableRowModel
 void setRowsHeight(int minRow, int maxRow, int height)
           
 void setSelectedRect(GridRect rect)
          Selects cells by rect
 void setShowPrintDialog(boolean show)
           
 void setSize(Dimension newSize)
           
 void setTableHeader(JTableHeader tableHeader)
           
 void setVertAlign(int align)
          Sets the vertical alignment for the selected cells The vertical alignment is a constant that may be TOP, BOTTOM or CENTER
 void showCellEditor()
           
 void showCellProperty()
           
 void startUpdate()
           
 void tableChanged(TableModelEvent e)
           
protected  void unconfigureEnclosingScrollPane()
           
 void unionCell()
          Unions the selected cells
protected  void unionUndo(UndoItem undo)
           
 void updatePages(int startRow)
          Calculates pages' size
 void updateRowHeight(ReportModel model)
           
 void updateRowHeight(ReportModel model, int row, int column)
          Compares text's height and row's height.
 void updateUI()
           
 void valueChanged(ListSelectionEvent e)
           
 void verticalPageBreak()
           
 
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnRemoved, columnSelectionChanged, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultDataModel, createDefaultSelectionModel, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getRowCount, getRowHeight, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUpdateSelectionOnSort, getValueAt, isCellEditable, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareRenderer, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setPreferredScrollableViewportSize, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.event.TableColumnModelListener
columnAdded, columnMarginChanged, columnRemoved, columnSelectionChanged
 

Field Detail

ROW_MARGIN

public static final int ROW_MARGIN
See Also:
Constant Field Values

htmlReportRenderer

protected ReportCellRenderer htmlReportRenderer

textReportRenderer

protected ReportCellRenderer textReportRenderer

undoListener

protected UndoListener undoListener
Constructor Detail

JReportGrid

public JReportGrid()

JReportGrid

public JReportGrid(TableModel tm)
Method Detail

addAction

public void addAction(Action action)

removeAction

public void removeAction(Action action)

getRowMargin

public int getRowMargin()
Overrides:
getRowMargin in class JTable

rowUpdated

public void rowUpdated(TableRowModelEvent e)
Description copied from interface: TableRowModelListener
Tells listeners that a rows was change.

Specified by:
rowUpdated in interface TableRowModelListener

rowAdded

public void rowAdded(TableRowModelEvent e)
Description copied from interface: TableRowModelListener
Tells listeners that a row was added to the model.

Specified by:
rowAdded in interface TableRowModelListener

rowRemoved

public void rowRemoved(TableRowModelEvent e)
Tells listeners that a row was removed from the model.

Specified by:
rowRemoved in interface TableRowModelListener

rowMoved

public void rowMoved(TableRowModelEvent e)
Tells listeners that a row was repositioned.

Specified by:
rowMoved in interface TableRowModelListener

rowResized

public void rowResized(TableRowModelEvent e)
Tells listeners that a row was resized.

Specified by:
rowResized in interface TableRowModelListener

rowMarginChanged

public void rowMarginChanged(ChangeEvent e)
Tells listeners that a row was moved due to a margin change.

Specified by:
rowMarginChanged in interface TableRowModelListener

rowSelectionChanged

public void rowSelectionChanged(ListSelectionEvent e)
Tells listeners that the selection model of the TableRowModel changed.

Specified by:
rowSelectionChanged in interface TableRowModelListener

getReportModel

public ReportModel getReportModel()
Returns:
the ReportModel

getTableRowModel

public TableRowModel getTableRowModel()
Returns:
the TableRowModel

getRowHeight

public int getRowHeight(int row)
Overrides:
getRowHeight in class JTable

setRowHeight

public void setRowHeight(int rowHeight)
Overrides:
setRowHeight in class JTable

setRowHeight

public void setRowHeight(int row,
                         int rowHeight)
Overrides:
setRowHeight in class JTable

rowAtPoint

public int rowAtPoint(Point point)
Overrides:
rowAtPoint in class JTable

getUIClassID

public String getUIClassID()
Overrides:
getUIClassID in class JTable

updateUI

public void updateUI()
Overrides:
updateUI in class JTable

getCellRect

public Rectangle getCellRect(int row,
                             int column,
                             boolean includeSpacing)
Overrides:
getCellRect in class JTable

tableChanged

public void tableChanged(TableModelEvent e)
Specified by:
tableChanged in interface TableModelListener
Overrides:
tableChanged in class JTable

setModel

public void setModel(TableModel dataModel)
Overrides:
setModel in class JTable

setTableHeader

public void setTableHeader(JTableHeader tableHeader)
Overrides:
setTableHeader in class JTable

setRowModel

public void setRowModel(TableRowModel rowModel)
Sets the TableRowModel

Parameters:
rowModel - the TableRowModel

getRowName

public String getRowName(int row)
Returns the row's header value

Parameters:
row - the row's number
Returns:
the row's header value

updatePages

public void updatePages(int startRow)
Calculates pages' size

Parameters:
startRow - the first row for calculation

createDefaultColumnsFromModel

public void createDefaultColumnsFromModel()
Overrides:
createDefaultColumnsFromModel in class JTable

setRowHeader

public void setRowHeader(RowHeader rowHeader)
Parameters:
rowHeader - the RowHeader

getRowHeader

public RowHeader getRowHeader()
Returns:
the RowHeader

isShowGrid

public boolean isShowGrid()

createDefaultColumnModel

protected TableColumnModel createDefaultColumnModel()
Overrides:
createDefaultColumnModel in class JTable

createDefaultTableHeader

protected JTableHeader createDefaultTableHeader()
Overrides:
createDefaultTableHeader in class JTable

convertColumnIndexToModel

public int convertColumnIndexToModel(int viewColumnIndex)
Overrides:
convertColumnIndexToModel in class JTable

changeSelection

public void changeSelection(int rowIndex,
                            int columnIndex,
                            boolean toggle,
                            boolean extend)
Overrides:
changeSelection in class JTable

isCellSelected

public boolean isCellSelected(int row,
                              int column)
Overrides:
isCellSelected in class JTable

columnMoving

public void columnMoving(TableColumnModelEvent e)
Specified by:
columnMoving in interface ReportColumnModelListener

columnMoved

public void columnMoved(TableColumnModelEvent e)
Specified by:
columnMoved in interface TableColumnModelListener
Overrides:
columnMoved in class JTable

unionCell

public void unionCell()
Unions the selected cells


autoHeightCell

public void autoHeightCell()
Auto height row


valueChanged

public void valueChanged(ListSelectionEvent e)
Specified by:
valueChanged in interface ListSelectionListener
Overrides:
valueChanged in class JTable

getCellStyle

public CellStyle getCellStyle(Object index)
Returns the CellStyle by index

Parameters:
index - the CellStyle's id
Returns:
the CellStyle

setHorzAlign

public void setHorzAlign(int align)
Sets the horizontal alignment for the selected cells The horizontal alignment is a constant that may be LEFT, RIGHT, CENTER or JUSTIFY

Parameters:
align - the new horizontal alignment for the cells

setVertAlign

public void setVertAlign(int align)
Sets the vertical alignment for the selected cells The vertical alignment is a constant that may be TOP, BOTTOM or CENTER

Parameters:
align - the new vertical alignment for the cells

addBorder

public void addBorder(boolean[] positions)
Sets the borders at the specified positions for the selected cells

Parameters:
positions - positions - boolean values, where true sets border, otherwise does nothing. Position's index can be from Border.LINE_LEFT to Border.LINE_HMIDDLE

removeBorder

public void removeBorder(boolean[] positions)
Removes the borders at the specified positions for the selected cells

Parameters:
positions - positions - boolean values, where true sets border, otherwise does nothing. Position's index can be from Border.LINE_LEFT to Border.LINE_HMIDDLE

setFontName

public void setFontName(String fontName)
Sets the font's name for the selected cells.

Parameters:
fontName - the font's name

setFontSize

public void setFontSize(int fontSize)
Sets the font's size for the selected cells

Parameters:
fontSize - the new font's size

setFontStyle

public void setFontStyle(int fontStyle)
Changes the font's style for the selected cells on the inverse one

Parameters:
fontStyle - the font's style The style argument is an integer bitmask that may be PLAIN, or a bitwise union of BOLD, ITALIC, UNDERLINE, STRIKETHROUGH

setCellBackground

public void setCellBackground(Color color)
Sets background color for the selected cells

Parameters:
color - the new background color for the cells

incDecimals

public void incDecimals()
Increments decimal position of the numeric value for selected cells.


decDecimals

public void decDecimals()
Decrements decimal position of the numeric value for selected cells.


getSelectedCell

public Cell getSelectedCell()
Returns the first selected cell

Returns:
the first selected cell

getSelectionRect

public GridRect getSelectionRect()
Returns:
the selected coordinates

setSelectedRect

public void setSelectedRect(GridRect rect)
Selects cells by rect

Parameters:
rect - coordinates

getCellEditor

public TableCellEditor getCellEditor(int row,
                                     int column)
Overrides:
getCellEditor in class JTable

initializeLocalVars

protected void initializeLocalVars()
Overrides:
initializeLocalVars in class JTable

createDefaultRowHeader

protected RowHeader createDefaultRowHeader()

configureEnclosingScrollPane

protected void configureEnclosingScrollPane()
Overrides:
configureEnclosingScrollPane in class JTable

setSize

public void setSize(Dimension newSize)
Overrides:
setSize in class Component

unconfigureEnclosingScrollPane

protected void unconfigureEnclosingScrollPane()
Overrides:
unconfigureEnclosingScrollPane in class JTable

addUndoListener

public void addUndoListener(UndoListener l)

removeUndoListener

public void removeUndoListener(UndoListener l)

pushUndo

protected void pushUndo(UndoItem undo)

unionUndo

protected void unionUndo(UndoItem undo)

canUndo

protected boolean canUndo()

addCellSelectListener

public void addCellSelectListener(CellSelectListener l)

removeCellSelectListener

public void removeCellSelectListener(CellSelectListener l)
Parameters:
l - CellSelectListener

fireCellSelectChanged

public void fireCellSelectChanged()

fireCellSelectChanged

public void fireCellSelectChanged(CellSelectChangedEvent e)

print

public boolean print(boolean showPrintDialog,
                     PrintRequestAttributeSet attr)
              throws PrinterException
Throws:
PrinterException

print

public boolean print()
              throws PrinterException
Overrides:
print in class JTable
Throws:
PrinterException

getPrintAttributes

public PrintRequestAttributeSet getPrintAttributes()

setShowPrintDialog

public void setShowPrintDialog(boolean show)

getPrintable

public Printable getPrintable(JTable.PrintMode printMode,
                              MessageFormat headerFormat,
                              MessageFormat footerFormat)
Overrides:
getPrintable in class JTable

getReportPrintable

public Printable getReportPrintable(boolean isPreview)

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

editingStopped

public void editingStopped(ChangeEvent e)
Specified by:
editingStopped in interface CellEditorListener
Overrides:
editingStopped in class JTable

addCellValueChangeListener

public void addCellValueChangeListener(CellValueChangeListener l)

removeCellValueChangeListener

public void removeCellValueChangeListener(CellValueChangeListener l)
Parameters:
l - CellValueChangeListener

fireCellValueChanged

protected void fireCellValueChanged(CellValueChangedEvent e)

getScrollableUnitIncrement

public int getScrollableUnitIncrement(Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Specified by:
getScrollableUnitIncrement in interface Scrollable
Overrides:
getScrollableUnitIncrement in class JTable

downCell

public boolean downCell()

rightCell

public boolean rightCell()

nextCell

public boolean nextCell()

horizontalPageBreak

public void horizontalPageBreak()

verticalPageBreak

public void verticalPageBreak()

delete

public void delete()

prepareEditor

public Component prepareEditor(TableCellEditor editor,
                               int row,
                               int column)
Overrides:
prepareEditor in class JTable

copyText

public String copyText(GridRect selectionRect)
                throws SaveReportException
Throws:
SaveReportException

copyImage

public Image copyImage(GridRect selectionRect)

copy

public void copy()

copy

public String copy(GridRect selectionRect)
            throws SaveReportException
Throws:
SaveReportException

createClipboardWriter

protected ClipboardParser createClipboardWriter()

pasteText

public void pasteText(String data,
                      int selectedRow,
                      int selectedColumn)
               throws IOException
Throws:
IOException

pasteImage

public void pasteImage(Image image,
                       int selectedRow,
                       int selectedColumn)

paste

public void paste(String data,
                  int selectRow,
                  int selectCol)
           throws ParserConfigurationException,
                  SAXException,
                  IOException
Throws:
ParserConfigurationException
SAXException
IOException

createGridWriter

public GridParser createGridWriter()

createGridHandler

public DefaultHandler createGridHandler(XMLReader reader)

loadFragment

public void loadFragment(Reader reader,
                         int selectRow,
                         int selectCol)
                  throws ParserConfigurationException,
                         SAXException,
                         IOException
Parameters:
reader -
selectRow -
selectCol -
Throws:
ParserConfigurationException
SAXException
IOException

createPasteHandler

protected DefaultHandler createPasteHandler(XMLReader reader,
                                            int selectRow,
                                            int selectCol)

cut

public void cut()

paste

public void paste()

insertIcon

public void insertIcon()

saveIcon

public void saveIcon()

scaleIcon

public void scaleIcon()

deleteIcon

public void deleteIcon()

pageSetup

public void pageSetup()

addColumns

public void addColumns()

removeColumns

public void removeColumns()

addRows

public void addRows(int count,
                    int index)

removeRows

public void removeRows(int count,
                       int index)

setColumnsWidth

public void setColumnsWidth(int minColumn,
                            int maxColumn,
                            int width)

setRowsHeight

public void setRowsHeight(int minRow,
                          int maxRow,
                          int height)

calcRowHeight

public int calcRowHeight(ReportModel model,
                         Cell cell,
                         int row,
                         int column)
Specified by:
calcRowHeight in interface HeighCalculator

updateRowHeight

public void updateRowHeight(ReportModel model,
                            int row,
                            int column)
Compares text's height and row's height.

Parameters:
model -
row - the row's number
column - the column's number

startUpdate

public void startUpdate()

endUpdate

public void endUpdate()

updateRowHeight

public void updateRowHeight(ReportModel model)

canEdit

protected boolean canEdit(Cell cell)

showCellEditor

public void showCellEditor()

showCellProperty

public void showCellProperty()

createCellProperties

protected CellPropertiesDlg createCellProperties()
                                          throws HeadlessException
Throws:
HeadlessException

isPrintState

public boolean isPrintState()

getFinder

protected and.finder.Finder getFinder()

find

public boolean find(and.finder.FindParams findParams)
Specified by:
find in interface and.finder.Finder

incrementalFind

public boolean incrementalFind(and.finder.FindParams findParams)
Specified by:
incrementalFind in interface and.finder.Finder

getHTMLReportRenderer

public ReportCellRenderer getHTMLReportRenderer()

getTextReportRenderer

public ReportCellRenderer getTextReportRenderer()

setLazyRenderer

protected void setLazyRenderer(Class<?> c,
                               String s)

getCellRenderer

public TableCellRenderer getCellRenderer(int row,
                                         int column)
Overrides:
getCellRenderer in class JTable

getCellRenderer

public TableCellRenderer getCellRenderer(Cell cell)

createDefaultRenderers

protected void createDefaultRenderers()
Overrides:
createDefaultRenderers in class JTable

isPrintLeftToRight

public boolean isPrintLeftToRight()
Direction of an output of pages on the printer. If true that pages are printed from left to right, from top to down, differently pages are printed from top to down, from left to right.

Returns:
true if pages are printed from left to right, otherwise false
Since:
2.0

createDefaultEditors

protected void createDefaultEditors()
Overrides:
createDefaultEditors in class JTable

getStringMetrics

public StringMetrics getStringMetrics()
Specified by:
getStringMetrics in interface HeighCalculator