JComponentPack 1.5.0

com.zfqjava.swing
Class JBean

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
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, WindowConstants
Direct Known Subclasses:
JDataGridBean, JDataTableBean, JImageViewerBean

public class JBean
extends JPanel
implements WindowConstants

JBean provides a abstract application panel.
The default layout manager is BorderLayout.
JBean provides some methods to create menu, button.

See Also:
DefaultAction, ResourceManager, 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 ABOUT
           
static String CLEAR
           
static String CLEAR_ALL
           
static String COPY
           
static String CUT
           
static String EXIT
           
static String EXPORT
           
static String FILE
           
static String FIND
           
static String FIND_NEXT
           
static String HELP
           
static String IMPORT
           
static String NEW
           
static String OPEN
           
static String PAGE_SETUP
           
static String PASTE
           
static String PRINT
           
static String PRINT_PREVIEW
           
static String REDO
           
static String REPLACE
           
static String SAVE
           
static String SAVE_AS
           
static String SELECT_ALL
           
static String SPELL
           
static String TIP
           
static String TOOL
           
static String UNDO
           
static String 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
JBean()
          Constructs a JBean use the BorderLayout.
 
Method Summary
protected  ActionManager createActionManager()
          Creates the action manager.
protected  AbstractButton createButton(String name)
          Creates a new JButton use the specified action name.
protected  JFrame createFrame()
          Creates a frame for the JBean.
protected  JInternalFrame createInternalFrame()
          Creates a internal frame for the JBean.
protected  JMenu createMenu(String name)
          Creates a new JMenu use the specified action name.
protected  JMenuBar createMenuBar(String name)
          Create a new JMenuBar use the specified name.
protected  JMenuItem createMenuItem(String name)
          Creates a new JMenuItem use the specified action name.
protected  JPopupMenu createPopupMenu(String name)
          Create a new JPopupMenu use the specified name.
protected  ResourceManager createResourceManager()
          Creates the resource manager.
protected  JStatusBar createStatusBar()
          Creates a status bar.
protected  JToolBar createToolBar(String name)
          Creates a new JToolBar use the specified name.
protected  UIFactory createUIFactory()
          Creates the ui factory.
 void doAbout()
          Invokes when the about action invoke.
protected  void doBeforeClose()
          Invoke this method before close the frame.
 void doClose()
          Invokes when the frame closing.
 void doExit()
          Invokes when the exit action invoke.
 void doFeedback()
          Invokes when the feedback action fired.
 void doLookAndFeel()
           
protected  void doOpen(File[] files)
          Open the specified files by drop, subclass can override this methods to open the files as needed.
 void doSplash()
           
 void doTip()
          Invokes when the tip action invoke.
 Action getAction(String name)
          Returns the Action for the specified name.
 ActionManager getActionManager()
          Returns the ActionManager for this JBean.
 int getDefaultCloseOperation()
          Retutns the default close operation for this bean.
 int getExtendedState()
           
 JFrame getFrame()
          Returns the current frame.
 Icon getIcon(String key)
          Returns the cion for the specified key from ResourceManager.
 JInternalFrame getInternalFrame()
          Returns the current internal frame.
 ResourceManager getResourceManager()
          Returns the ResourceManager for this JBean.
 JStatusBar getStatusBar()
          Returns the JStatusBar for this JBean.
 String getString(String key)
          Returns the string for the specified key from ResourceManager.
 String getTitle()
          Returns the title for this JBean
 UIFactory getUIFactory()
          Returns the UIFactory for this JBean.
protected  void init()
          Adds component and configure the JBean
 void invokeAction(String name)
          Invoke the action by the specified name.
 boolean isDefaultPropertiesEnabled()
          Determines whethe enable the default properties, such "copyright-note", "logo-image", "application.name", "application.version".
 boolean isShowSplashOnStartup()
          Determines whether show the splash window on startup, default is true.
static void main(String[] args)
           
 void setDefaultCloseOperation(int operation)
          Sets the default close operation for this bean.
 void setDefaultPropertiesEnabled(boolean defaultPropertiesEnabled)
          Sets the default properties enabled property, , such "copyright-note", "logo-image", "application.name", "application.version".Default is true.
 void setExtendedState(int extendedState)
           
 void setShowSplashOnStartup(boolean showSplashOnStartup)
          Sets the splash window show on startup.
 void setTitle(String title)
          Sets the title for this JBean.
 void showFrame()
          Pops up a frame contains the JBean with the frame having a default title.
 void showInternalFrame(Component parent)
          Pops up a internal frame contains the JBean with the internal frame having a default title and parented to parent .
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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

FILE

public static final String FILE
See Also:
Constant Field Values

VIEW

public static final String VIEW
See Also:
Constant Field Values

TOOL

public static final String TOOL
See Also:
Constant Field Values

HELP

public static final String HELP
See Also:
Constant Field Values

NEW

public static final String NEW
See Also:
Constant Field Values

OPEN

public static final String OPEN
See Also:
Constant Field Values

SAVE

public static final String SAVE
See Also:
Constant Field Values

SAVE_AS

public static final String SAVE_AS
See Also:
Constant Field Values

IMPORT

public static final String IMPORT
See Also:
Constant Field Values

EXPORT

public static final String EXPORT
See Also:
Constant Field Values

PAGE_SETUP

public static final String PAGE_SETUP
See Also:
Constant Field Values

PRINT

public static final String PRINT
See Also:
Constant Field Values

PRINT_PREVIEW

public static final String PRINT_PREVIEW
See Also:
Constant Field Values

EXIT

public static final String EXIT
See Also:
Constant Field Values

UNDO

public static final String UNDO
See Also:
Constant Field Values

REDO

public static final String REDO
See Also:
Constant Field Values

CUT

public static final String CUT
See Also:
Constant Field Values

COPY

public static final String COPY
See Also:
Constant Field Values

PASTE

public static final String PASTE
See Also:
Constant Field Values

FIND

public static final String FIND
See Also:
Constant Field Values

FIND_NEXT

public static final String FIND_NEXT
See Also:
Constant Field Values

REPLACE

public static final String REPLACE
See Also:
Constant Field Values

CLEAR

public static final String CLEAR
See Also:
Constant Field Values

CLEAR_ALL

public static final String CLEAR_ALL
See Also:
Constant Field Values

SELECT_ALL

public static final String SELECT_ALL
See Also:
Constant Field Values

SPELL

public static final String SPELL
See Also:
Constant Field Values

TIP

public static final String TIP
See Also:
Constant Field Values

ABOUT

public static final String ABOUT
See Also:
Constant Field Values
Constructor Detail

JBean

public JBean()
Constructs a JBean use the BorderLayout.

Method Detail

createResourceManager

protected ResourceManager createResourceManager()
Creates the resource manager.

Returns:
the resource manager

createActionManager

protected ActionManager createActionManager()
Creates the action manager.

Returns:
the action manager

createUIFactory

protected UIFactory createUIFactory()
Creates the ui factory.

Returns:
the ui factory

createStatusBar

protected JStatusBar createStatusBar()
Creates a status bar.

Returns:
a status bar.

getResourceManager

public ResourceManager getResourceManager()
Returns the ResourceManager for this JBean.

Returns:
the ResourceManager

getActionManager

public ActionManager getActionManager()
Returns the ActionManager for this JBean.

Returns:
the ActionManager

getUIFactory

public UIFactory getUIFactory()
Returns the UIFactory for this JBean.

Returns:
the UIFactory

getStatusBar

public JStatusBar getStatusBar()
Returns the JStatusBar for this JBean.

Returns:
the JStatusBar

init

protected void init()
Adds component and configure the JBean


setTitle

public void setTitle(String title)
Sets the title for this JBean.

Parameters:
title - the title
See Also:
getTitle()

getTitle

public String getTitle()
Returns the title for this JBean

Returns:
the title
See Also:
setTitle(java.lang.String)

setDefaultCloseOperation

public void setDefaultCloseOperation(int operation)
Sets the default close operation for this bean. The default value is WindowConstants.DISPOSE_ON_CLOSE.

Parameters:
operation - the close operation:
  • JBean.DO_NOTHING_ON_CLOSE
  • JBean.HIDE_ON_CLOSE
  • JBean.DISPOSE_ON_CLOSE
  • JBean.EXIT_ON_CLOSE
Since:
JDataGrid 1.5.1
See Also:
getDefaultCloseOperation()

getDefaultCloseOperation

public int getDefaultCloseOperation()
Retutns the default close operation for this bean. The default value is JBean.DISPOSE_ON_CLOSE.

One of 4 legal values:

  • JBean.DO_NOTHING_ON_CLOSE
  • JBean.HIDE_ON_CLOSE
  • JBean.DISPOSE_ON_CLOSE
  • JBean.EXIT_ON_CLOSE

Returns:
the default close operation for this bean
Since:
JDataGrid 1.5.1
See Also:
setDefaultCloseOperation(int)

setExtendedState

public void setExtendedState(int extendedState)
See Also:
Frame.setExtendedState

getExtendedState

public int getExtendedState()
See Also:
Frame.setExtendedState

showFrame

public void showFrame()
Pops up a frame contains the JBean with the frame having a default title.

See Also:
createFrame()

createFrame

protected JFrame createFrame()
Creates a frame for the JBean.

See Also:
showFrame()

getFrame

public JFrame getFrame()
Returns the current frame.

See Also:
showFrame(), createFrame()

showInternalFrame

public void showInternalFrame(Component parent)
Pops up a internal frame contains the JBean with the internal frame having a default title and parented to parent .

Parameters:
parent - the parent
Since:
JBean 1.1
See Also:
createInternalFrame()

createInternalFrame

protected JInternalFrame createInternalFrame()
Creates a internal frame for the JBean.

Since:
JBean 1.1
See Also:
showInternalFrame(java.awt.Component)

getInternalFrame

public JInternalFrame getInternalFrame()
Returns the current internal frame.

Since:
JBean 1.1
See Also:
showInternalFrame(java.awt.Component), createInternalFrame()

doOpen

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

Parameters:
files - the files to drop

doSplash

public void doSplash()

doExit

public void doExit()
Invokes when the exit action invoke. The default behavior will invoke doClose() methods.


doTip

public void doTip()
Invokes when the tip action invoke.


doAbout

public void doAbout()
Invokes when the about action invoke.


doFeedback

public void doFeedback()
Invokes when the feedback action fired.


doLookAndFeel

public void doLookAndFeel()

doClose

public void doClose()
Invokes when the frame closing.


doBeforeClose

protected void doBeforeClose()
                      throws ActionVetoException
Invoke this method before close the frame.

Throws:
ActionVetoException - if the close action cannot be permited.
Since:
JDataGrid 1.5.1

invokeAction

public void invokeAction(String name)
Invoke the action by the specified name.

Parameters:
name - the action name

getString

public String getString(String key)
Returns the string for the specified key from ResourceManager.

Parameters:
key - the key
Returns:
the value for the specified key

getIcon

public Icon getIcon(String key)
Returns the cion for the specified key from ResourceManager.

Parameters:
key - the key
Returns:
the icon for the specified key

getAction

public Action getAction(String name)
Returns the Action for the specified name.
Create action as needed.

Parameters:
name - the action name

createMenuBar

protected JMenuBar createMenuBar(String name)
Create a new JMenuBar use the specified name.

Parameters:
name - the name
Returns:
a new JMenuBar

createPopupMenu

protected JPopupMenu createPopupMenu(String name)
Create a new JPopupMenu use the specified name.

Parameters:
name - the name
Returns:
a new JPopupMenu

createToolBar

protected JToolBar createToolBar(String name)
Creates a new JToolBar use the specified name.

Parameters:
name - the name
Returns:
a new JToolBar

createMenu

protected JMenu createMenu(String name)
Creates a new JMenu use the specified action name.

Parameters:
name - the action name

createMenuItem

protected JMenuItem createMenuItem(String name)
Creates a new JMenuItem use the specified action name.

Parameters:
name - the action name

createButton

protected AbstractButton createButton(String name)
Creates a new JButton use the specified action name.

Parameters:
name - the action name

main

public static void main(String[] args)

isShowSplashOnStartup

public boolean isShowSplashOnStartup()
Determines whether show the splash window on startup, default is true.

Since:
JDataGrid 2.0
See Also:
setShowSplashOnStartup(boolean)

setShowSplashOnStartup

public void setShowSplashOnStartup(boolean showSplashOnStartup)
Sets the splash window show on startup.

Since:
JDataGrid 2.0
See Also:
isShowSplashOnStartup()

isDefaultPropertiesEnabled

public boolean isDefaultPropertiesEnabled()
Determines whethe enable the default properties, such "copyright-note", "logo-image", "application.name", "application.version". Default is true.

Since:
JDataGrid 2.0
See Also:
setDefaultPropertiesEnabled(boolean)

setDefaultPropertiesEnabled

public void setDefaultPropertiesEnabled(boolean defaultPropertiesEnabled)
Sets the default properties enabled property, , such "copyright-note", "logo-image", "application.name", "application.version".Default is true.

Since:
JDataGrid 2.0
See Also:
isDefaultPropertiesEnabled()

JComponentPack 1.5.0

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