com.neuron.app.tonto
Class CCF

java.lang.Object
  extended by com.neuron.app.tonto.CCF
All Implemented Interfaces:
ICCFProvider

public class CCF
extends java.lang.Object
implements ICCFProvider

The starting point for manipulating Pronto CCF files. It is important to note that several of the data structures use linked lists. The API's expose getters and setters for the first element in the list, but it is up to you to maintain the integrity of the lists. When you replace the first item in the list, you are effectively replacing the entire list.


Constructor Summary
CCF()
          Create new in-memory CCF File for TS1000.
CCF(ProntoModel model)
          Create new in-memory CCF File.
 
Method Summary
 void appendDevice(CCFDevice dev)
          Add a device to the end of the normal device list.
 void appendHomeDevice(CCFDevice dev)
          Add a device to the end of the home device list.
 void appendMacroDevice(CCFDevice dev)
          Add a device to the end of the macro device list.
 CCF ccf()
           
 void conformTo(ProntoModel model)
          Enforce that the CCF will conform to the requirements of a specific Pronto/Marantz model.
 CCFDevice createDevice()
          Create a new Device
 CCFDevice createDevice(java.lang.String name)
          Create a new Device
 CCFIRCode createIRCode(java.lang.String code)
           
 void decode(byte[] b)
          Decode CCF from it's raw byte representation.
 byte[] encode()
          Encode the ccf into it's raw byte representation.
 ProntoModel[] getConformsMatch()
           
 ProntoModel getConformsTo(ProntoModel def)
           
 CCFDevice getDeviceByName(java.lang.String name)
          Return the first Device with the specified name.
 CCFPanel getDeviceTemplate()
          Get custom device template.
 CCFDevice getFirstDevice()
          Return the first regular Device.
 CCFDevice getFirstHomeDevice()
          Return the first Home Device.
 CCFDevice getFirstMacroDevice()
          Return the first macro Device.
 com.neuron.app.tonto.CCFNodeState getLastNodeState()
           
 CCFPanel getMacroPanel()
          Get macro edit panel.
 CCFPanel getMacroTemplate()
          Get custom macro template.
 CCFPanel getMasterTemplate()
          Get custom master template.
 ProntoModel getModel()
           
 java.util.Date getModifiedDate()
          Return the modification date.
 java.awt.Dimension getScreenSize()
           
 java.awt.Dimension getScreenSize(java.awt.Dimension def)
           
 java.awt.Dimension getScreenSize(ProntoModel def)
           
 CCFColor getTransparentColor()
           
 java.lang.String getVersionString()
          Return the version identifier.
 boolean isColor()
           
 boolean isConfigReadOnly()
          Returns true if this configuration is read only.
 boolean isFactoryCCF()
          Returns true if this configuration is a factory default.
 boolean isHomeReadOnly()
          Returns true if the home panel is read only.
 boolean isTransparentColor(CCFColor color)
           
 void load(java.lang.String file)
          Read CCF image from file.
 byte[] loadBytesFromPronto()
          Read raw CCF image from Pronto.
 void loadFromPronto()
          Read CCF image from Pronto.
 void merge(CCF c)
          Merge another CCF into this one by appending all devices from the merged CCF.
 void save(java.lang.String file)
          Save CCF image to named file.
 void saveToPronto()
          Save CCF image to Pronto.
 void saveToPronto(com.neuron.app.tonto.Comm c)
          Save CCF image to Pronto.
 void setConfigReadOnly(boolean flag)
          Sets the configuration read only flag.
 void setFactoryCCF(boolean flag)
          Sets the configuration as factory default.
 void setFirstDevice(CCFDevice dev)
          Set the first regular Device.
 void setFirstHomeDevice(CCFDevice dev)
          Set the first Home Device.
 void setFirstMacroDevice(CCFDevice dev)
          Set the first macro Device.
 void setHomeReadOnly(boolean flag)
          Sets the home panel read only flag.
 void setModified()
          Update the modification date.
 void setModifiedDate(java.util.Date date)
          Set the modification date.
 void setNotify(ITaskStatus status)
           
 void setScreenSize(int w, int h)
           
 void setTransparentColor(CCFColor color)
           
 void setUseRemoteCapability(boolean tf)
           
 void setVersionString(java.lang.String ver)
          Set the version identifier.
 java.lang.String toString()
           
 boolean usesRemoteCapability()
           
 boolean usesUDB()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CCF

public CCF()
Create new in-memory CCF File for TS1000.


CCF

public CCF(ProntoModel model)
Create new in-memory CCF File.

Method Detail

ccf

public CCF ccf()
Specified by:
ccf in interface ICCFProvider

usesUDB

public boolean usesUDB()

isColor

public boolean isColor()

usesRemoteCapability

public boolean usesRemoteCapability()

setUseRemoteCapability

public void setUseRemoteCapability(boolean tf)

getLastNodeState

public com.neuron.app.tonto.CCFNodeState getLastNodeState()

createIRCode

public CCFIRCode createIRCode(java.lang.String code)

setScreenSize

public void setScreenSize(int w,
                          int h)

getScreenSize

public java.awt.Dimension getScreenSize()

getScreenSize

public java.awt.Dimension getScreenSize(java.awt.Dimension def)

getTransparentColor

public CCFColor getTransparentColor()

setTransparentColor

public void setTransparentColor(CCFColor color)

isTransparentColor

public boolean isTransparentColor(CCFColor color)

getScreenSize

public java.awt.Dimension getScreenSize(ProntoModel def)

conformTo

public void conformTo(ProntoModel model)
Enforce that the CCF will conform to the requirements of a specific Pronto/Marantz model. This ensures that the remote will not report an 'Invalid Configuration' when the new image is downloaded.


getConformsTo

public ProntoModel getConformsTo(ProntoModel def)

getModel

public ProntoModel getModel()

getConformsMatch

public ProntoModel[] getConformsMatch()

load

public void load(java.lang.String file)
          throws java.io.IOException
Read CCF image from file.

Parameters:
file - name of file to read
Throws:
java.io.IOException

decode

public void decode(byte[] b)
Decode CCF from it's raw byte representation.


loadFromPronto

public void loadFromPronto()
                    throws java.lang.Exception
Read CCF image from Pronto.

Throws:
java.lang.Exception

loadBytesFromPronto

public byte[] loadBytesFromPronto()
                           throws java.lang.Exception
Read raw CCF image from Pronto.

Throws:
java.lang.Exception

save

public void save(java.lang.String file)
          throws java.io.IOException
Save CCF image to named file.

Parameters:
file - name of file to write image to
Throws:
java.io.IOException

encode

public byte[] encode()
              throws java.io.IOException
Encode the ccf into it's raw byte representation.

Throws:
java.io.IOException

saveToPronto

public void saveToPronto()
                  throws java.lang.Exception
Save CCF image to Pronto.

Throws:
java.lang.Exception

saveToPronto

public void saveToPronto(com.neuron.app.tonto.Comm c)
                  throws java.lang.Exception
Save CCF image to Pronto.

Throws:
java.lang.Exception

getFirstHomeDevice

public CCFDevice getFirstHomeDevice()
Return the first Home Device.


setFirstHomeDevice

public void setFirstHomeDevice(CCFDevice dev)
Set the first Home Device.


getFirstDevice

public CCFDevice getFirstDevice()
Return the first regular Device.


getDeviceByName

public CCFDevice getDeviceByName(java.lang.String name)
Return the first Device with the specified name.

Parameters:
name - name of device to locate.

createDevice

public CCFDevice createDevice()
Create a new Device


createDevice

public CCFDevice createDevice(java.lang.String name)
Create a new Device


setFirstDevice

public void setFirstDevice(CCFDevice dev)
Set the first regular Device.


getFirstMacroDevice

public CCFDevice getFirstMacroDevice()
Return the first macro Device.


setFirstMacroDevice

public void setFirstMacroDevice(CCFDevice dev)
Set the first macro Device.


getMacroPanel

public CCFPanel getMacroPanel()
Get macro edit panel.


getMasterTemplate

public CCFPanel getMasterTemplate()
Get custom master template.


getDeviceTemplate

public CCFPanel getDeviceTemplate()
Get custom device template.


getMacroTemplate

public CCFPanel getMacroTemplate()
Get custom macro template.


appendHomeDevice

public void appendHomeDevice(CCFDevice dev)
Add a device to the end of the home device list.


appendDevice

public void appendDevice(CCFDevice dev)
Add a device to the end of the normal device list.


appendMacroDevice

public void appendMacroDevice(CCFDevice dev)
Add a device to the end of the macro device list.


setNotify

public void setNotify(ITaskStatus status)

merge

public void merge(CCF c)
Merge another CCF into this one by appending all devices from the merged CCF.


getVersionString

public java.lang.String getVersionString()
Return the version identifier.


setVersionString

public void setVersionString(java.lang.String ver)
Set the version identifier.


getModifiedDate

public java.util.Date getModifiedDate()
Return the modification date.


setModifiedDate

public void setModifiedDate(java.util.Date date)
Set the modification date.


setModified

public void setModified()
Update the modification date.


isFactoryCCF

public boolean isFactoryCCF()
Returns true if this configuration is a factory default.


isConfigReadOnly

public boolean isConfigReadOnly()
Returns true if this configuration is read only.


isHomeReadOnly

public boolean isHomeReadOnly()
Returns true if the home panel is read only.


setFactoryCCF

public void setFactoryCCF(boolean flag)
Sets the configuration as factory default.

Parameters:
flag - new status of the factory flag

setConfigReadOnly

public void setConfigReadOnly(boolean flag)
Sets the configuration read only flag.

Parameters:
flag - new status of the config read only flag

setHomeReadOnly

public void setHomeReadOnly(boolean flag)
Sets the home panel read only flag.

Parameters:
flag - new status of the home panel read only flag

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object