|
||||||||||
| 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
edu.neu.ccs.gui.DisplayPanel
edu.neu.ccs.gui.BasePane
Class BasePane contains common font and size
definitions for use in certain other JPT classes.
In 2.5.0, this class was designed as a base class that defined certain protected variables that could be used in a derived class. That usage is still possible. In addition, in 2.6.0, public “get” methods were added that allow a caller access the same definitions. Therefore, a designer need not used inheritance but may simply add items to this panel and use the definitions as desired.
Note that it is the responsibility of the caller to set fonts for fields, labels, and buttons. That cannot be done automatically.
In 2.5.0, the font size used for the fonts was computed by the formula:
14 + (int)LookAndFeelTools.getNetFontSizeAdjustment()The rationale for this formula was to start with a base
font size (14) and then adjust that size by whatever font
size adjustment was already defined via the class
LookAndFeelTools. In this way, the usability
features of LookAndFeelTools would be taken
into account automatically.
In 2.6.0, the decision was made to permit the base font size to be supplied in a constructor and to make 12 rather than 14 be the default if no such size is supplied.
This class chooses font families using the methods in
class Fonts.
Fonts,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
protected int |
baseFontSize
The base font size which either defaults to 12 or is supplied in the constructor. |
protected Font |
buttonFont
The button font uses the sans serif font with BOLD style in the common font size. |
static int |
DEFAULT_BASE_FONT_SIZE
The default value of the base font size. |
protected Font |
fieldFont
The field font uses the monospaced font with BOLD style in the common font size. |
protected int |
fontSize
The common font size for fields, labels, and buttons. |
protected int |
gap
The recommend common gap for use in table panels. |
protected Font |
labelFont
The label font uses the serif font with BOLD style in the common font size. |
protected int |
largeFieldWidth
The large field width is 3 times the small field width. |
protected int |
mediumFieldWidth
The medium field width is 2 times the small field width. |
static int |
MINIMUM_FONT_SIZE
The minimum value permitted for the common font size regardless of other settings. |
protected String |
monospacedFontName
The monospaced font name from class Fonts. |
protected String |
sansserifFontName
The sans serif font name from class Fonts. |
protected String |
serifFontName
The serif font name from class Fonts. |
protected int |
smallFieldWidth
The small field width is the width of 20 characters in the field font. |
| Fields inherited from class edu.neu.ccs.gui.DisplayPanel |
background, codec, CODEC |
| Fields inherited from class javax.swing.JPanel |
|
| 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.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface edu.neu.ccs.gui.Displayable |
DEFAULT_VIEW_STATE, VIEW_STATE |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
BasePane()
The default constructor that assumes a base font size of 12. |
|
BasePane(int baseFontSize)
The constructor that permits the base font size to be supplied by the caller. |
|
| Method Summary | |
Font |
getButtonFont()
Returns the recommended button font. |
Font |
getFieldFont()
Returns the recommended field font. |
int |
getFontSize()
Returns the common font size. |
int |
getGap()
Returns the recommended table panel gap. |
Font |
getLabelFont()
Returns the recommended label font. |
int |
getLargeFieldWidth()
Returns the recommended large field width. |
int |
getMediumFieldWidth()
Returns the recommended medium field width. |
int |
getSmallFieldWidth()
Returns the recommended small field width. |
protected void |
initializeBasePane()
The common initialization code for both constructors. |
| 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 |
public static final int DEFAULT_BASE_FONT_SIZE
public static final int MINIMUM_FONT_SIZE
protected String monospacedFontName
Fonts.
protected String serifFontName
Fonts.
protected String sansserifFontName
Fonts.
protected int baseFontSize
protected int fontSize
The common font size for fields, labels, and buttons.
This font size is computed as the base font size plus
the net font size adjustment from LookAndFeelTools.
The resulting font size will be forced to be at least as
big as MINIMUM_FONT_SIZE.
protected Font fieldFont
protected Font labelFont
protected Font buttonFont
protected int smallFieldWidth
protected int mediumFieldWidth
protected int largeFieldWidth
protected int gap
| Constructor Detail |
public BasePane()
The default constructor that assumes a base font size of 12.
public BasePane(int baseFontSize)
The constructor that permits the base font size to be supplied by the caller.
baseFontSize - the desired base font size| Method Detail |
public int getFontSize()
public Font getFieldFont()
public Font getLabelFont()
public Font getButtonFont()
public int getSmallFieldWidth()
public int getMediumFieldWidth()
public int getLargeFieldWidth()
public int getGap()
protected void initializeBasePane()
The common initialization code for both constructors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||