treeItem = orgChart.getDiagramTree().getRootItem().getFirstChild();
if(treeItem != null)
getController().setSelectedShape(treeItem.getRectangleShape());
}
if(getController().getGroupType() == Controller.RELATIONGROUP){
RelationDiagramItem item = ((RelationDiagram)getController().getDiagram()).getFirstItem();
if(item != null){
getController().setSelectedShape(item.getMainShape());
setNextColorOnControlDialog();
}
}
if(getController().getGroupType() == Controller.PROCESSGROUP){
ProcessDiagramItem item = ((ProcessDiagram)getController().getDiagram()).getFirstItem();
if(item != null){
if(getController().getDiagramType() == Controller.UPWARDARROWPROCESS)
getController().setSelectedShape(item.getSecondShape());
else
getController().setSelectedShape(item.getMainShape());
setNextColorOnControlDialog();
}
}
getController().addSelectionListener();
getController().setTextFieldOfControlDialog();
}
return true;
}
//m shortcut key
if(methodName.equals("mainShape")){
if(getController().isOnlySimpleItemIsSelected()){
if(getController().getDiagram() != null) {
getController().removeSelectionListener();
if(getController().getGroupType() == Controller.RELATIONGROUP){
RelationDiagramItem item = ((RelationDiagram)getController().getDiagram()).getItem(getController().getSelectedShape());
if(item != null){
getController().setSelectedShape(item.getMainShape());
setNextColorOnControlDialog();
}
}
getController().addSelectionListener();
}
}
getController().setTextFieldOfControlDialog();
return true;
}
//t shortcut key
if(methodName.equals("textShape")){
if(getController().isOnlySimpleItemIsSelected()){
if(getController().getDiagram() != null) {
getController().removeSelectionListener();
if(getController().getGroupType() == Controller.RELATIONGROUP){
RelationDiagramItem item = ((RelationDiagram)getController().getDiagram()).getItem(getController().getSelectedShape());
if(item != null){
XShape xShape = item.getTextShape();
if(xShape != null && getController().getDiagram().isInGruopShapes(xShape))
getController().setSelectedShape(xShape);
}
}
getController().addSelectionListener();