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.ButtonView +----borland.jbcl.control.ButtonControl
Variables Constructors Properties Methods Event Listeners
Implements ItemPaintSite, SingletonModelListener, SingletonView, MenuContainer, ImageObserver, Serializable, EventListener
The ButtonView component is a button view element for developing new layered components. It requires a SingletonDataSetManager data provider and a SingletonViewManager view manager.
protected String actionCommandThe command name of the action event fired by this button. By default, this will be set to the label of the button.
protected ButtonItemPainter borderPainterPaints the border of a button.
protected boolean mouseDownIf true, indicates that the mouse button has been pressed, over the button, but not released.
protected int stateStores whether the button is selected or disabled. Also stores whether the button currently has focus.
public ButtonView()Constructs a ButtonView component with default property values.
Sets the button background color to SystemColor.control.
public String getActionCommand() public void setActionCommand(java.lang.String command)The command name of the action event fired by this button. By default this will be set to the label of the button.
public int getAlignment()No-op. Returns 0.
public void setEnabled(boolean enable)Enables the button.
public boolean isFocusAware() public void setFocusAware(boolean aware)Determines whether this button is able to accept input focus.
public Insets getItemMargins()Returns the insets of the button.
public String getLabel() public void setLabel(java.lang.String label)Stores the text that appears on the button.
public SingletonModel getModel() public void setModel(borland.jbcl.model.SingletonModel sm)To set the model: removes the model listener, changes the model to SingleonModel, and adds a model listener for the current viewer. Sets writeModel to WritableSingletonModel.
public Dimension getPreferredSize()Returns the preferred size of the button, for controlling layout.
public boolean isReadOnly() public void setReadOnly(boolean ro)Whether the button label can be changed.
public boolean isSelected() public void setSelected(boolean selected)Stores whether the button has been pressed. Supports exclusive-selection for sticky buttons.
public SingletonViewManager getViewManager() public void setViewManager(borland.jbcl.model.SingletonViewManager vm)Determines the view manager object handling the viewer selection for this component.
public void setVisible(boolean visible)Sets to not selected, and calls java.awt.Component.setVisible(visible).
public WritableSingletonModel getWriteModel()Returns null if the button is read-only, else returns the WritableSingletonModel for this button.
public void paint(java.awt.Graphics g)Paints or repaints the button.
Parameters:
Overrides: java.awt.Container.paint(Graphics)
protected String paramString()Returns the parameter string of the button.
Overrides: java.awt.Container.paramString()
protected void processFocusEvent(java.awt.event.FocusEvent e)If the button is focus-aware, repaints. Calls super.processFocusEvent(FocusEvent).
Parameters:
Overrides: borland.jbcl.view.ViewPanel.processFocusEvent(java.awt.event.FocusEvent)
protected void processKeyPressed(java.awt.event.KeyEvent e)Handles clicking the button when a keyboard shortcut is pressed.
Parameters:
Overrides: borland.jbcl.view.ViewPanel.processKeyPressed(java.awt.event.KeyEvent)
protected void processKeyReleased(java.awt.event.KeyEvent e)Handles the release of a key when a keyboard shortcut is used to click the button.
Parameters:
Overrides: borland.jbcl.view.ViewPanel.processKeyReleased(java.awt.event.KeyEvent)
protected void processMouseEntered(java.awt.event.MouseEvent event)Called when the mouse cursor is over the button.
Parameters:
Overrides: borland.jbcl.view.ViewPanel.processMouseEntered(java.awt.event.MouseEvent)
protected void processMouseExited(java.awt.event.MouseEvent event)Called when the mouse cursor moves off of the button.
Parameters:
Overrides: borland.jbcl.view.ViewPanel.processMouseExited(java.awt.event.MouseEvent)
protected void processMousePressed(java.awt.event.MouseEvent event)Called when the mouse button is clicked over the button.
Parameters:
Overrides: borland.jbcl.view.ViewPanel.processMousePressed(java.awt.event.MouseEvent)
protected void processMouseReleased(java.awt.event.MouseEvent event)Called when the mouse button is released while the mouse cursor is over the button.
Parameters:
Overrides: borland.jbcl.view.ViewPanel.processMouseReleased(java.awt.event.MouseEvent)
public void setBounds(int x, int y, int width, int height)Calls super.setBounds(x, y, width, height), then adds a delay to make navigator buttons repaint properly after a resize.
Parameters:
Overrides: java.awt.Component.setBounds(int, int, int, int)
public void update(java.awt.Graphics g)Paints or repaints the button to the screen. This method is called in response to a call to repaint. By default, the background is not cleared, avoiding flicker.
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 synchronized void addKeyListener(java.awt.event.KeyListener l) public synchronized 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)