public class FITSGraphics extends Object
Modifier and Type | Field and Description |
---|---|
protected CanvasDraw |
canvasDraw
User interface object managing a list of graphics objects.
|
protected DivaImageGraphics |
graphics
Object managing image graphics
|
protected DivaMainImageDisplay |
imageDisplay
The target image display.
|
protected SelectionInteractor |
interactor
Handles selections for graphics objects.
|
protected static int[] |
PATTERNS
Maps a skycat pattern (pat0..15) index to CanvasDraw composite index
|
Constructor and Description |
---|
FITSGraphics(DivaMainImageDisplay imageDisplay)
Initialize with the image display object.
|
Modifier and Type | Method and Description |
---|---|
void |
deleteHDU(String extName)
Delete the table HDU with the given name, if found.
|
protected Color |
getColor(String s)
Return a color for the given name
|
protected String |
getColorName(Color c)
Return the name of the given color
|
protected Composite |
getComposite(String s)
Return a composite for the given composite string as defined in CanvasDraw (0%,100%).
|
protected String |
getCompositeName(Composite composite)
Return the name corresponding to the given composite.
|
protected String |
getConfig(Paint fill,
Paint outline,
int lineWidth,
Composite composite)
Return a Tcl formatted list of Tk canvas item style configuration options
and values for the given arguments.
|
protected String |
getConfig(String text,
Font font,
Paint fill)
Return a Tcl formatted list of Tk canvas item style configuration options
and values for the given arguments.
|
protected String |
getCoords(Point2D.Double p)
Return a Tcl formatted list of two image coordinate values
for the given screen coordinate point.
|
protected String |
getCoords(Shape shape)
Return a Tcl formatted list of image coordinate values
for the given screen coordinate shape.
|
protected double[] |
getCoords(String[] coords)
Convert the given String formatted image coords to doubles in screen coords and
return the new array.
|
protected Font |
getFont(String s)
Return a font for the given name
|
protected Composite |
getStipple(String s)
Return a composite for the given skycat stipple name (pat0..pat15)
|
protected String |
getType(Shape shape)
Return the Tk canvas item type name corresponding to the given shape.
|
void |
loadGraphicsFromImage(String extName)
If a binary table with the given name is found in the current image,
load the previously saved image graphics from it.
|
void |
loadGraphicsFromImage(TableHDU hdu)
Load previously saved graphics from the given FITS binary table.
|
void |
saveGraphicsWithImage(String extName)
Save the current image graphics to a binary FITS table with the given name
in the current image.
|
protected DivaMainImageDisplay imageDisplay
protected DivaImageGraphics graphics
protected CanvasDraw canvasDraw
protected SelectionInteractor interactor
protected static final int[] PATTERNS
public FITSGraphics(DivaMainImageDisplay imageDisplay)
imageDisplay
- used to access the JCanvas and DivaImageGraphics objectspublic void saveGraphicsWithImage(String extName) throws FitsException
FitsException
public void loadGraphicsFromImage(String extName)
public void loadGraphicsFromImage(TableHDU hdu) throws FitsException
FitsException
public void deleteHDU(String extName)
protected double[] getCoords(String[] coords)
protected Composite getStipple(String s)
protected Composite getComposite(String s)
protected String getCompositeName(Composite composite)
protected String getType(Shape shape)
protected String getCoords(Shape shape)
protected String getCoords(Point2D.Double p)
protected String getConfig(Paint fill, Paint outline, int lineWidth, Composite composite)
Example "{-fill red} {-outline black} {-width 2} {-composite 20%}"
Note: the return value is Tk canvas "style", but may contain other options, such as -composite.
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.