|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
uk.ac.starlink.util.gui.SelectTextField
public class SelectTextField
A component for accepting a text string, but with the additional capability of choosing from the complete list of characters available in the current font. The font details are shown in a popup window that is initialised using a button shown against the text entry area.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected JButton |
charButton
Button to initiate selecting special characters. |
protected SelectCharacters |
charChooser
The special character chooser. |
protected EventListenerList |
listeners
|
protected JTextField |
textField
The text entry field. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
SelectTextField()
Create an instance. |
|
SelectTextField(String text)
Create an instance with initial text field. |
|
SelectTextField(String text,
SelectCharacters charChooser)
Create an instance with initial text field and using the pre-configured instance of SelectCharacters. |
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
Registers a listener who wants to be informed about changes to the character string. |
protected void |
chooseChars()
Choose a special character phrase to append. |
protected void |
fireAction(ActionEvent e)
Send action event to all listeners. |
Document |
getDocument()
Get the document model used by the JTextField. |
String |
getText()
Get the displayed text. |
Color |
getTextColour()
Get the text colour. |
Font |
getTextFont()
Get the text font. |
protected void |
initUI()
Initialise the user interface. |
void |
insertText(String text)
Insert new text, either at the end or at the insertion point. |
void |
newCharacters(SelectCharactersEvent e)
Accept new characters. |
void |
removeActionListener(ActionListener l)
|
void |
setColumns(int columns)
Set the number of columns displayed by the JTextField. |
void |
setText(String text)
Set the displayed text. |
void |
setTextColour(Color colour)
Set the text colour. |
void |
setTextFont(Font font)
Set the text font. |
void |
setToolTipText(String tip)
Set the tooltip for the text component. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected JTextField textField
protected JButton charButton
protected SelectCharacters charChooser
protected EventListenerList listeners
Constructor Detail |
---|
public SelectTextField()
public SelectTextField(String text)
text
- default text for the text field.public SelectTextField(String text, SelectCharacters charChooser)
text
- default text for the text field.Method Detail |
---|
protected void initUI()
protected void chooseChars()
public void newCharacters(SelectCharactersEvent e)
newCharacters
in interface SelectCharactersListener
public void setText(String text)
public void insertText(String text)
public String getText()
public void setTextFont(Font font)
public Font getTextFont()
public void setTextColour(Color colour)
public Color getTextColour()
public Document getDocument()
public void setToolTipText(String tip)
setToolTipText
in class JComponent
public void setColumns(int columns)
public void addActionListener(ActionListener l)
l
- the ActionListenerpublic void removeActionListener(ActionListener l)
protected void fireAction(ActionEvent e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |