public class AnnotationData extends Object implements Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
AnnotationData.StyleRange
Formatting rule on the text; similar to SWT style range.
|
static class |
AnnotationData.TextAlignment
Text alignment in annotation.
|
Modifier and Type | Field and Description |
---|---|
static int |
VERSION_20151012
Released with 3.0 - uses (almost) same fonts on all systems.
|
static int |
VERSION_20151123
Released with 3.1: store default font size in annotation.
|
static int |
VERSION_OLD
Old type annotation - font is system font (inconsistent layout).
|
Constructor and Description |
---|
AnnotationData() |
Modifier and Type | Method and Description |
---|---|
AnnotationData |
clone() |
void |
copyFrom(AnnotationData otherData,
boolean includeBounds)
Copy content, styles, position from the argument.
|
boolean |
equals(Object obj) |
AnnotationData.TextAlignment |
getAlignment() |
int |
getBgColor() |
int |
getBorderColor() |
int |
getBorderSize() |
int |
getDefaultFontSize()
Return the default font size for this annotation, or -1 if size from pref page should be used.
|
int |
getHeight() |
AnnotationData.StyleRange[] |
getStyleRanges() |
String |
getText() |
int |
getVersion()
Save-Version of this annotation.
|
int |
getWidth() |
int |
getX() |
int |
getY() |
int |
hashCode() |
void |
load(NodeSettingsRO config,
FileWorkflowPersistor.LoadVersion loadVersion)
loads new values.
|
void |
save(NodeSettingsWO config)
Save all data.
|
void |
setAlignment(AnnotationData.TextAlignment alignment) |
void |
setBgColor(int bgColor) |
void |
setBorderColor(int color) |
void |
setBorderSize(int size) |
void |
setDefaultFontSize(int size)
Set the default font size for this annotation.
|
void |
setDimension(int x,
int y,
int width,
int height)
Set dimensionality.
|
void |
setHeight(int height) |
void |
setStyleRanges(AnnotationData.StyleRange[] styleRanges) |
void |
setText(String text) |
void |
setWidth(int width) |
void |
setX(int x) |
void |
setY(int y) |
void |
shiftPosition(int xOff,
int yOff)
Shift annotation after copy&paste.
|
String |
toString() |
public static final int VERSION_OLD
public static final int VERSION_20151012
public static final int VERSION_20151123
public final String getText()
public final void setText(String text)
text
- the text to setpublic final AnnotationData.StyleRange[] getStyleRanges()
public final void setStyleRanges(AnnotationData.StyleRange[] styleRanges)
styleRanges
- the styleRanges to setpublic final int getBgColor()
public final void setBgColor(int bgColor)
bgColor
- the bgColor to setpublic final int getX()
public final void setX(int x)
x
- the x to setpublic final int getY()
public final void setY(int y)
y
- the y to setpublic final int getWidth()
public final void setWidth(int width)
width
- the width to setpublic final int getHeight()
public final void setHeight(int height)
height
- the height to setpublic final void setAlignment(AnnotationData.TextAlignment alignment)
alignment
- the alignment to setpublic final AnnotationData.TextAlignment getAlignment()
public final int getBorderSize()
public final void setBorderSize(int size)
size
- border size in pixel, 0 or neg. for no border.public final int getBorderColor()
getBorderSize()
.public final void setBorderColor(int color)
color
- the new border color to set.public final void shiftPosition(int xOff, int yOff)
xOff
- x offsetyOff
- y offsetpublic final int getVersion()
public final void setDimension(int x, int y, int width, int height)
x
- x-coordinatey
- y-coordinatewidth
- width of componentheight
- height of componentpublic final void setDefaultFontSize(int size)
size
- new default sizepublic final int getDefaultFontSize()
public void copyFrom(AnnotationData otherData, boolean includeBounds)
otherData
- To copy from.includeBounds
- Whether to also update x, y, width, height. If
false, it will only a copy the text with its stylespublic AnnotationData clone()
public void save(NodeSettingsWO config)
config
- To save to.public void load(NodeSettingsRO config, FileWorkflowPersistor.LoadVersion loadVersion) throws InvalidSettingsException
config
- To load fromloadVersion
- Version to loadInvalidSettingsException
- If fails
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.