use of com.ramussoft.pb.idef.visual.VisualPanel in project ramus by Vitaliy-Yakovchuk.
the class IDEF0TabView method createPanel.
private void createPanel() {
panel = new IDEFPanel(frame, dataPlugin, framework, rules, this) {
@Override
protected void openTab(Function function) {
long id = -1;
if (!dataPlugin.getBaseFunction().equals(function))
id = function.getElement().getId();
OpenDiagram openDiagram = new OpenDiagram(dataPlugin.getBaseFunctionQualifier(), id);
framework.propertyChanged(IDEF0ViewPlugin.OPEN_DIAGRAM, openDiagram);
}
@Override
protected void setActiveObject(Object activeObject) {
super.setActiveObject(activeObject);
if (activeObject instanceof VisualPanel)
activaPanel = (VisualPanel) activeObject;
if ((Boolean) handAction.getValue(AbstractAction.SELECTED_KEY)) {
if (activeObject instanceof VisualPanel) {
panel.getMovingArea().startUserTransaction();
VisualPanel vpanel = (VisualPanel) activeObject;
visualCopy.copyTo(vpanel);
panel.getMovingArea().commitUserTransaction();
}
} else {
if (activeObject instanceof VisualPanel) {
handAction.setEnabled(true);
} else
handAction.setEnabled(false);
}
}
};
Function function = null;
if (functionId >= 0) {
function = (Function) dataPlugin.findRowByGlobalId(functionId);
}
if (function == null)
function = dataPlugin.getBaseFunction();
panel.getMovingArea().setActiveFunction(function);
panel.getMovingArea().addActiveFunctionListener(new ActiveFunctionListener() {
@Override
public void activeFunctionChanged(ActiveFunctionEvent event) {
refreshTitle();
framework.propertyChanged(ACTIVE_DIAGRAM, getOpenAction());
}
});
frame.getActiveZoom().doZoom(panel);
basePanel.add(panel, BorderLayout.CENTER);
}
Aggregations