JComponentPack 1.5.0

com.zfqjava.swing
Class JDataGridBean

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.zfqjava.swing.JBean
                      extended by com.zfqjava.swing.JDataGridBean
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, WindowConstants

public class JDataGridBean
extends JBean

JDataGridBean provides a JavaBean ready to use.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
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
static String CHART_TOOLBAR
          Identifies the chart toolbar.
static String FORMULA_TOOLBAR
          Identifies the formula toolbar.
static String MAIN_MENUBAR
          Identifies the main menubar.
static String MAIN_TOOLBAR
          Identifies the main toolbar.
static String SHAPE_TOOLBAR
          Identifies the shape toolbar.
static String STYLE_TOOLBAR
          Identifies the style toolbar.
 
Fields inherited from class com.zfqjava.swing.JBean
ABOUT, CLEAR, CLEAR_ALL, COPY, CUT, EXIT, EXPORT, FILE, FIND, FIND_NEXT, HELP, IMPORT, NEW, OPEN, PAGE_SETUP, PASTE, PRINT, PRINT_PREVIEW, REDO, REPLACE, SAVE, SAVE_AS, SELECT_ALL, SPELL, TIP, TOOL, UNDO, VIEW
 
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.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JDataGridBean()
           
 
Method Summary
protected  JDataGrid createDataGrid()
          Creates a datagrid for this bean.
protected  DataGridModel createModel()
          Creates the default DataGridModel for the JDataGrid.
protected  Printable createPrintable(JDataGrid dataGrid)
          Creates the printable for the specified data grid.
 Map createPrintProperties()
          Creates the default print properties.
protected  JStatusBar createStatusBar()
          Creates a status bar.
 WorkBook createWorkBook()
          Creates the default work book, includes 3 work sheets, first sheet is selected by default.
 WorkSheet createWorkSheet()
          Creates the default work sheet, with the model by createModel().
protected  void doBeforeClose()
          Invoke this method before close the frame.
 void doCellAttributes()
           
 void doChart()
           
 void doClear()
           
 void doClearAll()
           
 void doColumnName()
           
 void doColumnWidth()
           
 void doComment()
           
 void doCopy(ActionEvent e)
           
 void doCut(ActionEvent e)
           
 void doDeleteColumn()
           
 void doDeleteComment()
           
 void doDeleteRow()
           
 void doDeleteSheet()
           
 void doFind()
           
 void doFindNext()
           
 void doFormula()
           
 void doFreeze()
           
 void doFunction()
           
 void doGoCell()
           
 void doHideColumn()
           
 void doHideRow()
           
 void doHyperlink()
           
 void doImage()
           
 void doInsertColumnAfter()
           
 void doInsertColumnBefore()
           
 void doInsertComment()
           
 void doInsertRowAfter()
           
 void doInsertRowBefore()
           
 void doInsertSheet()
           
 void doMergeCell()
           
 void doNew()
           
 void doNewWindow()
           
 void doOpen()
           
protected  void doOpen(File[] files)
          Open the specified files by drop, subclass can override this methods to open the files as needed.
protected  void doOpen(URL[] urls)
           
 void doPageSetup()
           
 void doPaste(ActionEvent e)
           
 void doPrint()
           
 void doPrintPreview()
           
 void doRedo()
           
 void doRenameSheet()
           
 void doReplace()
           
 void doRowHeight()
           
 void doSave()
           
 void doSaveAs()
           
 void doSelectAll()
           
 void doShowColumn()
           
 void doShowRow()
           
 void doSort()
           
 void doSortAscending()
           
 void doSortDescending()
           
 void doSpell()
           
 void doSplit()
           
 void doSplitCell()
           
 void doUndo()
           
 void doViewChartBar(ActionEvent e)
           
 void doViewColumnHeader(ActionEvent e)
           
 void doViewFormulaBar(ActionEvent e)
           
 void doViewRowHeader(ActionEvent e)
           
 void doViewShapeBar(ActionEvent e)
           
 void doViewStatusBar(ActionEvent e)
           
 void doViewStyleBar(ActionEvent e)
           
 void doViewToolBar(ActionEvent e)
           
 AbstractChart getAbstractChart()
          Returns the current AbstractChart.
 Object getData()
          Returns the data object, a WorkBook or TableModel.
 JDataGrid getDataGrid()
          Returns the datagrid for this bean.
 Object getDataLocation()
          Returns the current data location.
 JMenuBar getMenuBar(String name)
          Returns the menubar for the specified name.
 JPrintPreview getPrintPreview()
          Returns the print preview component.
 Map getPrintProperties()
          Returns the print properties.
 JScrollPane getScrollPane()
          Returns the JScrollPane the JDataGrid use.
 Set getSupportedFileSuffix()
          Returns the supported file suffix.
 JToolBar getToolBar(String name)
          Returns the toolbar for the specified name.
 WorkBook getWorkBook()
          Returns the work book in use.
 boolean isAutoAdjustRowColumCount()
          Determines whether auto adjust the row and column count.
 boolean isPrintSelectedCell()
          Determines whether print the selected cell area.
static void main(String[] args)
           
 void setAutoAdjustRowColumCount(boolean autoAdjustRowColumCount)
          Sets whether auto adjust the row and column count.
 void setData(Object object)
          Sets the data for JDataGrid, support two types: WorkBook, TableModel
 void setDataGrid(JDataGrid dataGrid)
          Sets the datagrid for this bean.
 void setDataLocation(Object urlObject)
          Sets the data location, the data file or URL.
 void setPrintProperties(Map printProperties)
          Sets the print properties.
 void setPrintSelectedCell(boolean printSelectedCell)
          Sets whether print the selected cell area.
 void setScrollPane(JScrollPane scrollPane)
          Sets the JScrollPane the JDataGrid use.
 void setSupportedFileSuffix(Set supportedFileSuffix)
          Sets the supported file suffix.
 void setWorkBook(WorkBook workBook)
          Sets the bean's work book to the specified workBook.
 void updateUI()
           
 
Methods inherited from class com.zfqjava.swing.JBean
createActionManager, createButton, createFrame, createInternalFrame, createMenu, createMenuBar, createMenuItem, createPopupMenu, createResourceManager, createToolBar, createUIFactory, doAbout, doClose, doExit, doFeedback, doLookAndFeel, doSplash, doTip, getAction, getActionManager, getDefaultCloseOperation, getExtendedState, getFrame, getIcon, getInternalFrame, getResourceManager, getStatusBar, getString, getTitle, getUIFactory, init, invokeAction, isDefaultPropertiesEnabled, isShowSplashOnStartup, setDefaultCloseOperation, setDefaultPropertiesEnabled, setExtendedState, setShowSplashOnStartup, setTitle, showFrame, showInternalFrame
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, 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, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, doLayout, 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, transferFocusBackward, 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, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAIN_MENUBAR

public static final String MAIN_MENUBAR
Identifies the main menubar.

See Also:
Constant Field Values

MAIN_TOOLBAR

public static final String MAIN_TOOLBAR
Identifies the main toolbar.

See Also:
Constant Field Values

CHART_TOOLBAR

public static final String CHART_TOOLBAR
Identifies the chart toolbar.

See Also:
Constant Field Values

SHAPE_TOOLBAR

public static final String SHAPE_TOOLBAR
Identifies the shape toolbar.

See Also:
Constant Field Values

FORMULA_TOOLBAR

public static final String FORMULA_TOOLBAR
Identifies the formula toolbar.

See Also:
Constant Field Values

STYLE_TOOLBAR

public static final String STYLE_TOOLBAR
Identifies the style toolbar.

See Also:
Constant Field Values
Constructor Detail

JDataGridBean

public JDataGridBean()
Method Detail

updateUI

public void updateUI()
Overrides:
updateUI in class JPanel

createStatusBar

protected JStatusBar createStatusBar()
Description copied from class: JBean
Creates a status bar.

Overrides:
createStatusBar in class JBean
Returns:
a status bar.

getMenuBar

public JMenuBar getMenuBar(String name)
Returns the menubar for the specified name.

Parameters:
name - the menubar name
Returns:
the menubar
Since:
JDataGrid 1.5.1

getToolBar

public JToolBar getToolBar(String name)
Returns the toolbar for the specified name.

Parameters:
name - the toolbar name
Returns:
the toolbar
Since:
JDataGrid 1.5.1

setDataGrid

public void setDataGrid(JDataGrid dataGrid)
Sets the datagrid for this bean.

Parameters:
dataGrid - the datagrid
Since:
JDataGrid 1.5.1

createWorkBook

public WorkBook createWorkBook()
Creates the default work book, includes 3 work sheets, first sheet is selected by default.

Returns:
new default work book
Since:
JDataGrid 2.0

createWorkSheet

public WorkSheet createWorkSheet()
Creates the default work sheet, with the model by createModel().

Returns:
a new default work sheet
Since:
JDataGrid 2.0

setWorkBook

public void setWorkBook(WorkBook workBook)
Sets the bean's work book to the specified workBook.

Parameters:
workBook - the work book
Since:
JDataGrid 2.0
See Also:
getWorkBook()

getWorkBook

public WorkBook getWorkBook()
Returns the work book in use.

Returns:
the work book in use
Since:
JDataGrid 2.0

doInsertSheet

public void doInsertSheet()

doDeleteSheet

public void doDeleteSheet()

doRenameSheet

public void doRenameSheet()

getDataGrid

public JDataGrid getDataGrid()
Returns the datagrid for this bean.

Returns:
the datagrid for this bean
Since:
JDataGrid 1.5.1

createDataGrid

protected JDataGrid createDataGrid()
Creates a datagrid for this bean.

Returns:
a new datagrid
Since:
JDataGrid 1.5.1

createModel

protected DataGridModel createModel()
Creates the default DataGridModel for the JDataGrid.

Returns:
the default DataGridModel
Since:
JDataGrid 1.5.1

getAbstractChart

public AbstractChart getAbstractChart()
Returns the current AbstractChart.

Returns:
the current AbstractChart
Since:
JDataGrid 2.0

doRowHeight

public void doRowHeight()

doColumnWidth

public void doColumnWidth()

doShowColumn

public void doShowColumn()

doHideColumn

public void doHideColumn()

doShowRow

public void doShowRow()

doHideRow

public void doHideRow()

doNew

public void doNew()

doOpen

protected void doOpen(URL[] urls)

setData

public void setData(Object object)
Sets the data for JDataGrid, support two types: WorkBook, TableModel

Parameters:
object - the data for JDataGrid
Since:
JComponentPack 1.2.0

getData

public Object getData()
Returns the data object, a WorkBook or TableModel.

Returns:
the data object, a WorkBook or TableModel.
Since:
JComponentPack 1.2.0

doOpen

protected void doOpen(File[] files)
Description copied from class: JBean
Open the specified files by drop, subclass can override this methods to open the files as needed.

Overrides:
doOpen in class JBean
Parameters:
files - the files to drop

doOpen

public void doOpen()

doSave

public void doSave()

doSaveAs

public void doSaveAs()

doPageSetup

public void doPageSetup()

doPrint

public void doPrint()

doPrintPreview

public void doPrintPreview()

doBeforeClose

protected void doBeforeClose()
                      throws ActionVetoException
Description copied from class: JBean
Invoke this method before close the frame.

Overrides:
doBeforeClose in class JBean
Throws:
ActionVetoException - if the close action cannot be permited.

doUndo

public void doUndo()

doRedo

public void doRedo()

doCut

public void doCut(ActionEvent e)

doCopy

public void doCopy(ActionEvent e)

doPaste

public void doPaste(ActionEvent e)

doFind

public void doFind()

doFindNext

public void doFindNext()

doReplace

public void doReplace()

doGoCell

public void doGoCell()

doClear

public void doClear()

doClearAll

public void doClearAll()

doSelectAll

public void doSelectAll()

doViewToolBar

public void doViewToolBar(ActionEvent e)

doViewStyleBar

public void doViewStyleBar(ActionEvent e)

doViewFormulaBar

public void doViewFormulaBar(ActionEvent e)

doViewShapeBar

public void doViewShapeBar(ActionEvent e)

doViewChartBar

public void doViewChartBar(ActionEvent e)

doViewStatusBar

public void doViewStatusBar(ActionEvent e)

doViewRowHeader

public void doViewRowHeader(ActionEvent e)

doViewColumnHeader

public void doViewColumnHeader(ActionEvent e)

doFormula

public void doFormula()

doChart

public void doChart()

doSpell

public void doSpell()

doInsertRowBefore

public void doInsertRowBefore()

doInsertRowAfter

public void doInsertRowAfter()

doDeleteRow

public void doDeleteRow()

doInsertColumnBefore

public void doInsertColumnBefore()

doInsertColumnAfter

public void doInsertColumnAfter()

doDeleteColumn

public void doDeleteColumn()

doMergeCell

public void doMergeCell()

doSplitCell

public void doSplitCell()

doSort

public void doSort()

doSortAscending

public void doSortAscending()

doSortDescending

public void doSortDescending()

doColumnName

public void doColumnName()

doCellAttributes

public void doCellAttributes()

doFunction

public void doFunction()

doHyperlink

public void doHyperlink()

doImage

public void doImage()

doFreeze

public void doFreeze()

doSplit

public void doSplit()

doNewWindow

public void doNewWindow()

doComment

public void doComment()

doInsertComment

public void doInsertComment()

doDeleteComment

public void doDeleteComment()

getPrintPreview

public JPrintPreview getPrintPreview()
Returns the print preview component.

Returns:
the print preview component
Since:
JDataGrid 1.5.1

createPrintable

protected Printable createPrintable(JDataGrid dataGrid)
Creates the printable for the specified data grid.

Parameters:
dataGrid - the dataGrid
Returns:
the printable
Since:
JDataGrid 1.5.1

getPrintProperties

public Map getPrintProperties()
Returns the print properties.

Returns:
the print properties
Since:
JDataGrid 2.5.0

setPrintProperties

public void setPrintProperties(Map printProperties)
Sets the print properties.

Parameters:
printProperties - the print properties
Since:
JDataGrid 2.5.0

isPrintSelectedCell

public boolean isPrintSelectedCell()
Determines whether print the selected cell area.

Returns:
true if print the selected cell area, false otherwise
Since:
JDataGrid 2.5.0

setPrintSelectedCell

public void setPrintSelectedCell(boolean printSelectedCell)
Sets whether print the selected cell area.

Parameters:
printSelectedCell -
Since:
JDataGrid 2.5.0

createPrintProperties

public Map createPrintProperties()
Creates the default print properties.

Returns:
the print properties
Since:
JDataGrid 2.5.0

getSupportedFileSuffix

public Set getSupportedFileSuffix()
Returns the supported file suffix.

Returns:
the supported file suffix
Since:
JDataGrid 2.5.0

setSupportedFileSuffix

public void setSupportedFileSuffix(Set supportedFileSuffix)
Sets the supported file suffix.

Parameters:
supportedFileSuffix -
Since:
JDataGrid 2.5.0

setDataLocation

public void setDataLocation(Object urlObject)
Sets the data location, the data file or URL.

Parameters:
urlObject - the data location
Since:
JComponentPack 1.2.0

getDataLocation

public Object getDataLocation()
Returns the current data location.

Returns:
the current data location
Since:
JComponentPack 1.2.0

main

public static void main(String[] args)

getScrollPane

public JScrollPane getScrollPane()
Returns the JScrollPane the JDataGrid use.

Since:
JDataGrid 2.2.3

setScrollPane

public void setScrollPane(JScrollPane scrollPane)
Sets the JScrollPane the JDataGrid use.

Since:
JDataGrid 2.2.3

isAutoAdjustRowColumCount

public boolean isAutoAdjustRowColumCount()
Determines whether auto adjust the row and column count.

Since:
JDataGrid 2.2.3

setAutoAdjustRowColumCount

public void setAutoAdjustRowColumCount(boolean autoAdjustRowColumCount)
Sets whether auto adjust the row and column count.

Since:
JDataGrid 2.2.3

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.