Diamond Control Suite 3.0

diamondedge.swing
Class DsLabel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by diamondedge.swing.DsLabel
All Implemented Interfaces:
DsConstants, ImageObserver, MenuContainer, Serializable, SwingConstants
Direct Known Subclasses:
DsCellRenderer

public class DsLabel
extends JComponent
implements DsConstants

DsLabel displays multiple lines of text and/or an icon that a user can't change directly. It is a replacement to and uses the same API as JLabel. It breaks the text up into multiple lines when WordWrap is turned on. Many other additional features are available such as rotation, margins, text styles (3D and highlighting), built-in borders, and font underlining and strikethrough.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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 diamondedge.swing.DsConstants
ACCOUNTING, ALL, ASCENDING, ASCENDING_CASE, BORDER_BOTTOM, BORDER_LEFT, BORDER_NONE, BORDER_OUTLINE, BORDER_RIGHT, BORDER_TOP, CROSS_LINES, DASH, DASH_DOT, DASH_DOT_DOT, DEFAULT, DESCENDING, DESCENDING_CASE, DIAGONAL_CROSS_LINES, DOT, DOUBLE, DOUBLE_LINE, DOWNWARD_DIAGONAL_LINES, ETCHED, ETCHED_RAISED, FALSE, FIND_ALL, FIND_EQUALS, FIND_GT, FIND_GTE, FIND_LT, FIND_LTE, FIND_NE, FIND_PREFIX, FIND_REGEX, FIND_STRING, FIRST, FLAT, GRID_DASH, GRID_DASH_DOT, GRID_DASH_DOT_DOT, GRID_DOT, GRID_LINE, HIGHLIGHT_SELECTION_ALWAYS, HIGHLIGHT_SELECTION_NEVER, HIGHLIGHT_SELECTION_WITH_FOCUS, HORIZONTAL_LINES, LOWERED, LOWERED_LIGHT, NONE, RAISED, RAISED_LIGHT, SELECT_CELL, SELECT_NONE, SELECT_ROW, SINGLE, SINGLE_LINE, SOLID, STRETCH, TILE, TRANSPARENT, TRUE, UPWARD_DIAGONAL_LINES, VERTICAL_LINES
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DsLabel()
          Creates a DsLabel without an icon and a blank string for the text.
DsLabel(Icon icon)
          Creates a DsLabel with an icon which is centered vertically and horizontally.
DsLabel(Icon icon, int horizontalAlignment)
          Creates a DsLabel with an icon which is centered vertically and the specified horizontal alignment.
DsLabel(String text)
          Creates a DsLabel with the specified text and without an icon.
DsLabel(String text, Icon icon, int horizontalAlignment)
          Creates a DsLabel with the specified text, icon and horizontal alignment.
DsLabel(String text, int horizontalAlignment)
           
 
Method Summary
 void addTextListener(TextListener l)
          Adds the specified text listener to receive text events
protected  Border createBorder()
           
protected  void fireLabelChangedEvent()
          Fire an text event to the listeners
 Paint getBackgroundPaint()
           
 int getCenterBorder()
          Returns whether to draw a border in between the InnerBorder and the OuterBorder.
 Icon getDisabledIcon()
          Returns the graphic image (glyph, icon) that the label displays when the label is disabled.
 char getDisplayedMnemonic()
          Returns the character that indicates a mnemonic key.
 int getFontUnderline()
          Returns a value that determines how the text for the label is underlined.
 Paint getForegroundPaint()
           
 int getHorizontalAlignment()
          Returns the horizontal alignment of the contents (text and icon) within the Label
 int getHorizontalTextPosition()
          Returns the horizontal position of the text relative to the icon
 Icon getIcon()
          Returns the graphic image (glyph, icon) that the label displays.
 int getIconTextGap()
          Returns the amount of space between the text and the icon displayed in this label.
 int getInnerBorder()
          Returns whether to draw a border inside of the CenterBorder.
 Insets getInsets()
          Returns the insets which includes the border's insets and the margin.
 Insets getInsets(Insets insets)
          Returns the insets which includes the border's insets and the margin.
 Component getLabelFor()
          Get the component this is labelling.
 Color getLineBorderColor()
          Returns the color used to draw the line border.
 int getLineBorderWidth()
          Returns the width of the line border drawn around the label.
 Insets getMargins()
          Returns the spacing between the border and the contents (text/icon).
 Dimension getMinimumSize()
          This method is called when the layout manager wants to know the bare minimum amount of space we need to get by.
 int getOuterBorder()
          Returns whether to draw a border on the outside of the label but inside of the outline if it exists.
 Dimension getPreferredSize()
          This method is called by a layout manager when it wants to know how big we'd like to be.
 int getRotation()
          Returns the degrees to rotate text and icon.
 String getText()
          Returns the text that the label displays
 Color getTextOutlineColor()
          Returns the color used to draw an outline around each character of the text.
 double getTextOutlineWidth()
          Returns the width of the outline drawn around each character in the text.
 int getTextStyle()
          Returns a value that determines how the text is drawn.
 int getVerticalAlignment()
          Returns the vertical alignment of the contents (text and icon) within the Label
 int getVerticalTextPosition()
          Returns the vertical position of the text relative to the icon
 boolean isAutoSize()
          Returns a value that determines whether the label is automatically resized to display its entire contents.
 boolean isFontStrikeThrough()
          Returns a value that determines whether the text for the label is displayed with a line through the text.
 boolean isWordWrap()
          Returns a value that determines whether the text should be wrapped to a new line when it reaches the trailing margin.
protected  void paintComponent(Graphics g)
           
 void removeTextListener(TextListener l)
          Removes the specified text listener so it no longer receives text events.
 void setAutoSize(boolean s)
          Sets a value that determines whether the label is automatically resized to display its entire contents.
 void setBackground(Color c)
           
 void setBackgroundPaint(Paint p)
           
protected  void setBorders()
           
 void setBounds(int x, int y, int width, int height)
          Moves and resizes this component.
 void setCenterBorder(int val)
          Creates a border in between the InnerBorder and the OuterBorder.
 void setDisabledIcon(Icon icon)
          Defines the icon this component will display when the label is disabled.
 void setDisplayedMnemonic(char mnemonicChar)
          Specify a character that indicates a mnemonic key.
 void setFont(Font f)
           
 void setFontStrikeThrough(boolean strikeThrough)
          Sets a value that determines whether the text for the label is displayed with a line through the text.
 void setFontUnderline(int underline)
          Sets a value that determines how the text for the label is underlined.
 void setForeground(Color c)
          Sets the text color (ForegroundPaint property).
 void setForegroundPaint(Paint p)
           
 void setHorizontalAlignment(int align)
          Sets the horizontal alignment of the contents (text and icon) within the Label.
 void setHorizontalTextPosition(int textPosition)
          Sets the horizontal position of the text relative to the icon.
 void setIcon(Icon icon)
          Defines the icon this component will display.
 void setIconTextGap(int iconTextGap)
          If both the icon and text properties are set, this property defines the space between them.
 void setInnerBorder(int val)
          Creates a border on the inside of the CenterBorder.
 void setLabelFor(Component c)
          Specify the component on which the label will call the requestFocus method when the mnemonic is activated.
 void setLineBorderColor(Color c)
          Sets the color used to draw the line border.
 void setLineBorderWidth(int lineWidth)
          Sets the width of the line border drawn around the label.
 void setMargins(Insets margins)
          Sets the spacing between the border and the contents (text/icon).
 void setOuterBorder(int val)
          Creates a border on the outside of the label but inside of the outline if it exists.
 void setRotation(int val)
          Set the degrees to rotate the text and icon.
 void setText(String text)
          Sets the text that the label displays.
 void setTextOutlineColor(Color c)
          Sets the color used to draw an outline around each character of the text.
 void setTextOutlineWidth(double lineWidth)
          Sets the width of the outline drawn around each character in the text.
 void setTextStyle(int style)
          Sets a value that determines how the text is drawn.
 void setVerticalAlignment(int a)
          Sets the vertical alignment of the contents (text and icon) within the Label.
 void setVerticalTextPosition(int textPosition)
          Sets the vertical position of the text relative to the icon.
 void setWordWrap(boolean s)
          Sets a value that determines whether the text should be wrapped to a new line when it reaches the trailing margin.
 void updateUI()
           
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DsLabel

public DsLabel(String text,
               Icon icon,
               int horizontalAlignment)
Creates a DsLabel with the specified text, icon and horizontal alignment. The contents are centered vertically. The text is on the trailing side of the icon.

Parameters:
text - The text displayed in the label.
icon - The icon displayed next to the text.
horizontalAlignment - The horizontal alignment of the contents (text and icon) within the Label. One of: LEFT, CENTER, RIGHT, LEADING or TRAILING

DsLabel

public DsLabel(String text)
Creates a DsLabel with the specified text and without an icon. The text is aligned to the leading edge horizontally and centered vertically.


DsLabel

public DsLabel(String text,
               int horizontalAlignment)

DsLabel

public DsLabel(Icon icon)
Creates a DsLabel with an icon which is centered vertically and horizontally.


DsLabel

public DsLabel(Icon icon,
               int horizontalAlignment)
Creates a DsLabel with an icon which is centered vertically and the specified horizontal alignment.

Parameters:
horizontalAlignment - - One of: LEFT, CENTER, RIGHT, LEADING or TRAILING

DsLabel

public DsLabel()
Creates a DsLabel without an icon and a blank string for the text.

Method Detail

updateUI

public void updateUI()
Overrides:
updateUI in class JComponent

setForeground

public void setForeground(Color c)
Sets the text color (ForegroundPaint property).

Overrides:
setForeground in class JComponent

getForegroundPaint

public Paint getForegroundPaint()

setForegroundPaint

public void setForegroundPaint(Paint p)

setBackground

public void setBackground(Color c)
Overrides:
setBackground in class JComponent

getBackgroundPaint

public Paint getBackgroundPaint()

setBackgroundPaint

public void setBackgroundPaint(Paint p)

isAutoSize

public boolean isAutoSize()
Returns a value that determines whether the label is automatically resized to display its entire contents.


setAutoSize

public void setAutoSize(boolean s)
Sets a value that determines whether the label is automatically resized to display its entire contents.


isWordWrap

public boolean isWordWrap()
Returns a value that determines whether the text should be wrapped to a new line when it reaches the trailing margin.


setWordWrap

public void setWordWrap(boolean s)
Sets a value that determines whether the text should be wrapped to a new line when it reaches the trailing margin.


getHorizontalAlignment

public int getHorizontalAlignment()
Returns the horizontal alignment of the contents (text and icon) within the Label


setHorizontalAlignment

public void setHorizontalAlignment(int align)
Sets the horizontal alignment of the contents (text and icon) within the Label.
 LEFT    - contents are left-aligned.
 CENTER  - contents are centered.
 RIGHT   - contents are right-aligned.
 LEADING - contents are aligned to the leading edge (at the beginning). (Default)
 TRAILING- contents are aligned to the trailing edge (at the end).


getVerticalAlignment

public int getVerticalAlignment()
Returns the vertical alignment of the contents (text and icon) within the Label


setVerticalAlignment

public void setVerticalAlignment(int a)
Sets the vertical alignment of the contents (text and icon) within the Label. Valid values are:
 TOP     - contents are aligned to the top.
 CENTER  - contents are centered. (Default)
 BOTTOM  - contents are aligned to the bottom.


getHorizontalTextPosition

public int getHorizontalTextPosition()
Returns the horizontal position of the text relative to the icon


setHorizontalTextPosition

public void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the text relative to the icon. Valid values are:
 LEFT    - text is on the left side of the icon.
 CENTER  - text and icon are centered horizontally.
 RIGHT   - text is on the right side.
 LEADING - text is on the leading edge of the icon (at the beginning).
 TRAILING- text is on the trailing edge of the icon (at the end). (Default)


getVerticalTextPosition

public int getVerticalTextPosition()
Returns the vertical position of the text relative to the icon


setVerticalTextPosition

public void setVerticalTextPosition(int textPosition)
Sets the vertical position of the text relative to the icon. Valid values are:
 TOP     - text is on the top of the icon.
 CENTER  - text and icon are centered vertically. (Default)
 BOTTOM  - text is on the bottom of the icon. 


getDisplayedMnemonic

public char getDisplayedMnemonic()
Returns the character that indicates a mnemonic key.

See Also:
setDisplayedMnemonic(char)

setDisplayedMnemonic

public void setDisplayedMnemonic(char mnemonicChar)
Specify a character that indicates a mnemonic key. This property is used when the label is part of a larger component. If the labelFor property of the label is not null, the label will call the requestFocus method of the component specified by the labelFor property when the mnemonic is activated.

Parameters:
mnemonicChar - a char specifying the mnemonic to display
See Also:
setLabelFor(Component)

getLabelFor

public Component getLabelFor()
Get the component this is labelling.

Returns:
the Component this is labelling. Can be null if this does not label a Component.
See Also:
setDisplayedMnemonic(char)

setLabelFor

public void setLabelFor(Component c)
Specify the component on which the label will call the requestFocus method when the mnemonic is activated.

See Also:
setDisplayedMnemonic(char)

getText

public String getText()
Returns the text that the label displays


setText

public void setText(String text)
Sets the text that the label displays.


getIcon

public Icon getIcon()
Returns the graphic image (glyph, icon) that the label displays.


setIcon

public void setIcon(Icon icon)
Defines the icon this component will display. If the value of icon is null, nothing is displayed.

The default value of this property is null.

See Also:
setVerticalTextPosition(int), setHorizontalTextPosition(int)

getDisabledIcon

public Icon getDisabledIcon()
Returns the graphic image (glyph, icon) that the label displays when the label is disabled.


setDisabledIcon

public void setDisabledIcon(Icon icon)
Defines the icon this component will display when the label is disabled. If the value of icon is null, a grayed out version getIcon() is displayed if set otherwise nothing is displayed.

The default value of this property is null.

See Also:
setVerticalTextPosition(int), setHorizontalTextPosition(int)

getIconTextGap

public int getIconTextGap()
Returns the amount of space between the text and the icon displayed in this label.

Returns:
an int equal to the number of pixels between the text and the icon.
See Also:
setIconTextGap(int)

setIconTextGap

public void setIconTextGap(int iconTextGap)
If both the icon and text properties are set, this property defines the space between them.

The default value of this property is 4 pixels.


getInsets

public Insets getInsets()
Returns the insets which includes the border's insets and the margin.

Overrides:
getInsets in class JComponent

getInsets

public Insets getInsets(Insets insets)
Returns the insets which includes the border's insets and the margin.

Overrides:
getInsets in class JComponent

getMargins

public Insets getMargins()
Returns the spacing between the border and the contents (text/icon).


setMargins

public void setMargins(Insets margins)
Sets the spacing between the border and the contents (text/icon).


setFont

public void setFont(Font f)
Overrides:
setFont in class JComponent

isFontStrikeThrough

public boolean isFontStrikeThrough()
Returns a value that determines whether the text for the label is displayed with a line through the text.


setFontStrikeThrough

public void setFontStrikeThrough(boolean strikeThrough)
Sets a value that determines whether the text for the label is displayed with a line through the text.


getFontUnderline

public int getFontUnderline()
Returns a value that determines how the text for the label is underlined.


setFontUnderline

public void setFontUnderline(int underline)
Sets a value that determines how the text for the label is underlined. Valid values are:


getTextStyle

public int getTextStyle()
Returns a value that determines how the text is drawn.


setTextStyle

public void setTextStyle(int style)
Sets a value that determines how the text is drawn. Valid values are:

RAISED and LOWERED look good with larger or bold fonts. For smaller fonts use RAISED_LIGHT and LOWERED_LIGHT


getTextOutlineColor

public Color getTextOutlineColor()
Returns the color used to draw an outline around each character of the text. Can be null which means no outline will be drawn.


setTextOutlineColor

public void setTextOutlineColor(Color c)
Sets the color used to draw an outline around each character of the text. Can be null which means no outline will be drawn.


setTextOutlineWidth

public void setTextOutlineWidth(double lineWidth)
Sets the width of the outline drawn around each character in the text. Set to 0 to turn it off.


getTextOutlineWidth

public double getTextOutlineWidth()
Returns the width of the outline drawn around each character in the text.


addTextListener

public void addTextListener(TextListener l)
Adds the specified text listener to receive text events

Parameters:
l - the text listener

removeTextListener

public void removeTextListener(TextListener l)
Removes the specified text listener so it no longer receives text events.

Parameters:
l - the text listener

fireLabelChangedEvent

protected void fireLabelChangedEvent()
Fire an text event to the listeners


setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height. Overriden to ignore width and height when autoSize is turned on.

Overrides:
setBounds in class Component

getPreferredSize

public Dimension getPreferredSize()
This method is called by a layout manager when it wants to know how big we'd like to be.

Overrides:
getPreferredSize in class JComponent

getMinimumSize

public Dimension getMinimumSize()
This method is called when the layout manager wants to know the bare minimum amount of space we need to get by.

Overrides:
getMinimumSize in class JComponent

paintComponent

protected void paintComponent(Graphics g)
Overrides:
paintComponent in class JComponent

getRotation

public int getRotation()
Returns the degrees to rotate text and icon.


setRotation

public void setRotation(int val)
Set the degrees to rotate the text and icon.

Parameters:
val - degrees to rotate from horizontal (only valid values: 0, 90, 270)

getLineBorderColor

public Color getLineBorderColor()
Returns the color used to draw the line border. Can be null.


setLineBorderColor

public void setLineBorderColor(Color c)
Sets the color used to draw the line border. Can be null which means it will use black for the outline and the background color for all other borders.


getLineBorderWidth

public int getLineBorderWidth()
Returns the width of the line border drawn around the label.


setLineBorderWidth

public void setLineBorderWidth(int lineWidth)
Sets the width of the line border drawn around the label. Set to 0 to turn it off.


getOuterBorder

public int getOuterBorder()
Returns whether to draw a border on the outside of the label but inside of the outline if it exists.


setOuterBorder

public void setOuterBorder(int val)
Creates a border on the outside of the label but inside of the outline if it exists.

Parameters:
val - One of: NONE, RAISED, LOWERED, ETCHED_RAISED, ETCHED, SINGLE_LINE

getCenterBorder

public int getCenterBorder()
Returns whether to draw a border in between the InnerBorder and the OuterBorder.


setCenterBorder

public void setCenterBorder(int val)
Creates a border in between the InnerBorder and the OuterBorder.

Parameters:
val - One of: RAISED, LOWERED, ETCHED_RAISED, ETCHED, SINGLE_LINE

getInnerBorder

public int getInnerBorder()
Returns whether to draw a border inside of the CenterBorder.


setInnerBorder

public void setInnerBorder(int val)
Creates a border on the inside of the CenterBorder.

Parameters:
val - One of: NONE, RAISED, LOWERED, ETCHED_RAISED, ETCHED, SINGLE_LINE

createBorder

protected Border createBorder()

setBorders

protected void setBorders()

Diamond Control Suite 3.0

Diamond Edge and Diamond Control Suite are trademarks or registered trademarks of Diamond Edge, Inc. Copyright 1999-2005 Diamond Edge, Inc. All Rights Reserved.