|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.xdoc.fig.FigureIcon
public abstract class FigureIcon
Base class for drawings.
As well as implementing Icon
it provides some
utility methods for output.
Constructor Summary | |
---|---|
protected |
FigureIcon(Rectangle bounds)
Constructor. |
Method Summary | |
---|---|
void |
display()
Displays the figure in a Swing window. |
protected abstract void |
doDrawing(Graphics2D g2)
Implement this method to draw the figure content. |
void |
exportEps(OutputStream out)
Exports the currently displayed plot to encapsulated postscript. |
void |
exportImageIO(String formatName,
boolean transparent,
OutputStream out)
Exports this figure to an output stream using the ImageIO framework. |
void |
exportPdf(OutputStream out)
Exports the currently displayed plot to PDF. |
Rectangle |
getBounds()
Returns the bounds for this figure. |
int |
getIconHeight()
|
int |
getIconWidth()
|
static void |
main(String[] args)
Main method. |
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
|
static int |
runMain(String[] args,
FigureIcon fig)
Does the work for the main(java.lang.String[]) method. |
void |
setBounds(Rectangle bounds)
Sets the bounds for this figure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected FigureIcon(Rectangle bounds)
bounds
- of imageMethod Detail |
---|
protected abstract void doDrawing(Graphics2D g2)
g2
- graphics contextpublic void setBounds(Rectangle bounds)
bounds
- new boundspublic Rectangle getBounds()
public int getIconWidth()
getIconWidth
in interface Icon
public int getIconHeight()
getIconHeight
in interface Icon
public void paintIcon(Component c, Graphics g, int x, int y)
paintIcon
in interface Icon
public void display()
public void exportEps(OutputStream out) throws IOException
out
- destination stream for the EPS
IOException
public void exportPdf(OutputStream out) throws IOException
out
- destination stream for the PDF
IOException
public void exportImageIO(String formatName, boolean transparent, OutputStream out) throws IOException
formatName
- ImageIO format nametransparent
- true iff image will have a transparent backgroundout
- destination output stream; will not be closed
IOException
public static int runMain(String[] args, FigureIcon fig) throws IOException
main(java.lang.String[])
method.
args
- argument vectorfig
- optional FigureIcon instance to draw; if null the
class name must be supplied on the command line
IOException
public static void main(String[] args) throws IOException
-help
flag for usage.
args
- argument vector
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |