|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Button
com.mxgxw.graphics.BotonSimple
La clase BotonSimple, representa un boton sencillo que puede poseer un texto o una imagen, se pueden modificar tanto el color el texto o la imagen del mismo.
Nested Class Summary |
Nested classes inherited from class java.awt.Button |
java.awt.Button.AccessibleAWTButton |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
static int |
ELEVADO
Constante que define el estado del boton elevado. |
static int |
PRESIONADO
Constante que define el estado de boton presionado |
static int |
VALOR_COLOR
Constante que define un color como fondo. |
static int |
VALOR_IMAGEN
Constante que define una imagen como fondo |
static int |
VALOR_TEXTO
Constante que define el fondo como un texto |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
BotonSimple()
Constructor por defecto, se crea un boton con fondo estilo color y se inicializan los colores por defecto. |
|
BotonSimple(java.awt.Image img)
Define la imagen a ser mostrada cuando el boton tiene como fondo una imagen. |
Method Summary | |
void |
cambiarTipoFondo(int tipo)
Cambia el tipo del fondo |
java.awt.Dimension |
getPreferredSize()
Esta función define el tamaño por defecto que tendrá el componente al dibujarse en la pantalla. |
java.lang.String |
getText()
Función "alias" de obtenerTexto() |
java.awt.Color |
obtenerColorBrillo()
Devuelve el color utilizado en la parte iluminada del boton. |
java.awt.Color |
obtenerColorBrilloFondo()
Devuelve el color utilizado en el fondo del botón cuando esta presionado. |
java.awt.Color |
obtenerColorFondo()
Devuelve el color utilizado en el fondo del botón. |
java.awt.Color |
obtenerColorSombra()
Devuelve el color utilizado en la parte oscura del botón |
java.awt.Color |
obtenerColorTexto()
Devuelve el color utilizado para dibujar el texto. |
int |
obtenerEstado()
Devuelve el estado actual del boton |
java.awt.Image |
obtenerImagen()
Devuelve la imagen que esta utilizando el botón. |
java.lang.String |
obtenerTexto()
Devuelve la cadena de texto mostrada en el boton. |
int |
obtenerTipoFondo()
Devuelve el tipo de fondo actual |
void |
paint(java.awt.Graphics g)
Esta función dibuja el componente. |
void |
ponerColorBrillo(java.awt.Color c)
Establece el color del borde iluminado del boton. |
void |
ponerColorBrilloFondo(java.awt.Color c)
Establece el color del fondo cuando este esta presionado. |
void |
ponerColorFondo(java.awt.Color c)
Establece el color de fondo del boton. |
void |
ponerColorSombra(java.awt.Color c)
Establece el color del borde oscuro del boton. |
void |
ponerColorTexto(java.awt.Color c)
Establece el color del texto del botón. |
void |
ponerEstado(int est)
Cambia el estado del boton. |
void |
ponerImagen(java.awt.Image img)
Establece la imagen que se dibujará en el botón. |
void |
ponerTexto(java.lang.String txt)
Establece el texto del botón. |
void |
setText(java.lang.String txt)
Funcion "alias" de la funcion ponerTexto. |
Methods inherited from class java.awt.Button |
addActionListener, addNotify, getAccessibleContext, getActionCommand, getActionListeners, getLabel, getListeners, paramString, processActionEvent, processEvent, removeActionListener, setActionCommand, setLabel |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.image.ImageObserver |
imageUpdate |
Field Detail |
public static final int ELEVADO
public static final int PRESIONADO
public static final int VALOR_COLOR
public static final int VALOR_IMAGEN
public static final int VALOR_TEXTO
Constructor Detail |
public BotonSimple()
public BotonSimple(java.awt.Image img)
img
- Imagen proporcionada para el fondo del boton.Method Detail |
public void ponerEstado(int est)
est
- Cambia el estado del boton, que puede tomar los valores de:
BotonSimple.ELEVADO: Muestra el boton elevado
BotonSimple.PRESIONADO: Muestra el boton presionadopublic int obtenerEstado()
public void cambiarTipoFondo(int tipo)
tipo
- Define el tipo del fondo para el boton presionado, puede tomar los valores:
BotonSimple.VALOR_COLOR: Muestra el color de fondo
BotonSimple.VALOR_IMAGEN: Muestra la imagen de fondo
BotonSimple.VALOR_TEXTO: Muestra el texto de fondo
El color de fondo del botón siempre se mostrara, en imagen y texto se sobrepondra al color de fondo.public int obtenerTipoFondo()
public void ponerColorBrillo(java.awt.Color c)
c
- Color que se utilizara para dibujar la parte iluminada del boton.public void ponerColorSombra(java.awt.Color c)
c
- Color que se utilizara para dibujar la parte oscura del boton.public void ponerColorFondo(java.awt.Color c)
c
- Color que se utilizara en el fondo del botón.public void ponerColorBrilloFondo(java.awt.Color c)
c
- Color que se utilizara en el fondo del botón cuando este esta presionado.public void ponerColorTexto(java.awt.Color c)
c
- Color que se utilizara para dibujar el texto del botón.public void ponerImagen(java.awt.Image img)
img
- Imagen que se dibujará en el botón.public void ponerTexto(java.lang.String txt)
txt
- Cadena de texto que se mostrará en el boton.public void setText(java.lang.String txt)
txt
- Cadena que se colocará en el botón.public java.awt.Color obtenerColorBrillo()
public java.awt.Color obtenerColorSombra()
public java.awt.Color obtenerColorFondo()
public java.awt.Color obtenerColorBrilloFondo()
public java.awt.Color obtenerColorTexto()
public java.awt.Image obtenerImagen()
public java.lang.String obtenerTexto()
public java.lang.String getText()
public java.awt.Dimension getPreferredSize()
public void paint(java.awt.Graphics g)
g
- Entorno gráfico en el que se dibujara el componente.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |