*
* @param dispClose the new display close button
*/
public void setDisplayCloseButton(boolean dispClose){
if (dispClose){
MTSvgButton keybCloseSvg = new MTSvgButton(MT4jSettings.getInstance().getDefaultSVGPath()
+ "keybClose.svg", this.getRenderer());
//Transform
keybCloseSvg.scale(0.5f, 0.5f, 1, new Vector3D(0,0,0));
keybCloseSvg.translate(new Vector3D(this.getWidthXY(TransformSpace.RELATIVE_TO_PARENT) - 45, 2,0));
keybCloseSvg.setBoundsPickingBehaviour(AbstractShape.BOUNDS_ONLY_CHECK);
keybCloseSvg.addActionListener(new CloseActionListener(new MTComponent[]{this, keybCloseSvg}) );
// pic.addChild(keybCloseSvg);
keybCloseSvg.setName("closeButton");
this.addChild(keybCloseSvg);
}else{
//Remove svg button and destroy child display lists
MTComponent[] childs = this.getChildren();
for (int i = 0; i < childs.length; i++) {
MTComponent component = childs[i];
if (component.getName().equals("closeButton")) {
MTSvgButton svgButton = (MTSvgButton) component;
svgButton.destroy();
}
}
}
}