|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--au.edu.swin.synergy.plugin.mod13.bwt.BSwingUtilities
Because the current version of swing is not thread safe, all methods on swing components need to be called from the awt event thread. Due to the fact that Cohesion is so incredibly thread centric, this requires a central means for performing these tasks.
This class needs to provide a means of setting all the required methods with their given paramaters as needed. Obviously it won't cover everything and so needs to be updated as new requirements come to hand.
The alternative is to write a your own inner class for each
method you call and call SwingUtilities.invokeLater()
yourself
Inner Class Summary | |
class |
BSwingUtilities.BAddJComboItem
Handles the add item method in the combo |
class |
BSwingUtilities.BAddTab
Adds the given component to the table as a tab |
class |
BSwingUtilities.BListModelRefresh
This provides a means of safely setting the contents of a BListModel from within the awt thread. |
class |
BSwingUtilities.BListModelSetContents
This provides a means of safely setting the contents of a BListModel from within the awt thread. |
class |
BSwingUtilities.BRemoveAllJComboItems
Handles the removeAllItems method of the combo |
class |
BSwingUtilities.BSetAccelerator
Sets the user object in the given tree node |
class |
BSwingUtilities.BSetBorderTitle
Sets the user object in the given tree node |
class |
BSwingUtilities.BSetFrameIcon
Adds the given component to the table as a tab |
class |
BSwingUtilities.BSetFrameTitle
Adds the given component to the table as a tab |
class |
BSwingUtilities.BSetJBorder
Handles the set enabled on a JComponent |
class |
BSwingUtilities.BSetJButtonText
Handles the set enabled on a JComponent |
class |
BSwingUtilities.BSetJComboItem
Handles the add item method in the combo |
class |
BSwingUtilities.BSetJComponentEnabled
Handles the set enabled on a JComponent |
class |
BSwingUtilities.BSetJLabelText
Handles the set text on a JLabel |
class |
BSwingUtilities.BSetJMenuItemText
Handles the set text on a JLabel |
class |
BSwingUtilities.BSetJText
Handles the set text on a JTextComponents |
class |
BSwingUtilities.BSetMnemonic
Sets the user object in the given tree node |
class |
BSwingUtilities.BSetPreferedSize
Adds the given component to the table as a tab |
class |
BSwingUtilities.BSetTitleFor
Adds the given component to the table as a tab |
class |
BSwingUtilities.BSetToolTip
Sets the user object in the given tree node |
class |
BSwingUtilities.BSetUserObject
Sets the user object in the given tree node |
class |
BSwingUtilities.BSetValueAt
Handles the add item method in the combo |
Constructor Summary | |
BSwingUtilities()
|
Method Summary | |
static void |
addTab(JTabbedPane tabbedPane,
String title,
JComponent component)
Adds the given component to the given JTable as a tab |
static void |
doBListModelRefresh(BListModel listModel)
This will call the doRefresh method in list model provided |
static void |
doJComboAddItem(JComboBox comboBox,
Object item)
This will call the addItem() method of the given combo box with the given object |
static void |
doJComboRemoveAllItems(JComboBox comboBox)
This will call the removeAllItems() method of the given combo box |
static void |
doJComboSetItem(JComboBox comboBox,
Object item)
This will call the addItem() method of the given combo box with the given object |
static ImageIcon |
getImage(Object loader,
String location)
Gets an image icon using the give objects class as the class loader and the given location as the path to the icon. |
static void |
setBListModelContents(BListModel listModel,
Vector contents)
This accepts a BListModel and a Vector of contents for that model and performs the operation in the awt thread. |
static void |
setBorder(JComponent fComponent,
Border border)
This accepts any JComponent and sets its enabled state to the given value |
static void |
setBorderTitle(TitledBorder border,
String title)
Sets the title in the given title border |
static void |
setFrameIcon(Frame frame,
Image icon)
Sets the frame icon for the given frame |
static void |
setFrameTitle(Frame frame,
String title)
Sets the title for the given component on the given table to the given value! |
static void |
setJButtonText(AbstractButton button,
String fText)
Sets the text in the given textComponent to the value provided |
static void |
setJComponentEnabled(JComponent fComponent,
boolean fEnabled)
This accepts any JComponent and sets its enabled state to the given value |
static void |
setJLabelText(JLabel fLabel,
String fText)
Sets the text in the given JLabel to the value provided |
static void |
setJMenuItemText(JMenuItem menuItem,
String fText)
Sets the text in the given JMenuItem to the value provided |
static void |
setJText(JTextComponent textComponent,
String fText)
Sets the text in the given textComponent to the value provided |
static void |
setMenuAccererator(JMenuItem menuItem,
KeyStroke keyStroke)
Sets the accererator for the given menu item |
static void |
setMnemonic(AbstractButton button,
char mnemonic)
Sets the mnemonic for the given abstract button |
static void |
setMnemonic(AbstractButton button,
int mnemonic)
Sets the mnemonic for the given abstract button |
static void |
setSize(Component component,
Dimension size,
boolean preferred)
Sets the size or prefered size of the component |
static void |
setTableModelValueAt(DefaultTableModel tableModel,
Object value,
int row,
int column)
Sets the value at the specified row and column to the given value |
static void |
setTitleFor(JTabbedPane tabbedPane,
JComponent component,
String title)
Sets the title for the given component on the given table to the given value! |
static void |
setToolTip(JComponent component,
String fText)
Sets the tooltip text on the given JComponent to the value provided |
static void |
setUserObject(DefaultMutableTreeNode node,
Object value)
Sets the user object in the given default mutable tree node |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public BSwingUtilities()
Method Detail |
public static void setJLabelText(JLabel fLabel, String fText)
fLabel
- The label to set the text offText
- The text to set it topublic static void setUserObject(DefaultMutableTreeNode node, Object value)
node
- The node to set the user object invalue
- The value to setpublic static void setTableModelValueAt(DefaultTableModel tableModel, Object value, int row, int column)
tableModel
- The table model to set the value invalue
- The value to setrow
- The row to set the value incolumn
- The column to set the value inpublic static void setJButtonText(AbstractButton button, String fText)
fLabel
- The label to set the text offText
- The text to set it topublic static void setToolTip(JComponent component, String fText)
component
- The component to set the tool tip onfText
- The text to set it topublic static void setSize(Component component, Dimension size, boolean preferred)
component
- The component to set the size ofsize
- The size to set it topreferred
- True to set the preferred size, false to set the sizepublic static void setTitleFor(JTabbedPane tabbedPane, JComponent component, String title)
component
- The component to set the title fortabbedPane
- The tabbed pane to set the title onString
- The new titlepublic static void setFrameTitle(Frame frame, String title)
frame
- The frame to set the title ofString
- The new titlepublic static void setFrameIcon(Frame frame, Image icon)
frame
- The frame to set the title oficon
- The icon to set on the framepublic static void doBListModelRefresh(BListModel listModel)
listModel
- The list model to call refresh onpublic static ImageIcon getImage(Object loader, String location)
This should be used in the following manner:
ImageIcon icon = BSwingUtilities.getImage(this, "/au/edu/swin/synergy/plugin/mod13/images/logo.gif")
This will allow the images to be stored in a jar along with the classes. Make sure you have the slash on the front.
loader
- The object to be used as the resource loaderlocation
- The relative path to the iconpublic static void doJComboSetItem(JComboBox comboBox, Object item)
comboBox
- The combo to add toitem
- The item to addpublic static void doJComboAddItem(JComboBox comboBox, Object item)
comboBox
- The combo to add toitem
- The item to addpublic static void doJComboRemoveAllItems(JComboBox comboBox)
comboBox
- The combo box to remove all the items frompublic static void setJMenuItemText(JMenuItem menuItem, String fText)
menuItem
- The menu item to set the text offText
- The text to set it topublic static void setMenuAccererator(JMenuItem menuItem, KeyStroke keyStroke)
menuItem
- The menu item to set accererator forkeyStroke
- The keystroke to set as the acceleratorpublic static void addTab(JTabbedPane tabbedPane, String title, JComponent component)
table
- The table add the component tocomponent
- The component to add as a tab to the given tablepublic static void setMnemonic(AbstractButton button, int mnemonic)
button
- The button item to set mnemonic formnemonic
- The mnemonic to set as the mnemonicpublic static void setMnemonic(AbstractButton button, char mnemonic)
button
- The button item to set mnemonic formnemonic
- The mnemonic to set as the mnemonicpublic static void setBorderTitle(TitledBorder border, String title)
border
- The border to set the title oftitle
- The title to setpublic static void setJText(JTextComponent textComponent, String fText)
fLabel
- The label to set the text offText
- The text to set it topublic static void setBorder(JComponent fComponent, Border border)
fComponent
- The component to set the border offEnabled
- The new enabled state of the given componentpublic static void setJComponentEnabled(JComponent fComponent, boolean fEnabled)
fComponent
- The component to setfEnabled
- The new enabled state of the given componentpublic static void setBListModelContents(BListModel listModel, Vector contents)
listModel
- The list model to set the contents ofcontents
- The contents of the list model to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |