public class DrawingTool extends Object
Dataset
. Many
methods adapted from ImageJ1's ImageProcessor methods. Internally the drawing
routines work in a UV plane. U and V can be specified from existing coord
axes (i.e UV can equal XY or ZT or any other combination of Dataset axes that
do not involve the channel axis). It is the user's responsibility to avoid
using a single axis to specify both the U and V axes.Constructor and Description |
---|
DrawingTool(Dataset ds,
RenderingService service)
Creates a DrawingTool to modify a specified Dataset.
|
Modifier and Type | Method and Description |
---|---|
void |
drawDot(long u,
long v)
Draws a dot in the current UV plane at specified UV coordinates.
|
void |
drawLine(long u1,
long v1,
long u2,
long v2)
Draws a line from (u1,v1) to (u2,v2).
|
void |
drawPixel(long u,
long v)
Draws a pixel in the current UV plane at specified UV coordinates.
|
void |
drawRect(long uOrg,
long vOrg,
long w,
long h)
Draws the outline of a rectangle in the current UV plane.
|
void |
drawText(long anchorU,
long anchorV,
String text,
TextRenderer.TextJustification just)
Draws a line of text along the U axis
|
void |
fill()
Fills the current UV plane.
|
void |
fillCircle(long uc,
long vc)
Draws a filled circle in the current UV plane centered at the specified UV
coordinates.
|
void |
fillRect(long uOrigin,
long vOrigin,
long w,
long h)
Draws a filled rectangle in the current UV plane.
|
ChannelCollection |
getChannels() |
Dataset |
getDataset()
Return the Dataset associated with this DrawingTool.
|
TextRenderer.FontFamily |
getFontFamily()
Gets the family name of the drawing font.
|
int |
getFontSize()
Gets the size of the drawing font.
|
TextRenderer.FontStyle |
getFontStyle()
Gets the style of the drawing font.
|
long |
getLineWidth()
Gets the current drawing line width.
|
void |
getPosition(long[] position)
Gets this DrawingHelper's current drawing position.
|
boolean |
getTextAntialiasing()
Get the drawn text antialiasing value: on (true) or off (false)
|
int |
getUAxis()
Returns the index of the U axis of this Drawing Tool.
|
int |
getVAxis()
Returns the index of the V axis of this Drawing Tool.
|
void |
lineTo(long u1,
long v1)
Draws a line in the current UV plane from the current origin to the
specified coordinate.
|
void |
moveTo(long u,
long v)
Moves the drawing origin of the current UV plane to the specified
coordinates.
|
void |
setChannels(ChannelCollection chans) |
void |
setFontFamily(TextRenderer.FontFamily family)
Sets the family name of the drawing font.
|
void |
setFontSize(int size)
Sets the size of the drawing font.
|
void |
setFontStyle(TextRenderer.FontStyle style)
Sets the style of the drawing font.
|
void |
setLineWidth(long lineWidth)
Sets the current drawing line width.
|
void |
setPosition(long[] position)
Sets this DrawingHelper's current drawing position.
|
void |
setPreferredChannel(long channelNumber)
Set the preferred channel to draw on.
|
void |
setTextAntialiasing(boolean value)
Turns antialiasing of drawn text on (true) or off (false)
|
void |
setTextRenderer(TextRenderer renderer) |
void |
setUAxis(int axisNum)
Sets the U axis index this DrawingTool will work in.
|
void |
setVAxis(int axisNum)
Sets the V axis index this DrawingTool will work in.
|
public DrawingTool(Dataset ds, RenderingService service)
public void setPreferredChannel(long channelNumber)
channelNumber
- public Dataset getDataset()
public void setUAxis(int axisNum)
public int getUAxis()
public void setVAxis(int axisNum)
public int getVAxis()
public void setPosition(long[] position)
public void getPosition(long[] position)
public ChannelCollection getChannels()
public void setChannels(ChannelCollection chans)
public void setLineWidth(long lineWidth)
public long getLineWidth()
public void setTextRenderer(TextRenderer renderer)
public void setFontFamily(TextRenderer.FontFamily family)
public TextRenderer.FontFamily getFontFamily()
public void setFontStyle(TextRenderer.FontStyle style)
public TextRenderer.FontStyle getFontStyle()
public void setFontSize(int size)
public int getFontSize()
public void setTextAntialiasing(boolean value)
public boolean getTextAntialiasing()
public void drawPixel(long u, long v)
public void drawDot(long u, long v)
public void moveTo(long u, long v)
public void lineTo(long u1, long v1)
public void drawLine(long u1, long v1, long u2, long v2)
public void fillCircle(long uc, long vc)
public void drawRect(long uOrg, long vOrg, long w, long h)
public void fillRect(long uOrigin, long vOrigin, long w, long h)
public void fill()
public void drawText(long anchorU, long anchorV, String text, TextRenderer.TextJustification just)
Copyright © 2014–2022 ImageJ. All rights reserved.