public class TrianaImage extends TrianaType
NOT_CONNECTED, NOT_READY, OUT_OF_RANGE
Constructor and Description |
---|
TrianaImage()
Default constructor.
|
TrianaImage(java.awt.Image image)
Constructor for given image.
|
Modifier and Type | Method and Description |
---|---|
protected void |
copyData(TrianaType source)
Implement the abstract copyData method of TrianaType.
|
TrianaType |
copyMe()
This is one of the most important methods of Triana data.
|
java.awt.Image |
getImage() |
java.awt.Dimension |
getImageDimensions() |
javax.swing.JComponent |
getImageObs() |
void |
readObject(java.io.ObjectInputStream in)
Uses the default writer to input and create an object from the Object input stream.
|
void |
setImage(java.awt.Image image)
Put an image into the current object.
|
void |
writeObject(java.io.ObjectOutputStream out)
Uses the default writer to output this object to the given Object output stream.
|
containerSize, copyParameters, dataExists, deleteFromContainer, getDataContainer, getFromContainer, getSequenceNumber, insertIntoContainer, inspectDataContainer, setDataContainer, setSequenceNumber, updateObsoletePointers
public TrianaImage()
public TrianaImage(java.awt.Image image)
image
- The image to be held in the new TrianaImagepublic void setImage(java.awt.Image image)
image
- The image to be placed into this objectpublic java.awt.Image getImage()
public javax.swing.JComponent getImageObs()
public java.awt.Dimension getImageDimensions()
public TrianaType copyMe()
To override, the programmer should not invoke the super.copyMe method. Instead, create an object of the current type and call methods copyData and copyParameters. If these have been written correctly, then they will do the copying. The code should createTool, for type YourType:
YourType y = null; try { y = (YourType)getClass().newInstance(); y.copyData( this ); y.copyParameters( this ); y.setLegend( this.getLegend() ); } catch (IllegalAccessException ee) { System.out.println("Illegal Access: " + ee.getMessage()); } catch (InstantiationException ee) { System.out.println("Couldn't be instantiated: " + ee.getMessage()); } return y;
The copied object's data should be identical to the original. The method here modifies only one item: a String indicating that the object was created as a copy is added to the description StringVector.
copyMe
in class TrianaType
protected void copyData(TrianaType source)
copyData
in class TrianaType
source
- The TrianaImage whose image is being copiedpublic void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
out
- The stream to write tojava.io.IOException
public void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- The stream to createTool fromjava.io.IOException
java.lang.ClassNotFoundException