quoggles.representation
Interface IBoxRepresentation

All Known Implementing Classes:
DefaultBoxRepresentation, Input_Box.InputBoxRepresentation

public interface IBoxRepresentation

Interface for classes that specify properties that affect how the graphical representation will look like. This includes for example the position of inputs and outputs.


Method Summary
 IBox getIBox()
          Returns the IBox it represents.
 java.awt.geom.Point2D[] getRelInputsPos()
          Relative position of inputs, measured from top left corner, values between 0 and 1.
 java.awt.geom.Point2D[] getRelOutputsPos()
          Relative position of outputs, measured from top left corner, values between 0 and 1.
 BoxRepresentation getRepresentation()
          Gets a representation that can be added to the visual system.
 void setParameters(org.graffiti.plugin.parameter.Parameter[] params, boolean fromBox)
          Sets the parameters for this representation.
 void updateGraphicalRep()
          Called whenever something (parameters, number of IO, ...) changed that requires a change in the looks of the box's graphicsal representation.
 void updateId()
          Called when the ID changed (e.g. the box number).
 

Method Detail

getRepresentation

public BoxRepresentation getRepresentation()
Gets a representation that can be added to the visual system.


updateGraphicalRep

public void updateGraphicalRep()
Called whenever something (parameters, number of IO, ...) changed that requires a change in the looks of the box's graphicsal representation.

Also useful to be called in the constructor of an IBoxRepresentation.

Implementation node:

Don't assign to the graphicalRep field. Just add components to it and adjust its size.


updateId

public void updateId()
Called when the ID changed (e.g. the box number).


setParameters

public void setParameters(org.graffiti.plugin.parameter.Parameter[] params,
                          boolean fromBox)
Sets the parameters for this representation. If the second parameter is false, the setParameters method of the box associated with this representation is called (with the second parameter set to true). Should be overridden and called by subclasses with parameters. They then update the values of the representations of the parameters with the new values of the set parameters.

Parameters:
params -
fromBox -

getRelOutputsPos

public java.awt.geom.Point2D[] getRelOutputsPos()
Relative position of outputs, measured from top left corner, values between 0 and 1. Only used if the box has several outputs.


getRelInputsPos

public java.awt.geom.Point2D[] getRelInputsPos()
Relative position of inputs, measured from top left corner, values between 0 and 1. Only used if the box has several inputs.


getIBox

public IBox getIBox()
Returns the IBox it represents.

Returns: