private void parseFlow() { for (InstanciaComponente component : componentList) { component.setEditable(false); for (FlowStateHistoryTO flowState : flowStateHistory) { if (component.ID == flowState.getState()) { touchedBlocks.add(component); if (StringUtils.isNotBlank(flowState.getExitPort())) { int index = component.C_B.nomes_saidas.indexOf(flowState.getExitPort()); if (index > -1 && component.C_B.Pontos_Saida.length > index) { for (List<Conector> conectorList : component.lista_estado_saidas) { for (Conector conector : conectorList) { if (conector.Comp instanceof Linha) { Point point = new Point(component.C_B.Pontos_Saida[index]); point.setLocation(component.Posicao_X + point.x, component.Posicao_Y + point.y); Point p1 = ((Linha) conector.Comp).p1; Point p2 = ((Linha) conector.Comp).p2; if (p1.equals(point) || p2.equals(point)) { touchedLines.add((Linha) conector.Comp); } } } } } } break; } } } }
private boolean isCurrentState(Componente comp) { boolean ret = false; FlowStateHistoryTO state = flowStateHistory.get(flowStateHistory.size() - 1); if (comp instanceof InstanciaComponente && ((InstanciaComponente) comp).ID == state.getState()) { ret = true; } return ret; }
private List<BlockState> getBlockStates() { List<BlockState> blockStates = new ArrayList<BlockState>(); for (int i = 0, lim = flowStateHistory.size(); i < lim; i++) { FlowStateHistoryTO flowState = flowStateHistory.get(i); for (InstanciaComponente component : touchedBlocks) { if (component.ID == flowState.getState()) { blockStates.add(new BlockState(flowState, component, (i == lim - 1))); } } } return blockStates; }