JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.datasource.swing
Class DSdbJNavigator

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.klg.jclass.datasource.swing.DSdbJNavigator
All Implemented Interfaces:
Accessible, ActionListener, EventListener, ImageObserver, MenuContainer, Serializable

public class DSdbJNavigator
extends JPanel
implements ActionListener, Serializable

This component navigates the result set of a data bean and manipulate the data source inserting and deleting records, cancel, save an requery data in the data source.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  int border
           
protected  Color buttonBackground
           
protected  Color buttonForeground
           
protected  int buttons
           
protected  com.klg.jclass.datasource.swing.DSdbJNavigator.DSNavigatorDataBinding dataBinding
           
protected  com.klg.jclass.datasource.swing.NavigatorButton delete
           
protected  com.klg.jclass.datasource.swing.NavigatorButton first
           
protected  com.klg.jclass.datasource.swing.NavigatorButton insert
           
protected  com.klg.jclass.datasource.swing.NavigatorButton last
           
protected  int leftButtons
           
protected  com.klg.jclass.datasource.swing.NavigatorButton menu
           
protected  com.klg.jclass.datasource.swing.NavigatorButton next
           
protected  com.klg.jclass.datasource.util.NavigatorPopupMenu popupMenu
           
protected  com.klg.jclass.datasource.swing.NavigatorButton previous
           
protected  String rowLabel
           
protected  Color statusBackground
           
protected  Color statusForeground
           
protected  boolean statusVisible
           
 
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
DSdbJNavigator()
          Creates a new DSdbJNavigator component.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Invoked when an action occurs.
protected  void cancelAll()
           
protected  void cancelCurrent()
           
protected  void commitAll()
           
protected  void commitCurrent()
           
protected  void delete()
           
 void doLayout()
          Lays out the component.
 Color getButtonBackground()
          Gets ButtonBackground property value.
 Color getButtonForeground()
          Gets ButtonForeground property value.
 boolean getCommandVisible()
          Gets CommandVisible property value.
 String getDataBinding()
          Returns the data binding hierarchy string, starting from a JCTreeData instance name and containing full sequence of MetaDataModel level descriptions separated by '|' starting from the root to the level the component is bound with (e.g.
 boolean getDeleteVisible()
          Gets DeleteVisible property value.
 boolean getFirstVisible()
          Gets FirstVisible property value.
 boolean getInsertVisible()
          Gets InsertVisible property value.
 boolean getLastVisible()
          Gets LastVisible property value.
 Dimension getMaximumSize()
          Returns the maximum size of the component.
 Dimension getMinimumSize()
          Returns the minimum size of the component.
 boolean getNextVisible()
          Gets NextVisible property value.
 Dimension getPreferredSize()
          Returns the preferred size of the component.
 boolean getPreviousVisible()
          Gets PreviousVisible property value.
 Color getStatusBackground()
          Gets StatusBackground property value.
 Color getStatusForeground()
          Gets StatusForeground property value.
 boolean getStatusVisible()
          Gets StatusVisible property value.
protected  void goToRow()
          Opens a dialog to specify current row index and moves the current row position in the data source
protected  com.klg.jclass.datasource.swing.NavigatorButton initButton(com.klg.jclass.datasource.swing.NavigatorButton button, String toolTipText)
          Initializes and adds a button to the component.
protected  void insert()
           
protected  int minimumWidth()
          Returns the minimum width of the component.
 void paint(Graphics gc)
          Paints the component.
protected  int preferredHeight()
          Returns the preferred height of the component.
protected  int preferredWidth()
          Returns the preferred width of the component.
 void refresh()
          Resets and repaints component.
protected  void requeryAll()
           
protected  void requeryCurrent()
           
protected  void reset()
          Resets the status line according to the current data binding state, metadata model description, current record index and total number of rows in the result set.
protected  void setBtnBackground(Color color)
          Sets background for all buttons
protected  void setBtnForeground(Color color)
          Sets foreground for all buttons
 void setButtonBackground(Color color)
          Sets ButtonBackground property value.
 void setButtonForeground(Color color)
          Sets ButtonForeground property value.
 void setCommandVisible(boolean b)
          Sets CommandVisible property value.
 void setCurrentRow()
          Saves current data source row position and updates the component.
 void setDataBinding(com.klg.jclass.datasource.BindingModel binding, boolean parameterNotCurrentlyUsed)
          Binds the component to a particular MetaDataModel in the DataModel data source.
 void setDataBinding(com.klg.jclass.datasource.DataModel dataModel, com.klg.jclass.datasource.MetaDataModel metaDataModel)
           
 void setDataBinding(com.klg.jclass.datasource.DataModel dataModel, String metaPath)
          Binds the component to a particular MetaDataModel in the DataModel data source represented by a "path" of MetaDataModel descriptions separated by '|' (e.g.
 void setDataBinding(String metaPath)
          Binds the component to a particular MetaDataModel in the DataModel data source represented by a "path" of DataModel instance name and MetaDataModel descriptions separated by '|' (e.g.
 void setDeleteVisible(boolean b)
          Sets DeleteVisible property value.
 void setFirstVisible(boolean b)
          Sets FirstVisible property value.
 void setInsertVisible(boolean b)
          Sets InsertVisible property value.
 void setLastVisible(boolean b)
          Sets LastVisible property value.
 void setLayout(LayoutManager mgr)
          Sets the layout manager for this container.
 void setNextVisible(boolean b)
          Sets NextVisible property value.
 void setPreviousVisible(boolean b)
          Sets PreviousVisible property value.
 void setStatusBackground(Color color)
          Sets StatusBackground property value.
 void setStatusForeground(Color color)
          Sets StatusForeground property value.
 void setStatusVisible(boolean b)
          Sets StatusVisible property value.
protected  boolean showPopupMenu(int x, int y)
          Popups a menu.
 void update(Graphics graphics)
          Overwrites default update to avoid the component to be cleared and filled it with the background color that causes flickering.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

statusBackground

protected Color statusBackground

statusForeground

protected Color statusForeground

statusVisible

protected boolean statusVisible

buttonBackground

protected Color buttonBackground

buttonForeground

protected Color buttonForeground

buttons

protected int buttons

leftButtons

protected int leftButtons

first

protected com.klg.jclass.datasource.swing.NavigatorButton first

previous

protected com.klg.jclass.datasource.swing.NavigatorButton previous

insert

protected com.klg.jclass.datasource.swing.NavigatorButton insert

delete

protected com.klg.jclass.datasource.swing.NavigatorButton delete

next

protected com.klg.jclass.datasource.swing.NavigatorButton next

last

protected com.klg.jclass.datasource.swing.NavigatorButton last

menu

protected com.klg.jclass.datasource.swing.NavigatorButton menu

rowLabel

protected String rowLabel

border

protected int border

popupMenu

protected com.klg.jclass.datasource.util.NavigatorPopupMenu popupMenu

dataBinding

protected com.klg.jclass.datasource.swing.DSdbJNavigator.DSNavigatorDataBinding dataBinding
Constructor Detail

DSdbJNavigator

public DSdbJNavigator()
Creates a new DSdbJNavigator component.

Method Detail

initButton

protected com.klg.jclass.datasource.swing.NavigatorButton initButton(com.klg.jclass.datasource.swing.NavigatorButton button,
                                                                     String toolTipText)
Initializes and adds a button to the component.


setCurrentRow

public void setCurrentRow()
Saves current data source row position and updates the component.


setDataBinding

public void setDataBinding(com.klg.jclass.datasource.BindingModel binding,
                           boolean parameterNotCurrentlyUsed)
Binds the component to a particular MetaDataModel in the DataModel data source.

Parameters:
binding - the Binding to use.
parameterNotCurrentlyUsed - not currently used

setDataBinding

public void setDataBinding(com.klg.jclass.datasource.DataModel dataModel,
                           com.klg.jclass.datasource.MetaDataModel metaDataModel)

setDataBinding

public void setDataBinding(com.klg.jclass.datasource.DataModel dataModel,
                           String metaPath)
Binds the component to a particular MetaDataModel in the DataModel data source represented by a "path" of MetaDataModel descriptions separated by '|' (e.g. Orders|Customers).


setDataBinding

public void setDataBinding(String metaPath)
Binds the component to a particular MetaDataModel in the DataModel data source represented by a "path" of DataModel instance name and MetaDataModel descriptions separated by '|' (e.g. DataSource:Orders|Customers).


getDataBinding

public String getDataBinding()
Returns the data binding hierarchy string, starting from a JCTreeData instance name and containing full sequence of MetaDataModel level descriptions separated by '|' starting from the root to the level the component is bound with (e.g. DataSource:Orders|Customers).


getStatusBackground

public Color getStatusBackground()
Gets StatusBackground property value.

See Also:
setStatusBackground(java.awt.Color)

setStatusBackground

public void setStatusBackground(Color color)
Sets StatusBackground property value.

See Also:
getStatusBackground()

getStatusForeground

public Color getStatusForeground()
Gets StatusForeground property value.

See Also:
setStatusForeground(java.awt.Color)

setStatusForeground

public void setStatusForeground(Color color)
Sets StatusForeground property value.

See Also:
getStatusForeground()

getStatusVisible

public boolean getStatusVisible()
Gets StatusVisible property value.

See Also:
setStatusVisible(boolean)

setStatusVisible

public void setStatusVisible(boolean b)
Sets StatusVisible property value.

See Also:
getStatusVisible()

getButtonBackground

public Color getButtonBackground()
Gets ButtonBackground property value.

See Also:
setButtonBackground(java.awt.Color)

setButtonBackground

public void setButtonBackground(Color color)
Sets ButtonBackground property value.

See Also:
getButtonBackground()

getButtonForeground

public Color getButtonForeground()
Gets ButtonForeground property value.

See Also:
setButtonForeground(java.awt.Color)

setButtonForeground

public void setButtonForeground(Color color)
Sets ButtonForeground property value.

See Also:
getButtonForeground()

getFirstVisible

public boolean getFirstVisible()
Gets FirstVisible property value.

See Also:
setFirstVisible(boolean)

setFirstVisible

public void setFirstVisible(boolean b)
Sets FirstVisible property value.

See Also:
getFirstVisible()

getPreviousVisible

public boolean getPreviousVisible()
Gets PreviousVisible property value.

See Also:
setPreviousVisible(boolean)

setPreviousVisible

public void setPreviousVisible(boolean b)
Sets PreviousVisible property value.

See Also:
getPreviousVisible()

getCommandVisible

public boolean getCommandVisible()
Gets CommandVisible property value.

See Also:
setCommandVisible(boolean)

setCommandVisible

public void setCommandVisible(boolean b)
Sets CommandVisible property value.

See Also:
getCommandVisible()

getNextVisible

public boolean getNextVisible()
Gets NextVisible property value.

See Also:
setNextVisible(boolean)

setNextVisible

public void setNextVisible(boolean b)
Sets NextVisible property value.

See Also:
getNextVisible()

getLastVisible

public boolean getLastVisible()
Gets LastVisible property value.

See Also:
setLastVisible(boolean)

setLastVisible

public void setLastVisible(boolean b)
Sets LastVisible property value.

See Also:
getLastVisible()

getInsertVisible

public boolean getInsertVisible()
Gets InsertVisible property value.

See Also:
setInsertVisible(boolean)

setInsertVisible

public void setInsertVisible(boolean b)
Sets InsertVisible property value.

See Also:
getInsertVisible()

getDeleteVisible

public boolean getDeleteVisible()
Gets DeleteVisible property value.

See Also:
setDeleteVisible(boolean)

setDeleteVisible

public void setDeleteVisible(boolean b)
Sets DeleteVisible property value.

See Also:
getDeleteVisible()

preferredWidth

protected int preferredWidth()
Returns the preferred width of the component.


minimumWidth

protected int minimumWidth()
Returns the minimum width of the component.


preferredHeight

protected int preferredHeight()
Returns the preferred height of the component.


getPreferredSize

public Dimension getPreferredSize()
Returns the preferred size of the component.

Overrides:
getPreferredSize in class JComponent

getMinimumSize

public Dimension getMinimumSize()
Returns the minimum size of the component.

Overrides:
getMinimumSize in class JComponent

getMaximumSize

public Dimension getMaximumSize()
Returns the maximum size of the component.

Overrides:
getMaximumSize in class JComponent

doLayout

public void doLayout()
Lays out the component.

Overrides:
doLayout in class Container

update

public void update(Graphics graphics)
Overwrites default update to avoid the component to be cleared and filled it with the background color that causes flickering.

Overrides:
update in class JComponent

paint

public void paint(Graphics gc)
Paints the component.

Overrides:
paint in class JComponent

reset

protected void reset()
Resets the status line according to the current data binding state, metadata model description, current record index and total number of rows in the result set. Also, enable/disable buttons and menu items according to the current data binding state and row position the result set.


refresh

public void refresh()
Resets and repaints component.


setLayout

public final void setLayout(LayoutManager mgr)
Sets the layout manager for this container. As layout manager is not needed for the component, the method is overridden to prevent the layout manager from being set.

Overrides:
setLayout in class Container

setBtnBackground

protected void setBtnBackground(Color color)
Sets background for all buttons


setBtnForeground

protected void setBtnForeground(Color color)
Sets foreground for all buttons


actionPerformed

public void actionPerformed(ActionEvent event)
Invoked when an action occurs.

Specified by:
actionPerformed in interface ActionListener

showPopupMenu

protected boolean showPopupMenu(int x,
                                int y)
Popups a menu.


insert

protected void insert()

delete

protected void delete()

cancelCurrent

protected void cancelCurrent()

cancelAll

protected void cancelAll()

requeryCurrent

protected void requeryCurrent()

requeryAll

protected void requeryAll()

commitCurrent

protected void commitCurrent()

commitAll

protected void commitAll()

goToRow

protected void goToRow()
Opens a dialog to specify current row index and moves the current row position in the data source


Copyright © 2004 Quest Software Inc..
All rights reserved.