|
||||||||||
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 javax.swing.JComponent javax.swing.JPanel chooser.BindingPanel chooser.BindingChooser
public class BindingChooser
Implementation of the BindingPanel that provides configuring functionality for the keystroke
component of key bindings. Methods provide a means of producing predefined, sweeping changes in
the display. This defaults to a light blue color scheme with an index indent style.
Though display elements are still accessible, manual changes are not particularly recommended
unless automated changes to the appearance (the indentation style and color scheme) are disabled
since they may be unexpectedly reverted or clash any alterations made.
Nested Class Summary | |
---|---|
static class |
BindingChooser.FrameColorScheme
Coloring used for the labels and buttons of constructed dialogs. |
static class |
BindingChooser.IndentStyle
Supported appearances of the indent field, which includes: NONE- No actions are taken to change the indent field's appearance. EMPTY- Indent field is set to be invisible (effectively removing it from the display). SPACER- Blank field that occupies its currently set dimensions. TYPE- Displays Unicode arrows according to the shortcut's event type (down for KEY_PRESSED, up for KEY_RELEASED, bidirectional for KEY_TYPED, and an 'X' if disabled). INDEX- Displays the field's index from the top (starting with one). |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 | |
---|---|
BindingChooser()
|
Method Summary | |
---|---|
BindingChooser.IndentStyle |
getIndentStyle()
Provides the indent style used by the chooser. |
BindingEntry |
getSelected()
Provides the currently selected entry if awaiting input. |
boolean |
isBindingSelected()
Returns if a binding is currently awaiting input or not. |
BindingAdaptor |
makeAdaptor()
Provides a key adaptor that can provide editing functionality for the selected entry. |
BindingEntry |
makeLabels(BindingChooser.FrameColorScheme colorScheme)
Provides the labels naming the fields. |
void |
setColorScheme(Color color,
boolean lightened)
Sets foreground and background of components to a theme centered around a given hue. |
void |
setColorScheme(Color selectedBackground,
Color evenBackground,
Color oddBackground,
Color foreground,
Color selectedForeground)
Manually sets each attribute of color scheme. |
void |
setColorSchemeEnabled(boolean enabled)
Sets if the display should manage its coloring scheme or not. |
void |
setEditable(boolean editable)
Sets if the shortcut fields of entries can be selected to provide editing functionality or not. |
void |
setIndentStyle(BindingChooser.IndentStyle style)
Sets content display in the indent field of entries. |
void |
setSelected(BindingEntry entry)
Sets the shortcut field of an entry to prompt user input. |
void |
setSelectedText(String message)
Sets the message of the selected shortcut field when awaiting user input. |
static LinkedHashMap<KeyStroke,String> |
showDialog(Component parent,
BindingChooser display,
String dialogTitle,
boolean showLabels,
BindingAdaptor adaptor,
BindingChooser.FrameColorScheme frameColoring)
Displays a dialog allowing the user to redefine the keystroke component of key bindings. |
static LinkedHashMap<KeyStroke,String> |
showDialog(Component parent,
Map<KeyStroke,String> bindings)
Displays a dialog allowing the user to redefine the keystroke component of key bindings. |
void |
validate()
|
Methods inherited from class chooser.BindingPanel |
---|
clearBindings, contains, getBinding, getBindingCount, getBindingIndex, getBindingInputMap, getBindingMap, getBindings, putAllBindings, putBinding, putBinding, putBinding, putBinding, removeBinding, removeBinding |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BindingChooser()
Method Detail |
---|
public static LinkedHashMap<KeyStroke,String> showDialog(Component parent, Map<KeyStroke,String> bindings)
parent
- frame to which to apply modal property and center within (centers within screen
if null)bindings
- initial mapping of keystrokes to their actions
public static LinkedHashMap<KeyStroke,String> showDialog(Component parent, BindingChooser display, String dialogTitle, boolean showLabels, BindingAdaptor adaptor, BindingChooser.FrameColorScheme frameColoring)
parent
- frame to which to apply modal property and center within (centers within screen
if null)display
- body of the display, containing current bindings and appearance propertiesdialogTitle
- title of the displayed dialogshowLabels
- if true the top has labels describing the fields, otherwise they are omittedadaptor
- adaptor used to provide configuring functionalityframeColoring
- method of determining coloring of labels and buttons
public void setEditable(boolean editable)
editable
- if true shortcut fields may be selected to have their values changed, otherwise
user input and calls to the setSelected method are ignoredpublic void setColorSchemeEnabled(boolean enabled)
enabled
- if true then display changes may trigger the recoloring of components according
to the current color scheme, otherwise automated recoloring is disabledpublic void setColorScheme(Color color, boolean lightened)
color
- hue considered in setting component colorslightened
- if true backgrounds are bent toward a lighter theme, otherwise they are darkerpublic void setColorScheme(Color selectedBackground, Color evenBackground, Color oddBackground, Color foreground, Color selectedForeground)
selectedBackground
- shortcut field's background color when awaiting user inputevenBackground
- background color of entries with an even index (starting with zero)oddBackground
- background color of entries with an odd index (starting with zero)foreground
- text color of entriesselectedForeground
- text color of entries awaiting inputpublic BindingChooser.IndentStyle getIndentStyle()
public void setIndentStyle(BindingChooser.IndentStyle style)
style
- type of content displayed in entry's indent fieldpublic void setSelectedText(String message)
message
- prompt for user inputpublic boolean isBindingSelected()
public BindingEntry getSelected()
public void setSelected(BindingEntry entry)
entry
- binding entry awaiting input for its shortcut field
IllegalArgumentException
- if entry is not contained in chooserpublic BindingAdaptor makeAdaptor()
public BindingEntry makeLabels(BindingChooser.FrameColorScheme colorScheme)
colorScheme
- method of setting background gradient
public void validate()
validate
in class Container
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |