com.didkovsky.portview
Interface PVCheckbox
- All Superinterfaces:
- PVComponent
- All Known Implementing Classes:
- PVCheckboxAWT, PVCheckboxSwing
public interface PVCheckbox
- extends PVComponent
com.didkovsky.portview is a Java package for creating UI components in either
Swing or AWT (switchable depending on PortView.getViewFactory())
PVCheckbox is an interface for a Checkbox component that can be either AWT or
Swing depending on ViewFactory
Note that addActionListener() is supported in Swing and addItemListener() is
support by AWT. To handle an event add both an action listener and an
itemlistener to your PVCheckbox The Swing version will trigger
actionPerformed(), and AWT version will trigger itemStateChanged(). So one
way to manage this is to pull out the event handling code into a common
method called handleCheckboxSelected(Object source) and call this from
itemStateChanged() and from actionPerformed(), handing it ev.getsource();
This was done here because calling setSelected() on a Swing Checkbox also
generates an ItemState Changed event This is really messy if clicking one
checkbox causes the states of otehr checkboxes to change (a good example is
com.softsynth.jmsl.view.PatchEditorPanel where source checkboxes are "patched"
to destiination checkboxes)
- Author:
- Nick Didkovsky, (c) 2004 All rights reserved, Email:
didkovn@mail.rockefeller.edu
Methods inherited from interface com.didkovsky.portview.PVComponent |
addKeyListener, getBackground, getBounds, getComponent, getFont, getParent, isEnabled, removeKeyListener, setBackground, setEnabled, setFont, setLocation |
getState
boolean getState()
setState
void setState(boolean state)
addItemListener
void addItemListener(java.awt.event.ItemListener l)
setLabel
void setLabel(java.lang.String text)
getLabel
java.lang.String getLabel()