if(getController().isOnlySimpleItemIsSelected()){
if(getController().getDiagram() != null) {
getController().removeSelectionListener();
if(getController().getGroupType() == Controller.ORGANIGROUP){
OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
OrganizationChartTreeItem treeItem = orgChart.getDiagramTree().getTreeItem(getController().getSelectedShape());
if(treeItem.isDad()){
OrganizationChartTreeItem previousItem = treeItem.getDad().getPreviousSibling(treeItem);
if(previousItem != null)
getController().setSelectedShape(previousItem.getRectangleShape());
}
}
if(getController().getGroupType() == Controller.RELATIONGROUP){
XShape xShape = ((RelationDiagram)getController().getDiagram()).getPreviousShape();
if(xShape != null){
getController().setSelectedShape(xShape);
setNextColorOnControlDialog();
}
}
if(getController().getGroupType() == Controller.PROCESSGROUP){
XShape xShape = ((ProcessDiagram)getController().getDiagram()).getPreviousShape();
if(xShape != null){
getController().setSelectedShape(xShape);
setNextColorOnControlDialog();
}
}
getController().addSelectionListener();
}
}
getController().setTextFieldOfControlDialog();
return true;
}
//n shortcut key
if(methodName.equals("next")){
if(getController().isOnlySimpleItemIsSelected()){
if(getController().getDiagram() != null) {
getController().removeSelectionListener();
if(getController().getGroupType() == Controller.ORGANIGROUP){
OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
OrganizationChartTreeItem treeItem = orgChart.getDiagramTree().getTreeItem(getController().getSelectedShape());
if(treeItem.isFirstSibling())
getController().setSelectedShape(treeItem.getFirstSibling().getRectangleShape());
}
if(getController().getGroupType() == Controller.RELATIONGROUP){
XShape xShape = ((RelationDiagram)getController().getDiagram()).getNextShape();
if(xShape != null){
getController().setSelectedShape(xShape);
setNextColorOnControlDialog();
}
}
if(getController().getGroupType() == Controller.PROCESSGROUP){
XShape xShape = ((ProcessDiagram)getController().getDiagram()).getNextShape();
if(xShape != null){
getController().setSelectedShape(xShape);
setNextColorOnControlDialog();
}
}
getController().addSelectionListener();
}
}
getController().setTextFieldOfControlDialog();
return true;
}
//e shortcut key
if(methodName.equals("edit")){
// if(!getGui().isShownTextFieldOfControlDialog())
// getGui().moveTextFieldOfControlDialog();
if(getController().isOnlySimpleItemIsSelected())
getGui().setFocusTextFieldOfControlDialog();
return true;
}
//s shortcut key
if(methodName.equals("size")){
if(getController().getDiagram() != null) {
if(getController().getGroupType() != Controller.RELATIONGROUP){
getController().removeSelectionListener();
getController().setNewSize();
getController().addSelectionListener();
}
}
return true;
}
//****************************************************************************************************
//ControlDialog1 events ******************************************************************************
//click on colorImageControl
if(methodName.equals("showColorTable3")){
getGui().executeColorTable3();
return true;
}
//f shortcut key
if(methodName.equals("first")){
if(getController().getDiagram() != null) {
getController().removeSelectionListener();
if(getController().getGroupType() == Controller.ORGANIGROUP){
OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
OrganizationChartTreeItem treeItem = null;
if(!orgChart.isHiddenRootElementProp())
treeItem = orgChart.getDiagramTree().getRootItem();
else
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();
}
}
getController().setTextFieldOfControlDialog();
return true;
}
//****************************************************************************************************
//ControlDialog2 events ******************************************************************************
//in Organigroup
//click on colorImageControl
if(methodName.equals("showColorTable2")){
getGui().enableControlDialogWindow(false);
if(getController().getDiagram().isAnyGradientColorMode())
getGui().executeGradientDialog();
else
getGui().executeColorTable2();
getGui().enableAndSetFocusControlDialog();
return true;
}
//change the add-mode property of shape (underling-associate)
if(methodName.equals("changedAddProp")){
((OrganizationChart)getController().getDiagram()).setNewItemHType((short)((ItemEvent)eventObject).Selected);
return true;
}
//u shortcut key
if(methodName.equals("up")){
if(getController().isOnlySimpleItemIsSelected()){
if(getController().getDiagram() != null) {
getController().removeSelectionListener();
if(getController().getGroupType() == Controller.ORGANIGROUP){
OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
OrganizationChartTreeItem treeItem = orgChart.getDiagramTree().getTreeItem(getController().getSelectedShape());
if(treeItem.isDad())
if(!orgChart.isHiddenRootElementProp() || !orgChart.getDiagramTree().getRootItem().equals(treeItem.getDad()))
getController().setSelectedShape(treeItem.getDad().getRectangleShape());
}
getController().addSelectionListener();
}
}
getController().setTextFieldOfControlDialog();
return true;
}
//d shortcut key
if(methodName.equals("down")){
if(getController().isOnlySimpleItemIsSelected()){
if(getController().getDiagram() != null) {
getController().removeSelectionListener();
if(getController().getGroupType() == Controller.ORGANIGROUP){
OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
OrganizationChartTreeItem treeItem = orgChart.getDiagramTree().getTreeItem(getController().getSelectedShape());
if(treeItem.isFirstChild())
getController().setSelectedShape(treeItem.getFirstChild().getRectangleShape());
}
getController().addSelectionListener();
}
}
getController().setTextFieldOfControlDialog();