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.
-
APIBOOK
-
-
ARROW
-
-
BUILD
-
-
BUILDERRORS
-
-
BUTTON
-
-
CENTER
-
-
CHART
-
-
CHECK
-
-
CHECKBOX
-
-
CHISELFRAME
-
-
CHOICE
-
-
CIRCULAR
-
-
COMPILE
-
-
COPY
-
-
CUSTOM
-
-
DEBUGBUILD
-
-
DEFINE
-
-
DELETE
-
-
DOCUMENTS
-
-
DOWN
-
-
EMAIL
-
-
GO
-
-
GRID
-
-
HELPBOOK
-
-
HOTKEY
-
-
LABEL
-
-
LAYOUT
-
-
LEFT
-
-
LIST
-
-
LOAD
-
-
NEW
-
-
NEWFOLDER
-
-
PAGER
-
-
PANEL
-
-
PICTURE
-
-
PLUS
-
-
PRINTER
-
-
PROGRESS
-
-
PULLDOWN
-
-
RADIO
-
-
REPORT
-
-
RIGHT
-
-
SAVE
-
-
SCROLLEAST
-
-
SCROLLSOUTH
-
-
SEARCH
-
-
SEARCHBACK
-
-
SEARCHFWD
-
-
SLIDER
-
-
SPINNER
-
-
TAB
-
-
TEXTFIELD
-
-
TREE
-
-
UNDO
-
-
UP
-
-
VIEW
-
-
JDPButton()
- Creates a plain button.
-
JDPButton(int)
- Creates anb arrow button.
-
JDPButton(int, String)
- Creates a button with an icon only.
-
JDPButton(int, String, int)
- Creates a button with an icon only.
-
JDPButton(String)
- Creates a button with a label.
-
JDPButton(String, int)
- Creates a button with a label.
-
JDPButton(String, int, int)
- Creates a button with a label and an icon.
-
getAlignment()
- Get the current alignment (Left, Center or Right).
-
getAlignmentValue(String)
- Get the alignment value integer given one of the following (Left, Center or Right).
-
getButtonIconList()
- Get a list of the available icon names.
-
getIcon()
- Get the icon number for this button.
-
getIconImagePath()
- Get the path for the image that conatins the button icons.
-
getIconValue(String)
- Get the icon number for this icon text.
-
getLabel()
- Get the label of this button.
-
getStayOn()
- Get the current stay on setting.
-
handleEvent(Event)
-
-
isIconOnly()
- Check if this button is set to display only an icon and no label.
-
isPressed()
- Get the current state if it has been set for stayOn=true.
-
layout()
-
-
minimumSize()
-
-
paint(Graphics)
-
-
preferredSize()
-
-
setAlignment(int)
- Set the alignment (Left, Center or Right).
-
setIcon(int)
- Set the icon number for this button.
-
setIcon(String)
- Set the icon number for this button.
-
setIconImagePath(JDPUser, String)
- Set the path for the image that conatins the button icons.
-
setIconImagePath(String)
- Set the path for the image that conatins the button icons.
-
setIconOnly(boolean)
- Set this button to display only an icon or an icon and a label.
-
setLabel(String)
- Set the label of this button.
-
setPressed(boolean)
- Set this button to be in the requested state if it has been set for stayOn=true.
-
setStayOn(boolean)
- Set this button to stay on when pressed.
-
update(Graphics)
-
SAVE
public static final int SAVE
LOAD
public static final int LOAD
COMPILE
public static final int COMPILE
BUILD
public static final int BUILD
SEARCH
public static final int SEARCH
GO
public static final int GO
UNDO
public static final int UNDO
PLUS
public static final int PLUS
DELETE
public static final int DELETE
NEW
public static final int NEW
COPY
public static final int COPY
CHECK
public static final int CHECK
ARROW
public static final int ARROW
PICTURE
public static final int PICTURE
LABEL
public static final int LABEL
TEXTFIELD
public static final int TEXTFIELD
CHISELFRAME
public static final int CHISELFRAME
BUTTON
public static final int BUTTON
CHECKBOX
public static final int CHECKBOX
RADIO
public static final int RADIO
CHOICE
public static final int CHOICE
LIST
public static final int LIST
SCROLLSOUTH
public static final int SCROLLSOUTH
SCROLLEAST
public static final int SCROLLEAST
PANEL
public static final int PANEL
TAB
public static final int TAB
TREE
public static final int TREE
GRID
public static final int GRID
HOTKEY
public static final int HOTKEY
SLIDER
public static final int SLIDER
PROGRESS
public static final int PROGRESS
SPINNER
public static final int SPINNER
CUSTOM
public static final int CUSTOM
CHART
public static final int CHART
REPORT
public static final int REPORT
EMAIL
public static final int EMAIL
DEFINE
public static final int DEFINE
HELPBOOK
public static final int HELPBOOK
APIBOOK
public static final int APIBOOK
LAYOUT
public static final int LAYOUT
CIRCULAR
public static final int CIRCULAR
BUILDERRORS
public static final int BUILDERRORS
VIEW
public static final int VIEW
DOCUMENTS
public static final int DOCUMENTS
PAGER
public static final int PAGER
NEWFOLDER
public static final int NEWFOLDER
DEBUGBUILD
public static final int DEBUGBUILD
PRINTER
public static final int PRINTER
SEARCHFWD
public static final int SEARCHFWD
SEARCHBACK
public static final int SEARCHBACK
CENTER
public static final int CENTER
LEFT
public static final int LEFT
RIGHT
public static final int RIGHT
UP
public static final int UP
DOWN
public static final int DOWN
PULLDOWN
public static final int PULLDOWN
JDPButton
public JDPButton()
- Creates a plain button.
JDPButton
public JDPButton(String buttonText)
- Creates a button with a label.
- Parameters:
- buttonText - the text label for the button.
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).
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).
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).
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.
JDPButton
public JDPButton(int arrowDirection)
- Creates anb arrow button.
- Parameters:
- arrowDirection - (LEFT, RIGHT, UP, DOWN, PULLDOWN).
setStayOn
public void setStayOn(boolean stayOn)
- Set this button to stay on when pressed.
- 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(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.
isPressed
public boolean isPressed()
- Get the current state if it has been set for stayOn=true.
- Returns:
- the current state of the button.
getLabel
public String getLabel()
- Get the label of this button.
- Returns:
- the label of the button.
setLabel
public void setLabel(String buttonText)
- Set the label of this button.
- Parameters:
- buttonText - the label of the button.
getButtonIconList
public static String[] getButtonIconList()
- Get a list of the available icon names.
- Returns:
- the list of available icon names.
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.
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.
getIcon
public int getIcon()
- Get the icon number for this button.
- Returns:
- the icon number.
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.
setIcon
public void setIcon(int icon)
- Set the icon number for this button.
- Parameters:
- buttonIcon - the icon number.
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.
isIconOnly
public boolean isIconOnly()
- Check if this button is set to display only an icon and no label.
- Returns:
- whether displaying only an icon.
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.
getAlignment
public int getAlignment()
- Get the current alignment (Left, Center or Right).
- Returns:
- the current alignment value.
setAlignment
public void setAlignment(int align)
- Set the alignment (Left, Center or Right).
- Parameters:
- alignment - the new alignment value.
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.
layout
public void layout()
- Overrides:
- layout in class Container
paint
public void paint(Graphics g)
- Overrides:
- paint in class Container
update
public void update(Graphics g)
- Overrides:
- update in class Component
preferredSize
public Dimension preferredSize()
- Overrides:
- preferredSize in class Container
minimumSize
public Dimension minimumSize()
- Overrides:
- minimumSize in class Container
handleEvent
public synchronized boolean handleEvent(Event e)
- Overrides:
- handleEvent in class Component