com.cosylab.vdct.graphics.objects
Class Template

java.lang.Object
  extended by com.cosylab.vdct.graphics.objects.VisibleObject
      extended by com.cosylab.vdct.graphics.objects.ContainerObject
          extended by com.cosylab.vdct.graphics.objects.LinkManagerObject
              extended by com.cosylab.vdct.graphics.objects.Template
All Implemented Interfaces:
Clipboardable, Flexible, Hub, Morphable, Movable, SaveInterface, SaveObject, Selectable, Visitable, Popupable, Inspectable, CreatorPropertyListener, MonitoredPropertyListener

public class Template
extends LinkManagerObject
implements Movable, Inspectable, Popupable, Flexible, Selectable, Clipboardable, Hub, MonitoredPropertyListener, CreatorPropertyListener, SaveInterface, SaveObject, Morphable

Graphical representation of templates.

Author:
Matej

Field Summary
protected  java.awt.Font fieldFont
           
protected  int fields
           
protected  java.awt.Font idFont
           
protected  java.lang.String idlabel
           
protected  int initY
           
protected  java.util.Vector invalidLinks
           
protected  int leftFields
           
protected  long macrosID
           
protected  long portsID
           
protected  int rfieldLabelX
           
protected  int rfieldLabelY
           
protected  double rfieldRowHeight
           
protected  int ridLabelX
           
protected  int ridLabelY
           
protected  int rightFields
           
protected  int rlinkY
           
 
Fields inherited from class com.cosylab.vdct.graphics.objects.LinkManagerObject
fwdlinkString, inlinkString, nullString, outlinkString, varlinkPortString, varlinkString
 
Fields inherited from class com.cosylab.vdct.graphics.objects.ContainerObject
subObjects, subObjectsV, useHashtable
 
Fields inherited from class com.cosylab.vdct.graphics.objects.VisibleObject
x, y, zoomImage
 
Constructor Summary
Template(ContainerObject parent, VDBTemplateInstance templateData)
           
Template(ContainerObject parent, VDBTemplateInstance templateData, boolean initializeFields)
          Insert the method's description here.
 
Method Summary
 void accept(Visitor visitor)
           
 void addInvalidLink(EPICSLink field)
           
 void addLink(Linkable link)
           
 EPICSLink addMacroField(VDBMacro macro)
           
 EPICSLink addPortField(VDBPort port)
           
 void addProperty()
           
 InspectableProperty addProperty(java.lang.String key, java.lang.String value)
           
 boolean checkMove(int dx, int dy)
          Insert the method's description here.
 Flexible copyToGroup(java.lang.Object dsId, java.lang.String group)
          Returns the copied instance or null if the object cannot be copied.
 void destroy()
          Insert the method's description here.
protected  void destroyFields()
          Insert the method's description here.
protected  void draw(java.awt.Graphics g, boolean hilited)
          Insert the method's description here.
 void fieldChanged(VDBFieldData field)
          Insert the method's description here.
 void fieldSideChange(EPICSLink link, boolean isRight)
           
 void fieldVisibilityChange(VDBFieldData fieldData, boolean newVisible)
           
 void fixMacrosOnCopy(java.lang.String prevGroup, java.lang.String group)
          Insert the method's description here.
 void generateMacros(java.util.HashMap macros)
           
 InspectableProperty getCommentProperty()
           
 java.lang.String getDescription()
          Returns the description.
 VDBFieldData getField(java.lang.String name)
           
 java.lang.String getFlexibleName()
          Insert the method's description here.
 java.lang.String getHashID()
          Insert the method's description here.
 javax.swing.Icon getIcon()
          Insert the method's description here.
 java.util.Vector getItems()
          Insert the method's description here.
static GUISeparator getMacrosSeparator()
          Insert the method's description here.
 java.util.ArrayList getModeNames()
          Obtains list of all mode names for this particular property.
 java.lang.String getName()
          Insert the method's description here.
static GUISeparator getPortsSeparator()
          Insert the method's description here.
 InspectableProperty[] getProperties(int mode, boolean spreadsheet)
           
static GUISeparator getPropertiesSeparator()
          Insert the method's description here.
 java.lang.Object[] getTargets()
           
 VDBTemplateInstance getTemplateData()
          Returns the templateData.
static GUISeparator getTemplateInstanceSeparator()
          Insert the method's description here.
static GUISeparator getTemplateSeparator()
          Insert the method's description here.
 java.lang.String getType()
           
 VisibleObject hiliteComponentsCheck(int x, int y)
          Returned value inicates change Creation date: (21.12.2000 22:21:12)
 void initializeLinkFields()
          Insert the method's description here.
 VisibleObject intersects(int px, int py)
          Default impmlementation for square (must be rescaled) Creation date: (19.12.2000 20:20:20)
 boolean isFirstField(Field field)
          Insert the method's description here.
 boolean isLastField(Field field)
          Insert the method's description here.
 void manageLinks()
          Insert the method's description here.
 boolean morph(java.lang.String newType)
          Insert the method's description here.
 boolean move(int dx, int dy)
          Insert the method's description here.
 void moveFieldDown(Field field)
          Insert the method's description here.
 void moveFieldUp(Field field)
          Insert the method's description here.
 boolean moveToGroup(java.lang.Object dsId, java.lang.String group)
          Insert the method's description here.
static java.util.Map preparePorts(Group group, java.util.Map substitutions, NameManipulator namer)
          Insert the method's description here
static java.util.Map prepareSubstitutions(VDBTemplateInstance templateData, java.util.Map substitutions, java.util.Map ports)
          Insert the method's description here.
 void propertyChanged(InspectableProperty property)
           
 void removeInvalidLink(EPICSLink field)
           
 void removeLink(Linkable link)
           
 void removeProperty(InspectableProperty property)
           
 boolean rename(java.lang.Object dsId, java.lang.String newName)
          Insert the method's description here.
 void renameProperty(InspectableProperty property)
           
 void revalidateFieldsPosition()
          Insert the method's description here.
 void revalidatePosition()
          Insert the method's description here.
 void setDestroyed(boolean newDestroyed)
          Insert the method's description here.
 void setTemplateInstance(VDBTemplateInstance templateInstance)
           
 java.lang.String toString()
          Insert the method's description here.
protected  void undestroyFields()
          Insert the method's description here.
 void updateTemplateFields()
          Insert the method's description here.
protected  void validate()
          Insert the method's description here.
 void writeObjects(java.io.DataOutputStream file, NamingContext context, boolean export)
          Insert the method's description here.
 void writeVDCTObjects(java.io.DataOutputStream file, NamingContext renamer, boolean export)
          Insert the method's description here.
 
Methods inherited from class com.cosylab.vdct.graphics.objects.LinkManagerObject
checkIfMacroCandidate, fixEPICSOutLinks, fixLink_, fixLink, fixLink, fixLinks_, fixLinks, fixMacroLink, getLinkMenus, getTargetLink, isSoftwareLink, manageLink_, manageLink, moveConnectors, postDraw, setTargetLink
 
Methods inherited from class com.cosylab.vdct.graphics.objects.ContainerObject
addSubObject, addSubObject, addSubObject, clear, containsObject, getRootContainer, getSubObject, getSubObjects, getSubObjectsV, removeObject, updateFields
 
Methods inherited from class com.cosylab.vdct.graphics.objects.VisibleObject
forceValidation, getColor, getDsId, getFont, getHeight, getLabel, getLeftOffset, getMarkedX, getMarkedY, getMoveInsideView, getParent, getRheight, getRightOffset, getRlabelX, getRlabelY, getRscale, getRwidth, getRx, getRy, getScale, getTopOffset, getVisibleColor, getWidth, getX, getY, intersects, isDestroyed, isVisible, isZoomRepaint, markPosition, paint, postPaint, setColor, setFont, setHeight, setLabel, setParent, setRheight, setRlabelX, setRlabelY, setRwidth, setRx, setRy, setScale, setWidth, setX, setY, setZoomRepaint, snapToGrid, unconditionalValidation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.cosylab.vdct.inspector.Inspectable
getDsId
 
Methods inherited from interface com.cosylab.vdct.graphics.popup.Popupable
getLabel
 

Field Detail

rfieldLabelX

protected int rfieldLabelX

rfieldLabelY

protected int rfieldLabelY

rfieldRowHeight

protected double rfieldRowHeight

fieldFont

protected java.awt.Font fieldFont

ridLabelX

protected int ridLabelX

ridLabelY

protected int ridLabelY

idlabel

protected java.lang.String idlabel

idFont

protected java.awt.Font idFont

initY

protected int initY

rlinkY

protected int rlinkY

portsID

protected long portsID

macrosID

protected long macrosID

invalidLinks

protected java.util.Vector invalidLinks

fields

protected int fields

leftFields

protected int leftFields

rightFields

protected int rightFields
Constructor Detail

Template

public Template(ContainerObject parent,
                VDBTemplateInstance templateData)
Parameters:
parent -
templateData -

Template

public Template(ContainerObject parent,
                VDBTemplateInstance templateData,
                boolean initializeFields)
Insert the method's description here. Creation date: (21.12.2000 20:40:53)

Parameters:
parent - com.cosylab.vdct.graphics.objects.ContainerObject
templateData - The templateData to set
Method Detail

draw

protected void draw(java.awt.Graphics g,
                    boolean hilited)
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (19.12.2000 21:30:46)

Specified by:
draw in class VisibleObject
Parameters:
g - java.awt.Graphics
hilited - boolean
See Also:
VisibleObject.draw(Graphics, boolean)

getHashID

public java.lang.String getHashID()
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (3.5.2001 16:40:00)

Specified by:
getHashID in class VisibleObject
Returns:
java.lang.String
See Also:
VisibleObject.getHashID()

revalidatePosition

public void revalidatePosition()
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (21.12.2000 21:21:59)

Specified by:
revalidatePosition in class VisibleObject
See Also:
VisibleObject.revalidatePosition()

validate

protected void validate()
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (19.12.2000 21:31:15)

Specified by:
validate in class VisibleObject

checkMove

public boolean checkMove(int dx,
                         int dy)
Description copied from interface: Movable
Insert the method's description here. Creation date: (27.12.2000 13:08:09)

Specified by:
checkMove in interface Movable
Parameters:
dx - int
dy - int
Returns:
boolean
See Also:
Movable.checkMove(int, int)

move

public boolean move(int dx,
                    int dy)
Description copied from interface: Movable
Insert the method's description here. Creation date: (25.12.2000 14:13:14)

Specified by:
move in interface Movable
Parameters:
dx - int
dy - int
Returns:
boolean
See Also:
Movable.move(int, int)

getCommentProperty

public InspectableProperty getCommentProperty()
Specified by:
getCommentProperty in interface Inspectable
Returns:
com.cosylab.vdct.inspector.InspectableProperty
See Also:
Inspectable.getCommentProperty()

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: Inspectable
Insert the method's description here. Creation date: (10.1.2001 15:14:56)

Specified by:
getIcon in interface Inspectable
Returns:
javax.swing.Icon
See Also:
Inspectable.getIcon()

getName

public java.lang.String getName()
Description copied from interface: Inspectable
Insert the method's description here. Creation date: (10.1.2001 14:47:43)

Specified by:
getName in interface Morphable
Specified by:
getName in interface Inspectable
Returns:
java.lang.String
See Also:
Inspectable.getName()

toString

public java.lang.String toString()
Insert the method's description here. Creation date: (10.1.2001 14:49:50)

Specified by:
toString in interface Flexible
Specified by:
toString in interface Inspectable
Overrides:
toString in class java.lang.Object
Returns:
java.lang.String

getTemplateSeparator

public static GUISeparator getTemplateSeparator()
Insert the method's description here. Creation date: (3.2.2001 13:07:04)

Returns:
com.cosylab.vdct.vdb.GUISeparator

getTemplateInstanceSeparator

public static GUISeparator getTemplateInstanceSeparator()
Insert the method's description here. Creation date: (3.2.2001 13:07:04)

Returns:
com.cosylab.vdct.vdb.GUISeparator

getPortsSeparator

public static GUISeparator getPortsSeparator()
Insert the method's description here. Creation date: (3.2.2001 13:07:04)

Returns:
com.cosylab.vdct.vdb.GUISeparator

getMacrosSeparator

public static GUISeparator getMacrosSeparator()
Insert the method's description here. Creation date: (3.2.2001 13:07:04)

Returns:
com.cosylab.vdct.vdb.GUISeparator

getPropertiesSeparator

public static GUISeparator getPropertiesSeparator()
Insert the method's description here. Creation date: (3.2.2001 13:07:04)

Returns:
com.cosylab.vdct.vdb.GUISeparator

getProperties

public InspectableProperty[] getProperties(int mode,
                                           boolean spreadsheet)
Specified by:
getProperties in interface Inspectable
Returns:
com.cosylab.vdct.inspector.InspectableProperty[]
See Also:
Inspectable.getProperties(int, boolean spreadsheet)

getItems

public java.util.Vector getItems()
Description copied from interface: Popupable
Insert the method's description here. Creation date: (2.2.2001 20:26:25)

Specified by:
getItems in interface Popupable
Returns:
java.util.Vector
See Also:
Popupable.getItems()

getFlexibleName

public java.lang.String getFlexibleName()
Description copied from interface: Flexible
Insert the method's description here. Creation date: (3.5.2001 10:15:48)

Specified by:
getFlexibleName in interface Flexible
Returns:
java.lang.String
See Also:
Flexible.getFlexibleName()

accept

public void accept(Visitor visitor)
Specified by:
accept in interface Visitable
Parameters:
visitor - com.cosylab.vdct.graphics.objects.Visitor
See Also:
Visitable.accept(Visitor)

getTemplateData

public VDBTemplateInstance getTemplateData()
Returns the templateData.

Returns:
VDBTemplateInstance

getDescription

public java.lang.String getDescription()
Returns the description.

Returns:
String

hiliteComponentsCheck

public VisibleObject hiliteComponentsCheck(int x,
                                           int y)
Returned value inicates change Creation date: (21.12.2000 22:21:12)

Parameters:
x - int
y - int
Returns:
com.cosylab.visible.objects.VisibleObject

intersects

public VisibleObject intersects(int px,
                                int py)
Default impmlementation for square (must be rescaled) Creation date: (19.12.2000 20:20:20)

Overrides:
intersects in class VisibleObject
Parameters:
px - int
py - int
Returns:
com.cosylab.visible.objects.VisibleObject

revalidateFieldsPosition

public void revalidateFieldsPosition()
Insert the method's description here. Creation date: (26.1.2001 17:18:51)

Specified by:
revalidateFieldsPosition in class LinkManagerObject

updateTemplateFields

public void updateTemplateFields()
Insert the method's description here. Creation date: (26.1.2001 17:19:47)


initializeLinkFields

public void initializeLinkFields()
Insert the method's description here. Creation date: (26.1.2001 17:19:47)


addPortField

public EPICSLink addPortField(VDBPort port)
Parameters:
port -

addMacroField

public EPICSLink addMacroField(VDBMacro macro)
Parameters:
macro -

manageLinks

public void manageLinks()
Insert the method's description here. Creation date: (30.1.2001 11:35:39)


addLink

public void addLink(Linkable link)
Specified by:
addLink in interface Hub
Parameters:
link - com.cosylab.vdct.graphics.objects.Linkable

removeLink

public void removeLink(Linkable link)
Specified by:
removeLink in interface Hub
Parameters:
link - com.cosylab.vdct.graphics.objects.Linkable

fieldChanged

public void fieldChanged(VDBFieldData field)
Insert the method's description here. Creation date: (27.1.2001 16:12:03)

Specified by:
fieldChanged in class LinkManagerObject
Parameters:
field - com.cosylab.vdct.vdb.VDBFieldData

getField

public VDBFieldData getField(java.lang.String name)
Specified by:
getField in class LinkManagerObject

addProperty

public InspectableProperty addProperty(java.lang.String key,
                                       java.lang.String value)
Specified by:
addProperty in interface CreatorPropertyListener

addProperty

public void addProperty()
Specified by:
addProperty in interface MonitoredPropertyListener
See Also:
MonitoredPropertyListener.addProperty()

propertyChanged

public void propertyChanged(InspectableProperty property)
Specified by:
propertyChanged in interface MonitoredPropertyListener
See Also:
MonitoredPropertyListener.propertyChanged(InspectableProperty)

removeProperty

public void removeProperty(InspectableProperty property)
Specified by:
removeProperty in interface MonitoredPropertyListener
See Also:
MonitoredPropertyListener.removeProperty(InspectableProperty)

renameProperty

public void renameProperty(InspectableProperty property)
Specified by:
renameProperty in interface MonitoredPropertyListener
See Also:
MonitoredPropertyListener.renameProperty(InspectableProperty)

addInvalidLink

public void addInvalidLink(EPICSLink field)
Overrides:
addInvalidLink in class LinkManagerObject

removeInvalidLink

public void removeInvalidLink(EPICSLink field)
Overrides:
removeInvalidLink in class LinkManagerObject

destroy

public void destroy()
Insert the method's description here. Creation date: (30.1.2001 11:59:21)

Overrides:
destroy in class VisibleObject

setDestroyed

public void setDestroyed(boolean newDestroyed)
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (5.5.2001 18:02:09)

Overrides:
setDestroyed in class VisibleObject
Parameters:
newDestroyed - boolean
See Also:
VisibleObject.setDestroyed(boolean)

copyToGroup

public Flexible copyToGroup(java.lang.Object dsId,
                            java.lang.String group)
Description copied from interface: Flexible
Returns the copied instance or null if the object cannot be copied. Creation date: (4.2.2001 21:59:44)

Specified by:
copyToGroup in interface Flexible
group - java.lang.String
See Also:
com.cosylab.vdct.graphics.objects.Flexible#copyToGroup(String)

fixMacrosOnCopy

public void fixMacrosOnCopy(java.lang.String prevGroup,
                            java.lang.String group)
Insert the method's description here. Creation date: (5.2.2001 9:42:29)

Parameters:
e - java.util.Enumeration list of VDBFieldData fields
prevGroup - java.lang.String
group - java.lang.String

moveToGroup

public boolean moveToGroup(java.lang.Object dsId,
                           java.lang.String group)
Description copied from interface: Flexible
Insert the method's description here. Creation date: (4.2.2001 22:00:01)

Specified by:
moveToGroup in interface Flexible
group - java.lang.String
See Also:
com.cosylab.vdct.graphics.objects.Flexible#moveToGroup(String)

rename

public boolean rename(java.lang.Object dsId,
                      java.lang.String newName)
Description copied from interface: Flexible
Insert the method's description here. Creation date: (2.5.2001 23:23:17)

Specified by:
rename in interface Flexible
newName - java.lang.String
See Also:
com.cosylab.vdct.graphics.objects.Flexible#rename(String)

destroyFields

protected void destroyFields()
Insert the method's description here. Creation date: (30.1.2001 11:59:54)

Overrides:
destroyFields in class LinkManagerObject

undestroyFields

protected void undestroyFields()
Insert the method's description here. Creation date: (30.1.2001 11:59:54)


writeObjects

public void writeObjects(java.io.DataOutputStream file,
                         NamingContext context,
                         boolean export)
                  throws java.io.IOException
Description copied from interface: SaveInterface
Insert the method's description here. Creation date: (22.4.2001 21:46:41)

Specified by:
writeObjects in interface SaveInterface
Parameters:
file - java.io.DataOutputStream
Throws:
java.io.IOException - The exception description.
See Also:
com.cosylab.vdct.graphics.objects.SaveInterface#writeObjects(DataOutputStream, String)

prepareSubstitutions

public static java.util.Map prepareSubstitutions(VDBTemplateInstance templateData,
                                                 java.util.Map substitutions,
                                                 java.util.Map ports)
Insert the method's description here.

Parameters:
substitutions - group current substitutions

preparePorts

public static java.util.Map preparePorts(Group group,
                                         java.util.Map substitutions,
                                         NameManipulator namer)
Insert the method's description here

Parameters:
substitutions - group current substitutions

writeVDCTObjects

public void writeVDCTObjects(java.io.DataOutputStream file,
                             NamingContext renamer,
                             boolean export)
                      throws java.io.IOException
Description copied from interface: SaveInterface
Insert the method's description here. Creation date: (22.4.2001 21:47:00)

Specified by:
writeVDCTObjects in interface SaveInterface
Parameters:
file - java.io.DataOutputStream
Throws:
java.io.IOException - The exception description.
See Also:
com.cosylab.vdct.graphics.objects.SaveInterface#writeVDCTData(DataOutputStream, String)

getModeNames

public java.util.ArrayList getModeNames()
Description copied from interface: Inspectable
Obtains list of all mode names for this particular property. Modes are numbered from 0-n. Creation date: (11.1.2001 21:30:04)

Specified by:
getModeNames in interface Inspectable
Returns:
java.util.ArrayList array of mode names - obtained using toString().
See Also:
Inspectable.getModeNames()

generateMacros

public void generateMacros(java.util.HashMap macros)
Parameters:
linkableMacros -
macros -
deep -

fieldSideChange

public void fieldSideChange(EPICSLink link,
                            boolean isRight)
Parameters:
link -
isRight -

fieldVisibilityChange

public void fieldVisibilityChange(VDBFieldData fieldData,
                                  boolean newVisible)
Parameters:
field -
oldValue -
newValue -

isFirstField

public boolean isFirstField(Field field)
Insert the method's description here. Creation date: (3.5.2001 22:54:43)

Overrides:
isFirstField in class LinkManagerObject
Parameters:
field - com.cosylab.vdct.graphics.objects.Field
Returns:
boolean

isLastField

public boolean isLastField(Field field)
Insert the method's description here. Creation date: (3.5.2001 22:53:47)

Overrides:
isLastField in class LinkManagerObject
Parameters:
field - com.cosylab.vdct.graphics.objects.Field

moveFieldDown

public void moveFieldDown(Field field)
Insert the method's description here. Creation date: (3.5.2001 22:36:11)

Overrides:
moveFieldDown in class LinkManagerObject
Parameters:
field - com.cosylab.vdct.graphics.objects.Field

moveFieldUp

public void moveFieldUp(Field field)
Insert the method's description here. Creation date: (3.5.2001 22:36:11)

Overrides:
moveFieldUp in class LinkManagerObject
Parameters:
field - com.cosylab.vdct.graphics.objects.Field

getType

public java.lang.String getType()
Specified by:
getType in interface Morphable
See Also:
Morphable.getType()

morph

public boolean morph(java.lang.String newType)
Description copied from interface: Morphable
Insert the method's description here. Creation date: (4.2.2001 21:57:20)

Specified by:
morph in interface Morphable
Parameters:
newType - java.lang.String
See Also:
Morphable.morph(java.lang.String)

setTemplateInstance

public void setTemplateInstance(VDBTemplateInstance templateInstance)
Parameters:
templateInstance -

getTargets

public java.lang.Object[] getTargets()
Specified by:
getTargets in interface Morphable
See Also:
Morphable.getTargets()