|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Dialog javax.swing.JDialog jimm.datavision.gui.EditWin jimm.datavision.gui.FormatWin
public class FormatWin
A field format editing dialog box. There are tabs for text format and borders. The initial format and border values are retrieved from one of two places: either a field passed in to the constructor or the first selected field in the desing window. The format and border are applied to either a single field or all selected fields.
Warning: this code depends upon the fact that the strings in
edgeCountChoices
equals the integer value of the string
(zero, one, two, etc.) and that the strings in
edgeStyleChoices
correspond to the numeric values of the
BorderEdge.STYLE_*
constants.
Nested Class Summary | |
---|---|
(package private) static class |
FormatWin.EdgeWidgets
Holds a border edge and the widgets used for editing it. |
Nested classes/interfaces inherited from class javax.swing.JDialog |
---|
javax.swing.JDialog.AccessibleJDialog |
Nested classes/interfaces inherited from class java.awt.Dialog |
---|
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected javax.swing.JComboBox |
align
|
protected javax.swing.JCheckBox |
bold
|
protected Border |
border
|
protected javax.swing.JLabel |
borderColorLabel
|
protected static int |
BOTTOM
|
protected FormatWin.EdgeWidgets[] |
edgeWidgets
|
protected Field |
field
|
protected javax.swing.JLabel |
fieldColorLabel
|
protected javax.swing.JComboBox |
fontFamily
|
protected static java.lang.String[] |
fontFamilyNames
|
protected Format |
format
|
protected static int |
FORMAT_TEXT_FIELD_COLS
|
protected javax.swing.JTextField |
formatText
|
protected javax.swing.JCheckBox |
italic
|
protected static int |
LEFT
|
protected Border |
origBorder
|
protected Format |
origFormat
|
protected static int |
RIGHT
|
protected boolean |
saveRevertInfo
|
protected javax.swing.JComboBox |
size
|
protected static java.lang.Integer[] |
SIZE_CHOICES
List of pre-approved font size choices. |
protected static int |
THICKNESS_COLS
|
protected static int |
TOP
|
protected javax.swing.JCheckBox |
underline
|
protected javax.swing.JCheckBox |
wrap
|
Fields inherited from class jimm.datavision.gui.EditWin |
---|
commands, designer, revertButton |
Fields inherited from class javax.swing.JDialog |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Dialog |
---|
DEFAULT_MODALITY_TYPE |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
FormatWin(Designer designer,
Field f,
int whichTab)
Constructor. |
Method Summary | |
---|---|
protected java.lang.String[] |
alignChoices()
|
protected javax.swing.Box |
buildBorderColorWidgets()
|
protected javax.swing.Box |
buildBorderEdge(int edgeIndex,
java.lang.String edgeName,
BorderEdge edge)
Builds one of the edges of the border. |
protected javax.swing.Box |
buildBorderTab()
Builds the border tab contents. |
protected javax.swing.Box |
buildFieldColorWidgets()
|
protected java.awt.Container |
buildFormatTab()
Builds the format tab contents. |
protected void |
buildWindow(int whichTab)
Builds the window contents. |
protected void |
copyFormatAndBorder(Format origFormat,
Border origBorder)
Saves copies of format and border into the objects that we really edit. |
protected javax.swing.JButton |
createBorderColorChooserButton()
|
protected javax.swing.JButton |
createFieldColorChooserButton()
|
protected void |
doRevert()
Gives subclasses a chance to clean up their GUI. |
protected void |
doSave()
Saves all data by creating a new command, performing it, and adding it to commands. |
protected java.lang.String[] |
edgeCountChoices()
|
protected java.lang.String[] |
edgeStyleChoices()
|
protected void |
fillBorderTab()
Fills the border tab edit fields with values of border. |
protected void |
fillFormatTab()
Fills the format tab edit fields with values of format. |
protected java.lang.String[] |
fontChoices()
Returns the list of font choices. |
protected int |
fontIndexOf(java.lang.String fontFamilyName)
Returns the index of the specified font family name. |
static void |
loadFontChoices()
This method loads all the font family names in a separate thread. |
protected void |
setBorderExampleColor()
|
protected void |
setFieldExampleColor()
|
protected java.lang.Integer[] |
sizeChoices()
Returns the list of font size choices, lazily instantiating it if necessary. |
protected int |
sizeIndexOf(int size)
Returns the index of the specified size value in the SIZE_CHOICES list. |
void |
step(Field f)
Creates and performs a command that gives the format and borders to the specified field. |
Methods inherited from class jimm.datavision.gui.EditWin |
---|
actionPerformed, closeButtonPanel, revert, save |
Methods inherited from class javax.swing.JDialog |
---|
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Dialog |
---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static java.lang.Integer[] SIZE_CHOICES
sizeChoices()
.
protected static final int FORMAT_TEXT_FIELD_COLS
protected static final int THICKNESS_COLS
protected static final int TOP
protected static final int LEFT
protected static final int RIGHT
protected static final int BOTTOM
protected static java.lang.String[] fontFamilyNames
protected Field field
protected Format format
protected Border border
protected Format origFormat
protected Border origBorder
protected boolean saveRevertInfo
protected javax.swing.JComboBox fontFamily
protected javax.swing.JComboBox size
protected javax.swing.JCheckBox bold
protected javax.swing.JCheckBox italic
protected javax.swing.JCheckBox underline
protected javax.swing.JCheckBox wrap
protected javax.swing.JComboBox align
protected javax.swing.JTextField formatText
protected javax.swing.JLabel fieldColorLabel
protected javax.swing.JLabel borderColorLabel
protected FormatWin.EdgeWidgets[] edgeWidgets
Constructor Detail |
---|
public FormatWin(Designer designer, Field f, int whichTab)
designer
- the window to which this dialog belongsf
- a field from which we will take the format and borderwhichTab
- the index of the tab to display when openedMethod Detail |
---|
public static void loadFontChoices()
protected void copyFormatAndBorder(Format origFormat, Border origBorder)
null
. Called from constructor and
doRevert()
.
origFormat
- the format we are copying; not necessarily that of
the fieldorigBorder
- the border we are copying; not necessarily that of
the fieldprotected void buildWindow(int whichTab)
whichTab
- the index of the tab to display when openedprotected java.awt.Container buildFormatTab()
protected javax.swing.Box buildFieldColorWidgets()
protected javax.swing.Box buildBorderColorWidgets()
protected void setFieldExampleColor()
protected void setBorderExampleColor()
protected javax.swing.JButton createFieldColorChooserButton()
protected javax.swing.JButton createBorderColorChooserButton()
protected java.lang.Integer[] sizeChoices()
Integer
size choicesprotected int sizeIndexOf(int size)
protected java.lang.String[] fontChoices()
protected int fontIndexOf(java.lang.String fontFamilyName)
protected java.lang.String[] alignChoices()
protected java.lang.String[] edgeCountChoices()
protected java.lang.String[] edgeStyleChoices()
protected javax.swing.Box buildBorderTab()
protected javax.swing.Box buildBorderEdge(int edgeIndex, java.lang.String edgeName, BorderEdge edge)
Warning: this code depends upon the fact that the strings in
edgeCountChoices
equals the integer value of the string
(zero, one, two, etc.) and that the strings in
edgeStyleChoices
correspond to the numeric values of the
BorderEdge.STYLE_*
constants.
edgeIndex
- one of TOP
, LEFT
, etc.edgeName
- the text name of the widgetedge
- the edge we are representing visually
protected void fillFormatTab()
protected void fillBorderTab()
protected void doSave()
EditWin
doSave
in class EditWin
public void step(Field f)
step
in interface FieldWalker
f
- the fieldprotected void doRevert()
EditWin
doRevert
in class EditWin
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |