public class IltDefaultAlarmCountGraphic extends JComponent
null
for transparency.null
for transparency.true
to display the inner border --
defaults to false
.IlvConstants.TRAILING
or IlvConstants.LEADING
.IltImpactAlarmCountGraphic
,
Serialized FormJComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected int |
baseline |
protected int |
count |
protected String |
countText |
protected int |
ellipsisWidth |
protected boolean |
hasLessSevereAlarms |
protected Image |
icon |
protected Dimension |
iconDimension |
protected int |
iconPosition |
protected boolean |
iconVisible |
protected Color |
innerBorderColor |
protected boolean |
innerBorderVisible |
protected int |
innerBorderWidth |
protected String |
label |
protected Color |
labelBackgroundColor |
protected boolean |
maxTextLayoutValid |
protected Color |
outerBorderColor |
protected int |
outerBorderWidth |
protected String |
severityText |
protected boolean |
textLayoutValid |
protected TextLayout |
tlCount |
protected TextLayout |
tlEllipsis |
protected TextLayout |
tlLabel |
protected TextLayout |
tlMaxCount |
protected TextLayout |
tlMaxLabel |
protected TextLayout |
tlMaxSeverity |
protected TextLayout |
tlMaxUnit |
protected TextLayout |
tlMore |
protected TextLayout |
tlSeverity |
protected TextLayout |
tlUnit |
protected String |
unitText |
protected boolean |
useLabel |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IltDefaultAlarmCountGraphic()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected float |
drawText(Graphics2D g2d,
TextLayout textLayout,
String text,
int x,
int y,
int remain,
float fieldWidth,
int alignment) |
Image |
getIcon()
Returns the alarm severity icon.
|
int |
getIconPosition()
Returns the position of the icon relative to the alarm count label.
|
Color |
getInnerBorderColor()
Returns the inner border color.
|
int |
getInnerBorderWidth()
Returns the inner border width.
|
String |
getLabel()
Returns the alarm count label.
|
Color |
getLabelBackgroundColor()
Returns the label background color.
|
protected String |
getLargestCountText() |
protected String |
getLargestSeverityText() |
protected String |
getLargestText() |
protected String |
getLargestUnitText() |
Dimension |
getMinimumSize()
If the minimum size has been set to a non-
null value
just returns it. |
Color |
getOuterBorderColor()
Returns the outer border color.
|
int |
getOuterBorderWidth()
Returns the outer border width.
|
Dimension |
getPreferredSize()
Gets the preferred size of this component.
|
boolean |
isIconVisible()
Returns if the icon representing the alarm severity is
visible or not.
|
boolean |
isInnerBorderVisible()
Returns the visibility status of the inner border.
|
protected void |
paintComponent(Graphics g) |
protected void |
paintParsedLabel(Graphics2D g2d,
int x,
int y,
int width) |
protected void |
paintUnparsedLabel(Graphics2D g2d,
int x,
int y,
int width) |
protected void |
parseLabel() |
protected void |
setCount(int count) |
void |
setFont(Font font)
Sets the alarm count font.
|
void |
setIcon(Image im)
Sets the alarm severity icon.
|
void |
setIconPosition(int v)
Sets the position of the icon relative to the alarm count label.
|
void |
setIconVisible(boolean v)
Sets if the icon representing the alarm severity should
be visible or not.
|
void |
setInnerBorderColor(Color color)
Sets the inner border color.
|
void |
setInnerBorderVisible(boolean innerBorderVisible)
Sets the inner border visibility.
|
void |
setInnerBorderWidth(int width)
Sets the inner border width.
|
void |
setLabel(String label)
Sets the alarm count label.
|
void |
setLabelBackgroundColor(Color labelBackgroundColor)
Sets the label background color.
|
void |
setOuterBorderColor(Color color)
Sets the outer border color.
|
void |
setOuterBorderWidth(int width)
Sets the outer border width.
|
protected void |
updateMaxTextLayouts(FontRenderContext frc) |
protected void |
updateTextLayouts(FontRenderContext frc) |
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, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, 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, validateTree
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, getAccessibleContext, 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, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected Color labelBackgroundColor
protected Color outerBorderColor
protected int outerBorderWidth
protected Color innerBorderColor
protected int innerBorderWidth
protected boolean innerBorderVisible
protected String label
protected boolean useLabel
protected int count
protected String countText
protected String unitText
protected String severityText
protected boolean hasLessSevereAlarms
protected Image icon
protected boolean iconVisible
protected int iconPosition
protected Dimension iconDimension
protected boolean maxTextLayoutValid
protected TextLayout tlMaxCount
protected TextLayout tlMaxUnit
protected TextLayout tlMaxSeverity
protected TextLayout tlMaxLabel
protected TextLayout tlEllipsis
protected int ellipsisWidth
protected boolean textLayoutValid
protected TextLayout tlCount
protected TextLayout tlUnit
protected TextLayout tlSeverity
protected TextLayout tlMore
protected TextLayout tlLabel
protected int baseline
public IltDefaultAlarmCountGraphic()
public void setLabelBackgroundColor(Color labelBackgroundColor)
labelBackgroundColor
- The color to be set for the label background.public Color getLabelBackgroundColor()
Default value: null
.
null
indicates
transparency.public void setOuterBorderColor(Color color)
color
- The color to be set for the outer border.public Color getOuterBorderColor()
Default value: null
.
null
indicates
transparency.public void setOuterBorderWidth(int width)
width
- The width to be set for the outer border.public int getOuterBorderWidth()
Default value: 2
.
public void setInnerBorderColor(Color color)
color
- The color to be set for the inner border.public Color getInnerBorderColor()
Default value: null
.
null
indicates
transparency.public void setInnerBorderWidth(int width)
width
- The width to be set for the inner border.public int getInnerBorderWidth()
Default value: 1
.
public void setInnerBorderVisible(boolean innerBorderVisible)
innerBorderVisible
- true
to show the inner border.public boolean isInnerBorderVisible()
Default value: false
.
true
when the inner border is visible.public void setLabel(String label)
label
- The label for the alarm count.public String getLabel()
public void setIcon(Image im)
im
- The alarm severity iconpublic Image getIcon()
public void setIconVisible(boolean v)
v
- Visibility flagpublic boolean isIconVisible()
true
if the icon is visiblepublic void setIconPosition(int v)
Possible values are:
v
- Icon positionpublic int getIconPosition()
Possible values are:
Default value is IlvConstants.TRAILING
.
protected void parseLabel()
protected void setCount(int count)
protected String getLargestText()
protected String getLargestCountText()
protected String getLargestUnitText()
protected String getLargestSeverityText()
public void setFont(Font font)
setFont
in class JComponent
public Dimension getMinimumSize()
null
value
just returns it. If the UI delegate's getMinimumSize
method returns a non-null
value then return that;
otherwise defer to the component's layout manager.getMinimumSize
in class JComponent
minimumSize
propertyComponent.getMinimumSize()
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
Component.getPreferredSize()
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
Component.paint(java.awt.Graphics)
protected void paintParsedLabel(Graphics2D g2d, int x, int y, int width)
protected float drawText(Graphics2D g2d, TextLayout textLayout, String text, int x, int y, int remain, float fieldWidth, int alignment)
protected void paintUnparsedLabel(Graphics2D g2d, int x, int y, int width)
protected void updateTextLayouts(FontRenderContext frc)
protected void updateMaxTextLayouts(FontRenderContext frc)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.