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
-
alignmentValues
-
-
button
-
-
HORIZONTAL
-
-
VERTICAL
-
-
JDPButtons(JDPUser, int)
- Creates a pair of arrow buttons.
-
JDPButtons(JDPUser, int[], String[], int)
- Creates a set of buttons with only icons showing.
-
JDPButtons(JDPUser, int[], String[], int, String)
- Creates a set of buttons with only icons showing.
-
JDPButtons(JDPUser, String[], int)
- Creates a set of buttons with the requested labels.
-
JDPButtons(JDPUser, String[], int, String)
- Creates a set of buttons with the requested labels.
-
JDPButtons(JDPUser, String[], int[], int)
- Creates a set of buttons with the requested labels and icons.
-
JDPButtons(JDPUser, String[], int[], int, String)
- Creates a set of buttons with the requested labels and icons.
-
disable()
-
-
enable()
-
-
getAlignment()
- Get the current alignment (Horizontal or Vertical).
-
getAlignmentValue(String)
- Get the alignment value integer given one of the following (Horizontal or Vertical).
-
getButton(int)
- Get the handle to the speicified button.
-
getButtonCount()
- Get the number of buttons in this group.
-
getFont()
-
-
getIcon(int)
- Get the icon number of a button.
-
getIconImagePath()
- Get the path for the image that conatins the button icons.
-
getIconsOnly()
- Check if these button are set to display only an icon and no label.
-
getLabels()
- Get the labels of the buttons in this group.
-
getPressed()
- Get the button that is currently pressed if it has been set for stayOn=true.
-
getStayOn()
- Get the current stay on setting.
-
handleEvent(Event)
-
-
insets()
-
-
isIconsOnly()
- Check if these button are set to display only an icon and no label.
-
paint(Graphics)
-
-
setAlignment(int)
- Set the alignment (Horizontal or Vertical).
-
setBackground(Color)
-
-
setButtonCount(int)
- Set the number of buttons in this group.
-
setEnabled(boolean)
-
-
setFont(Font)
-
-
setForeground(Color)
-
-
setIcon(int, int)
- Set the icon of a button.
-
setIcon(int, String)
- Set the icon of a button.
-
setIconImagePath(String)
- Set the path for the image that conatins the button icons.
-
setIconsOnly(boolean)
- Set these buttons to display only an icon or an icon and a label.
-
setLabel(int, String)
- Set the label of a button.
-
setPressed(String)
- Set this button to be in the requested state if it has been set for stayOn=true.
-
setStayOn(boolean)
- Set only one button to stay pressed at a time.
VERTICAL
public static int VERTICAL
HORIZONTAL
public static int HORIZONTAL
alignmentValues
public static String alignmentValues[]
button
public JDPButton button[]
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).
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).
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).
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).
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).
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).
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).
insets
public Insets insets()
- Overrides:
- insets in class Container
setStayOn
public void setStayOn(boolean stayOn)
- Set only one button to stay pressed at a time.
- Parameters:
- stayOn - the stay on value.
getStayOn
public boolean getStayOn()
- Get the current stay on setting.
- Returns:
- the stay on value.
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.
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.
setFont
public void setFont(Font thisFont)
- Overrides:
- setFont in class Component
getFont
public Font getFont()
- Overrides:
- getFont in class Component
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.
getButtonCount
public int getButtonCount()
- Get the number of buttons in this group.
- Returns:
- the number of buttons in this group.
setButtonCount
public void setButtonCount(int btnCount)
- Set the number of buttons in this group.
- Parameters:
- buttonCount - the number of buttons in this group.
getLabels
public String[] getLabels()
- Get the labels of the buttons in this group.
- Returns:
- the labels of buttons in this group.
getIcon
public int getIcon(int ix)
- Get the icon number of a button.
- Returns:
- the icon number of the selected button.
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.
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.
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.
getAlignment
public int getAlignment()
- Get the current alignment (Horizontal or Vertical).
- Returns:
- the current alignment value.
setAlignment
public void setAlignment(int align)
- Set the alignment (Horizontal or Vertical).
- Parameters:
- alignment - the new alignment value.
isIconsOnly
public boolean isIconsOnly()
- Check if these button are set to display only an icon and no label.
- Returns:
- whether displaying only an icon.
getIconsOnly
public boolean getIconsOnly()
- Check if these button are set to display only an icon and no label.
- Returns:
- whether displaying only an icon.
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.
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.
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.
getAlignmentValue
public static int getAlignmentValue(String align)
- Get the alignment value integer given one of the following (Horizontal or Vertical).
- Returns:
- the alignment value.
setForeground
public void setForeground(Color thisColor)
- Overrides:
- setForeground in class Component
setBackground
public void setBackground(Color thisColor)
- Overrides:
- setBackground in class Component
disable
public void disable()
- Overrides:
- disable in class Component
enable
public void enable()
- Overrides:
- enable in class Component
setEnabled
public void setEnabled(boolean enabled)
- Overrides:
- setEnabled in class Component
paint
public void paint(Graphics g)
- Overrides:
- paint in class Container
handleEvent
public boolean handleEvent(Event evt)
- Overrides:
- handleEvent in class Component