public class NodeLabel extends AbstractLabel
CENTER, HORIZONTALPOS_CENTER, HORIZONTALPOS_LEFT, HORIZONTALPOS_RIGHT, LEFT, RIGHT, STYLE_BOLD, STYLE_ITALIC, STYLE_PLAIN, VERTICALPOS_BOTTOM, VERTICALPOS_CENTER, VERTICALPOS_TOP
Constructor and Description |
---|
NodeLabel() |
Modifier and Type | Method and Description |
---|---|
NodeLabel |
clone() |
java.awt.image.BufferedImage |
getIcon()
Return the label associated icon.
|
int |
getIconID()
Return the label associated icon ID.
|
float |
getIconScaleX()
Return the X scale of the icon.
|
float |
getIconScaleXWithRatio()
Return the X scale of the icon, taking into account the
isKeepingIconAspectRatio() . |
float |
getIconScaleY()
Return the Y scale of the icon.
|
float |
getIconScaleYWithRatio()
Return the Y scale of the icon, taking into account the
isKeepingIconAspectRatio() . |
java.net.URL |
getIconURL()
Return the label associated icon URL.
|
boolean |
hasIcon()
Return true if the label has an associated icon.
|
boolean |
isKeepingIconAspectRatio()
Return true if the icon aspect ratio must be kept.
|
void |
keepIconAspectRatio(boolean keepAspectRatio)
Specify if the icon aspect ratio must be kept.
|
void |
setIcon(java.awt.image.BufferedImage icon)
Set the label associated icon.
|
boolean |
setIcon(java.io.File imageFile)
Set the label associated icon as an image file.
|
boolean |
setIcon(java.net.URL imageURL)
Set the label associated icon as an image URL.
|
void |
setIconID(int iconID)
Set the label associated icon ID.
|
void |
setIconScaleX(float scaleX)
Set the X scale of the icon.
|
void |
setIconScaleY(float scaleY)
Set the Y scale of the icon.
|
createLabelPlacement, createLabelPlacement, getAlignment, getFontFamily, getFontSize, getFontStyle, getHorizontalTextPosition, getLabel, getLabeledElement, getLabelPlacement, getLabelPlacementType, getMinimumHeight, getMinimumSize, getMinimumWidth, getTextColor, getVerticalTextPosition, isEmpty, setAlignment, setFontFamily, setFontSize, setFontStyle, setHorizontalTextPosition, setLabel, setLabeledElement, setTextColor, setTextColor, setVerticalTextPosition
public void keepIconAspectRatio(boolean keepAspectRatio)
keepAspectRatio
- true if the icon aspect ratio must be keptpublic boolean isKeepingIconAspectRatio()
public void setIconScaleX(float scaleX)
scaleX
- the X scalepublic float getIconScaleX()
public float getIconScaleXWithRatio()
isKeepingIconAspectRatio()
.public void setIconScaleY(float scaleY)
scaleY
- the Y scalepublic float getIconScaleY()
public float getIconScaleYWithRatio()
isKeepingIconAspectRatio()
.public boolean hasIcon()
public void setIconID(int iconID)
iconID
- the icon IDpublic int getIconID()
public void setIcon(java.awt.image.BufferedImage icon)
icon
- the iconpublic boolean setIcon(java.io.File imageFile)
imageFile
- the icon as an image filepublic boolean setIcon(java.net.URL imageURL)
imageURL
- the icon as an image URLpublic java.awt.image.BufferedImage getIcon()
public java.net.URL getIconURL()
public NodeLabel clone()
clone
in class AbstractLabel
Copyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence