Package net.simplace.pipe.formcomponents
Class FWAbstractFormComponent
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
net.simplace.pipe.formcomponents.FWAbstractFormComponent
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,FWObserver
- Direct Known Subclasses:
FWAbstractExtendedFormComponent,FWChartFormComponent,FWCheckValueFormComponent,FWChoiceFormComponent,FWDatabaseAccessFormComponent,FWDateFormComponent,FWDoubleFormComponent,FWFileChooserFormComponent,FWGroupFormComponent,FWHeaderFormComponent,FWImageFormComponent,FWIntegerFormComponent,FWLabelFormComponent,FWMemoryMonitorFormComponent,FWPasswordFormComponent,FWProcessorButtonFormComponent,FWProgressFormComponent,FWResultFormComponent,FWTableFormComponent,FWTextFormComponent,FWTreeFormComponent
This panel is supposed to be overwritten by component implementing classes that should be used to be shown in
FWFormPanel. It implements Observer to be updated while one other component changes his value. It
offers the notifyDependentComponents-function to update the observable with the current value of this component.
The observable will then inform all other components about this change. It is up to the implementations of
this abstract class to call notifyDependentComponents whenever necessary!
Implementations can use own configurations via XML. Feel free to use them as you need, but call the
superconstructor before beginning.
- Author:
- Andreas Enders, Christoph Kunze
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ImageIconprotected static final ImageIconprotected static final ImageIconstatic final intComponent detaches automatically while opening the formstatic final intComponent shows only a frame - while klicking the frame is extended and outpoped.static final intDefault!static final intComponent detaches automatically while opening the form, but stays linkedstatic final intComponent is to be detachableprotected static final Colorprotected static final Colorprotected static final intprotected static final ImageIconprotected static final ImageIconprotected static final ImageIconprotected static final ImageIconprotected static final ImageIconprotected static final ImageIconprotected JPanelprotected FWObservableprotected static final ImageIconprotected static final ImageIconprotected static final ImageIconFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedFWAbstractFormComponent(String aFormID, String aFieldID, boolean aShowLabel, int aDetachable, org.jdom2.Element aFormElement, FWObservable aObservable) protectedFWAbstractFormComponent(String aFormID, String aFieldID, boolean aShowLabel, org.jdom2.Element aFormElement, FWObservable aObservable) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidattachPanel(FWDetachFrame aDetachFrame) detaches the detachpanel im possiblevoidManages all things that have to be done while closing a Form.protected voidcreateDetachControls(JPanel aContentPanel) voiddetachPanel(boolean aUpdateContent) detaches the detachpanel im possiblevoiddisposePanel(FWDetachFrame aDetachFrame) detaches the detachpanel im possibleprotected voidupdates different functions like enabling of the Componentcom.lowagie.text.Rectangle[]getCells(int aType) protected Stringprotected org.jdom2.Elementgets the detailed configuration of the Processor.intorg.jdom2.Elementprotected FWAbstractFormComponentFillerprotected Stringprotected Stringprotected StringgetLocaleValue(String aKey) This method limits the coding for reading values from the locale.protected StringgetLocaleValue(String aKey, String aDefault) This method limits the coding for reading values from the locale.protected StringgetTitle()abstract ObjectgetValue()protected abstract com.lowagie.text.RectanglegetValueCell(int aType) returns the value label to use for generating rtf, pdf or html version of the formprotected booleangets the detailed configuration of the Processor.protected booleanprotected voidinit(String aFormID, String aFieldID, boolean aShowLabel, int aDetachable, org.jdom2.Element aFormElement, FWObservable aObservable) booleanManages all things that have to be done while closing a Form.booleanbooleanprotected voidUpdates the functionalities' parameter map with the current value of this control so other form components that observe the parameter map get notified.abstract voidvoidprotected voidsetConfiguration(String aClassname, org.jdom2.Element aConfigurationElement) sets the detailed configuration of a Processor.voidprotected voidsetDetachControlsEnabled(boolean aEnabled) Sets the enabled state of the detach button to aEnabled and clears the highlighted state if aEnabled is false.protected voidsetDetachControlsHighlighted(boolean aHighlighted) Makes the detach button and related controls appear highlighted or not according to aHighlightedvoidsetFieldID(String aFieldID) voidsetFormElement(org.jdom2.Element aFormElement) voidvoidsetObservable(FWObservable aObservable) voidsetRequired(boolean aRequiredness) voidsetting Title of Componentprotected voidsetUpDetachControl(int aDetachability) abstract voidtoString()voidupdate(FWObservable aObservable, Object aKeyOfParameterChanged) updates different functions like enableing of the ComponentMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
iObservable
-
iDetachContentPanel
-
DETACH_TRUE
public static final int DETACH_TRUEComponent is to be detachable- See Also:
-
DETACH_FALSE
public static final int DETACH_FALSEDefault! Component looks and behaves as any other component- See Also:
-
DETACH_AUTO
public static final int DETACH_AUTOComponent detaches automatically while opening the form- See Also:
-
DETACH_BUTTON
public static final int DETACH_BUTTONComponent shows only a frame - while klicking the frame is extended and outpoped.- See Also:
-
DETACH_LINKED
public static final int DETACH_LINKEDComponent detaches automatically while opening the form, but stays linked- See Also:
-
DETATCH_BORDER_WIDTH
protected static final int DETATCH_BORDER_WIDTH- See Also:
-
DETATCH_BORDER_DEFAULT_COLOR
-
DETATCH_BORDER_HIGHLIGHT_COLOR
-
DETATCH_BUTTON_DEFAULT_IMAGE
-
DETATCH_BUTTON_HIGHLIGHT_IMAGE
-
DETATCH_BUTTON_DISABLED_IMAGE
-
PRINT_BUTTON_DEFAULT_IMAGE
-
PRINT_BUTTON_HIGHLIGHT_IMAGE
-
PRINT_BUTTON_DISABLED_IMAGE
-
COPY_BUTTON_DEFAULT_IMAGE
-
COPY_BUTTON_HIGHLIGHT_IMAGE
-
COPY_BUTTON_DISABLED_IMAGE
-
EXPORT_BUTTON_DEFAULT_IMAGE
-
EXPORT_BUTTON_HIGHLIGHT_IMAGE
-
EXPORT_BUTTON_DISABLED_IMAGE
-
-
Constructor Details
-
FWAbstractFormComponent
protected FWAbstractFormComponent()- Parameters:
aFormID- of form, this component is placed inaFieldID- making this compontent uniqueaShowLabel- if label should be shown. For Use in table use false, otherwise true
-
FWAbstractFormComponent
protected FWAbstractFormComponent(String aFormID, String aFieldID, boolean aShowLabel, org.jdom2.Element aFormElement, FWObservable aObservable) - Parameters:
aFormID- of form, this component is placed inaFieldID- making this compontent uniqueaShowLabel- if label should be shown. For Use in table use false, otherwise trueaFormElement-aObservable-
-
FWAbstractFormComponent
protected FWAbstractFormComponent(String aFormID, String aFieldID, boolean aShowLabel, int aDetachable, org.jdom2.Element aFormElement, FWObservable aObservable) - Parameters:
aFormID- of form, this component is placed inaFieldID- making this compontent uniqueaShowLabel- if label should be shown. For Use in table use false, otherwise trueaDetachable-aFormElement-aObservable-
-
-
Method Details
-
init
protected void init(String aFormID, String aFieldID, boolean aShowLabel, int aDetachable, org.jdom2.Element aFormElement, FWObservable aObservable) - Parameters:
aFormID-aFieldID-aShowLabel-aDetachable-aFormElement-aObservable-
-
setUpDetachControl
protected void setUpDetachControl(int aDetachability) - Parameters:
aDetachability-
-
getValue
- Returns:
- value of the implemented component
-
setValue
- Parameters:
aValue- of the implemented component
-
processFormFiller
public abstract void processFormFiller()- Parameters:
value- of the implemented component
-
getFieldID
- Returns:
- field id of the implemented component
-
setFormID
- Parameters:
aFormID-
-
getFormID
- Returns:
- form id of the implemented component
-
setFieldID
- Parameters:
aFieldID-
-
getFormElement
public org.jdom2.Element getFormElement()- Returns:
- the formElement
-
getOriginalComponentParameteterValue
- Parameters:
aKey-- Returns:
- the Value of the given parameterkey in FormElement parameters
-
getComponentParameteterValue
- Parameters:
aKey-- Returns:
- the Value of the given parameterkey in FormElement parameters
-
isRequired
public boolean isRequired()- Returns:
- if form is required
-
setRequired
public void setRequired(boolean aRequiredness) - Parameters:
aRequiredness-
-
isEnabled
public boolean isEnabled() -
notifyDependentComponents
protected void notifyDependentComponents()Updates the functionalities' parameter map with the current value of this control so other form components that observe the parameter map get notified. ImplementationsMUST call this function, whenever their value changes. -
getConfiguration
protected org.jdom2.Element getConfiguration()gets the detailed configuration of the Processor.- Returns:
- the configuration Element
-
setConfiguration
sets the detailed configuration of a Processor.- Parameters:
aClassname-aConfigurationElement-
-
hasConfiguration
protected boolean hasConfiguration()gets the detailed configuration of the Processor.- Returns:
- if component has a special configuration
-
getLocaleValue
This method limits the coding for reading values from the locale.- Parameters:
aKey-aDefault-- Returns:
-
getLocaleValue
This method limits the coding for reading values from the locale.- Parameters:
aKey-- Returns:
-
getPreferredSize
- Overrides:
getPreferredSizein classJComponent
-
getMaximumSize
- Overrides:
getMaximumSizein classJComponent
-
exportData
protected void exportData()updates different functions like enabling of the Component -
update
updates different functions like enableing of the Component- Specified by:
updatein interfaceFWObserver- Parameters:
aObservable- the observable object.aKeyOfParameterChanged- an argument passed to thenotifyObserversmethod.- See Also:
-
hasFormFiller
protected boolean hasFormFiller()- Returns:
- if the formFiller was initialized
-
getFormFiller
- Returns:
- the formFiller
-
getJumper
- Returns:
- the jumper
-
getJumperRule
- Returns:
- the jumperRule
-
getObservable
- Returns:
- the observable
-
setObservable
- Parameters:
aObservable- the observable to set
-
setFormElement
public void setFormElement(org.jdom2.Element aFormElement) - Parameters:
aFormElement- the formElement to set
-
getDetachability
public int getDetachability()- Returns:
- s if component is detachable
-
createDetachControls
-
attachPanel
detaches the detachpanel im possible- Parameters:
aDetachFrame-
-
disposePanel
detaches the detachpanel im possible- Parameters:
aDetachFrame-
-
detachPanel
public void detachPanel(boolean aUpdateContent) detaches the detachpanel im possible- Parameters:
aUpdateContent-
-
setDetachControlsHighlighted
protected void setDetachControlsHighlighted(boolean aHighlighted) Makes the detach button and related controls appear highlighted or not according to aHighlighted- Parameters:
aHighlighted-
-
setDetachControlsEnabled
protected void setDetachControlsEnabled(boolean aEnabled) Sets the enabled state of the detach button to aEnabled and clears the highlighted state if aEnabled is false. To query the enabled state, use the isEnabled method of iDetachButton!- Parameters:
aEnabled-
-
remove
-
add
-
add
- Parameters:
aComp-aConstraints-aUseScrollbar-
-
isClosingRequired
public boolean isClosingRequired()Manages all things that have to be done while closing a Form. For exaple closing the detached frames if user wants them to be closed- Returns:
-
closeFormComponent
public void closeFormComponent()Manages all things that have to be done while closing a Form. For exaple closing the detached frames if user wants them to be closed -
getTitle
- Returns:
- the Title of Component
-
getSystemID
- Returns:
- the SystemID of Component
-
setTitle
setting Title of Component- Parameters:
aTitle-
-
setDefault
public void setDefault() -
toString
-
getRequiredWarning
- Returns:
- s the Value from RequiredWarning. If empty returning a default value
-
getCells
public com.lowagie.text.Rectangle[] getCells(int aType) - Parameters:
aType-- Returns:
- s the Value from RequiredWarning. If empty returning a default value
-
getValueCell
protected abstract com.lowagie.text.Rectangle getValueCell(int aType) returns the value label to use for generating rtf, pdf or html version of the form- Parameters:
aType-- Returns:
- iText Cell
-