org.gcube.portlets.user.templates.client.model
Class TemplateComponent

java.lang.Object
  extended by org.gcube.portlets.user.templates.client.model.TemplateComponent

public class TemplateComponent
extends Object

This class represent all the possible template components in the Model, they basically are 2D rectangles A TemplateComponent specifies an area in a coordinate space that is enclosed by the TemplateComponent object's top-left point (xy) in the coordinate space, its width, and its height.

Author:
Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it

Constructor Summary
TemplateComponent()
          Creates a empty TemplateComponent
TemplateComponent(TemplateModel myModel, org.gcube.portlets.d4sreporting.common.shared.BasicComponent sc, Presenter controller, boolean addControls)
          create a template component which is displayable (create an actual Widget in the content field)
TemplateComponent(TemplateModel myModel, int x, int y, int width, int height, int templatePage, org.gcube.portlets.d4sreporting.common.shared.ComponentType type, String paramName, com.google.gwt.user.client.ui.Widget content)
          Creates a TemplateComponent with the given charactheristics and single column
TemplateComponent(TemplateModel myModel, int x, int y, int width, int height, int templatePage, org.gcube.portlets.d4sreporting.common.shared.ComponentType type, String paramName, com.google.gwt.user.client.ui.Widget content, ArrayList<org.gcube.portlets.d4sreporting.common.shared.Metadata> metadata)
          Creates a TemplateComponent with the given charactheristics and single column
TemplateComponent(TemplateModel myModel, int x, int y, int width, int height, int templatePage, org.gcube.portlets.d4sreporting.common.shared.ComponentType type, String paramName, com.google.gwt.user.client.ui.Widget content, boolean doubleColLayout)
          Creates a TemplateComponent with the given charactheristics in double column
 
Method Summary
 void addMetadata(String attr, String value)
           
 List<org.gcube.portlets.d4sreporting.common.shared.Metadata> getAllMetadata()
           
 TemplateComponent getChild()
           
 com.google.gwt.user.client.ui.Widget getContent()
           
 int getHeight()
          Returns the height of the bounding TemplateComponent
 TemplateModel getMyModel()
           
 String getParamName()
           
 org.gcube.portlets.d4sreporting.common.shared.BasicComponent getSerializable()
          return a template Component which is serializable
 int getTemplatePage()
           
 org.gcube.portlets.d4sreporting.common.shared.ComponentType getType()
          Returns the type of the TemplateComponent A TemplateComponent can be of different types depeding on its content
 int getWidth()
          Returns the width of the bounding TemplateComponent
 int getX()
          Returns the X coordinate of the bounding TemplateComponent
 int getY()
           
 boolean hasChild()
           
 boolean isDoubleColLayout()
           
 boolean isLocked()
          used only for text areas
 void setChild(TemplateComponent child)
           
 void setContent(com.google.gwt.user.client.ui.Widget content)
           
 void setDoubleColLayout(boolean doubleColLayout)
           
 void setHeight(int height)
           
 void setLocked(boolean locked)
           
 void setParamName(String paramName)
           
 void setTemplatePage(int templatePage)
           
 void setType(org.gcube.portlets.d4sreporting.common.shared.ComponentType type)
           
 void setWidth(int width)
           
 void setX(int x)
           
 void setY(int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateComponent

public TemplateComponent()
Creates a empty TemplateComponent


TemplateComponent

public TemplateComponent(TemplateModel myModel,
                         int x,
                         int y,
                         int width,
                         int height,
                         int templatePage,
                         org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
                         String paramName,
                         com.google.gwt.user.client.ui.Widget content,
                         boolean doubleColLayout)
Creates a TemplateComponent with the given charactheristics in double column

Parameters:
myModel - .
x - .
y - .
width - .
height - .
templatePage - .
content - the inserted widget
type - the type of the inserted widget
paramName - for assigning it a value when exporting to pdf, valid only for Dynamic Content
doubleColLayout - to specify that its layout is double columned

TemplateComponent

public TemplateComponent(TemplateModel myModel,
                         int x,
                         int y,
                         int width,
                         int height,
                         int templatePage,
                         org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
                         String paramName,
                         com.google.gwt.user.client.ui.Widget content)
Creates a TemplateComponent with the given charactheristics and single column

Parameters:
myModel - .
x - .
y - .
width - .
height - .
templatePage - .
content - the inserted widget
type - the type of the inserted widget
paramName - for assigning it a value when exporting to pdf, valid only for Dynamic Content

TemplateComponent

public TemplateComponent(TemplateModel myModel,
                         int x,
                         int y,
                         int width,
                         int height,
                         int templatePage,
                         org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
                         String paramName,
                         com.google.gwt.user.client.ui.Widget content,
                         ArrayList<org.gcube.portlets.d4sreporting.common.shared.Metadata> metadata)
Creates a TemplateComponent with the given charactheristics and single column

Parameters:
myModel - .
x - .
y - .
width - .
height - .
templatePage - .
content - the inserted widget
type - the type of the inserted widget
paramName - for assigning it a value when exporting to pdf, valid only for Dynamic Content

TemplateComponent

public TemplateComponent(TemplateModel myModel,
                         org.gcube.portlets.d4sreporting.common.shared.BasicComponent sc,
                         Presenter controller,
                         boolean addControls)
create a template component which is displayable (create an actual Widget in the content field)

Parameters:
myModel - the model
sc - the serialiazble to convert
controller - .
Method Detail

isLocked

public boolean isLocked()
used only for text areas

Returns:

setLocked

public void setLocked(boolean locked)

getSerializable

public org.gcube.portlets.d4sreporting.common.shared.BasicComponent getSerializable()
return a template Component which is serializable

Returns:
.a

getHeight

public int getHeight()
Returns the height of the bounding TemplateComponent

Returns:
the height of the bounding TemplateComponent.

setHeight

public void setHeight(int height)
Parameters:
height - .

getType

public org.gcube.portlets.d4sreporting.common.shared.ComponentType getType()
Returns the type of the TemplateComponent A TemplateComponent can be of different types depeding on its content

Returns:
.
See Also:
class

setType

public void setType(org.gcube.portlets.d4sreporting.common.shared.ComponentType type)
Parameters:
type - .

getWidth

public int getWidth()
Returns the width of the bounding TemplateComponent

Returns:
the width of the bounding TemplateComponent.

setWidth

public void setWidth(int width)
Parameters:
width - .

getX

public int getX()
Returns the X coordinate of the bounding TemplateComponent

Returns:
the width of the bounding TemplateComponent.

setX

public void setX(int x)
Parameters:
x - .

getY

public int getY()
Returns:
.

setY

public void setY(int y)
Parameters:
y - .

getTemplatePage

public int getTemplatePage()
Returns:
.

setTemplatePage

public void setTemplatePage(int templatePage)
Parameters:
templatePage - .

getContent

public com.google.gwt.user.client.ui.Widget getContent()
Returns:
.

setContent

public void setContent(com.google.gwt.user.client.ui.Widget content)
Parameters:
content - .

getParamName

public String getParamName()
Returns:
.

setParamName

public void setParamName(String paramName)
Parameters:
paramName - .

isDoubleColLayout

public boolean isDoubleColLayout()

setDoubleColLayout

public void setDoubleColLayout(boolean doubleColLayout)

addMetadata

public void addMetadata(String attr,
                        String value)

getAllMetadata

public List<org.gcube.portlets.d4sreporting.common.shared.Metadata> getAllMetadata()

getMyModel

public TemplateModel getMyModel()

getChild

public TemplateComponent getChild()
Returns:

setChild

public void setChild(TemplateComponent child)
Parameters:
child -

hasChild

public boolean hasChild()


Copyright © 2013. All Rights Reserved.