borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.view
java.lang.Object +----java.awt.Component +----java.awt.Container +----java.awt.Panel +----borland.jbcl.view.BeanPanel +----borland.jbcl.view.FieldView +----borland.jbcl.control.FieldControl
Variables Constructors Properties Methods Event Listeners
Implements ItemEditSite, ItemPaintSite, SingletonModelListener, SingletonView, MenuContainer, FocusListener, KeyListener, ImageObserver, Serializable, EventListener
The FieldView component is a field view element for developing new composite components. It requires a SingletonModel data model and a SingletonViewManager view manager.
See also: Understanding model-view component architecture.
public FieldView()Constructs a FieldView component with the background color set to SystemColor.window.
public int getAlignment() public void setAlignment(int align)Stores the alignment of the items in the FieldView, both horizontal and vertical. To set a new value for both horizontal and vertical alignment, separate the values with a vertical bar (|). Acceptable values for newAlignment are defined in borland.jbcl.util.Alignment.
public boolean isAutoEdit() public void setAutoEdit(boolean edit)The autoEdit property enables or disables automatic item editing in the field. By default, this property is true, meaning that a user can edit values in any item on the list by typing a character on the keyboard. If set to false, the user must press F2, press Ctrl+Enter, or double-click, to start an edit session.
public Point getEditClickPoint()The editClickPoint property stores the point where the user clicked to initiate the edit session for this field. This is used to determine where to place the text cursor in the text field.
public boolean isEditInPlace() public void setEditInPlace(boolean editInPlace)The editInPlace property enables or disables item editing in the field. By default, this property is true, meaning that a user can edit the value. If set to false, the field data cannot by modified by the user; the data can only be changed through programmatic access to the field's model.
public boolean isEditing()The editing property (read-only) returns true if an item is currently being edited in the field.
public boolean isEnabled() public void setEnabled(boolean enabled)The enabled property specifies the enabled state of this component. If enabled is true, the component can be navigated to and can have focus. If false, the component cannot be navigated to, cannot have focus, and may be dimmed.
public Insets getItemMargins() public void setItemMargins(java.awt.Insets margins)The itemMargins property specifies the amount of space between the text and the edge of the field.
public SingletonModel getModel() public void setModel(borland.jbcl.model.SingletonModel sm)Specifies the data model object that provides the single item for this component. FieldView requires a SingletonModel data model.
If an edit is in progress when the setModel() method is called, the edit is ended prior to setting the data model.
See also: postOnEndEdit
public boolean isPostOnEndEdit() public void setPostOnEndEdit(boolean post)Specifies whether a pending edit on the data provided by the SingletonModel should be saved or discarded when the edit is ended. This can happen, for example, when calling setModel() when an edit is in progress. When postOnEndEdit is true, changes are saved. When false, changes are discarded. The value of postOnEndEdit defaults to true.
See also: model
public int getPreferredHeight() public void setPreferredHeight(int preferredHeight)The preferredHeight property specifies the vertical size that you would prefer layout managers to use for this field.
public Dimension getPreferredSize()The preferredSize property specifies the size that you would prefer layout managers to use for this field.
public int getPreferredWidth() public void setPreferredWidth(int preferredWidth)The preferredWidth property specifies the horizontal size that you would prefer layout managers to use for this field.
public boolean isReadOnly() public void setReadOnly(boolean ro)Specifies whether the FieldView can be edited. The readOnly property returns false only if the component user sets it to false and a WriteableSingletonModel is being used. Otherwise, isReadOnly () returns true regardless of how it has been set and the writable data model for this component is set to null.
See also: writeModel
public boolean isSelectable() public void setSelectable(boolean select)Specifies whether the FieldView is selectable (true) or not (false). If setSelectable() is successful, the FieldView is repainted.
public boolean isSelected() public void setSelected(boolean selected)Specifies the selected state of the FieldView. The isSelected() method returns true if selected, or false if not. If setSelected() is successful, it repaints the FieldView.
public boolean isShowFocus() public void setShowFocus(boolean visible)The showFocus property enables or disables the painting of the focus rectangle on the field. Specifically, the showFocus property turns on or off the FOCUSED bit in the state information that is passed to the ItemPainter when the field is painted. If an ItemPainter ignores the FOCUSED bit, this property will have no effect. By default, showFocus is true.
public Graphics getSiteGraphics()Returns a correctly assembled Graphics object for coordinate comparisons with item painter coordinate calculations.
public SingletonViewManager getViewManager() public void setViewManager(borland.jbcl.model.SingletonViewManager viewManager)Specifies the Singleton data model view manager object that handles viewer and editor selection for this component.
public WritableSingletonModel getWriteModel()The writeModel property returns the writable data model for the FieldView component. For the FieldView, the writable data model is the WritableSingletonModel. This method returns null if the readOnly property is true.
This is a read-only property.
See also: readOnly
public void doLayout()Forces the field to update the layout of its contained data item.
Overrides: java.awt.Container.doLayout()
public void endEdit()Ends the edit of the FieldView component. If changes have been made, endEdit() informs the editor to post the changes.
public Rectangle getInnerRect(java.awt.Graphics g)
Parameters:
protected ItemPainter getPainter(java.lang.Object contents)Returns an appropriate item painter for the type of data in the field. See jbcl.model.SingletonViewManager.getPainter(java.lang.Object, int).
Parameters:
public void paint(java.awt.Graphics g)Paints the FieldView component with a border.
Parameters:
Overrides: java.awt.Container.paint(Graphics)
protected String paramString()A protected method that returns the parameter string of the FieldView component. The parameter string represents comma-separated values of this component's container properties such as selectable and focus states.
Overrides: java.awt.Container.paramString()
protected void processFocusEvent(java.awt.event.FocusEvent e)A protected method that is called when a focus event occurs. This method repaints the FieldView with the appropriate focus state when focus is gained or lost.
Parameters:
Overrides: borland.jbcl.view.ViewPanel.processFocusEvent(FocusEvent)
protected void processKeyPressed(java.awt.event.KeyEvent e)For Ctrl+Enter or F2, starts the edit session.
Parameters:
Overrides: borland.jbcl.view.ViewPanel.processKeyPressed(KeyEvent)
protected void processKeyTyped(java.awt.event.KeyEvent e)
Parameters:
Overrides: borland.jbcl.view.BeanPanel.processKeyTyped(KeyEvent)
protected void processMousePressed(java.awt.event.MouseEvent e)
Parameters:
Overrides: borland.jbcl.view.ViewPanel.processMousePressed(MouseEvent)
public void startEdit()Starts an edit session in the field, unless edit-in-place is false.
public void update(java.awt.Graphics g)Calls the paint() method.
Parameters:
Overrides: java.awt.Component.update(Graphics)
public synchronized void addActionListener(java.awt.event.ActionListener l) public synchronized void removeActionListener(java.awt.event.ActionListener l)
public synchronized void addComponentListener(java.awt.event.ComponentListener l) public synchronized void removeComponentListener(java.awt.event.ComponentListener l)
public synchronized void addContainerListener(java.awt.event.ContainerListener l) public void removeContainerListener(java.awt.event.ContainerListener l)
public synchronized void addFocusListener(java.awt.event.FocusListener l) public synchronized void removeFocusListener(java.awt.event.FocusListener l)
public void addKeyListener(java.awt.event.KeyListener l) public void removeKeyListener(java.awt.event.KeyListener l)
public void addModelListener(borland.jbcl.model.SingletonModelListener l) public void removeModelListener(borland.jbcl.model.SingletonModelListener l)
public synchronized void addMouseListener(java.awt.event.MouseListener l) public synchronized void removeMouseListener(java.awt.event.MouseListener l)
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener l) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener l)