Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jpl2.common.gui
Class AWTToolkit  view AWTToolkit download AWTToolkit.java

java.lang.Object
  extended byjpl2.common.gui.JPLToolkit
      extended byjpl2.common.gui.AWTToolkit

public class AWTToolkit
extends JPLToolkit


Field Summary
private  java.awt.FileDialog chooseFolder
           
private  java.awt.FileDialog openFile
           
private  java.awt.FileDialog saveFile
           
private  int windowCount
           
 
Fields inherited from class jpl2.common.gui.JPLToolkit
 
Constructor Summary
AWTToolkit()
           
 
Method Summary
 void add(java.awt.Window w, java.awt.Component c)
          Adds a component to a window.
 void add(java.awt.Window w, java.awt.Component c, java.lang.Object constraints)
          Adds a component to a window.
private  void addKeyListener(java.awt.Component c, java.awt.event.KeyListener kl)
           
 void addMenu(java.lang.Object menuBar, java.lang.Object menu)
          Add a menu to a menu bar.
 void addMenuItem(java.lang.Object menu, java.lang.Object menuItem)
          Add a menu item to a menu.
 void addSeparator(java.lang.Object menu)
          Insert a seperator/divider into the menu.
 boolean canChooseFolders()
          Under this setup can we create a folder/directory * chooser?
protected  java.io.File chooseFolderImp(java.awt.Frame parent, java.lang.String title)
          Display a dialog to allow the user to choose a folder (eg for * where to download files to.
protected  java.io.File chooseOpenFileImp(java.awt.Frame parent, java.lang.String title)
          Display a dialog to allow the user to open a file.
protected  java.io.File chooseSaveFileImp(java.awt.Frame parent, java.lang.String title)
          Display a dialog to allow the user to save a file.
 boolean getCheckBoxState(java.awt.Component checkBox)
          Get the current state of a CheckBox
 java.awt.Point getScrollPosition(java.awt.Container scrollpane)
          Returns the scroll position of a scrollpane.
 java.lang.String getSelected(java.awt.Component choice)
          Get the currently selected item on a choice.
 int getSelectedIndex(java.awt.Component choice)
          Get the currently selected item on a choice.
 java.lang.String getText(java.awt.Component textField)
          Get the text from a text field.
 java.awt.Dimension getViewportSize(java.awt.Container scrollpane)
          Returns the viewport size of a scrollpane.
protected  java.awt.Component makeButtonImp(java.lang.String text, java.lang.String action, java.awt.event.ActionListener listener)
          Returns either a java.awt.Button or a javax.swing.JButton.
protected  java.awt.Component makeCheckBoxImpl(java.lang.String label, java.awt.event.ItemListener listener)
          Returns either a java.awt.Checkbox or a javax.swing.JCheckBox
 java.awt.Component makeChoice(java.lang.String[] items, java.awt.event.ItemListener itemListener)
          Returns either a java.awt.Choice or a javax.swing.JComboBox.
protected  java.awt.Dialog makeDialogImp(java.awt.Frame parent, boolean modal)
          Returns either a java.awt.Dialog or a javax.swing.JDialog
protected  java.awt.Frame makeFrameImp()
          Returns either a java.awt.Frame or a javax.swing.JFrame
protected  java.awt.Container makeGroupPanelImp(java.lang.String title)
          Returns either a java.awt.Panel or a javax.swing.JPanel.
protected  java.awt.Component makeLabelImp(java.lang.String text, int horizontalAlignment)
          Returns either a java.awt.Label or a javax.swing.JLabel.
 java.awt.Component makeList(java.lang.String[] items, java.awt.event.ItemListener itemListener)
          Returns either a java.awt.List or a javax.swing.JList.
 java.lang.Object makeMenuBar()
          Returns either a java.awt.MenuBar or a javax.swing.JMenuBar.
protected  java.lang.Object makeMenuImp(java.lang.String label)
          Returns either a java.awt.Menu or a javax.swing.JMenu.
protected  java.lang.Object makeMenuItemImp(java.lang.String label, java.awt.MenuShortcut s, java.lang.String action, java.awt.event.ActionListener listener)
          Returns either a java.awt.MenuItem or a javax.swing.JMenuItem.
 java.awt.Container makePanel()
          Returns either a java.awt.Panel or a javax.swing.JPanel.
 java.awt.Component makeProgressBar()
          Returns either a ProgressBar or a javax.swing.JProgressBar.
 java.awt.Container makeScrollPane(java.awt.Component contents)
          Returns either a java.awt.ScrollPane of a javax.swing.JScrollPane.
 java.awt.Component makeTextField(java.lang.String text, int columns, java.awt.event.TextListener listener)
          Returns either a java.awt.TextField or a javax.swing.JTextField.
 void removeAll(java.lang.Object menu)
          Remove all items from a menu.
 void setButtonKey(java.awt.Dialog dialog, java.awt.Component button, int keyCode)
          Associate a key press with the button.
 void setButtonKey(java.awt.Frame frame, java.awt.Component button, int keyCode)
          Associate a key press with the button.
 void setCancelButton(java.awt.Dialog dialog, java.awt.Component button)
          Make the button the "cancel" button on a dialog.
 void setCancelButton(java.awt.Frame frame, java.awt.Component button)
          Make the button the "cancel" button on a frame.
 void setCheckBoxState(java.awt.Component checkBox, boolean state)
          Set the state of a CheckBox.
 void setChoiceItems(java.awt.Component choice, java.lang.String[] items)
          Set the items on a choice.
 void setDefaultButton(java.awt.Dialog dialog, java.awt.Component button)
          Make the button the default on a dialog.
 void setDefaultButton(java.awt.Frame frame, java.awt.Component button)
          Make the button the default on a frame.
 void setEditable(java.awt.Component textField, boolean editable)
           
 void setEnabled(java.lang.Object menuItem, boolean enabled)
          Enable disable a menu/menuitem.
 void setHelpMenu(java.lang.Object menuBar, java.lang.Object menu)
          Set the help menu on a menu bar.
 void setLayout(java.awt.Window w, java.awt.LayoutManager l)
          Sets a layout for a window.
 void setListItems(java.awt.Component list, java.lang.String[] items)
          Set the items on a list.
 void setMenuBar(java.awt.Frame frame, java.lang.Object menuBar)
          Sets a frames menu bar.
 void setProgressBarMax(java.awt.Component progressBar, int max)
          Set the max value on a progress bar.
 void setProgressBarValue(java.awt.Component progressBar, int value)
          Set the current value of a progress bar.
 void setScrollPosition(java.awt.Container scrollpane, int x, int y)
          Sets the scroll position of a scrollpane.
 void setSelected(java.awt.Component choice, java.lang.String item)
          Set the currently selected item on a choice.
 void setTextImp(java.awt.Component c, java.lang.String text)
          Sets the text on what may be a button or a label.
 
Methods inherited from class jpl2.common.gui.JPLToolkit
centreWindow, chooseFolder, chooseOpenFile, chooseSaveFile, createTemporaryFile, doMultipleQueryDialog, doQueryDialog, doTextInputDialog, getFonts, getPreferences, getResourceBundle, getResourceString, getResourceString, getToolkit, installDragAndDrop, isHiddenFile, isSwingToolkitAvailable, makeButton, makeCheckBox, makeDialog, makeFrame, makeGroupPanel, makeLabel, makeLabel, makeLabel, makeLabel, makeMenu, makeMenuItem, makeMultiLineLabel, setFileLastModified, setText, setText, showMessageDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chooseFolder

private java.awt.FileDialog chooseFolder

saveFile

private java.awt.FileDialog saveFile

openFile

private java.awt.FileDialog openFile

windowCount

private int windowCount
Constructor Detail

AWTToolkit

public AWTToolkit()
Method Detail

makeFrameImp

protected java.awt.Frame makeFrameImp()
Returns either a java.awt.Frame or a javax.swing.JFrame

Specified by:
makeFrameImp in class JPLToolkit

makeDialogImp

protected java.awt.Dialog makeDialogImp(java.awt.Frame parent,
                                        boolean modal)
Returns either a java.awt.Dialog or a javax.swing.JDialog

Specified by:
makeDialogImp in class JPLToolkit

add

public void add(java.awt.Window w,
                java.awt.Component c)
Adds a component to a window. In the case of swing getContentPane() must be used.

Specified by:
add in class JPLToolkit

add

public void add(java.awt.Window w,
                java.awt.Component c,
                java.lang.Object constraints)
Adds a component to a window. In the case of swing getContentPane() must be used.

Specified by:
add in class JPLToolkit

setLayout

public void setLayout(java.awt.Window w,
                      java.awt.LayoutManager l)
Sets a layout for a window. In the case of swing getContentPane() must be used.

Specified by:
setLayout in class JPLToolkit

makePanel

public java.awt.Container makePanel()
Returns either a java.awt.Panel or a javax.swing.JPanel.

Specified by:
makePanel in class JPLToolkit

makeGroupPanelImp

protected java.awt.Container makeGroupPanelImp(java.lang.String title)
Returns either a java.awt.Panel or a javax.swing.JPanel.

Specified by:
makeGroupPanelImp in class JPLToolkit

makeButtonImp

protected java.awt.Component makeButtonImp(java.lang.String text,
                                           java.lang.String action,
                                           java.awt.event.ActionListener listener)
Returns either a java.awt.Button or a javax.swing.JButton.

Specified by:
makeButtonImp in class JPLToolkit

setDefaultButton

public void setDefaultButton(java.awt.Dialog dialog,
                             java.awt.Component button)
Make the button the default on a dialog.

Specified by:
setDefaultButton in class JPLToolkit

setCancelButton

public void setCancelButton(java.awt.Dialog dialog,
                            java.awt.Component button)
Make the button the "cancel" button on a dialog. ie the button * which dismisses the dialog without takign any action.

Specified by:
setCancelButton in class JPLToolkit

addKeyListener

private void addKeyListener(java.awt.Component c,
                            java.awt.event.KeyListener kl)

setButtonKey

public void setButtonKey(java.awt.Dialog dialog,
                         java.awt.Component button,
                         int keyCode)
Associate a key press with the button. ie so a key can be pressed instead of * using the mouse to press the button.

Specified by:
setButtonKey in class JPLToolkit

setDefaultButton

public void setDefaultButton(java.awt.Frame frame,
                             java.awt.Component button)
Make the button the default on a frame.

Specified by:
setDefaultButton in class JPLToolkit

setCancelButton

public void setCancelButton(java.awt.Frame frame,
                            java.awt.Component button)
Make the button the "cancel" button on a frame. ie the button * which dismisses the frame without taking any action.

Specified by:
setCancelButton in class JPLToolkit

setButtonKey

public void setButtonKey(java.awt.Frame frame,
                         java.awt.Component button,
                         int keyCode)
Associate a key press with the button. ie so a key can be pressed instead of * using the mouse to press the button.

Specified by:
setButtonKey in class JPLToolkit

makeLabelImp

protected java.awt.Component makeLabelImp(java.lang.String text,
                                          int horizontalAlignment)
Returns either a java.awt.Label or a javax.swing.JLabel.

Specified by:
makeLabelImp in class JPLToolkit

setTextImp

public void setTextImp(java.awt.Component c,
                       java.lang.String text)
Sets the text on what may be a button or a label.

Specified by:
setTextImp in class JPLToolkit

makeMenuBar

public java.lang.Object makeMenuBar()
Returns either a java.awt.MenuBar or a javax.swing.JMenuBar.

Specified by:
makeMenuBar in class JPLToolkit

setMenuBar

public void setMenuBar(java.awt.Frame frame,
                       java.lang.Object menuBar)
Sets a frames menu bar.

Specified by:
setMenuBar in class JPLToolkit

makeMenuImp

protected java.lang.Object makeMenuImp(java.lang.String label)
Returns either a java.awt.Menu or a javax.swing.JMenu.

Specified by:
makeMenuImp in class JPLToolkit

addSeparator

public void addSeparator(java.lang.Object menu)
Insert a seperator/divider into the menu.

Specified by:
addSeparator in class JPLToolkit

removeAll

public void removeAll(java.lang.Object menu)
Remove all items from a menu.

Specified by:
removeAll in class JPLToolkit

addMenu

public void addMenu(java.lang.Object menuBar,
                    java.lang.Object menu)
Add a menu to a menu bar.

Specified by:
addMenu in class JPLToolkit

setHelpMenu

public void setHelpMenu(java.lang.Object menuBar,
                        java.lang.Object menu)
Set the help menu on a menu bar.

Specified by:
setHelpMenu in class JPLToolkit

makeMenuItemImp

protected java.lang.Object makeMenuItemImp(java.lang.String label,
                                           java.awt.MenuShortcut s,
                                           java.lang.String action,
                                           java.awt.event.ActionListener listener)
Returns either a java.awt.MenuItem or a javax.swing.JMenuItem.

Specified by:
makeMenuItemImp in class JPLToolkit

addMenuItem

public void addMenuItem(java.lang.Object menu,
                        java.lang.Object menuItem)
Add a menu item to a menu.

Specified by:
addMenuItem in class JPLToolkit

setEnabled

public void setEnabled(java.lang.Object menuItem,
                       boolean enabled)
Enable disable a menu/menuitem.

Specified by:
setEnabled in class JPLToolkit

makeScrollPane

public java.awt.Container makeScrollPane(java.awt.Component contents)
Returns either a java.awt.ScrollPane of a javax.swing.JScrollPane.

Specified by:
makeScrollPane in class JPLToolkit

getViewportSize

public java.awt.Dimension getViewportSize(java.awt.Container scrollpane)
Returns the viewport size of a scrollpane.

Specified by:
getViewportSize in class JPLToolkit

getScrollPosition

public java.awt.Point getScrollPosition(java.awt.Container scrollpane)
Returns the scroll position of a scrollpane.

Specified by:
getScrollPosition in class JPLToolkit

setScrollPosition

public void setScrollPosition(java.awt.Container scrollpane,
                              int x,
                              int y)
Sets the scroll position of a scrollpane.

Specified by:
setScrollPosition in class JPLToolkit

makeChoice

public java.awt.Component makeChoice(java.lang.String[] items,
                                     java.awt.event.ItemListener itemListener)
Returns either a java.awt.Choice or a javax.swing.JComboBox.

Specified by:
makeChoice in class JPLToolkit

setChoiceItems

public void setChoiceItems(java.awt.Component choice,
                           java.lang.String[] items)
Set the items on a choice.

Specified by:
setChoiceItems in class JPLToolkit

makeList

public java.awt.Component makeList(java.lang.String[] items,
                                   java.awt.event.ItemListener itemListener)
Returns either a java.awt.List or a javax.swing.JList.

Specified by:
makeList in class JPLToolkit

setListItems

public void setListItems(java.awt.Component list,
                         java.lang.String[] items)
Set the items on a list.

Specified by:
setListItems in class JPLToolkit

setSelected

public void setSelected(java.awt.Component choice,
                        java.lang.String item)
Set the currently selected item on a choice.

Specified by:
setSelected in class JPLToolkit

getSelected

public java.lang.String getSelected(java.awt.Component choice)
Get the currently selected item on a choice.

Specified by:
getSelected in class JPLToolkit

getSelectedIndex

public int getSelectedIndex(java.awt.Component choice)
Get the currently selected item on a choice.

Specified by:
getSelectedIndex in class JPLToolkit

makeProgressBar

public java.awt.Component makeProgressBar()
Returns either a ProgressBar or a javax.swing.JProgressBar.

Specified by:
makeProgressBar in class JPLToolkit

setProgressBarMax

public void setProgressBarMax(java.awt.Component progressBar,
                              int max)
Set the max value on a progress bar.

Specified by:
setProgressBarMax in class JPLToolkit

setProgressBarValue

public void setProgressBarValue(java.awt.Component progressBar,
                                int value)
Set the current value of a progress bar.

Specified by:
setProgressBarValue in class JPLToolkit

makeTextField

public java.awt.Component makeTextField(java.lang.String text,
                                        int columns,
                                        java.awt.event.TextListener listener)
Returns either a java.awt.TextField or a javax.swing.JTextField.

Specified by:
makeTextField in class JPLToolkit

setEditable

public void setEditable(java.awt.Component textField,
                        boolean editable)
Specified by:
setEditable in class JPLToolkit

getText

public java.lang.String getText(java.awt.Component textField)
Get the text from a text field.

Specified by:
getText in class JPLToolkit

makeCheckBoxImpl

protected java.awt.Component makeCheckBoxImpl(java.lang.String label,
                                              java.awt.event.ItemListener listener)
Returns either a java.awt.Checkbox or a javax.swing.JCheckBox

Specified by:
makeCheckBoxImpl in class JPLToolkit

getCheckBoxState

public boolean getCheckBoxState(java.awt.Component checkBox)
Get the current state of a CheckBox

Specified by:
getCheckBoxState in class JPLToolkit

setCheckBoxState

public void setCheckBoxState(java.awt.Component checkBox,
                             boolean state)
Set the state of a CheckBox.

Specified by:
setCheckBoxState in class JPLToolkit

canChooseFolders

public boolean canChooseFolders()
Under this setup can we create a folder/directory * chooser?

Specified by:
canChooseFolders in class JPLToolkit

chooseFolderImp

protected java.io.File chooseFolderImp(java.awt.Frame parent,
                                       java.lang.String title)
Display a dialog to allow the user to choose a folder (eg for * where to download files to.

Specified by:
chooseFolderImp in class JPLToolkit

chooseSaveFileImp

protected java.io.File chooseSaveFileImp(java.awt.Frame parent,
                                         java.lang.String title)
Display a dialog to allow the user to save a file.

Specified by:
chooseSaveFileImp in class JPLToolkit

chooseOpenFileImp

protected java.io.File chooseOpenFileImp(java.awt.Frame parent,
                                         java.lang.String title)
Display a dialog to allow the user to open a file.

Specified by:
chooseOpenFileImp in class JPLToolkit