Class JDPButton

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

public class JDPButton
extends Panel
Class JDPButton represents an enhanced button with options for an icon along with text positioning options.


Variable Index

 o APIBOOK
 o ARROW
 o BUILD
 o BUILDERRORS
 o BUTTON
 o CENTER
 o CHART
 o CHECK
 o CHECKBOX
 o CHISELFRAME
 o CHOICE
 o CIRCULAR
 o COMPILE
 o COPY
 o CUSTOM
 o DEBUGBUILD
 o DEFINE
 o DELETE
 o DOCUMENTS
 o DOWN
 o EMAIL
 o GO
 o GRID
 o HELPBOOK
 o HOTKEY
 o LABEL
 o LAYOUT
 o LEFT
 o LIST
 o LOAD
 o NEW
 o NEWFOLDER
 o PAGER
 o PANEL
 o PICTURE
 o PLUS
 o PRINTER
 o PROGRESS
 o PULLDOWN
 o RADIO
 o REPORT
 o RIGHT
 o SAVE
 o SCROLLEAST
 o SCROLLSOUTH
 o SEARCH
 o SEARCHBACK
 o SEARCHFWD
 o SLIDER
 o SPINNER
 o TAB
 o TEXTFIELD
 o TREE
 o UNDO
 o UP
 o VIEW

Constructor Index

 o JDPButton()
Creates a plain button.
 o JDPButton(int)
Creates anb arrow button.
 o JDPButton(int, String)
Creates a button with an icon only.
 o JDPButton(int, String, int)
Creates a button with an icon only.
 o JDPButton(String)
Creates a button with a label.
 o JDPButton(String, int)
Creates a button with a label.
 o JDPButton(String, int, int)
Creates a button with a label and an icon.

Method Index

 o getAlignment()
Get the current alignment (Left, Center or Right).
 o getAlignmentValue(String)
Get the alignment value integer given one of the following (Left, Center or Right).
 o getButtonIconList()
Get a list of the available icon names.
 o getIcon()
Get the icon number for this button.
 o getIconImagePath()
Get the path for the image that conatins the button icons.
 o getIconValue(String)
Get the icon number for this icon text.
 o getLabel()
Get the label of this button.
 o getStayOn()
Get the current stay on setting.
 o handleEvent(Event)
 o isIconOnly()
Check if this button is set to display only an icon and no label.
 o isPressed()
Get the current state if it has been set for stayOn=true.
 o layout()
 o minimumSize()
 o paint(Graphics)
 o preferredSize()
 o setAlignment(int)
Set the alignment (Left, Center or Right).
 o setIcon(int)
Set the icon number for this button.
 o setIcon(String)
Set the icon number for this button.
 o setIconImagePath(JDPUser, String)
Set the path for the image that conatins the button icons.
 o setIconImagePath(String)
Set the path for the image that conatins the button icons.
 o setIconOnly(boolean)
Set this button to display only an icon or an icon and a label.
 o setLabel(String)
Set the label of this button.
 o setPressed(boolean)
Set this button to be in the requested state if it has been set for stayOn=true.
 o setStayOn(boolean)
Set this button to stay on when pressed.
 o update(Graphics)

Variables

 o SAVE
 public static final int SAVE
 o LOAD
 public static final int LOAD
 o COMPILE
 public static final int COMPILE
 o BUILD
 public static final int BUILD
 o SEARCH
 public static final int SEARCH
 o GO
 public static final int GO
 o UNDO
 public static final int UNDO
 o PLUS
 public static final int PLUS
 o DELETE
 public static final int DELETE
 o NEW
 public static final int NEW
 o COPY
 public static final int COPY
 o CHECK
 public static final int CHECK
 o ARROW
 public static final int ARROW
 o PICTURE
 public static final int PICTURE
 o LABEL
 public static final int LABEL
 o TEXTFIELD
 public static final int TEXTFIELD
 o CHISELFRAME
 public static final int CHISELFRAME
 o BUTTON
 public static final int BUTTON
 o CHECKBOX
 public static final int CHECKBOX
 o RADIO
 public static final int RADIO
 o CHOICE
 public static final int CHOICE
 o LIST
 public static final int LIST
 o SCROLLSOUTH
 public static final int SCROLLSOUTH
 o SCROLLEAST
 public static final int SCROLLEAST
 o PANEL
 public static final int PANEL
 o TAB
 public static final int TAB
 o TREE
 public static final int TREE
 o GRID
 public static final int GRID
 o HOTKEY
 public static final int HOTKEY
 o SLIDER
 public static final int SLIDER
 o PROGRESS
 public static final int PROGRESS
 o SPINNER
 public static final int SPINNER
 o CUSTOM
 public static final int CUSTOM
 o CHART
 public static final int CHART
 o REPORT
 public static final int REPORT
 o EMAIL
 public static final int EMAIL
 o DEFINE
 public static final int DEFINE
 o HELPBOOK
 public static final int HELPBOOK
 o APIBOOK
 public static final int APIBOOK
 o LAYOUT
 public static final int LAYOUT
 o CIRCULAR
 public static final int CIRCULAR
 o BUILDERRORS
 public static final int BUILDERRORS
 o VIEW
 public static final int VIEW
 o DOCUMENTS
 public static final int DOCUMENTS
 o PAGER
 public static final int PAGER
 o NEWFOLDER
 public static final int NEWFOLDER
 o DEBUGBUILD
 public static final int DEBUGBUILD
 o PRINTER
 public static final int PRINTER
 o SEARCHFWD
 public static final int SEARCHFWD
 o SEARCHBACK
 public static final int SEARCHBACK
 o CENTER
 public static final int CENTER
 o LEFT
 public static final int LEFT
 o RIGHT
 public static final int RIGHT
 o UP
 public static final int UP
 o DOWN
 public static final int DOWN
 o PULLDOWN
 public static final int PULLDOWN

Constructors

 o JDPButton
 public JDPButton()
Creates a plain button.

 o JDPButton
 public JDPButton(String buttonText)
Creates a button with a label.

Parameters:
buttonText - the text label for the button.
 o JDPButton
 public JDPButton(String buttonText,
                  int alignment)
Creates a button with a label.

Parameters:
buttonText - the text label for the button.
alignment - the text alignment (Left, Center or Right).
 o JDPButton
 public JDPButton(String buttonText,
                  int buttonIcon,
                  int alignment)
Creates a button with a label and an icon.

Parameters:
buttonText - the text label for the button.
buttonIcon - the number of the icon.
alignment - the text alignment (Left, Center or Right).
 o JDPButton
 public JDPButton(int buttonIcon,
                  String returnValue,
                  int alignment)
Creates a button with an icon only.

Parameters:
buttonIcon - the number of the icon.
returnValue - the text value to return as the arg for events.
alignment - the text alignment (Left, Center or Right).
 o JDPButton
 public JDPButton(int buttonIcon,
                  String returnValue)
Creates a button with an icon only.

Parameters:
buttonIcon - the number of the icon.
returnValue - the text value to return as the arg for events.
 o JDPButton
 public JDPButton(int arrowDirection)
Creates anb arrow button.

Parameters:
arrowDirection - (LEFT, RIGHT, UP, DOWN, PULLDOWN).

Methods

 o setStayOn
 public void setStayOn(boolean stayOn)
Set this button to stay on when pressed.

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(boolean buttonPressed)
Set this button to be in the requested state if it has been set for stayOn=true.

Parameters:
buttonPressed - the new state of the button.
 o isPressed
 public boolean isPressed()
Get the current state if it has been set for stayOn=true.

Returns:
the current state of the button.
 o getLabel
 public String getLabel()
Get the label of this button.

Returns:
the label of the button.
 o setLabel
 public void setLabel(String buttonText)
Set the label of this button.

Parameters:
buttonText - the label of the button.
 o getButtonIconList
 public static String[] getButtonIconList()
Get a list of the available icon names.

Returns:
the list of available icon names.
 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 setIconImagePath
 public void setIconImagePath(JDPUser user,
                              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:
user - the JDPUser global parm required for loading the new image.
thisImageLoc - the full or partial path to the new image.
 o getIcon
 public int getIcon()
Get the icon number for this button.

Returns:
the icon number.
 o getIconValue
 public static int getIconValue(String icon)
Get the icon number for this icon text. Use getButtonIconList() to get a list of icon names and then user this method to get the corresponding icon number.

Returns:
the icon number.
 o setIcon
 public void setIcon(int icon)
Set the icon number for this button.

Parameters:
buttonIcon - the icon number.
 o setIcon
 public void setIcon(String icon)
Set the icon number for this button.

Parameters:
buttonIconName - the icon name. Use getButtonIconList() to get a list of names.
 o isIconOnly
 public boolean isIconOnly()
Check if this button is set to display only an icon and no label.

Returns:
whether displaying only an icon.
 o setIconOnly
 public void setIconOnly(boolean iconOnly)
Set this button 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 getAlignment
 public int getAlignment()
Get the current alignment (Left, Center or Right).

Returns:
the current alignment value.
 o setAlignment
 public void setAlignment(int align)
Set the alignment (Left, Center or Right).

Parameters:
alignment - the new alignment value.
 o getAlignmentValue
 public static int getAlignmentValue(String align)
Get the alignment value integer given one of the following (Left, Center or Right).

Returns:
the alignment value.
 o layout
 public void layout()
Overrides:
layout in class Container
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Container
 o update
 public void update(Graphics g)
Overrides:
update in class Component
 o preferredSize
 public Dimension preferredSize()
Overrides:
preferredSize in class Container
 o minimumSize
 public Dimension minimumSize()
Overrides:
minimumSize in class Container
 o handleEvent
 public synchronized boolean handleEvent(Event e)
Overrides:
handleEvent in class Component