Package org.gvsig.gui.beans.buttonspanel
Class ButtonsPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.gvsig.gui.beans.buttonspanel.ButtonsPanel
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
ButtonsPanel ofrece un widget con un conjunto de botones
preestablecidos, aunque también se pueden añadir botones con el método
addButton(String, int)- Version:
- 09/05/2008
- Author:
- BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intSirve para cuando se crean botones nuevos, saber el último número usado internamente, así 'new_id = BUTTON_LAST + 1;' podría ser el índice del nuevo botón.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionCrea un ButtonsPanel con un Layout por defecto.ButtonsPanel(int items) Crea un ButtonsPanel con un Layout por defecto. -
Method Summary
Modifier and TypeMethodDescriptionvoidAñadir el boton Aceptar.voidaddApply()Añadir el boton Aplicar.voidAñadimos un botón definido por el usuario.voidaddButtonPressedListener(ButtonsPanelListener listener) Añadir el disparador de cuando se pulsa un botón.voidAñadir el boton Cancelar.voidaddClose()Añadir el boton Cerrar.voidaddExit()Añadir el boton Salir.voidAñadir el boton Ocultar detalles.voidaddNo()Añadir el boton No.voidaddPause()Añadir el boton Pausar.voidAñadir el boton Reanudar.voidaddSave()Añadir el boton Guardar.voidAñadir el boton Ver detalles.voidaddYes()Añadir el boton Sí.getButton(int id) Obtener un botón por su EnteroObject[]Devuelve el array de listeners del componenteprotected StringgetButtonText(int id) Returns the text of the button identified byid.booleanremoveButton(int id) Removes the button identified byid.voidBorrar el disparador de eventos de los botones.booleansetEnabled(int id, boolean b) Enables (or disables) the button identified byid.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods 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, firePropertyChange, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
BUTTON_ACCEPT
public static final int BUTTON_ACCEPT- See Also:
-
BUTTON_CANCEL
public static final int BUTTON_CANCEL- See Also:
-
BUTTON_APPLY
public static final int BUTTON_APPLY- See Also:
-
BUTTON_YES
public static final int BUTTON_YES- See Also:
-
BUTTON_NO
public static final int BUTTON_NO- See Also:
-
BUTTON_CLOSE
public static final int BUTTON_CLOSE- See Also:
-
BUTTON_EXIT
public static final int BUTTON_EXIT- See Also:
-
BUTTON_SEEDETAILS
public static final int BUTTON_SEEDETAILS- See Also:
-
BUTTON_HIDEDETAILS
public static final int BUTTON_HIDEDETAILS- See Also:
-
BUTTON_PAUSE
public static final int BUTTON_PAUSE- See Also:
-
BUTTON_RESTART
public static final int BUTTON_RESTART- See Also:
-
BUTTON_SAVE
public static final int BUTTON_SAVE- See Also:
-
BUTTON_LAST
public static final int BUTTON_LASTSirve para cuando se crean botones nuevos, saber el último número usado internamente, así 'new_id = BUTTON_LAST + 1;' podría ser el índice del nuevo botón.- See Also:
-
BUTTONS_ACCEPT
public static final int BUTTONS_ACCEPT- See Also:
-
BUTTONS_ACCEPTCANCEL
public static final int BUTTONS_ACCEPTCANCEL- See Also:
-
BUTTONS_ACCEPTCANCELAPPLY
public static final int BUTTONS_ACCEPTCANCELAPPLY- See Also:
-
BUTTONS_CANCEL
public static final int BUTTONS_CANCEL- See Also:
-
BUTTONS_YESNO
public static final int BUTTONS_YESNO- See Also:
-
BUTTONS_CLOSE
public static final int BUTTONS_CLOSE- See Also:
-
BUTTONS_EXIT
public static final int BUTTONS_EXIT- See Also:
-
BUTTONS_NONE
public static final int BUTTONS_NONE- See Also:
-
BUTTONS_APPLYCLOSE
public static final int BUTTONS_APPLYCLOSE- See Also:
-
-
Constructor Details
-
ButtonsPanel
public ButtonsPanel()Crea un ButtonsPanel con un Layout por defecto. -
ButtonsPanel
public ButtonsPanel(int items) Crea un ButtonsPanel con un Layout por defecto.- Parameters:
items- Que botones vamos a usar en la creación.
-
-
Method Details
-
addButtonPressedListener
Añadir el disparador de cuando se pulsa un botón.- Parameters:
listener-
-
getButtonPressedListeners
Devuelve el array de listeners del componente- Returns:
-
removeButtonPressedListener
Borrar el disparador de eventos de los botones.- Parameters:
listener-
-
addAccept
public void addAccept()Añadir el boton Aceptar. -
addSave
public void addSave()Añadir el boton Guardar. -
addCancel
public void addCancel()Añadir el boton Cancelar. -
addYes
public void addYes()Añadir el boton Sí. -
addNo
public void addNo()Añadir el boton No. -
addApply
public void addApply()Añadir el boton Aplicar. -
addClose
public void addClose()Añadir el boton Cerrar. -
addExit
public void addExit()Añadir el boton Salir. -
addSeeDetails
public void addSeeDetails()Añadir el boton Ver detalles. -
addHideDetails
public void addHideDetails()Añadir el boton Ocultar detalles. -
addPause
public void addPause()Añadir el boton Pausar. -
addRestart
public void addRestart()Añadir el boton Reanudar. -
addButton
Añadimos un botón definido por el usuario.- Parameters:
text- Texto que contendrá el botónid- Entero para identificar los eventos del botón
-
getButton
Obtener un botón por su Entero- Parameters:
id- Número del disparador del botón- Returns:
- El botón especificado o
nullsi no se encontró el botón.
-
removeButton
public boolean removeButton(int id) Removes the button identified by
id.- Parameters:
id- identifier of the button- Returns:
trueif has removed the button; otherwisefalse
-
getButtonText
Returns the text of the button identified by
id.- Parameters:
id- identifier of the button- Returns:
- text of the identified button
-
setEnabled
public boolean setEnabled(int id, boolean b) Enables (or disables) the button identified by
id.- Parameters:
id- identifier of the buttonb-trueto enable the button, otherwisefalse- Returns:
trueif there was a button of that kind in this group, otherwisefalse
-