|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--ButtonCtrl
This super class is a generic button. It implements the general handling of a press button. Using parameters in the applet, it could load an image likes a .gif or .jpg, show a hint ( for now, it will show hint message into the status bar when the cursor pass over the button. Later, it will show the hint into tooltip window ) and some other parameters. All parameters are defined in Rosa applet parameters
Inner classes inherited from class java.awt.Component |
java.awt.Component.AWTTreeLock |
Field Summary | |
protected java.lang.String |
kstrBorderParam
Constant - Used to extract the border value parameters |
protected java.lang.String |
kstrHintParam
Constant - Used to extract the hint string parameters |
protected java.lang.String |
kstrInputParam
Constant - Used to extract the input string parameters |
protected java.lang.String |
kstrNameParam
Constant - Used to extract the action name string parameters |
protected static java.lang.String |
kstrPrefixParam
Constant - First part of all button parameters. |
protected java.lang.String |
kstrValueParam
Constant - Used to extract the action value string parameters |
protected java.lang.String |
kstrXYLocParam
Constant - Used to extract the XY coordinate parameters |
protected Rosa2000 |
m_applet
Use to set the status bar |
protected boolean |
m_bIsAutoPlace
Use to know if the position for this button is take by the button manager. |
protected int |
m_borderColor
Border color... |
protected boolean |
m_bPressed
True if the button is pressed. |
protected java.awt.Image |
m_Img
Default image. |
protected java.awt.event.ActionListener |
m_Listener
Object listener the action. |
protected int |
m_nXSize
Button Size including the offset. |
protected int |
m_nYSize
|
protected java.lang.String |
m_strCmd
Command that should be send on the pressed action |
protected java.lang.String |
m_strHint
Help context. |
protected java.lang.String |
m_strName
Button name. |
protected java.lang.String |
m_strNameParam
Name of the form parameter to set when the button is pressed. |
protected java.lang.String |
m_strValueParam
Specifies the value to set in the form parameter specified by the name |
Fields inherited from class java.awt.Component |
actionListenerK,
adjustmentListenerK,
appContext,
assert,
background,
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
changeSupport,
componentListener,
componentListenerK,
componentOrientation,
componentSerializedDataVersion,
containerListenerK,
cursor,
dropTarget,
enabled,
eventMask,
focusListener,
focusListenerK,
font,
foreground,
hasFocus,
height,
incRate,
inputMethodListener,
inputMethodListenerK,
isInc,
isPacked,
itemListenerK,
keyListener,
keyListenerK,
LEFT_ALIGNMENT,
locale,
LOCK,
minSize,
mouseListener,
mouseListenerK,
mouseMotionListener,
mouseMotionListenerK,
name,
nameExplicitlySet,
newEventsOnly,
ownedWindowK,
parent,
peer,
peerFont,
popups,
prefSize,
RIGHT_ALIGNMENT,
serialVersionUID,
textListenerK,
TOP_ALIGNMENT,
valid,
visible,
width,
windowListenerK,
x,
y |
Constructor Summary | |
ButtonCtrl(java.lang.String strName,
boolean bAutoPress,
Rosa2000 applet)
Constructors, Create an initialize the button. |
|
ButtonCtrl(java.lang.String strName,
int nXSize,
int nYSize,
boolean bAutoPress,
Rosa2000 applet)
Constructors Create an initialize the button. |
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener l)
Adds the specified action listener to receive action events from this button. |
java.lang.String |
getActionCommand()
Get the action command string. |
java.lang.String |
getButtonActionName()
Return the action name in the form parameter. |
java.lang.String |
getButtonActionValue()
Return the action value attached to the action name in the form. |
java.lang.String |
getHint()
Return the string to put in the tooltip. |
java.awt.event.ActionListener |
getListener()
Return the active ActionListener |
java.awt.Dimension |
getPreferredSize()
Gets the preferred size of this component |
static java.lang.String |
getPrefixButtonParam()
Return string of the first part of all button parameters. |
protected void |
init()
This method start the initialization. |
boolean |
isAutoPlacement()
Get the current value in the m_bIsAutoPlace attributs. |
boolean |
isPressed()
Return true if the button is in pressed state. |
abstract void |
paint(java.awt.Graphics g)
This method is called to repaint the button. |
protected void |
readBorder()
Read the border parameter. |
protected void |
readLocation()
Read the location of the current button. |
void |
removeActionListener(java.awt.event.ActionListener l)
Removes the specified action listener so that it no longer receives action events from this button. |
void |
setActionCommand(java.lang.String s)
Set the command string. |
void |
setAutoPlacement(boolean bAuto)
Set the current value in the m_bIsAutoPlace attributs. |
void |
setPressed(boolean bPressed)
Set the button in the pressed state. |
void |
update(java.awt.Graphics g)
Repaint the button. |
Methods inherited from class java.awt.Component |
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
Field Detail |
protected static final java.lang.String kstrPrefixParam
protected final java.lang.String kstrHintParam
protected final java.lang.String kstrBorderParam
protected final java.lang.String kstrXYLocParam
protected final java.lang.String kstrInputParam
protected final java.lang.String kstrNameParam
protected final java.lang.String kstrValueParam
protected java.lang.String m_strName
protected int m_nXSize
protected int m_nYSize
protected boolean m_bPressed
protected java.awt.Image m_Img
protected java.awt.event.ActionListener m_Listener
protected java.lang.String m_strCmd
protected java.lang.String m_strHint
protected int m_borderColor
protected java.lang.String m_strNameParam
protected java.lang.String m_strValueParam
protected Rosa2000 m_applet
protected boolean m_bIsAutoPlace
Constructor Detail |
public ButtonCtrl(java.lang.String strName, boolean bAutoPress, Rosa2000 applet)
strName
- Name of the button. This string will be use to extract all other
associated parameters.bAutoPress
- If true, the button will be press up in the release button action.
Otherwise, it will live press down until the applet call setPressed method.applet
- Applet where the current button is created. It will be used
to set the status bar information likes tooltip.public ButtonCtrl(java.lang.String strName, int nXSize, int nYSize, boolean bAutoPress, Rosa2000 applet)
strName
- Name of the button. This string will be use to extract all other
associated parameters.nXSize
- Width of the button.nYSize
- Height of the button.bAutoPress
- If true, the button will be press up in the release button action.
Otherwise, it will live press down until the applet call setPressed method.applet
- Applet where the current button is created. It will be used
to set the status bar information likes tooltip.Method Detail |
public abstract void paint(java.awt.Graphics g)
public boolean isAutoPlacement()
public void setAutoPlacement(boolean bAuto)
bAuto
- If true, the button will be place in the toolbar.public java.lang.String getButtonActionName()
public java.lang.String getButtonActionValue()
public java.lang.String getHint()
public static java.lang.String getPrefixButtonParam()
public void setPressed(boolean bPressed)
public boolean isPressed()
public java.awt.event.ActionListener getListener()
ActionListener
public void update(java.awt.Graphics g)
public java.awt.Dimension getPreferredSize()
public void setActionCommand(java.lang.String s)
public java.lang.String getActionCommand()
public void addActionListener(java.awt.event.ActionListener l)
l
- The action listener.public void removeActionListener(java.awt.event.ActionListener l)
l
- The action listener.protected void init()
protected void readBorder()
protected void readLocation()
m_bIsAutoPlace
,
ToolbarPanel
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |