Class Template
- java.lang.Object
-
- com.cosylab.vdct.graphics.objects.VisibleObject
-
- com.cosylab.vdct.graphics.objects.ContainerObject
-
- com.cosylab.vdct.graphics.objects.LinkManagerObject
-
- 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
Fields Modifier and Type Field Description protected FontfieldFontprotected intfieldsprotected FontidFontprotected Stringidlabelprotected intinitYprotected VectorinvalidLinksprotected intleftFieldsprotected longmacrosIDprotected longportsIDprotected intrfieldLabelXprotected intrfieldLabelYprotected doublerfieldRowHeightprotected intridLabelXprotected intridLabelYprotected intrightFieldsprotected intrlinkY-
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
Constructors Constructor Description Template(ContainerObject parent, VDBTemplateInstance templateData)Template(ContainerObject parent, VDBTemplateInstance templateData, boolean initializeFields)Insert the method's description here.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor visitor)voidaddInvalidLink(EPICSLink field)voidaddLink(Linkable link)EPICSLinkaddMacroField(VDBMacro macro)EPICSLinkaddPortField(VDBPort port)voidaddProperty()InspectablePropertyaddProperty(String key, String value)booleancheckMove(int dx, int dy)Insert the method's description here.FlexiblecopyToGroup(Object dsId, String group)Returns the copied instance or null if the object cannot be copied.voiddestroy()Insert the method's description here.protected voiddestroyFields()Insert the method's description here.protected voiddraw(Graphics g, boolean hilited)Insert the method's description here.voidfieldChanged(VDBFieldData field)Insert the method's description here.voidfieldSideChange(EPICSLink link, boolean isRight)voidfieldVisibilityChange(VDBFieldData fieldData, boolean newVisible)voidfixMacrosOnCopy(String prevGroup, String group)Insert the method's description here.voidgenerateMacros(HashMap macros)InspectablePropertygetCommentProperty()StringgetDescription()Returns the description.VDBFieldDatagetField(String name)StringgetFlexibleName()Insert the method's description here.StringgetHashID()Insert the method's description here.IcongetIcon()Insert the method's description here.VectorgetItems()Insert the method's description here.static GUISeparatorgetMacrosSeparator()Insert the method's description here.ArrayListgetModeNames()Obtains list of all mode names for this particular property.StringgetName()Insert the method's description here.static GUISeparatorgetPortsSeparator()Insert the method's description here.InspectableProperty[]getProperties(int mode, boolean spreadsheet)static GUISeparatorgetPropertiesSeparator()Insert the method's description here.Object[]getTargets()VDBTemplateInstancegetTemplateData()Returns the templateData.static GUISeparatorgetTemplateInstanceSeparator()Insert the method's description here.static GUISeparatorgetTemplateSeparator()Insert the method's description here.StringgetType()VisibleObjecthiliteComponentsCheck(int x, int y)Returned value inicates change Creation date: (21.12.2000 22:21:12)voidinitializeLinkFields()Insert the method's description here.VisibleObjectintersects(int px, int py)Default impmlementation for square (must be rescaled) Creation date: (19.12.2000 20:20:20)booleanisFirstField(Field field)Insert the method's description here.booleanisLastField(Field field)Insert the method's description here.voidmanageLinks()Insert the method's description here.booleanmorph(String newType)Insert the method's description here.booleanmove(int dx, int dy)Insert the method's description here.voidmoveFieldDown(Field field)Insert the method's description here.voidmoveFieldUp(Field field)Insert the method's description here.booleanmoveToGroup(Object dsId, String group)Insert the method's description here.static MappreparePorts(Group group, Map substitutions, NameManipulator namer)Insert the method's description herestatic MapprepareSubstitutions(VDBTemplateInstance templateData, Map substitutions, Map ports)Insert the method's description here.voidpropertyChanged(InspectableProperty property)voidremoveInvalidLink(EPICSLink field)voidremoveLink(Linkable link)voidremoveProperty(InspectableProperty property)booleanrename(Object dsId, String newName)Insert the method's description here.voidrenameProperty(InspectableProperty property)voidrevalidateFieldsPosition()Insert the method's description here.voidrevalidatePosition()Insert the method's description here.voidsetDestroyed(boolean newDestroyed)Insert the method's description here.voidsetTemplateInstance(VDBTemplateInstance templateInstance)StringtoString()Insert the method's description here.protected voidundestroyFields()Insert the method's description here.voidupdateTemplateFields()Insert the method's description here.protected voidvalidate()Insert the method's description here.voidwriteObjects(Writer writer, NamingContext context, boolean export)Insert the method's description here.voidwriteVDCTObjects(Writer writer, 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
-
-
-
-
Field Detail
-
rfieldLabelX
protected int rfieldLabelX
-
rfieldLabelY
protected int rfieldLabelY
-
rfieldRowHeight
protected double rfieldRowHeight
-
fieldFont
protected Font fieldFont
-
ridLabelX
protected int ridLabelX
-
ridLabelY
protected int ridLabelY
-
idlabel
protected String idlabel
-
idFont
protected Font idFont
-
initY
protected int initY
-
rlinkY
protected int rlinkY
-
portsID
protected long portsID
-
macrosID
protected long macrosID
-
invalidLinks
protected 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- parenttemplateData- 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.ContainerObjecttemplateData- The templateData to setinitializeFields- initializeFields
-
-
Method Detail
-
draw
protected void draw(Graphics g, boolean hilited)
Description copied from class:VisibleObjectInsert the method's description here. Creation date: (19.12.2000 21:30:46)- Specified by:
drawin classVisibleObject- Parameters:
g- java.awt.Graphicshilited- boolean- See Also:
VisibleObject.draw(Graphics, boolean)
-
getHashID
public String getHashID()
Description copied from class:VisibleObjectInsert the method's description here. Creation date: (3.5.2001 16:40:00)- Specified by:
getHashIDin classVisibleObject- Returns:
- something
- See Also:
VisibleObject.getHashID()
-
revalidatePosition
public void revalidatePosition()
Description copied from class:VisibleObjectInsert the method's description here. Creation date: (21.12.2000 21:21:59)- Specified by:
revalidatePositionin classVisibleObject- See Also:
VisibleObject.revalidatePosition()
-
validate
protected void validate()
Description copied from class:VisibleObjectInsert the method's description here. Creation date: (19.12.2000 21:31:15)- Specified by:
validatein classVisibleObject
-
checkMove
public boolean checkMove(int dx, int dy)Description copied from interface:MovableInsert the method's description here. Creation date: (27.12.2000 13:08:09)- Specified by:
checkMovein interfaceMovable- Parameters:
dx- intdy- int- Returns:
- boolean
- See Also:
Movable.checkMove(int, int)
-
move
public boolean move(int dx, int dy)Description copied from interface:MovableInsert the method's description here. Creation date: (25.12.2000 14:13:14)- Specified by:
movein interfaceMovable- Parameters:
dx- intdy- int- Returns:
- boolean
- See Also:
Movable.move(int, int)
-
getCommentProperty
public InspectableProperty getCommentProperty()
- Specified by:
getCommentPropertyin interfaceInspectable- Returns:
- com.cosylab.vdct.inspector.InspectableProperty
- See Also:
Inspectable.getCommentProperty()
-
getIcon
public Icon getIcon()
Description copied from interface:InspectableInsert the method's description here. Creation date: (10.1.2001 15:14:56)- Specified by:
getIconin interfaceInspectable- Returns:
- javax.swing.Icon
- See Also:
Inspectable.getIcon()
-
getName
public String getName()
Description copied from interface:InspectableInsert the method's description here. Creation date: (10.1.2001 14:47:43)- Specified by:
getNamein interfaceInspectable- Specified by:
getNamein interfaceMorphable- Returns:
- java.lang.String
- See Also:
Inspectable.getName()
-
toString
public String toString()
Insert the method's description here. Creation date: (10.1.2001 14:49:50)
-
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:
getPropertiesin interfaceInspectable- Parameters:
mode- modespreadsheet- spreadsheet- Returns:
- com.cosylab.vdct.inspector.InspectableProperty[]
- See Also:
Inspectable.getProperties(int, boolean spreadsheet)
-
getItems
public Vector getItems()
Description copied from interface:PopupableInsert the method's description here. Creation date: (2.2.2001 20:26:25)- Specified by:
getItemsin interfacePopupable- Returns:
- java.util.Vector
- See Also:
Popupable.getItems()
-
getFlexibleName
public String getFlexibleName()
Description copied from interface:FlexibleInsert the method's description here. Creation date: (3.5.2001 10:15:48)- Specified by:
getFlexibleNamein interfaceFlexible- Returns:
- java.lang.String
- See Also:
Flexible.getFlexibleName()
-
accept
public void accept(Visitor visitor)
- Specified by:
acceptin interfaceVisitable- Parameters:
visitor- visitor- See Also:
Visitable.accept(Visitor)
-
getTemplateData
public VDBTemplateInstance getTemplateData()
Returns the templateData.- Returns:
- VDBTemplateInstance
-
getDescription
public 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- inty- 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:
intersectsin classVisibleObject- Parameters:
px- intpy- 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:
revalidateFieldsPositionin classLinkManagerObject
-
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- port- Returns:
- something
-
addMacroField
public EPICSLink addMacroField(VDBMacro macro)
- Parameters:
macro- macro- Returns:
- something
-
manageLinks
public void manageLinks()
Insert the method's description here. Creation date: (30.1.2001 11:35:39)
-
addLink
public void addLink(Linkable link)
-
removeLink
public void removeLink(Linkable link)
- Specified by:
removeLinkin interfaceHub- 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:
fieldChangedin classLinkManagerObject- Parameters:
field- com.cosylab.vdct.vdb.VDBFieldData
-
getField
public VDBFieldData getField(String name)
- Specified by:
getFieldin classLinkManagerObject- Parameters:
name- name- Returns:
- something
-
addProperty
public InspectableProperty addProperty(String key, String value)
- Specified by:
addPropertyin interfaceCreatorPropertyListener- Parameters:
key- keyvalue- value- Returns:
- something
-
addProperty
public void addProperty()
- Specified by:
addPropertyin interfaceMonitoredPropertyListener- See Also:
MonitoredPropertyListener.addProperty()
-
propertyChanged
public void propertyChanged(InspectableProperty property)
- Specified by:
propertyChangedin interfaceMonitoredPropertyListener- Parameters:
property- property- See Also:
MonitoredPropertyListener.propertyChanged(InspectableProperty)
-
removeProperty
public void removeProperty(InspectableProperty property)
- Specified by:
removePropertyin interfaceMonitoredPropertyListener- Parameters:
property- property- See Also:
MonitoredPropertyListener.removeProperty(InspectableProperty)
-
renameProperty
public void renameProperty(InspectableProperty property)
- Specified by:
renamePropertyin interfaceMonitoredPropertyListener- Parameters:
property- property- See Also:
MonitoredPropertyListener.renameProperty(InspectableProperty)
-
addInvalidLink
public void addInvalidLink(EPICSLink field)
- Overrides:
addInvalidLinkin classLinkManagerObject- Parameters:
field- field
-
removeInvalidLink
public void removeInvalidLink(EPICSLink field)
- Overrides:
removeInvalidLinkin classLinkManagerObject- Parameters:
field- field
-
destroy
public void destroy()
Insert the method's description here. Creation date: (30.1.2001 11:59:21)- Overrides:
destroyin classVisibleObject
-
setDestroyed
public void setDestroyed(boolean newDestroyed)
Description copied from class:VisibleObjectInsert the method's description here. Creation date: (5.5.2001 18:02:09)- Overrides:
setDestroyedin classVisibleObject- Parameters:
newDestroyed- boolean- See Also:
VisibleObject.setDestroyed(boolean)
-
copyToGroup
public Flexible copyToGroup(Object dsId, String group)
Description copied from interface:FlexibleReturns the copied instance or null if the object cannot be copied. Creation date: (4.2.2001 21:59:44)- Specified by:
copyToGroupin interfaceFlexible- Parameters:
dsId- dsIdgroup- java.lang.String- Returns:
- something
- See Also:
Flexible.copyToGroup(java.lang.Object, java.lang.String)
-
fixMacrosOnCopy
public void fixMacrosOnCopy(String prevGroup, String group)
Insert the method's description here. Creation date: (5.2.2001 9:42:29)- Parameters:
prevGroup- java.lang.Stringgroup- java.lang.String
-
moveToGroup
public boolean moveToGroup(Object dsId, String group)
Description copied from interface:FlexibleInsert the method's description here. Creation date: (4.2.2001 22:00:01)- Specified by:
moveToGroupin interfaceFlexible- Parameters:
dsId- dsIdgroup- java.lang.String- Returns:
- something
- See Also:
Flexible.moveToGroup(java.lang.Object, java.lang.String)
-
rename
public boolean rename(Object dsId, String newName)
Description copied from interface:FlexibleInsert the method's description here. Creation date: (2.5.2001 23:23:17)- Specified by:
renamein interfaceFlexible- Parameters:
dsId- dsIdnewName- java.lang.String- Returns:
- something
- See Also:
Flexible.rename(java.lang.Object, java.lang.String)
-
destroyFields
protected void destroyFields()
Insert the method's description here. Creation date: (30.1.2001 11:59:54)- Overrides:
destroyFieldsin classLinkManagerObject
-
undestroyFields
protected void undestroyFields()
Insert the method's description here. Creation date: (30.1.2001 11:59:54)
-
writeObjects
public void writeObjects(Writer writer, NamingContext context, boolean export) throws IOException
Description copied from interface:SaveInterfaceInsert the method's description here. Creation date: (22.4.2001 21:46:41)- Specified by:
writeObjectsin interfaceSaveInterface- Parameters:
writer- writercontext- NamingContextexport- export- Throws:
IOException- The exception description.
-
prepareSubstitutions
public static Map prepareSubstitutions(VDBTemplateInstance templateData, Map substitutions, Map ports)
Insert the method's description here.- Parameters:
templateData- templateDatasubstitutions-groupcurrent substitutionsports- ports- Returns:
- something
-
preparePorts
public static Map preparePorts(Group group, Map substitutions, NameManipulator namer)
Insert the method's description here- Parameters:
group- groupsubstitutions-groupcurrent substitutionsnamer- namer- Returns:
- something
-
writeVDCTObjects
public void writeVDCTObjects(Writer writer, NamingContext renamer, boolean export) throws IOException
Description copied from interface:SaveInterfaceInsert the method's description here. Creation date: (22.4.2001 21:47:00)- Specified by:
writeVDCTObjectsin interfaceSaveInterface- Parameters:
writer- writerrenamer- NamingContextexport- export- Throws:
IOException- The exception description.
-
getModeNames
public ArrayList getModeNames()
Description copied from interface:InspectableObtains 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:
getModeNamesin interfaceInspectable- Returns:
- java.util.ArrayList array of mode names - obtained using toString().
- See Also:
Inspectable.getModeNames()
-
generateMacros
public void generateMacros(HashMap macros)
- Parameters:
macros- macros
-
fieldSideChange
public void fieldSideChange(EPICSLink link, boolean isRight)
- Parameters:
link- linkisRight- isRight
-
fieldVisibilityChange
public void fieldVisibilityChange(VDBFieldData fieldData, boolean newVisible)
- Parameters:
fieldData- fieldDatanewVisible- newVisible
-
isFirstField
public boolean isFirstField(Field field)
Insert the method's description here. Creation date: (3.5.2001 22:54:43)- Overrides:
isFirstFieldin classLinkManagerObject- 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:
isLastFieldin classLinkManagerObject- Parameters:
field- com.cosylab.vdct.graphics.objects.Field- Returns:
- something
-
moveFieldDown
public void moveFieldDown(Field field)
Insert the method's description here. Creation date: (3.5.2001 22:36:11)- Overrides:
moveFieldDownin classLinkManagerObject- 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:
moveFieldUpin classLinkManagerObject- Parameters:
field- com.cosylab.vdct.graphics.objects.Field
-
getType
public String getType()
- Specified by:
getTypein interfaceMorphable- Returns:
- something
- See Also:
Morphable.getType()
-
morph
public boolean morph(String newType)
Description copied from interface:MorphableInsert the method's description here. Creation date: (4.2.2001 21:57:20)- Specified by:
morphin interfaceMorphable- Parameters:
newType- java.lang.String- Returns:
- something
- See Also:
Morphable.morph(java.lang.String)
-
setTemplateInstance
public void setTemplateInstance(VDBTemplateInstance templateInstance)
- Parameters:
templateInstance- templateInstance
-
getTargets
public Object[] getTargets()
- Specified by:
getTargetsin interfaceMorphable- Returns:
- something
- See Also:
Morphable.getTargets()
-
-