Package voltage.core

# Class VoltageLabel

java.lang.Object
voltage.core.VoltageComponent
voltage.core.VoltageLabel

public class VoltageLabel extends VoltageComponent
A label class

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `VoltageLabel.Justification`
  Label justification for the text such as left, center, etc.

- ## Field Summary

  ### Fields inherited from class voltage.core.VoltageComponent

  `componentName, displayName`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VoltageLabel(String name, String displayName, VoltageModule module, String text)`
  Constructor
  `VoltageLabel(String name, VoltageModule module, String text)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Color`
  `GetBkColor()`
  Gets the background color of the label.
  `Color`
  `GetBorderColor()`
  Gets the border color of the label.
  `Color`
  `GetColor()`
  Gets the color of the text.
  `Color`
  `GetEditBackColor()`
  Gets the edit background color of the label.
  `Color`
  `GetEditOutlineColor()`
  Gets the edit mode border color of the label.
  `Color`
  `GetEditTextColor()`
  Gets the edit text color of the label.
  `String`
  `GetFont()`
  Get the font name
  `int`
  `GetFontSize()`
  Get the font size.
  `int`
  `GetNumberEditorInterval()`
  Get the interval for this number interval.
  `int`
  `GetNumberEditorMaxValue()`
  Gets the maximum number for this label.
  `int`
  `GetNumberEditorMinValue()`
  Gets the minimum number for this label.
  `int`
  `GetNumberEditorValue()`
  Gets the current number for this label.
  `String`
  `GetText()`
  Get the text of the label.
  `Color`
  `GetTextHoverColor()`
  Gets the text hover color of the label.
  `boolean`
  `HasCustomTextHoverColor()`
  Does it have a custom hover color?
  `boolean`
  `IsBold()`
  Is the font bold?
  `boolean`
  `IsItalic()`
  Is the font italic?
  `boolean`
  `IsNumberEditor()`
  Is this a number editor?
  `boolean`
  `NumberEditorUsesMouseWheel()`
  Does this use the mousewheel for editing numbers.
  `void`
  `SetBkColor(Color zeColor)`
  Sets the background color.
  `void`
  `SetBorderColor(Color zeColor)`
  Sets the border color of the label.
  `void`
  `SetBorderSize(int pixSize)`
  Set the border size of label.
  `void`
  `SetColor(Color zeColor)`
  Sets the text color
  `void`
  `SetEditable(boolean bEditOnSingleClick, boolean bEditOnDoubleClick)`
  Can the label be edited?
  `void`
  `SetEditBackColor(Color zeColor)`
  Sets the background color of the label during edit mode.
  `void`
  `SetEditOutlineColor(Color zeColor)`
  Set the text border color of the label during edit mode.
  `void`
  `SetEditTextColor(Color zeColor)`
  Set the text color of the label during edit mode.
  `void`
  `SetFont(String typeface, int fontSize, boolean bBold, boolean bItalic)`
  Set a custom font.
  `void`
  `SetHasCustomTextHoverColor(boolean htc)`
  Set that it has a custom hover color.
  `void`
  `SetHorizontalScale(double scale)`
  Sets the horizontal scale for the font.
  `void`
  `SetIsNumberEditor(boolean bEditor)`
  Is this a number editor label? This means that this label contains a number.
  `void`
  `SetJustificationFlags(VoltageLabel.Justification justificationFlag)`
  Set the label's text justification
  `void`
  `SetMultiLineEdit(boolean bMultiLineEdit)`
  Can the label edit multiple lines?
  `void`
  `SetNumberEditorInterval(int newInterval)`
  Sets the interval for this number editor.
  `void`
  `SetNumberEditorRange(int rangeMin, int rangeMax)`
  Sets the range for this number (If a number editor)
  `void`
  `SetNumberEditorUsesMouseWheel(boolean umw)`
  Sets whether this uses a mousewheel for adjustment.
  `void`
  `SetNumberEditorValue(int value)`
  Sets the current number for this label.
  `void`
  `SetText(String newString)`
  Set the text for the label.
  `void`
  `SetText(String newString, boolean bUpdateGUI)`
  Set the text for the label.
  `void`
  `SetTextHoverColor(Color zeColor)`
  Set the text hover color of the label Make sure to call SetHasCustomTextHoverColor(true)

  ### Methods inherited from class voltage.core.VoltageComponent

  `AddChildComponent, GetComponentID, GetDisplayName, GetHeight, GetMaxValue, GetMinValue, GetRect, GetSkin, GetTooltipText, GetTransparency, GetUserProperty, GetValue, GetWidth, GetX, GetY, IsEnabled, IsVisible, RemoveChildComponent, SetCanBeAutomated, SetEnabled, SetPosition, SetRect, SetRect, SetSize, SetSkin, SetTransparency, SetUnits, SetUserProperty, SetValue, SetValue, SetValueNoNotification, SetVisible, SetWantsMouseNotifications, SetZOrder, SkewNormalizedValue, UpdateGUIValue, WantsMouseNotifications`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### VoltageLabel

    public VoltageLabel(String name, String displayName, VoltageModule module, String text)
    Constructor
    Parameters:
      `name` - internal name for label.
      `displayName` - display name for label.
      `module` - the module this belongs to
      `text` - the initial text of the label.

  - ### VoltageLabel

    public VoltageLabel(String name, VoltageModule module, String text)
    Constructor
    Parameters:
      `name` - internal name for label.
      `module` - the module this belongs to
      `text` - the initial text of the label.

- ## Method Details

  - ### SetText

    public void SetText(String newString)
    Set the text for the label.
    Parameters:
      `newString` - the new text for the label.

  - ### SetText

    public void SetText(String newString, boolean bUpdateGUI)
    Set the text for the label.
    Parameters:
      `newString` - the new text for the label.
      `bUpdateGUI` - a flag to optional update the user interface.

  - ### GetText

    public String GetText()
    Get the text of the label.
    Returns:
      the text of the label.

  - ### SetColor

    public void SetColor(Color zeColor)
    Sets the text color
    Parameters:
      `zeColor` - the new color of the text.

  - ### GetColor

    public Color GetColor()
    Gets the color of the text.
    Returns:
      the color.

  - ### SetBkColor

    public void SetBkColor(Color zeColor)
    Sets the background color.
    Parameters:
      `zeColor` - the new background color.

  - ### GetBkColor

    public Color GetBkColor()
    Gets the background color of the label.
    Returns:
      the color.

  - ### SetBorderColor

    public void SetBorderColor(Color zeColor)
    Sets the border color of the label.
    Parameters:
      `zeColor` - the border color.

  - ### GetBorderColor

    public Color GetBorderColor()
    Gets the border color of the label.
    Returns:
      the color.

  - ### SetBorderSize

    public void SetBorderSize(int pixSize)
    Set the border size of label.
    Parameters:
      `pixSize` - the pixel size of the border.

  - ### SetEditBackColor

    public void SetEditBackColor(Color zeColor)
    Sets the background color of the label during edit mode.
    Parameters:
      `zeColor` - the color.

  - ### GetEditBackColor

    public Color GetEditBackColor()
    Gets the edit background color of the label.
    Returns:
      the color.

  - ### SetEditTextColor

    public void SetEditTextColor(Color zeColor)
    Set the text color of the label during edit mode.
    Parameters:
      `zeColor` - the text color.

  - ### GetEditTextColor

    public Color GetEditTextColor()
    Gets the edit text color of the label.
    Returns:
      the color.

  - ### SetEditOutlineColor

    public void SetEditOutlineColor(Color zeColor)
    Set the text border color of the label during edit mode.
    Parameters:
      `zeColor` - the text color.

  - ### GetEditOutlineColor

    public Color GetEditOutlineColor()
    Gets the edit mode border color of the label.
    Returns:
      the color.

  - ### SetTextHoverColor

    public void SetTextHoverColor(Color zeColor)
    Set the text hover color of the label Make sure to call SetHasCustomTextHoverColor(true)
    Parameters:
      `zeColor` - the text color.
    See Also:
      - `SetHasCustomTextHoverColor(boolean)`

  - ### GetTextHoverColor

    public Color GetTextHoverColor()
    Gets the text hover color of the label.
    Returns:
      the color.

  - ### HasCustomTextHoverColor

    public boolean HasCustomTextHoverColor()
    Does it have a custom hover color?
    Returns:
      true if it does.

  - ### SetHasCustomTextHoverColor

    public void SetHasCustomTextHoverColor(boolean htc)
    Set that it has a custom hover color.
    Parameters:
      `htc` - true if it has a custom hover color.

  - ### SetFont

    public void SetFont(String typeface, int fontSize, boolean bBold, boolean bItalic)
    Set a custom font.
    Parameters:
      `typeface` - the name of the font like "Arial"
      `fontSize` - the point size of the font, such as 12
      `bBold` - set to true to create a bold font.
      `bItalic` - set to true to create an italic font.

  - ### IsBold

    public boolean IsBold()
    Is the font bold?
    Returns:
      true if bold.

  - ### IsItalic

    public boolean IsItalic()
    Is the font italic?
    Returns:
      true if italic.

  - ### GetFontSize

    public int GetFontSize()
    Get the font size.
    Returns:
      the point size of the font.

  - ### GetFont

    public String GetFont()
    Get the font name
    Returns:
      the font name.

  - ### SetJustificationFlags

    public void SetJustificationFlags(VoltageLabel.Justification justificationFlag)
    Set the label's text justification
    Parameters:
      `justificationFlag` - determines how the text is oriented.

  - ### SetEditable

    public void SetEditable(boolean bEditOnSingleClick, boolean bEditOnDoubleClick)
    Can the label be edited?
    Parameters:
      `bEditOnSingleClick` - should it enter edit mode on single clicks.
      `bEditOnDoubleClick` - should the label enter edit mode on a double click.

  - ### SetMultiLineEdit

    public void SetMultiLineEdit(boolean bMultiLineEdit)
    Can the label edit multiple lines?
    Parameters:
      `bMultiLineEdit` - true to allow multiple lines.

  - ### SetHorizontalScale

    public void SetHorizontalScale(double scale)
    Sets the horizontal scale for the font.
    Parameters:
      `scale` - the scale of the font horizontally. 1.0 is normal.

  - ### SetIsNumberEditor

    public void SetIsNumberEditor(boolean bEditor)
    Is this a number editor label? This means that this label contains a number.
    Parameters:
      `bEditor` - set to true to be a number editor label.

  - ### IsNumberEditor

    public boolean IsNumberEditor()
    Is this a number editor?
    Returns:
      true if its a number editor.

  - ### SetNumberEditorRange

    public void SetNumberEditorRange(int rangeMin, int rangeMax)
    Sets the range for this number (If a number editor)
    Parameters:
      `rangeMin` - the minimum integer for this label.
      `rangeMax` - the maximum integer for this label.
    See Also:
      - `SetIsNumberEditor(boolean)`

  - ### GetNumberEditorMinValue

    public int GetNumberEditorMinValue()
    Gets the minimum number for this label.
    Returns:
      the minimum value for this label.
    See Also:
      - `SetIsNumberEditor(boolean)`

  - ### GetNumberEditorMaxValue

    public int GetNumberEditorMaxValue()
    Gets the maximum number for this label.
    Returns:
      the maximum value for this label.
    See Also:
      - `SetIsNumberEditor(boolean)`

  - ### SetNumberEditorValue

    public void SetNumberEditorValue(int value)
    Sets the current number for this label.
    Parameters:
      `value` - the new value for this label.
    See Also:
      - `SetIsNumberEditor(boolean)`

  - ### GetNumberEditorValue

    public int GetNumberEditorValue()
    Gets the current number for this label.
    Returns:
      the current number for this label.
    See Also:
      - `SetIsNumberEditor(boolean)`

  - ### SetNumberEditorInterval

    public void SetNumberEditorInterval(int newInterval)
    Sets the interval for this number editor. This is how much it increases/decreases with the mousewheel.
    Parameters:
      `newInterval` - the interval to adjust by. Defaults to 1. Valid values are 1 or greater .
    See Also:
      - `SetIsNumberEditor(boolean)`

  - ### GetNumberEditorInterval

    public int GetNumberEditorInterval()
    Get the interval for this number interval.
    Returns:
      the interval used with this number editor.
    See Also:
      - `SetIsNumberEditor(boolean)`

  - ### SetNumberEditorUsesMouseWheel

    public void SetNumberEditorUsesMouseWheel(boolean umw)
    Sets whether this uses a mousewheel for adjustment.
    Parameters:
      `umw` - true if this should use the mousewheel.
    See Also:
      - `SetIsNumberEditor(boolean)`

  - ### NumberEditorUsesMouseWheel

    public boolean NumberEditorUsesMouseWheel()
    Does this use the mousewheel for editing numbers.
    Returns:
      true if it uses the mousewheel to edit the value.
    See Also:
      - `SetIsNumberEditor(boolean)`