|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.gui.visualize.JComponentWriter
public abstract class JComponentWriter
This class takes any JComponent and outputs it to a file. Scaling is by default enabled.
#setScalingEnabled()
Constructor Summary | |
---|---|
JComponentWriter()
initializes the object |
|
JComponentWriter(javax.swing.JComponent c)
initializes the object with the given Component |
|
JComponentWriter(javax.swing.JComponent c,
java.io.File f)
initializes the object with the given Component and filename |
Method Summary | |
---|---|
javax.swing.JComponent |
getComponent()
returns the component that is stored in the output format |
java.lang.String |
getDescription()
returns the name of the writer, to display in the FileChooser. |
java.lang.String |
getExtension()
returns the extension (incl. |
java.io.File |
getFile()
returns the file being used for storing the output |
boolean |
getScalingEnabled()
whether scaling is enabled or ignored |
double |
getXScale()
returns the scale factor for the x-axis |
double |
getYScale()
returns the scale factor for the y-axis |
void |
setComponent(javax.swing.JComponent c)
sets the component to print to an output format |
void |
setFile(java.io.File f)
sets the file to store the output in |
void |
setScale(double x,
double y)
sets the scale factor - is ignored since we always create a screenshot! |
void |
setScalingEnabled(boolean enabled)
sets whether to enable scaling |
void |
toOutput()
saves the current component to the currently set file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JComponentWriter()
public JComponentWriter(javax.swing.JComponent c)
c
- the component to print in the output formatpublic JComponentWriter(javax.swing.JComponent c, java.io.File f)
c
- the component to print in the output formatf
- the file to store the output inMethod Detail |
---|
public void setComponent(javax.swing.JComponent c)
public javax.swing.JComponent getComponent()
public void setFile(java.io.File f)
public java.io.File getFile()
public java.lang.String getDescription()
public java.lang.String getExtension()
public boolean getScalingEnabled()
public void setScalingEnabled(boolean enabled)
public void setScale(double x, double y)
x
- the scale factor for the x-axisy
- the scale factor for the y-axispublic double getXScale()
public double getYScale()
public void toOutput() throws java.lang.Exception
Note: this method has to be overriden in subclasses!
java.lang.Exception
- if either the file or the component is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |