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 Font
fieldFont
protected int
fields
protected Font
idFont
protected String
idlabel
protected int
initY
protected 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
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 void
accept(Visitor visitor)
void
addInvalidLink(EPICSLink field)
void
addLink(Linkable link)
EPICSLink
addMacroField(VDBMacro macro)
EPICSLink
addPortField(VDBPort port)
void
addProperty()
InspectableProperty
addProperty(String key, String value)
boolean
checkMove(int dx, int dy)
Insert the method's description here.Flexible
copyToGroup(Object dsId, 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(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(String prevGroup, String group)
Insert the method's description here.void
generateMacros(HashMap macros)
InspectableProperty
getCommentProperty()
String
getDescription()
Returns the description.VDBFieldData
getField(String name)
String
getFlexibleName()
Insert the method's description here.String
getHashID()
Insert the method's description here.Icon
getIcon()
Insert the method's description here.Vector
getItems()
Insert the method's description here.static GUISeparator
getMacrosSeparator()
Insert the method's description here.ArrayList
getModeNames()
Obtains list of all mode names for this particular property.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.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.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(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(Object dsId, String group)
Insert the method's description here.static Map
preparePorts(Group group, Map substitutions, NameManipulator namer)
Insert the method's description herestatic Map
prepareSubstitutions(VDBTemplateInstance templateData, Map substitutions, 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(Object dsId, 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)
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(Writer writer, NamingContext context, boolean export)
Insert the method's description here.void
writeVDCTObjects(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:VisibleObject
Insert the method's description here. Creation date: (19.12.2000 21:30:46)- Specified by:
draw
in classVisibleObject
- Parameters:
g
- java.awt.Graphicshilited
- boolean- See Also:
VisibleObject.draw(Graphics, boolean)
-
getHashID
public 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 classVisibleObject
- Returns:
- something
- 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 classVisibleObject
- 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 classVisibleObject
-
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 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:Movable
Insert the method's description here. Creation date: (25.12.2000 14:13:14)- Specified by:
move
in interfaceMovable
- Parameters:
dx
- intdy
- int- Returns:
- boolean
- See Also:
Movable.move(int, int)
-
getCommentProperty
public InspectableProperty getCommentProperty()
- Specified by:
getCommentProperty
in interfaceInspectable
- Returns:
- com.cosylab.vdct.inspector.InspectableProperty
- See Also:
Inspectable.getCommentProperty()
-
getIcon
public 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 interfaceInspectable
- Returns:
- javax.swing.Icon
- See Also:
Inspectable.getIcon()
-
getName
public 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 interfaceInspectable
- Specified by:
getName
in 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:
getProperties
in 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:Popupable
Insert the method's description here. Creation date: (2.2.2001 20:26:25)- Specified by:
getItems
in interfacePopupable
- Returns:
- java.util.Vector
- See Also:
Popupable.getItems()
-
getFlexibleName
public 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 interfaceFlexible
- Returns:
- java.lang.String
- See Also:
Flexible.getFlexibleName()
-
accept
public void accept(Visitor visitor)
- Specified by:
accept
in 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:
intersects
in 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:
revalidateFieldsPosition
in 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:
removeLink
in 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:
fieldChanged
in classLinkManagerObject
- Parameters:
field
- com.cosylab.vdct.vdb.VDBFieldData
-
getField
public VDBFieldData getField(String name)
- Specified by:
getField
in classLinkManagerObject
- Parameters:
name
- name- Returns:
- something
-
addProperty
public InspectableProperty addProperty(String key, String value)
- Specified by:
addProperty
in interfaceCreatorPropertyListener
- Parameters:
key
- keyvalue
- value- Returns:
- something
-
addProperty
public void addProperty()
- Specified by:
addProperty
in interfaceMonitoredPropertyListener
- See Also:
MonitoredPropertyListener.addProperty()
-
propertyChanged
public void propertyChanged(InspectableProperty property)
- Specified by:
propertyChanged
in interfaceMonitoredPropertyListener
- Parameters:
property
- property- See Also:
MonitoredPropertyListener.propertyChanged(InspectableProperty)
-
removeProperty
public void removeProperty(InspectableProperty property)
- Specified by:
removeProperty
in interfaceMonitoredPropertyListener
- Parameters:
property
- property- See Also:
MonitoredPropertyListener.removeProperty(InspectableProperty)
-
renameProperty
public void renameProperty(InspectableProperty property)
- Specified by:
renameProperty
in interfaceMonitoredPropertyListener
- Parameters:
property
- property- See Also:
MonitoredPropertyListener.renameProperty(InspectableProperty)
-
addInvalidLink
public void addInvalidLink(EPICSLink field)
- Overrides:
addInvalidLink
in classLinkManagerObject
- Parameters:
field
- field
-
removeInvalidLink
public void removeInvalidLink(EPICSLink field)
- Overrides:
removeInvalidLink
in classLinkManagerObject
- Parameters:
field
- field
-
destroy
public void destroy()
Insert the method's description here. Creation date: (30.1.2001 11:59:21)- Overrides:
destroy
in classVisibleObject
-
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 classVisibleObject
- Parameters:
newDestroyed
- boolean- See Also:
VisibleObject.setDestroyed(boolean)
-
copyToGroup
public Flexible copyToGroup(Object dsId, 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 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:Flexible
Insert the method's description here. Creation date: (4.2.2001 22:00:01)- Specified by:
moveToGroup
in 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:Flexible
Insert the method's description here. Creation date: (2.5.2001 23:23:17)- Specified by:
rename
in 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:
destroyFields
in 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:SaveInterface
Insert the method's description here. Creation date: (22.4.2001 21:46:41)- Specified by:
writeObjects
in 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
-group
current substitutionsports
- ports- Returns:
- something
-
preparePorts
public static Map preparePorts(Group group, Map substitutions, NameManipulator namer)
Insert the method's description here- Parameters:
group
- groupsubstitutions
-group
current substitutionsnamer
- namer- Returns:
- something
-
writeVDCTObjects
public void writeVDCTObjects(Writer writer, NamingContext renamer, boolean export) throws IOException
Description copied from interface:SaveInterface
Insert the method's description here. Creation date: (22.4.2001 21:47:00)- Specified by:
writeVDCTObjects
in interfaceSaveInterface
- Parameters:
writer
- writerrenamer
- NamingContextexport
- export- Throws:
IOException
- The exception description.
-
getModeNames
public 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 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:
isFirstField
in 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:
isLastField
in 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:
moveFieldDown
in 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:
moveFieldUp
in classLinkManagerObject
- Parameters:
field
- com.cosylab.vdct.graphics.objects.Field
-
getType
public String getType()
- Specified by:
getType
in interfaceMorphable
- Returns:
- something
- See Also:
Morphable.getType()
-
morph
public boolean morph(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 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:
getTargets
in interfaceMorphable
- Returns:
- something
- See Also:
Morphable.getTargets()
-
-