JComponent
to generate a graphic representation and customize it using CSS.
TreeCellRenderer
interface) to generate an arbitrary Swing Component.
'class'
. The given class must follow the JavaBeans™ pattern; its
properties can be directly customized in CSS.
object."Workstation" { class: 'ilog.views.graphic.composite.IlvCompositeGraphic'; layout: @+attachmentLayout; children[0]: @+wsBase; children[1]: @+wsLabel; constraints[1]: @+wsLabelConstraint; } Subobject#attachmentLayout { class: 'ilog.views.graphic.composite.layout.IlvAttachmentLayout'; } Subobject#wsBase { class: 'ilog.views.graphic.IlvIcon'; image: '@|image("workstation.png")'; } Subobject#wsLabel { class: 'ilog.views.graphic.IlvText'; label: @name; foreground: black; font: 'arial-bold-12'; } Subobject#wsLabel:selected { foreground: red; } Subobject#wsLabelConstraint { class: 'ilog.views.graphic.composite.layout.IlvAttachmentConstraint'; hotSpot: Left; anchor: Right; offset: 3,0; }
class
property, refer to Class property.
JComponent
to generate a tree node representation. It is based on a CSS
file.
JLabel
whose properties
text
,
icon
and
foreground
are customized according to the business attributes and the
selection state of the tree node.
object."Workstation" { class: 'javax.swing.JLabel'; icon : @=icon; text: @name; foreground: black; } object."Workstation":selected { foreground: red; } Subobject#icon { class: 'javax.swing.ImageIcon'; image: '@|image("workstation.png")'; }
JComponent
instances can be used to represent tree nodes through the
property
'class'
. The given class must follow the JavaBeans pattern; its
properties can be customized directly in CSS (icon, text,
foreground).
class
property, refer to Class property.
TreeCellRenderer
interface. For details, refer to Using
an arbitrary TreeCellRenderer.