IltPortBaseRenderer
is the same as to create a new IltNEBaseRenderer..
IltPort.Type MyType = new IltPort.Type("MyType"); IltSettings.SetValue("Port.Type.MyType.Renderer", new IltBaseRendererFactory() { public IltBaseRenderer createValue() { return new MyPortTypeBaseRenderer(); } });
setting."ilog.tgo.model.IltPort"{ types[0]: @+portType0; } Subobject#portType0 { class: 'ilog.tgo.model.IltPort.Type'; name: "MyType"; }
renderer
. In the example below, the name of the renderer factory class
that is included in the search path is
MyPortRendererFactory
.
setting."ilog.tgo.model.IltPort.Type"[name="MyType"] { renderer: @+portRendererFactory; } Subobject#portRendererFactory { class: 'MyPortRendererFactory'; }
String fileName = "plug.png"; // create the new type that will be associated with an image IltPort.Type portType = new IltPort.Type("Plug"); try { // Retrieve the image using the Image Repository Image img = IltSystem.GetDefaultContext().getImageRepository().getImage(fileName); // then map the renderer factory created using the image with the new type IltPortImageBaseRendererFactory factory = new IltPortImageBaseRendererFactory(img, 255, 32, 165); IltSettings.SetValue("Port.Type.Plug.Label", "Plug"); IltSettings.SetValue("Port.Type.Plug.Renderer", factory); // Note: the numerical values above have been adjusted using the // Image Color Tuner application provided with JTGO. } catch (Exception e) { e.printStackTrace(); }
IltPort.Type portType = new IltPort.Type("Plug");
setting."ilog.tgo.model.IltPort"{ types[0]: @+portType0; } Subobject#portType0 { class: 'ilog.tgo.model.IltPort.Type'; name: "Plug"; }
IltSettings.SetValue("Port.Type.Plug.Label", "Plug"); IltSettings.SetValue("Port.Type.Plug.Renderer", new IltPortDirectImageBaseRendererFactory());
setting."ilog.tgo.model.IltPort.Type"[name="Plug"] { renderer: @+portRendererFactory; label: Plug; } Subobject#portRendererFactory { class: 'ilog.tgo.graphic.renderer.IltPortDirectImageRendererFactory'; }
object."ilog.tgo.model.IltPort"["type"=Plug]["objectState.Bellcore.State"=En abledIdle] { sourceImage: '@|image("PortPlug_EnabledIdle.png")'; alarmColorLevel: 128; } object."ilog.tgo.model.IltPort"["type"=Plug]["objectState.Bellcore.State"=Di sabledIdle] { sourceImage: '@|image("PortPlug_DisabledIdle.png")'; alarmColorLevel: 140; }
labelVisible
. All other label properties are also applicable to IltPort instances.
ilog.tgo.Port_Type_<TYPE NAME>
: port type labels
ilog.tgo.Port_Type_<TYPE
NAME>_ToolTip
: port type tooltips
IltPort.Type portType = new IltPort.Type("Plug");
JTGOMessages.properties
file:
ilog.tgo.Port_Type_Plug=Plug
ilog.tgo.Port_Type_Plug_ToolTip=Plug
Port
object."ilog.tgo.model.IltPort" { labelVisible: true; }