|
qflib 0.98.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--de.qfs.lib.option.OptionEdit
An OptionEdit is a component used to edit an Option's
value.
An OptionGroup
can be used to group OptionEdits into a
larger component, which in turn can be used inside an OptionDialog
. The layout and labels of the OptionEdits and OptionGroups
are determined by a set of resources set with Option.setResources
. See the package documentation for details about the
resource names used.
OptionEdit uses a ClassWrapper
to
create specialiced OptionEdits via makeEdit
. The AWT
component name of an OptionEdit created with makeEdit is initialized to
"OptionEdit-<name>"
where <name>
is
the name of the option being edited. It is up to the derived classes to set
expressive names on their child components in the style
"Label-<name>"
, "Text-<name>"
etc.
You will rarely need to use this class directly, except for deriving a spcialized OptionEdit for a custom Option of your own design.
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected boolean |
disabled
Whether the edit is permanently disabled. |
protected OptionGroup |
group
The OptionGroup to which the edit belongs. |
protected Option |
option
The Option to edit. |
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 | |
protected |
OptionEdit()
Hidden constructor. |
Method Summary | |
static void |
addPackage(java.lang.String packagename)
Add a package to be searched for OptionEdit classes, to enable OptionEdits for user defined Options outside of the de.qfs.lib.option package. |
abstract boolean |
checkValue()
Check the currently entered value of the OptionEdit. |
Option |
getOption()
Get the Option that is being edited by this OptionEdit. |
OptionGroup |
getOptionGroup()
Get the OptionGroup to which the edit belongs. |
double |
getWeight()
Get the y-weight for the OptionEdit. |
protected abstract void |
init()
Initialize the OptionEdit. |
boolean |
isDisabled()
Query whether the edit is permanently disabled. |
static OptionEdit |
makeEdit(Option option)
A factory method that dynamically creates an OptionEdit for an Option. |
abstract void |
readValue()
Read the currently entered value and store it in the Option. |
void |
setDisabled(boolean disabled)
Set whether theedit is permanently disabled. |
void |
setOptionGroup(OptionGroup group)
Set the OptionGroup to which the edit belongs. |
abstract void |
update(Option option)
Update the display of the edit component after a possible change of its Option or the Option's value. |
void |
update(OptionSet options)
Update the display of the edit component after a possible change of its Option or the Option's value. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUIClassID, paramString, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean disabled
setEnabled
will be forced to disable the edit.protected Option option
protected OptionGroup group
Constructor Detail |
protected OptionEdit()
makeEdit
to create
OptionEdits.Method Detail |
public static OptionEdit makeEdit(Option option)
de.qfs.lib.option
package you can do so by either having
your Option implement ClassWrapperAware
or by adding the package of your OptionEdit with
addPackage
.
After the OptionEdit instance is created its option
member is set and it is initialized through init
.
option
- The object to create an OptionEdit for.ClassWrapper
public static void addPackage(java.lang.String packagename)
de.qfs.lib.option
package. Packages added later are
considered more specific and are searched first.packagename
- The name of the package to add.ClassWrapper.addPackage(java.lang.String)
public Option getOption()
public void update(OptionSet options)
options
- The OptionSet containing the (possibly new) option.public boolean isDisabled()
setEnabled
to disable the group.public void setDisabled(boolean disabled)
setEnabled
to disable the group.disabled
- True to disable the group. If true,
setEnabled(false)
is
called automatically.public OptionGroup getOptionGroup()
public void setOptionGroup(OptionGroup group)
group
- The OptionGroup to set.public double getWeight()
protected abstract void init()
makeEdit
factory method after the option member has been
set. Must be implemented by a derived class.
public abstract void update(Option option)
Must be implemented by a derived class.
option
- The (possibly new) option.public abstract boolean checkValue()
Option.checkValue
. Must be implemented by a derived class.
public abstract void readValue()
Must be implemented by a derived class.
|
qflib 0.98.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |