sub_arctic.style
Class styled_image

java.lang.Object
  |
  +--sub_arctic.output.loaded_image
        |
        +--sub_arctic.style.styled_image

public class styled_image
extends loaded_image

A subclass of loaded image which keeps additional information from the style system allowing it to be recreated under a new style ("restyled").

See Also:
Serialized Form

Field Summary
protected  style _creating_style
          The style this image was originally created with.
protected  int _index
          The index of this image within its image set (if any).
protected  boolean _locked
          Whether the image is locked -- that is whether it will ignore attempted style changes.
protected  java.lang.Object[] _parameters
          The parameters which were passed to a composer to construct this image (or null if the image was not constructed).
protected  style_resource_desig _style_desig
          The style resource designator cooresponding to the type of resource this image is, or the composer object which created it.
 
Fields inherited from class sub_arctic.output.loaded_image
_image, _is_loaded
 
Constructor Summary
styled_image(java.awt.Image img)
          Construct from an Image (this image is marked as not loaded yet).
styled_image(java.awt.Image img, style stl, java.lang.String des, java.lang.Object[] parms, int indx)
          Construct from an Image (this image is marked as not loaded yet).
styled_image(java.awt.Image img, style stl, style_resource_desig des, java.lang.Object[] parms, int indx)
          Construct from an Image (this image is marked as not loaded yet).
styled_image(int[] data, int w, int h)
          Construct from in memory data.
styled_image(int[] data, int w, int h, style stl, java.lang.String des, java.lang.Object[] parms, int indx)
          Construct from in memory data.
styled_image(int[] data, int w, int h, style stl, style_resource_desig des, java.lang.Object[] parms, int indx)
          Construct from in memory data.
styled_image(int w, int h)
          Construct a blank in memory image of the given size and force it to be "loaded" (not clear what that means for in-memory images, but it seems to be required).
styled_image(int w, int h, style stl, java.lang.String des, java.lang.Object[] parms, int indx)
          Construct a blank in memory image of the given size and force it to be "loaded" (not clear what that means for in-memory images, but it seems to be required).
styled_image(int w, int h, style stl, style_resource_desig des, java.lang.Object[] parms, int indx)
          Construct a blank in memory image of the given size and force it to be "loaded" (not clear what that means for in-memory images, but it seems to be required).
styled_image(loaded_image img)
          Construct from a loaded image
styled_image(loaded_image img, style stl, java.lang.String des, java.lang.Object[] parms, int indx)
          Construct from a loaded image
styled_image(loaded_image img, style stl, style_resource_desig des, java.lang.Object[] parms, int indx)
          Construct from a loaded image
 
Method Summary
 style creating_style()
          The style this image was originally created with.
 int index()
          The index of this image within its image set (if any).
 void lock()
          Lock the image.
 boolean locked()
          Whether the image is locked -- that is whether it will ignore attempted style changes.
 java.lang.Object[] parameters()
          The parameters which were passed to a composer to construct this image (or null if the image was not constructed).
 styled_image restyle(style under_new_style)
          Create a new image which is a restyling of this one.
 void set_creating_style(style stl)
          Set the style which created this image.
 void set_index(int indx)
          Set the index of this image within its image set (if any).
 void set_locked(boolean val)
          Set whether the image is locked -- that is whether it will ignore attempted style changes.
 void set_parameters(java.lang.Object[] parms)
          Set the parameters which were passed to a composer to construct this image (or null if the image was not constructed).
 void set_style_desig(style_resource_desig des)
          Set the style resource designator cooresponding to the type of resource this image is, or the composer object which created it.
 style_resource_desig style_desig()
          The style resource designator cooresponding to the type of resource this image is, or the composer object which created it.
 void unlock()
          Unlock the image.
 
Methods inherited from class sub_arctic.output.loaded_image
get_drawable, height, image_from_intensity_map, image, is_loaded, raw_image, set_is_loaded, width
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_creating_style

protected style _creating_style
The style this image was originally created with.

_style_desig

protected style_resource_desig _style_desig
The style resource designator cooresponding to the type of resource this image is, or the composer object which created it.

_parameters

protected java.lang.Object[] _parameters
The parameters which were passed to a composer to construct this image (or null if the image was not constructed).

_index

protected int _index
The index of this image within its image set (if any). This is only used if the style resource designator refers to a composer set, hence we were created as part of a set.

_locked

protected boolean _locked
Whether the image is locked -- that is whether it will ignore attempted style changes. Initially images are unlocked.
See Also:
lock(), unlock()
Constructor Detail

styled_image

public styled_image(loaded_image img)
Construct from a loaded image
Parameters:
loaged_image - img the image to copy from

styled_image

public styled_image(java.awt.Image img)
Construct from an Image (this image is marked as not loaded yet).
Parameters:
Image - img the Image to create the loaded_image from

styled_image

public styled_image(int w,
                    int h)
Construct a blank in memory image of the given size and force it to be "loaded" (not clear what that means for in-memory images, but it seems to be required). The image is filled with the systems default background color.
Parameters:
int - w the width of the image in pixels.
int - h the height of the image in pixels.

styled_image

public styled_image(int[] data,
                    int w,
                    int h)
Construct from in memory data. This image is marked as unloaded.
Parameters:
int[] - the data to build the image from
int - w the width of the image
int - h the height of the image

styled_image

public styled_image(loaded_image img,
                    style stl,
                    style_resource_desig des,
                    java.lang.Object[] parms,
                    int indx)
Construct from a loaded image
Parameters:
loaged_image - img the image to copy from
style - stl the style that created this image
style_resource_desig - des the resource designator for this image, or the composer that created it.
Object[] - parms the parameters passed to a composer to create this image (or null if this image was not created by a composer).
int - indx index of this image within a style created image set (ignored if this image is not from a set).

styled_image

public styled_image(java.awt.Image img,
                    style stl,
                    style_resource_desig des,
                    java.lang.Object[] parms,
                    int indx)
Construct from an Image (this image is marked as not loaded yet).
Parameters:
Image - img the Image to create the loaded_image from
style - stl the style that created this image
style_resource_desig - des the resource designator for this image, or the composer that created it.
Object[] - parms the parameters passed to a composer to create this image (or null if this image was not created by a composer).
int - indx index of this image within a style created image set (ignored if this image is not from a set).

styled_image

public styled_image(int w,
                    int h,
                    style stl,
                    style_resource_desig des,
                    java.lang.Object[] parms,
                    int indx)
Construct a blank in memory image of the given size and force it to be "loaded" (not clear what that means for in-memory images, but it seems to be required). The image is filled with the systems default background color.
Parameters:
int - w the width of the image in pixels.
int - h the height of the image in pixels.
style - stl the style that created this image
style_resource_desig - des the resource designator for this image, or the composer that created it.
Object[] - parms the parameters passed to a composer to create this image (or null if this image was not created by a composer).
int - indx index of this image within a style created image set (ignored if this image is not from a set).

styled_image

public styled_image(int[] data,
                    int w,
                    int h,
                    style stl,
                    style_resource_desig des,
                    java.lang.Object[] parms,
                    int indx)
Construct from in memory data. This image is marked as unloaded.
Parameters:
int[] - the data to build the image from
int - w the width of the image
int - h the height of the image
style - stl the style that created this image
style_resource_desig - des the resource designator for this image, or the composer that created it.
Object[] - parms the parameters passed to a composer to create this image (or null if this image was not created by a composer).
int - indx index of this image within a style created image set (ignored if this image is not from a set).

styled_image

public styled_image(loaded_image img,
                    style stl,
                    java.lang.String des,
                    java.lang.Object[] parms,
                    int indx)
Construct from a loaded image
Parameters:
loaged_image - img the image to copy from
style - stl the style that created this image
String - des the resource designator name for this image, or the composer that created it.
Object[] - parms the parameters passed to a composer to create this image (or null if this image was not created by a composer).
int - indx index of this image within a style created image set (ignored if this image is not from a set).

styled_image

public styled_image(java.awt.Image img,
                    style stl,
                    java.lang.String des,
                    java.lang.Object[] parms,
                    int indx)
Construct from an Image (this image is marked as not loaded yet).
Parameters:
Image - img the Image to create the loaded_image from
style - stl the style that created this image
String - des the resource designator name for this image, or the composer that created it.
Object[] - parms the parameters passed to a composer to create this image (or null if this image was not created by a composer).
int - indx index of this image within a style created image set (ignored if this image is not from a set).

styled_image

public styled_image(int w,
                    int h,
                    style stl,
                    java.lang.String des,
                    java.lang.Object[] parms,
                    int indx)
Construct a blank in memory image of the given size and force it to be "loaded" (not clear what that means for in-memory images, but it seems to be required). The image is filled with the systems default background color.
Parameters:
int - w the width of the image in pixels.
int - h the height of the image in pixels.
style - stl the style that created this image
String - des the resource designator name for this image, or the composer that created it.
Object[] - parms the parameters passed to a composer to create this image (or null if this image was not created by a composer).
int - indx index of this image within a style created image set (ignored if this image is not from a set).

styled_image

public styled_image(int[] data,
                    int w,
                    int h,
                    style stl,
                    java.lang.String des,
                    java.lang.Object[] parms,
                    int indx)
Construct from in memory data. This image is marked as unloaded.
Parameters:
int[] - the data to build the image from
int - w the width of the image
int - h the height of the image
style - stl the style that created this image
String - des the resource designator for this image, or the composer that created it.
Object[] - parms the parameters passed to a composer to create this image (or null if this image was not created by a composer).
int - indx index of this image within a style created image set (ignored if this image is not from a set).
Method Detail

creating_style

public style creating_style()
The style this image was originally created with.
Returns:
style the style that created this image

set_creating_style

public void set_creating_style(style stl)
Set the style which created this image. Note: this does not change the image itself. To create a new image under a new style, use restyle().
Parameters:
style - stl the style that created this image
See Also:
restyle(sub_arctic.style.style)

style_desig

public style_resource_desig style_desig()
The style resource designator cooresponding to the type of resource this image is, or the composer object which created it.
Returns:
style_resource_desig designator cooresponding to this image

set_style_desig

public void set_style_desig(style_resource_desig des)
Set the style resource designator cooresponding to the type of resource this image is, or the composer object which created it.
Parameters:
style_resource_desig - des the new designator.

parameters

public java.lang.Object[] parameters()
The parameters which were passed to a composer to construct this image (or null if the image was not constructed).
Returns:
Object[] the parameters

set_parameters

public void set_parameters(java.lang.Object[] parms)
Set the parameters which were passed to a composer to construct this image (or null if the image was not constructed).
Parameters:
Object[] - parms the parameters

index

public int index()
The index of this image within its image set (if any). This is only used if the style resource designator refers to a composer set, hence we were created as part of a set.
Returns:
int the index value

set_index

public void set_index(int indx)
Set the index of this image within its image set (if any). This is only meaningful if the style resource designator refers to a composer set, hence we were created as part of a set.
Parameters:
int - indx the new index value

locked

public boolean locked()
Whether the image is locked -- that is whether it will ignore attempted style changes. Initially images are unlocked.
Returns:
boolean indicating style lock status
See Also:
lock(), unlock()

set_locked

public void set_locked(boolean val)
Set whether the image is locked -- that is whether it will ignore attempted style changes. Initially images are unlocked.
Parameters:
boolean - indicating new style lock status
See Also:
lock(), unlock()

lock

public void lock()
Lock the image. This will cause future style changes (calls to restyle()) to be ignored. This is used, for example, if you want the image to be immune to global style changes. This is the same as set_locked(true);
See Also:
restyle(sub_arctic.style.style), set_locked(boolean)

unlock

public void unlock()
Unlock the image. This will cause future style changes (calls to restyle()) to again have their normal effect. This is the same as set_locked(false);
See Also:
restyle(sub_arctic.style.style), set_locked(boolean)

restyle

public styled_image restyle(style under_new_style)
Create a new image which is a restyling of this one. This uses the additional bookkeeping attached to the image to reconstruct how it was created and perform equivalent steps under a new style. If the image is locked, or for some reason the new style can't create the image (this shouldn't happen if the style was complete and properly constucted styles, but...), then the image itself is returned rather than a new image.
Parameters:
style - under_new_style the new style we want the image created by
Returns:
styled_image the restyled image