private void createTab() {
if(this.view == null) {
VisualGraph.windowMessage.warningMessage("You can't create a tab, because you haven't view of subgraph.", "Warning");
return;
}
StorableSubGraph ssg = this.view.getStorableSubGraph();
if(ssg == null) {
VisualGraph.windowMessage.warningMessage("You can't create a tab, because your your view is empty.", "Warning");
return;
}
FilterTableRow[] result = this.tablePanel.getResult();
List<StorableVertex>oldVertices = ssg.getVertices();
List<StorableEdge>oldEdges = ssg.getEdges();
Set<Integer>invibleVertices = new HashSet<Integer>();
Set<Integer>invibleEdges = new HashSet<Integer>();
if(this.optionMode == DEF_OPTION_MODE_1) {
//check vertices
for(StorableVertex bufVertex : oldVertices) {
if(!checkVertexWithModeAnd(bufVertex, result)) {
invibleVertices.add(bufVertex.getStorableId());
}
}
//check edges
for(StorableEdge bufEdge : oldEdges) {
if(!checkEdgeWithModeAnd(bufEdge, result)) {
invibleEdges.add(bufEdge.getStorableId());
}
}
} else {
//check vertices
for(StorableVertex bufVertex : oldVertices) {
if(!checkVertexWithModeOr(bufVertex, result)) {
invibleVertices.add(bufVertex.getStorableId());
}
}
//check edges
for(StorableEdge bufEdge : oldEdges) {
if(!checkEdgeWithModeOr(bufEdge, result)) {
invibleEdges.add(bufEdge.getStorableId());
}
}
}
IGraphView newView = GraphView.newGraphView(ssg, this.param.userInterface);
newView.setInvisibleVertices(invibleVertices);
newView.setInvisibleEdges(invibleEdges);
if(this.actionMode == DEF_ACTION_MODE_1) {
UIRequestOpenSubGraph request = new UIRequestOpenSubGraph("[" + ssg.getId() + "]", "", newView, this.owner);
this.param.userInterface.addRequest(request);
} else {
UIRequestReplaceCurrentTab request = new UIRequestReplaceCurrentTab("[" + ssg.getId() + "]", "", newView, this.owner);
this.param.userInterface.addRequest(request);
}
}