Package gov.nih.mipav.model.structures
Class VOIText
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
-
- gov.nih.mipav.model.structures.VOIBase
-
- gov.nih.mipav.model.structures.VOIText
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<WildMagic.LibFoundation.Mathematics.Vector3f>
,java.util.Collection<WildMagic.LibFoundation.Mathematics.Vector3f>
,java.util.List<WildMagic.LibFoundation.Mathematics.Vector3f>
,java.util.RandomAccess
- Direct Known Subclasses:
VOIWormAnnotation
public class VOIText extends VOIBase
Title: VOI Text
Description: VOI Text is used to hold an annotation that will be displayed on screen with the chosen font size, color, type, and descriptors (BOLD, ITALIC) it e
Copyright: Copyright (c) 2004
Company:
- Version:
- 1.0
- Author:
- not attributable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Color
backgroundColor
The color used to draw behind the main text (so that the text will stand out)private java.util.ArrayList<java.lang.String>
comments
private int
fontDescriptors
The descriptors for the font which start at PLAIN and are additive (PLAIN + BOLD = bold) (BOLD+ITALIC = bold and italic) etc.private java.lang.String
fontName
The name (or type) of the font.private int
fontSize
The size of the font (half-sizes not allowed...int).private java.lang.String
noteString
The note stored in VOIText, has same font as textStringprivate static long
serialVersionUID
Use serialVersionUID for interoperability.private java.awt.Color
textColor
This must be kept separate (but parallel) to the VOI color.private java.awt.Font
textFont
The font is stored here so that it does not have to be reallocated on each redraw.private java.lang.String
textString
The String to be displayed.private boolean
useMarker
If this is set to true, a draggable arrow will be displayed-
Fields inherited from class gov.nih.mipav.model.structures.VOIBase
active, autoLabel, averagePt, cenMassPt, cenMassPtB, cenMassPtG, cenMassPtR, CIRCLE, closed, display, DOWN, fixed, gcPt, label, lastPoint, LEFT, LEFT_MIDDLE, LOWER_LEFT, LOWER_MIDDLE, LOWER_RIGHT, m_akImageMinMax, m_bQuickLUT, m_bReloadPoints, m_bSplit, m_bUpdateAverage, m_bUpdateBounds, m_bUpdateGeometricCenter, m_bUpdateMask, m_bUpdatePlane, m_iAnchorIndex, m_iPlane, m_iVOIType, m_kColor, m_kPositionSum, m_kVolumeVOI, nearBoundPoint, nearPoint, NOT_A_PLANE, NOT_A_POINT, numPixels, process, RIGHT, RIGHT_MIDDLE, SQUARE, UNKNOWN_SUBTYPE, UP, UPPER_LEFT, UPPER_MIDDLE, UPPER_RIGHT, voiGroup, volumeDisplayRange, XPLANE, YPLANE, ZPLANE
-
-
Constructor Summary
Constructors Constructor Description VOIText()
default constructor.VOIText(VOIText kVOI)
Copy contructor.VOIText(java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kPositions)
Constructor, sets positions of the annotation.VOIText(WildMagic.LibFoundation.Mathematics.Vector3f kPosition)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VOIText
clone()
WildMagic.LibFoundation.Mathematics.Vector3f
exportPoint()
Method to access point VOI coordinate.java.awt.Color
getBackgroundColor()
Gets background color.java.awt.Color
getColor()
Gets the font color (for copy/paste operations).java.lang.String
getColorString()
Gets a string describing the font's color (for saving in XML header).java.util.ArrayList<java.lang.String>
getComments()
boolean
getDisplay()
int
getFontDescriptors()
Gets the font's descriptors (PLAN, BOLD, ITALIC).java.lang.String
getFontName()
Gets the name (type) of the font.int
getFontSize()
Returns the size of the font.java.lang.String
getLocationString()
Gets a string describing the text location (in the slice, does not include which slice).java.lang.String
getNote()
Gets the contained note.java.lang.String
getText()
Gets the displayed text.java.awt.Font
getTextFont()
Returns the Font.WildMagic.LibFoundation.Mathematics.Vector3f
getTextWidth()
void
moveVOIPoint(int xM, int yM, int zM)
Moves the point to the new location.void
setBackgroundColor(java.awt.Color color)
Sets background colorvoid
setColor(java.awt.Color color)
Sets the color of the font.void
setComments(java.lang.String comment)
void
setFontDescriptors(int fontDescriptors)
Sets the font's descriptors.void
setFontName(java.lang.String fontName)
Sets the name (type) of the font.void
setFontSize(int fontSize)
Sets the size of the font.void
setNote(java.lang.String noteString)
Sets the contained note.void
setText(java.lang.String textString)
Sets the displayed text.void
setTextFont(java.awt.Font font)
Sets Font.void
setTextWidth(WildMagic.LibFoundation.Mathematics.Vector3f kVolume)
void
setUseMarker(boolean mark)
Sets the arrow to be on or offvoid
update(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
Set the color of this contour.void
updateText()
boolean
useMarker()
gets whether or not the arrow should be drawnstatic int
xCor(int len, double dir)
static int
yCor(int len, double dir)
-
Methods inherited from class gov.nih.mipav.model.structures.VOIBase
addElement, addElement, area, areaTwice, calcIntensity, calcIntensity, calcIntensityThreshold, calcRGBIntensity, calcRGBIntensity, calcRGBIntensityThreshold, contain, contains, contains, contains, createVolumeVOI, cycleActivePt, delete, deleteVolumeVOI, display, dispose, distanceToVOI, equals, exportArrays, exportArrays, fillVolume, findPositionAndCurvature, findPositionAndIntensity, findPositionAndIntensity, findVOIIndentations2D, getActivePt, getAllContourPoints, getAnchor, getAverage, getBounds, getBounds, getCenterOfMass, getCenterOfMass, getCenterOfMassB, getCenterOfMassG, getCenterOfMassR, getContourID, getDoGeometricCenterLabel, getGeometricCenter, getGeometricCenterA, getGroup, getImageBoundingBox, getLabel, getLastNumPixels, getLengthPtToPt, getLengthPtToPt, getLengthString, getMaskPositions, getName, getNearBoundPoint, getNearPoint, getNumVoxels, getPlane, getProcess, getSelectedPoint, getSubtype, getTotalLengthString, getType, getVolumeDisplayRange, getVolumeVOI, importArrays, importArrays, importPoints, isActive, isClosed, isFixed, isM_bUpdateBounds, isM_bUpdateGeometricCenter, isQuickLUT, isSplit, nearLine, nearLine, planeFit, reloadPoints, setActive, setAnchor, setClosed, setDoGeometricCenterLabel, setFixed, setGroup, setLabel, setMask, setMaskSlice, setNearBoundPoint, setNearPoint, setPlane, setProcess, setQuickLUT, setSelectedPoint, setSplit, setSubtype, setVolumeDisplayRange, slice, slice, transform, trimPoints, update, update
-
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
fontDescriptors
private int fontDescriptors
The descriptors for the font which start at PLAIN and are additive (PLAIN + BOLD = bold) (BOLD+ITALIC = bold and italic) etc.
-
fontName
private java.lang.String fontName
The name (or type) of the font.
-
fontSize
private int fontSize
The size of the font (half-sizes not allowed...int).
-
textColor
private java.awt.Color textColor
This must be kept separate (but parallel) to the VOI color.
-
backgroundColor
private java.awt.Color backgroundColor
The color used to draw behind the main text (so that the text will stand out)
-
textFont
private java.awt.Font textFont
The font is stored here so that it does not have to be reallocated on each redraw. It is only new'd at the beginning or if the fontDescriptors variable changes
-
textString
private java.lang.String textString
The String to be displayed.
-
noteString
private java.lang.String noteString
The note stored in VOIText, has same font as textString
-
useMarker
private boolean useMarker
If this is set to true, a draggable arrow will be displayed
-
comments
private java.util.ArrayList<java.lang.String> comments
-
-
Constructor Detail
-
VOIText
public VOIText()
default constructor.
-
VOIText
public VOIText(java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kPositions)
Constructor, sets positions of the annotation.- Parameters:
kPositions
-
-
VOIText
public VOIText(WildMagic.LibFoundation.Mathematics.Vector3f kPosition)
-
VOIText
public VOIText(VOIText kVOI)
Copy contructor.- Parameters:
kVOI
-
-
-
Method Detail
-
xCor
public static int xCor(int len, double dir)
-
yCor
public static int yCor(int len, double dir)
-
exportPoint
public WildMagic.LibFoundation.Mathematics.Vector3f exportPoint()
Method to access point VOI coordinate.- Returns:
- 3d point
-
getBackgroundColor
public java.awt.Color getBackgroundColor()
Gets background color.- Returns:
- background color.
-
getColor
public java.awt.Color getColor()
Gets the font color (for copy/paste operations).- Returns:
- Color font color
-
getColorString
public java.lang.String getColorString()
Gets a string describing the font's color (for saving in XML header).- Returns:
- String formatted string for font's color
-
getComments
public java.util.ArrayList<java.lang.String> getComments()
-
getFontDescriptors
public int getFontDescriptors()
Gets the font's descriptors (PLAN, BOLD, ITALIC).- Returns:
- int font descriptors
-
getFontName
public java.lang.String getFontName()
Gets the name (type) of the font.- Returns:
- String font name
-
getFontSize
public int getFontSize()
Returns the size of the font.- Returns:
- int font size
-
getLocationString
public java.lang.String getLocationString()
Gets a string describing the text location (in the slice, does not include which slice).- Returns:
- String formatted location string
-
getNote
public java.lang.String getNote()
Gets the contained note.- Returns:
- Contained note of the VOIText
-
getText
public java.lang.String getText()
Gets the displayed text.- Returns:
- String on-screen text
-
getTextFont
public java.awt.Font getTextFont()
Returns the Font.- Returns:
-
getTextWidth
public WildMagic.LibFoundation.Mathematics.Vector3f getTextWidth()
-
moveVOIPoint
public void moveVOIPoint(int xM, int yM, int zM)
Moves the point to the new location. NO bounds checking is performed- Parameters:
xM
- amount in pixels to move the line in the x directionyM
- amount in pixels to move the line in the y directionzM
- amount in pixels to move the line in the z directionxDim
- x dimension maximumyDim
- y dimension maximumzDim
- z dimension maximum
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color color)
Sets background color- Parameters:
color
-
-
setColor
public void setColor(java.awt.Color color)
Sets the color of the font.- Parameters:
color
- Color font color
-
setComments
public void setComments(java.lang.String comment)
-
setFontDescriptors
public void setFontDescriptors(int fontDescriptors)
Sets the font's descriptors.- Parameters:
fontDescriptors
- int font descriptors
-
setFontName
public void setFontName(java.lang.String fontName)
Sets the name (type) of the font.- Parameters:
fontName
- String font name
-
setFontSize
public void setFontSize(int fontSize)
Sets the size of the font.- Parameters:
fontSize
- int font size
-
setNote
public void setNote(java.lang.String noteString)
Sets the contained note.- Parameters:
noteString
- String note stored in VOIText
-
setText
public void setText(java.lang.String textString)
Sets the displayed text.- Parameters:
textString
- String text to be displayed
-
setTextFont
public void setTextFont(java.awt.Font font)
Sets Font.- Parameters:
font
-
-
setTextWidth
public void setTextWidth(WildMagic.LibFoundation.Mathematics.Vector3f kVolume)
-
setUseMarker
public void setUseMarker(boolean mark)
Sets the arrow to be on or off- Parameters:
mark
- whether to draw the arrow
-
getDisplay
public boolean getDisplay()
-
useMarker
public boolean useMarker()
gets whether or not the arrow should be drawn- Returns:
-
update
public void update(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
Description copied from class:VOIBase
Set the color of this contour.
-
updateText
public void updateText()
-
-