Class JDPButtons

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----JDPButtons

public class JDPButtons
extends Panel
Class JDPButtons represents a neat grouping of JDPButton components


Variable Index

 o alignmentValues
 o button
 o HORIZONTAL
 o VERTICAL

Constructor Index

 o JDPButtons(JDPUser, int)
Creates a pair of arrow buttons.
 o JDPButtons(JDPUser, int[], String[], int)
Creates a set of buttons with only icons showing.
 o JDPButtons(JDPUser, int[], String[], int, String)
Creates a set of buttons with only icons showing.
 o JDPButtons(JDPUser, String[], int)
Creates a set of buttons with the requested labels.
 o JDPButtons(JDPUser, String[], int, String)
Creates a set of buttons with the requested labels.
 o JDPButtons(JDPUser, String[], int[], int)
Creates a set of buttons with the requested labels and icons.
 o JDPButtons(JDPUser, String[], int[], int, String)
Creates a set of buttons with the requested labels and icons.

Method Index

 o disable()
 o enable()
 o getAlignment()
Get the current alignment (Horizontal or Vertical).
 o getAlignmentValue(String)
Get the alignment value integer given one of the following (Horizontal or Vertical).
 o getButton(int)
Get the handle to the speicified button.
 o getButtonCount()
Get the number of buttons in this group.
 o getFont()
 o getIcon(int)
Get the icon number of a button.
 o getIconImagePath()
Get the path for the image that conatins the button icons.
 o getIconsOnly()
Check if these button are set to display only an icon and no label.
 o getLabels()
Get the labels of the buttons in this group.
 o getPressed()
Get the button that is currently pressed if it has been set for stayOn=true.
 o getStayOn()
Get the current stay on setting.
 o handleEvent(Event)
 o insets()
 o isIconsOnly()
Check if these button are set to display only an icon and no label.
 o paint(Graphics)
 o setAlignment(int)
Set the alignment (Horizontal or Vertical).
 o setBackground(Color)
 o setButtonCount(int)
Set the number of buttons in this group.
 o setEnabled(boolean)
 o setFont(Font)
 o setForeground(Color)
 o setIcon(int, int)
Set the icon of a button.
 o setIcon(int, String)
Set the icon of a button.
 o setIconImagePath(String)
Set the path for the image that conatins the button icons.
 o setIconsOnly(boolean)
Set these buttons to display only an icon or an icon and a label.
 o setLabel(int, String)
Set the label of a button.
 o setPressed(String)
Set this button to be in the requested state if it has been set for stayOn=true.
 o setStayOn(boolean)
Set only one button to stay pressed at a time.

Variables

 o VERTICAL
 public static int VERTICAL
 o HORIZONTAL
 public static int HORIZONTAL
 o alignmentValues
 public static String alignmentValues[]
 o button
 public JDPButton button[]

Constructors

 o JDPButtons
 public JDPButtons(JDPUser user,
                   String buttons[],
                   int alignment)
Creates a set of buttons with the requested labels.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
buttons - the text labels for the buttons.
alignment - the text alignment (Horizontal or Vertical).
 o JDPButtons
 public JDPButtons(JDPUser user,
                   String buttons[],
                   int icons[],
                   int alignment)
Creates a set of buttons with the requested labels and icons.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
buttons - the text labels for the buttons.
icons - the icon numbers for the buttons.
alignment - the text alignment (Horizontal or Vertical).
 o JDPButtons
 public JDPButtons(JDPUser user,
                   int icons[],
                   String buttons[],
                   int alignment)
Creates a set of buttons with only icons showing.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
icons - the icon numbers for the buttons.
buttons - the text labels for the buttons.
alignment - the text alignment (Horizontal or Vertical).
 o JDPButtons
 public JDPButtons(JDPUser user,
                   String buttons[],
                   int alignment,
                   String layout)
Creates a set of buttons with the requested labels.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
buttons - the text labels for the buttons.
alignment - the text alignment (Horizontal or Vertical).
layout - the button positioning (North, South, East, West or Center).
 o JDPButtons
 public JDPButtons(JDPUser user,
                   String buttons[],
                   int icons[],
                   int alignment,
                   String layout)
Creates a set of buttons with the requested labels and icons.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
buttons - the text labels for the buttons.
icons - the icon numbers for the buttons.
alignment - the text alignment (Horizontal or Vertical).
layout - the button positioning (North, South, East, West or Center).
 o JDPButtons
 public JDPButtons(JDPUser user,
                   int icons[],
                   String buttons[],
                   int alignment,
                   String layout)
Creates a set of buttons with only icons showing.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
icons - the icon numbers for the buttons.
buttons - the text labels for the buttons.
alignment - the text alignment (Horizontal or Vertical).
layout - the button positioning (North, South, East, West or Center).
 o JDPButtons
 public JDPButtons(JDPUser user,
                   int alignment)
Creates a pair of arrow buttons.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
alignment - the text alignment (Horizontal or Vertical).

Methods

 o insets
 public Insets insets()
Overrides:
insets in class Container
 o setStayOn
 public void setStayOn(boolean stayOn)
Set only one button to stay pressed at a time.

Parameters:
stayOn - the stay on value.
 o getStayOn
 public boolean getStayOn()
Get the current stay on setting.

Returns:
the stay on value.
 o setPressed
 public void setPressed(String choice)
Set this button to be in the requested state if it has been set for stayOn=true.

Parameters:
buttonLabel - the label of the button that should be pressed.
 o getPressed
 public String getPressed()
Get the button that is currently pressed if it has been set for stayOn=true.

Returns:
the label of the button that is pressed.
 o setFont
 public void setFont(Font thisFont)
Overrides:
setFont in class Component
 o getFont
 public Font getFont()
Overrides:
getFont in class Component
 o getButton
 public JDPButton getButton(int ix)
Get the handle to the speicified button.

Parameters:
the - button number to retrieve.
Returns:
the handle to the speicified button.
 o getButtonCount
 public int getButtonCount()
Get the number of buttons in this group.

Returns:
the number of buttons in this group.
 o setButtonCount
 public void setButtonCount(int btnCount)
Set the number of buttons in this group.

Parameters:
buttonCount - the number of buttons in this group.
 o getLabels
 public String[] getLabels()
Get the labels of the buttons in this group.

Returns:
the labels of buttons in this group.
 o getIcon
 public int getIcon(int ix)
Get the icon number of a button.

Returns:
the icon number of the selected button.
 o setLabel
 public void setLabel(int ix,
                      String btnName)
Set the label of a button.

Parameters:
buttonNumber - the number of the selected button.
buttonLabel - the new label text.
 o setIcon
 public void setIcon(int ix,
                     int icon)
Set the icon of a button.

Parameters:
buttonNumber - the number of the selected button.
buttonIcon - the new icon number.
 o setIcon
 public void setIcon(int ix,
                     String icon)
Set the icon of a button.

Parameters:
buttonNumber - the number of the selected button.
buttonIcon - the new icon name.
 o getAlignment
 public int getAlignment()
Get the current alignment (Horizontal or Vertical).

Returns:
the current alignment value.
 o setAlignment
 public void setAlignment(int align)
Set the alignment (Horizontal or Vertical).

Parameters:
alignment - the new alignment value.
 o isIconsOnly
 public boolean isIconsOnly()
Check if these button are set to display only an icon and no label.

Returns:
whether displaying only an icon.
 o getIconsOnly
 public boolean getIconsOnly()
Check if these button are set to display only an icon and no label.

Returns:
whether displaying only an icon.
 o setIconsOnly
 public void setIconsOnly(boolean iconsOnly)
Set these buttons to display only an icon or an icon and a label.

Parameters:
iconOnly - whether displaying only an icon or an icon and a label.
 o setIconImagePath
 public void setIconImagePath(String thisImageLoc)
Set the path for the image that conatins the button icons. This class has a default image call JDPBUTNS.gif that may be overidden. To create your own icon image use the JDPBUTNS.gif as a template.

Parameters:
thisImageLoc - the full or partial path to the new image.
 o getIconImagePath
 public String getIconImagePath()
Get the path for the image that conatins the button icons.

Returns:
the full or partial path to the new image.
 o getAlignmentValue
 public static int getAlignmentValue(String align)
Get the alignment value integer given one of the following (Horizontal or Vertical).

Returns:
the alignment value.
 o setForeground
 public void setForeground(Color thisColor)
Overrides:
setForeground in class Component
 o setBackground
 public void setBackground(Color thisColor)
Overrides:
setBackground in class Component
 o disable
 public void disable()
Overrides:
disable in class Component
 o enable
 public void enable()
Overrides:
enable in class Component
 o setEnabled
 public void setEnabled(boolean enabled)
Overrides:
setEnabled in class Component
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Container
 o handleEvent
 public boolean handleEvent(Event evt)
Overrides:
handleEvent in class Component