public class LabeledComponentPanel extends javax.swing.JPanel implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener, javax.swing.event.PopupMenuListener, Disposable, HasAlignableLabels
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
LabeledComponentPanel() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
javax.swing.JLabel |
addLabel(java.lang.String text) |
void |
addSelectionListener(javax.swing.event.ListSelectionListener l) |
java.awt.Component |
addWidget(java.awt.Component comp) |
java.awt.Component |
addWidget(java.awt.Component comp,
int idx) |
java.awt.Component |
addWidget(java.lang.String labelText,
LabeledComponentBase comp) |
boolean |
areWidgetsDraggable() |
boolean |
areWidgetsSelectable() |
void |
deselectAllWidgets() |
void |
deselectWidget(javax.swing.JComponent comp) |
void |
dispose() |
javax.swing.JComponent |
findWidget(java.awt.event.MouseEvent e) |
javax.swing.JComponent |
findWidgetAtCursor(java.awt.event.MouseEvent e) |
boolean |
getAutoRepackEnabled(boolean enable)
Queries whether auto repacking is enabled.
|
int |
getComponentIndex(java.awt.Component comp) |
void |
getLabelSpacing(LabelSpacing spacing) |
int |
getLabelWidth() |
int |
getLeftInsetToTop() |
void |
getPreferredLabelSpacing(LabelSpacing spacing) |
javax.swing.JComponent[] |
getSelectedWidgets() |
javax.swing.event.ListSelectionListener[] |
getSelectionListeners() |
int |
getSpacing() |
static LabeledComponentPanel |
getTopPanel(java.awt.Component comp) |
java.awt.Component |
getWidget(int idx) |
LabeledComponent |
getWidget(java.lang.String label) |
java.awt.Component[] |
getWidgets() |
boolean |
isStretchable() |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
int |
numBasicWidgets() |
int |
numSelectedWidgets() |
int |
numWidgets() |
void |
popupMenuCanceled(javax.swing.event.PopupMenuEvent e) |
void |
popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e) |
void |
popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e) |
java.awt.Component[] |
removeAllWidgets() |
void |
removeSelectionListener(javax.swing.event.ListSelectionListener l) |
boolean |
removeWidget(java.awt.Component comp) |
boolean |
removeWidget(int idx) |
void |
repackContainingWindow()
Repacks the window containing this panel.
|
void |
resetLabelAlignment() |
void |
selectWidget(javax.swing.JComponent comp) |
void |
setAutoRepackEnabled(boolean enable)
Sets whether auto repacking is enabled.
|
void |
setLabelSpacing(LabelSpacing spacing) |
void |
setSpacing(int spacing) |
void |
setStretchable(boolean enable) |
void |
setWidgetsDraggable(boolean enable) |
void |
setWidgetsSelectable(boolean enable) |
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, 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, transferFocusBackward, transferFocusUpCycle
public boolean areWidgetsDraggable()
public void setWidgetsDraggable(boolean enable)
public boolean areWidgetsSelectable()
public void setWidgetsSelectable(boolean enable)
public void addSelectionListener(javax.swing.event.ListSelectionListener l)
public void removeSelectionListener(javax.swing.event.ListSelectionListener l)
public javax.swing.event.ListSelectionListener[] getSelectionListeners()
public int getSpacing()
public int getLabelWidth()
public void setSpacing(int spacing)
public boolean isStretchable()
public void setStretchable(boolean enable)
public void getLabelSpacing(LabelSpacing spacing)
getLabelSpacing
in interface HasAlignableLabels
public void setLabelSpacing(LabelSpacing spacing)
setLabelSpacing
in interface HasAlignableLabels
public void getPreferredLabelSpacing(LabelSpacing spacing)
getPreferredLabelSpacing
in interface HasAlignableLabels
public void resetLabelAlignment()
public static LabeledComponentPanel getTopPanel(java.awt.Component comp)
public int getLeftInsetToTop()
public int getComponentIndex(java.awt.Component comp)
public java.awt.Component[] getWidgets()
public java.awt.Component getWidget(int idx)
public LabeledComponent getWidget(java.lang.String label)
public int numSelectedWidgets()
public javax.swing.JComponent[] getSelectedWidgets()
public int numBasicWidgets()
public java.awt.Component addWidget(java.lang.String labelText, LabeledComponentBase comp)
public java.awt.Component addWidget(java.awt.Component comp)
public javax.swing.JLabel addLabel(java.lang.String text)
public java.awt.Component addWidget(java.awt.Component comp, int idx)
public boolean removeWidget(int idx)
public boolean removeWidget(java.awt.Component comp)
public java.awt.Component[] removeAllWidgets()
public void dispose()
dispose
in interface Disposable
public void selectWidget(javax.swing.JComponent comp)
public void deselectWidget(javax.swing.JComponent comp)
public void deselectAllWidgets()
public javax.swing.JComponent findWidget(java.awt.event.MouseEvent e)
public javax.swing.JComponent findWidgetAtCursor(java.awt.event.MouseEvent e)
public int numWidgets()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void repackContainingWindow()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void popupMenuCanceled(javax.swing.event.PopupMenuEvent e)
popupMenuCanceled
in interface javax.swing.event.PopupMenuListener
public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)
popupMenuWillBecomeInvisible
in interface javax.swing.event.PopupMenuListener
public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)
popupMenuWillBecomeVisible
in interface javax.swing.event.PopupMenuListener
public boolean getAutoRepackEnabled(boolean enable)
setAutoRepackEnabled(boolean)
.true
if auto repacking is enabled.public void setAutoRepackEnabled(boolean enable)
true
.
It is not clear that auto repacking is actually needed or even desirable, since it may result in more "pack" operations than necessary. The feature currently remains in place for legacy reasons.