|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
NOS.gui.NOSButton
public class NOSButton
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected boolean |
border
|
protected int |
custom_icon_height
|
protected int[] |
custom_icon_pix
|
protected int |
custom_icon_width
|
protected java.awt.Image |
focus
|
protected boolean |
hover
|
protected int |
icon
|
protected java.lang.String |
label
|
protected java.awt.Image |
pressed
|
protected Style |
style
|
protected java.awt.Image |
unfocus
|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| 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 | |
|---|---|
NOSButton(java.awt.image.BufferedImage buf,
boolean border)
Creates a new NOSButton object. |
|
NOSButton(int icon,
boolean border)
Creates a new NOSButton object. |
|
NOSButton(java.lang.String label)
Creates a new NOSButton object. |
|
NOSButton(java.lang.String label,
boolean border)
Creates a new NOSButton object. |
|
NOSButton(java.lang.String label,
int icon,
boolean toggle,
boolean border,
java.awt.image.BufferedImage buf)
Creates a new NOSButton object. |
|
| Method Summary | |
|---|---|
void |
addActionListener(java.awt.event.ActionListener al)
Adds an ActionListener to this button |
int |
getIcon()
Returns the system icon to be drawn on this button. |
java.lang.String |
getLabel()
Returns the label text of this button |
java.awt.Dimension |
getMinimumSize()
Returns the minimum size of this button |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this button |
boolean |
isToggle()
Returns the toggle behaviour of this button |
void |
notifyActionListeners()
Calls all the action listeners attached to this button. |
void |
notifyStyleChange(Style style)
Called by the system to notify this button that the active Style has been changed. |
void |
paint(java.awt.Graphics g)
Draw this component. |
void |
removeActionListener(java.awt.event.ActionListener al)
Removes an ActionListener from this button |
void |
setHoverEnable(boolean hover)
Set the hover behaviour of this button |
void |
setIcon(int icon)
Changes the system icon displayed on this button |
void |
setLabel(java.lang.String label)
Changes the label displayed on this button |
void |
setToggle(boolean press)
Changes the toggle behaviour of this button |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, update, updateUI |
| Methods 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int[] custom_icon_pix
protected int custom_icon_width
protected int custom_icon_height
protected int icon
protected java.lang.String label
protected boolean border
protected Style style
protected java.awt.Image focus
protected java.awt.Image unfocus
protected java.awt.Image pressed
protected boolean hover
| Constructor Detail |
|---|
public NOSButton(java.lang.String label)
label - A string label to display on the button.
public NOSButton(java.awt.image.BufferedImage buf,
boolean border)
buf - An image to display on the buttonborder - Set to true if you want a border to be drawn around the
button
public NOSButton(java.lang.String label,
boolean border)
label - A string label to display on the button.border - Set to true if you want a border to be drawn around the
button
public NOSButton(int icon,
boolean border)
icon - The system icon to be drawn on the button (eg: one of
Style.ICON_CLOSE, Style.ICON_MAXIMISE, Style.ICON_RESTORE,
Style.ICON_MINIMISE, .. etc ..)border - Set to true if you want a border to be drawn around the
button
public NOSButton(java.lang.String label,
int icon,
boolean toggle,
boolean border,
java.awt.image.BufferedImage buf)
label - A string label to display on the button.icon - The system icon to be drawn on the button (eg: one of
Style.ICON_CLOSE, Style.ICON_MAXIMISE, Style.ICON_RESTORE,
Style.ICON_MINIMISE, .. etc ..)toggle - If set to true this button will act like a toggle switch.border - Set to true if you want a border to be drawn around the
buttonbuf - An image to display on the button (is overriden by icon if
not set to Style.ICON_NONE)| Method Detail |
|---|
public void setHoverEnable(boolean hover)
hover - If true then the button will animate when the user hovers
the mouse over it.public void notifyStyleChange(Style style)
notifyStyleChange in interface NOSStyleListenerstyle - The new Style object.public void setLabel(java.lang.String label)
label - The new labelpublic java.lang.String getLabel()
public void setIcon(int icon)
icon - The system icon to be drawn on the button (eg: one of
Style.ICON_CLOSE, Style.ICON_MAXIMISE, Style.ICON_RESTORE,
Style.ICON_MINIMISE, .. etc ..)public int getIcon()
public void addActionListener(java.awt.event.ActionListener al)
al - The ActionListener to be added.public void removeActionListener(java.awt.event.ActionListener al)
al - The ActionListener to be removed.public void notifyActionListeners()
public void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentg - The Graphics context to use.public void setToggle(boolean press)
press - If true then this button will act like a toggle switch.public boolean isToggle()
public java.awt.Dimension getMinimumSize()
getMinimumSize in class javax.swing.JComponentpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||