org.rubato.rubettes.wallpaper
Class WallpaperRubette

java.lang.Object
  extended by org.rubato.base.AbstractRubette
      extended by org.rubato.rubettes.wallpaper.WallpaperRubette
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, Rubette

public class WallpaperRubette
extends AbstractRubette
implements java.awt.event.ActionListener

A rubette that creates a wallpaper using an input power denotator and a number of morphisms.

Author:
Florian Thalmann

Constructor Summary
WallpaperRubette()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Processes the events comming from the selectForm and the buttons in the properties window.
 boolean applyProperties()
          Applies the changes of the morphisms table and the rubette properties
 Rubette duplicate()
          Creates a duplicate from this rubette instance.
 Rubette fromXML(XMLReader reader, org.w3c.dom.Element element)
          Creates a rubette from an XML description starting with element.
 java.lang.String getGroup()
          Returns the fact that WallpaperRubette belongs to the core rubettes
 java.lang.String getInfo()
          Returns the info string for the info label.
 java.lang.String getInTip(int i)
          Returns the tooltip for the input connector number i.
 java.lang.String getLongDescription()
          Returns a long description.
 JWallpaperDimensionsTable getMorphismsTable()
          Returns the table with all morphisms and their characteristics for the wallpaper
 java.lang.String getName()
          Returns the name of this rubette
 java.lang.String getOutTip(int i)
          Returns the tooltip for the output connector number i.
 javax.swing.JComponent getProperties()
          Returns the properties panel for wallpaper specification
 java.lang.String getShortDescription()
          Returns a short description.
 java.util.List<java.util.List<java.lang.Integer>> getSimpleFormPaths()
          Returns all paths belonging to the simple forms returned by getSimpleForms().
 java.util.List<SimpleForm> getSimpleForms()
          Returns all SimpleForms located in this input form (dynamically changed).
 javax.swing.JComponent getView()
          Returns the Swing component for the view.
 boolean hasInfo()
          Returns true iff this Rubette has an info label.
 boolean hasProperties()
          Returns the fact that this rubette has properties
 boolean hasView()
          Returns true iff this Rubette has a view.
 void init()
          Defines one input and one output.
 Rubette newInstance()
          Creates a standard instance of WallpaperRubette
 void revertProperties()
          Reverts this properties and the changes to this morphism table.
 void run(RunInfo runInfo)
          Called when the Rubette is run.
 void toXML(XMLWriter writer)
          Writes an XML description of this rubette.
 
Methods inherited from class org.rubato.base.AbstractRubette
addError, addError, clearErrors, getErrors, getIcon, getInCount, getInput, getModel, getOutCount, getOutput, hasErrors, setInCount, setModel, setOutCount, setOutput, updateView
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WallpaperRubette

public WallpaperRubette()
Method Detail

init

public void init()
Defines one input and one output. Initializes instance variables.

Specified by:
init in interface Rubette
Overrides:
init in class AbstractRubette

run

public void run(RunInfo runInfo)
Called when the Rubette is run. Calculates and sets the output denotator, if there is an input denotator.

Specified by:
run in interface Rubette
Specified by:
run in class AbstractRubette
Parameters:
runInfo - contains information about the Runner that executes the network

newInstance

public Rubette newInstance()
Creates a standard instance of WallpaperRubette

Specified by:
newInstance in interface Rubette
Overrides:
newInstance in class AbstractRubette

duplicate

public Rubette duplicate()
Description copied from class: AbstractRubette
Creates a duplicate from this rubette instance. All properties are copied if possible. This must be correctly implemented in order that many functions work as expected.

Specified by:
duplicate in interface Rubette
Specified by:
duplicate in class AbstractRubette

getGroup

public java.lang.String getGroup()
Returns the fact that WallpaperRubette belongs to the core rubettes

Specified by:
getGroup in interface Rubette
Overrides:
getGroup in class AbstractRubette

getName

public java.lang.String getName()
Returns the name of this rubette

Specified by:
getName in interface Rubette
Specified by:
getName in class AbstractRubette

hasProperties

public boolean hasProperties()
Returns the fact that this rubette has properties

Specified by:
hasProperties in interface Rubette
Overrides:
hasProperties in class AbstractRubette

getProperties

public javax.swing.JComponent getProperties()
Returns the properties panel for wallpaper specification

Specified by:
getProperties in interface Rubette
Overrides:
getProperties in class AbstractRubette

applyProperties

public boolean applyProperties()
Applies the changes of the morphisms table and the rubette properties

Specified by:
applyProperties in interface Rubette
Overrides:
applyProperties in class AbstractRubette
Returns:
true iff the values in the properties dialog are correct

getSimpleForms

public java.util.List<SimpleForm> getSimpleForms()
Returns all SimpleForms located in this input form (dynamically changed). Not all forms yet, though...

Returns:
the list of all simple type subforms

getSimpleFormPaths

public java.util.List<java.util.List<java.lang.Integer>> getSimpleFormPaths()
Returns all paths belonging to the simple forms returned by getSimpleForms().

Returns:
the list of paths

revertProperties

public void revertProperties()
Reverts this properties and the changes to this morphism table.

Specified by:
revertProperties in interface Rubette
Overrides:
revertProperties in class AbstractRubette

hasView

public boolean hasView()
Description copied from class: AbstractRubette
Returns true iff this Rubette has a view. A view should provide a visual (or aural) representation of the configuration (resp. values) of the Rubette, but must never affect the computation.

Specified by:
hasView in interface Rubette
Overrides:
hasView in class AbstractRubette

getView

public javax.swing.JComponent getView()
Description copied from class: AbstractRubette
Returns the Swing component for the view. If this Rubette has no view, this simply returns null.

Specified by:
getView in interface Rubette
Overrides:
getView in class AbstractRubette

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Processes the events comming from the selectForm and the buttons in the properties window.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

getMorphismsTable

public JWallpaperDimensionsTable getMorphismsTable()
Returns the table with all morphisms and their characteristics for the wallpaper

Returns:
this morphisms table

hasInfo

public boolean hasInfo()
Description copied from class: AbstractRubette
Returns true iff this Rubette has an info label. The info label is a short string that is displayed in the JRubette.

Specified by:
hasInfo in interface Rubette
Overrides:
hasInfo in class AbstractRubette

getInfo

public java.lang.String getInfo()
Description copied from class: AbstractRubette
Returns the info string for the info label. If this Rubette has no info label, this simply returns null.

Specified by:
getInfo in interface Rubette
Overrides:
getInfo in class AbstractRubette

getShortDescription

public java.lang.String getShortDescription()
Description copied from class: AbstractRubette
Returns a short description. The short description is shown as a tooltip over the JRubette. The default text is the name of the rubette.

Specified by:
getShortDescription in interface Rubette
Overrides:
getShortDescription in class AbstractRubette

getLongDescription

public java.lang.String getLongDescription()
Description copied from class: AbstractRubette
Returns a long description. The long description is shown in the text area below the Rubette list, if this Rubette is selected in the list.

Specified by:
getLongDescription in interface Rubette
Overrides:
getLongDescription in class AbstractRubette

getInTip

public java.lang.String getInTip(int i)
Description copied from class: AbstractRubette
Returns the tooltip for the input connector number i.

Specified by:
getInTip in interface Rubette
Overrides:
getInTip in class AbstractRubette

getOutTip

public java.lang.String getOutTip(int i)
Description copied from class: AbstractRubette
Returns the tooltip for the output connector number i.

Specified by:
getOutTip in interface Rubette
Overrides:
getOutTip in class AbstractRubette

toXML

public void toXML(XMLWriter writer)
Description copied from class: AbstractRubette
Writes an XML description of this rubette. This method should write XML for the configuration of this Rubette.

Specified by:
toXML in interface Rubette
Specified by:
toXML in class AbstractRubette

fromXML

public Rubette fromXML(XMLReader reader,
                       org.w3c.dom.Element element)
Description copied from class: AbstractRubette
Creates a rubette from an XML description starting with element.

Specified by:
fromXML in interface Rubette
Specified by:
fromXML in class AbstractRubette