public class Label extends JPanel implements FormComponent, IdentifiedElement, AccessForm
| Modifier and Type | Class and Description |
|---|---|
protected class |
Label.EJLabel
The class to create the label.
|
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static String |
ALIGN
The align property.
|
protected int |
alignment
The alignment.
|
protected int |
alignmentV
The alignment.
|
static String |
ATTR
The attr property.
|
protected Object |
attribute
The param attribute.
|
protected boolean |
bold
The bolt writing condition.
|
static String |
BOLD
The bold property.
|
static String |
BOTTOM
The bottom property.
|
static String |
CENTER
The center property.
|
static int |
DEFAULT_BOTTOM_MARGIN
The bottom margin.
|
static int |
DEFAULT_LABEL_LEFT_MARGIN
The label left margin.
|
static int |
DEFAULT_LABEL_RIGHT_MARGIN
The label right margin.
|
static int |
DEFAULT_PARENT_MARGIN
The parent margin.
|
static int |
DEFAULT_TOP_MARGIN
The top margin.
|
protected double |
dim
Variable to indicate the field resize.
|
static String |
FONT |
protected Color |
fontColor
The font color.
|
static String |
FONTCOLOR
The fontcolor property.
|
protected int |
fontSize
The font size.
|
static String |
FONTSIZE
The fontsize property.
|
protected boolean |
incrementalFont
The incremental font.
|
protected JLabel |
label
The label.
|
protected int |
labelSize
The label size.
|
static String |
LEFT
The left property.
|
static String |
MARGIN |
protected int |
originalSize
The original size.
|
protected Form |
parentForm
The parent form.
|
protected FormPermission |
permissionsActived
The activation permission.
|
protected FormPermission |
permissionVisible
The visibility permission.
|
protected ResourceBundle |
resourceFile
The resource file.
|
protected boolean |
restricted
Checks whether component is restricted.
|
static String |
RIGHT
The right property.
|
static String |
SIZE
The size property.
|
static String |
TEXT
The text property.
|
protected String |
textLabel
The text label.
|
static String |
VALIGN
The valign property.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTDEBUG_LANGUAGEDESACTIVATE_COMPONENT_BY_PERMISSION_TIPABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
Label(Hashtable parameters)
The class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkEnabledPermission()
Checks whether the component has permission to stay enabled.
|
protected boolean |
checkVisiblePermission()
Checks whether visible permissions are active.
|
Object |
getAttribute()
Gets the attribute paramameter.
|
Object |
getConstraints(LayoutManager parentLayout)
Get the alignment layout constraints.
|
JLabel |
getLabel()
Gets the reference of a label.
|
String |
getText()
Gets the text from a label.
|
Vector |
getTextsToTranslate()
Introduces in a Vector the textLabel.
|
void |
init(Hashtable parameters)
This method gets the
Hashtable and initializes the label
with parameters specified, also aligns the label. |
void |
initPermissions()
Initializes the permissions.
|
boolean |
isFocusable() |
boolean |
isRestricted() |
void |
setBold(boolean bold)
Changes the capitalization to bold.
|
void |
setComponentLocale(Locale locale)
Changes the component locale.
|
void |
setEnabled(boolean enabled)
Activates the label component.
|
void |
setFontColor(Color fontColor)
Changes the font color.
|
void |
setFontSize(int fontSize)
Changes the font size.
|
void |
setParentForm(Form f)
Sets the parent form.
|
void |
setResourceBundle(ResourceBundle resources)
Changes the resource bundle.
|
void |
setText(String text)
Sets the text to a label.
|
void |
setVisible(boolean visible)
Enables o disables the visualization permissions.
|
void |
updateFont()
Updates the font size.
|
void |
updateUI()
Updates the UI property.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUIaddAncestorListener, 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, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisEnabledpublic static int DEFAULT_TOP_MARGIN
DataField.DEFAULT_TOP_MARGINpublic static int DEFAULT_BOTTOM_MARGIN
DataField.DEFAULT_BOTTOM_MARGINpublic static int DEFAULT_LABEL_LEFT_MARGIN
DataField.DEFAULT_LABEL_LEFT_MARGINpublic static int DEFAULT_LABEL_RIGHT_MARGIN
DataField.DEFAULT_LABEL_RIGHT_MARGINpublic static int DEFAULT_PARENT_MARGIN
DataField.DEFAULT_PARENT_MARGINpublic static final String ATTR
public static final String TEXT
public static final String ALIGN
public static final String VALIGN
public static final String LEFT
public static final String RIGHT
public static final String CENTER
public static final String BOTTOM
public static final String SIZE
public static final String FONTSIZE
public static final String FONT
public static final String FONTCOLOR
public static final String BOLD
public static final String MARGIN
protected boolean bold
protected Object attribute
getAttribute()protected Color fontColor
Color.blackprotected int fontSize
protected int originalSize
protected boolean incrementalFont
protected int labelSize
protected String textLabel
protected int alignment
GridBagConstraints.NORTHWESTprotected int alignmentV
GridBagConstraints.NORTHprotected Form parentForm
protected FormPermission permissionVisible
protected FormPermission permissionsActived
protected ResourceBundle resourceFile
protected JLabel label
protected double dim
protected boolean restricted
public Label(Hashtable parameters)
parameters - a Hashtable with label parameterspublic void init(Hashtable parameters)
Hashtable and initializes the label
with parameters specified, also aligns the label.
init in interface FormComponentparameters - the Hashtable with parameters
| attribute | values | default | required | meaning |
| attr | yes | The attribute | ||
| text | yes | The label text | ||
| align | right/left | no | The alignment | |
| valign | center/bottom | no | The vertical alignment | |
| size | no | The label size | ||
| icon | no | The icon for label | ||
| fontsize | no | The font size | ||
| fontcolor | black | no | The font color | |
| font | A string like : 'Arial-BOLD-18' (See #Font.decode()) | The default font for system | no | Font for data field. |
| bold | yes/no | no | The bold capitalization condition | |
| margin | no | The empty space around the label in its panel | ||
| dim | no/text/yes | no | no | The resize possibilities (no resize or resize, values yes and text are the same but both of them exist to maintain the same possibilities that other fields accept). |
public void updateFont()
public void setFontSize(int fontSize)
fontSize - the font sizepublic void setFontColor(Color fontColor)
fontColor - the font colorpublic Object getConstraints(LayoutManager parentLayout)
getConstraints in interface FormComponentparentLayout - the layout to checkpublic void setComponentLocale(Locale locale)
setComponentLocale in interface Internationalizationlocale - the localepublic void setResourceBundle(ResourceBundle resources)
setResourceBundle in interface Internationalizationresources - the resourcepublic Vector getTextsToTranslate()
getTextsToTranslate in interface Internationalizationpublic Object getAttribute()
getAttribute in interface IdentifiedElementpublic void setVisible(boolean visible)
setVisible in interface FormComponentsetVisible in class JComponentvisible - the condition of visualizationpublic void setEnabled(boolean enabled)
setEnabled in interface FormComponentsetEnabled in class JComponentenabled - the boolean to activatepublic void initPermissions()
initPermissions in interface SecureElementprotected boolean checkVisiblePermission()
protected boolean checkEnabledPermission()
public void setParentForm(Form f)
setParentForm in interface AccessFormf - the parent formpublic void updateUI()
BOLD is true, also it calls to
updateFont()public void setBold(boolean bold)
bold - sets bold capitalization.public void setText(String text)
text - the text to put in the labelpublic String getText()
public JLabel getLabel()
public boolean isRestricted()
isRestricted in interface SecureElementpublic boolean isFocusable()
isFocusable in class ComponentCopyright © 2016 Imatia Innovation S.L.. All rights reserved.