|
||||||||||
| 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
net.lucidviews.util.gui.swing.JLettersPanel
public class JLettersPanel
A panel that displays a row of letters.
| 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 Border |
_defaultBorder
The border, if no other is specified, to use around each text component that displays a letter. |
protected JLabel[] |
_letters
Text components, one for each letter. |
| 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 | |
|---|---|
JLettersPanel()
Default constructor. |
|
JLettersPanel(boolean isDoubleBuffered)
Default constructor. |
|
| Method Summary | |
|---|---|
protected JLabel |
getLetter(int index)
Returns the label showing the letter at the given index. |
void |
setAlignment(int align)
Sets the alignment for the row of letters within the whole panel. |
void |
setLayout(LayoutManager layoutManager)
|
void |
setLetter(char letter,
int index)
Change the letter shown at a given position. |
void |
setLetter(char letter,
int index,
Font font,
Color colour)
Change the letter shown at a given position. |
void |
setLetterBorder(Border border)
Set the border used around each letter. |
void |
setLetters(char letter,
int count)
Set the letters to be displayed. |
void |
setLetters(String letters)
Set the letters to be displayed. |
| 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 Border _defaultBorder
protected JLabel[] _letters
| Constructor Detail |
|---|
public JLettersPanel()
public JLettersPanel(boolean isDoubleBuffered)
isDoubleBuffered - a boolean, true for double-buffering, which uses
additional memory space to achieve fast,
flicker-free updates| Method Detail |
|---|
public void setLayout(LayoutManager layoutManager)
setLayout in class Containerpublic void setAlignment(int align)
FlowLayout.LEFTFlowLayout.RIGHTFlowLayout.CENTERFlowLayout.LEADINGFlowLayout.TRAILING
align - one of the alignment values shown abovepublic void setLetterBorder(Border border)
border - the border around each letterpublic void setLetters(String letters)
String.
letters - a string of letters
public void setLetters(char letter,
int count)
letter - the letter to be usedcount - the number of letters to be added to the panel
public void setLetter(char letter,
int index)
throws IndexOutOfBoundsException
letter - the letter to be displayedindex - the index within the panel where the letter is to appear
IndexOutOfBoundsException - there is no letter at the specified
index
public void setLetter(char letter,
int index,
Font font,
Color colour)
throws IndexOutOfBoundsException
letter - the letter to be displayedindex - the index within the panel where the letter is to appearfont - the font to be used to render the lettercolour - the colour of the letter when it is rendered
IndexOutOfBoundsException - there is no letter at the specified
index
protected JLabel getLetter(int index)
throws IndexOutOfBoundsException
IndexOutOfBoundsException
is thrown.
index - the index of the letter
JLabel that renders the letter
IndexOutOfBoundsException - there is no letter at the specified
index
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||