Overview  Package   Class  Tree  Index 

be.lassi.domain
Class Fixture

java.lang.Object
  extended by be.lassi.domain.Fixture
All Implemented Interfaces:
java.lang.Iterable<Attribute>

public class Fixture
extends java.lang.Object
implements java.lang.Iterable<Attribute>

Represents a single fixture with a given fixture address and current state of the fixture attributes.


Constructor Summary
Fixture(FixtureDefinition definition)
          Constructs a new instance.
Fixture(FixtureDefinition definition, java.lang.String name, int address)
          Constructs a new instance.
 
Method Summary
 boolean equals(java.lang.Object object)
          
 int getAddress()
          Gets the fixture dmx address.
 Attribute getAttribute(int index)
          Gets the fixture attribute at given index.
 Attribute getAttribute(java.lang.String attributeName)
          Gets the attribute with given name.
 int getAttributeCount()
          Gets the number of attributes.
 int getChannelNumber(java.lang.String string)
          Gets the dmx channel number of the attribute with given name.
 FixtureDefinition getDefinition()
          Gets the fixture definition.
 int getMaxChannelNumber()
          Gets the highest dmx channel number that is used by this fixture.
 java.lang.String getName()
          Gets the fixture name.
 Preset getPreset(java.lang.String presetName)
          Gets the preset with given name.
 int hashCode()
          
 int indexOfAttribute(Attribute attribute)
          Gets the index of given attribute.
 void initPresets()
          Initializes the fixture presets.
 boolean isSelected()
          Indicates whether this fixture is selected.
 java.util.Iterator<Attribute> iterator()
          
 void setAddress(int address)
          Sets the fixture dmx address.
 void setName(java.lang.String name)
          Sets the fixture name.
 void setSelected(boolean selected)
          Sets the 'selected' indicator.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Fixture

public Fixture(FixtureDefinition definition)
Constructs a new instance.

Parameters:
definition - the fixture definition.

Fixture

public Fixture(FixtureDefinition definition,
               java.lang.String name,
               int address)
Constructs a new instance.

Parameters:
definition - the fixture definition
name - the fixture name
address - the fixture address (0 if not patched)
Method Detail

equals

public boolean equals(java.lang.Object object)

Overrides:
equals in class java.lang.Object

getAddress

public int getAddress()
Gets the fixture dmx address.

Returns:
the fixture dmx address, 0 if the fixture is not patched

getAttribute

public Attribute getAttribute(int index)
Gets the fixture attribute at given index.

Parameters:
index - the attribute index
Returns:
the attribute at given index

getAttribute

public Attribute getAttribute(java.lang.String attributeName)
Gets the attribute with given name.

Parameters:
attributeName - the attribute name
Returns:
the attribute with given name

getAttributeCount

public int getAttributeCount()
Gets the number of attributes.

Returns:
the attribute count

getChannelNumber

public int getChannelNumber(java.lang.String string)
Gets the dmx channel number of the attribute with given name.

Parameters:
string - the attribute name
Returns:
the dmx channel number

getDefinition

public FixtureDefinition getDefinition()
Gets the fixture definition.

Returns:
the fixture definition

getMaxChannelNumber

public int getMaxChannelNumber()
Gets the highest dmx channel number that is used by this fixture.

Returns:
the highest dmx channel number

getName

public java.lang.String getName()
Gets the fixture name.

Returns:
the fixture name

getPreset

public Preset getPreset(java.lang.String presetName)
Gets the preset with given name.

Parameters:
presetName - the preset name
Returns:
the preset with given name

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

indexOfAttribute

public int indexOfAttribute(Attribute attribute)
Gets the index of given attribute.

Parameters:
attribute - the attribute for which to return the index
Returns:
the attribute index

initPresets

public void initPresets()
Initializes the fixture presets.


isSelected

public boolean isSelected()
Indicates whether this fixture is selected.

Returns:
true if selected

iterator

public java.util.Iterator<Attribute> iterator()

Specified by:
iterator in interface java.lang.Iterable<Attribute>

setAddress

public void setAddress(int address)
Sets the fixture dmx address.

Parameters:
address - the fixture dmx address, 0 if the fixture is not patched

setName

public void setName(java.lang.String name)
Sets the fixture name.

Parameters:
name - the fixture name

setSelected

public void setSelected(boolean selected)
Sets the 'selected' indicator.

Parameters:
selected - true if this fixture is selected

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

Overview  Package   Class  Tree  Index 
Lighting Assistant 1.2