/** Method called when the factory reset is requested. */ public void reset() { if (Routing.isFactoryMimicStitchOn() != Routing.isMimicStitchOn()) Routing.setMimicStitchOn(Routing.isFactoryMimicStitchOn()); if (Routing.isFactoryAutoStitchOn() != Routing.isAutoStitchOn()) Routing.setAutoStitchOn(Routing.isFactoryAutoStitchOn()); if (!Routing.getFactoryPreferredRoutingArc().equals(Routing.getPreferredRoutingArc())) Routing.setPreferredRoutingArc(Routing.getFactoryPreferredRoutingArc()); for (Iterator<Technology> it = Technology.getTechnologies(); it.hasNext(); ) { Technology tech = it.next(); for (Iterator<ArcProto> aIt = tech.getArcs(); aIt.hasNext(); ) { ArcProto ap = aIt.next(); if (Routing.isFactorySeaOfGatesFavor(ap) != Routing.isSeaOfGatesFavor(ap)) Routing.setSeaOfGatesFavor(ap, Routing.isFactorySeaOfGatesFavor(ap)); if (Routing.isFactorySeaOfGatesPrevent(ap) != Routing.isSeaOfGatesPrevent(ap)) Routing.setSeaOfGatesPrevent(ap, Routing.isFactorySeaOfGatesPrevent(ap)); } } if (Routing.getFactorySeaOfGatesMaxWidth() != Routing.getSeaOfGatesMaxWidth()) Routing.setSeaOfGatesMaxWidth(Routing.getFactorySeaOfGatesMaxWidth()); if (Routing.getFactorySeaOfGatesComplexityLimit() != Routing.getSeaOfGatesComplexityLimit()) Routing.setSeaOfGatesComplexityLimit(Routing.getFactorySeaOfGatesComplexityLimit()); if (Routing.isFactorySeaOfGatesUseParallelRoutes() != Routing.isSeaOfGatesUseParallelRoutes()) Routing.setSeaOfGatesUseParallelRoutes(Routing.isFactorySeaOfGatesUseParallelRoutes()); if (Routing.isFactorySeaOfGatesUseParallelFromToRoutes() != Routing.isSeaOfGatesUseParallelFromToRoutes()) Routing.setSeaOfGatesUseParallelFromToRoutes( Routing.isFactorySeaOfGatesUseParallelFromToRoutes()); if (Routing.isFactoryMimicStitchInteractive() != Routing.isMimicStitchInteractive()) Routing.setMimicStitchInteractive(Routing.isFactoryMimicStitchInteractive()); if (Routing.isFactoryMimicStitchPinsKept() != Routing.isMimicStitchPinsKept()) Routing.setMimicStitchPinsKept(Routing.isFactoryMimicStitchPinsKept()); if (Routing.isFactoryMimicStitchMatchPorts() != Routing.isMimicStitchMatchPorts()) Routing.setMimicStitchMatchPorts(Routing.isFactoryMimicStitchMatchPorts()); if (Routing.isFactoryMimicStitchMatchPortWidth() != Routing.isMimicStitchMatchPortWidth()) Routing.setMimicStitchMatchPortWidth(Routing.isFactoryMimicStitchMatchPortWidth()); if (Routing.isFactoryMimicStitchMatchNumArcs() != Routing.isMimicStitchMatchNumArcs()) Routing.setMimicStitchMatchNumArcs(Routing.isFactoryMimicStitchMatchNumArcs()); if (Routing.isFactoryMimicStitchMatchNodeSize() != Routing.isMimicStitchMatchNodeSize()) Routing.setMimicStitchMatchNodeSize(Routing.isFactoryMimicStitchMatchNodeSize()); if (Routing.isFactoryMimicStitchMatchNodeType() != Routing.isMimicStitchMatchNodeType()) Routing.setMimicStitchMatchNodeType(Routing.isFactoryMimicStitchMatchNodeType()); if (Routing.isFactoryMimicStitchNoOtherArcsSameDir() != Routing.isMimicStitchNoOtherArcsSameDir()) Routing.setMimicStitchNoOtherArcsSameDir(Routing.isFactoryMimicStitchNoOtherArcsSameDir()); if (Routing.isFactoryMimicStitchOnlyNewTopology() != Routing.isMimicStitchOnlyNewTopology()) Routing.setMimicStitchOnlyNewTopology(Routing.isFactoryMimicStitchOnlyNewTopology()); if (Routing.isFactoryAutoStitchCreateExports() != Routing.isAutoStitchCreateExports()) Routing.setAutoStitchCreateExports(Routing.isFactoryAutoStitchCreateExports()); }
/** Method called when the "Sea of gates" technology has changed. */ private void sogTechChanged() { String techName = (String) sogRouteTechnology.getSelectedItem(); Technology tech = Technology.findTechnology(techName); if (tech == null) return; sogArcList = new JPanel(); sogRouteArcOptions.setViewportView(sogArcList); sogArcList.setLayout(new GridBagLayout()); int i = 0; for (Iterator<ArcProto> it = tech.getArcs(); it.hasNext(); ) { ArcProto ap = it.next(); if (!ap.getFunction().isMetal()) continue; JLabel arcName = new JLabel(ap.getName()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = i; gbc.anchor = GridBagConstraints.WEST; gbc.weightx = 1; gbc.insets = new Insets(0, 2, 0, 2); sogArcList.add(arcName, gbc); JCheckBox favorArc = sogFavorChecks.get(ap); if (favorArc == null) { favorArc = new JCheckBox("Favor"); sogFavorChecks.put(ap, favorArc); if (Routing.isSeaOfGatesFavor(ap)) favorArc.setSelected(true); } gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = i; sogArcList.add(favorArc, gbc); JCheckBox prohibitArc = sogProhibitChecks.get(ap); if (prohibitArc == null) { prohibitArc = new JCheckBox("Prohibit"); sogProhibitChecks.put(ap, prohibitArc); if (Routing.isSeaOfGatesPrevent(ap)) prohibitArc.setSelected(true); } gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = i; sogArcList.add(prohibitArc, gbc); i++; } }
/** Method called when the "OK" panel is hit. Updates any changed fields in the Routing tab. */ public void term() { boolean curMimic = routMimicStitcher.isSelected(); if (curMimic != Routing.isMimicStitchOn()) { Routing.setMimicStitchOn(curMimic); MenuCommands.menuBar().updateAllButtons(); } boolean curAuto = routAutoStitcher.isSelected(); if (curAuto != Routing.isAutoStitchOn()) { Routing.setAutoStitchOn(curAuto); MenuCommands.menuBar().updateAllButtons(); } // pick up sea-of-gates preferences for (Iterator<ArcProto> it = sogFavorChecks.keySet().iterator(); it.hasNext(); ) { ArcProto ap = it.next(); JCheckBox check = sogFavorChecks.get(ap); if (check.isSelected() != Routing.isSeaOfGatesFavor(ap)) Routing.setSeaOfGatesFavor(ap, check.isSelected()); } for (Iterator<ArcProto> it = sogProhibitChecks.keySet().iterator(); it.hasNext(); ) { ArcProto ap = it.next(); JCheckBox check = sogProhibitChecks.get(ap); if (check.isSelected() != Routing.isSeaOfGatesPrevent(ap)) Routing.setSeaOfGatesPrevent(ap, check.isSelected()); } double curSOGMaxWid = TextUtils.atofDistance(sogMaxArcWidth.getText()); if (curSOGMaxWid != Routing.getSeaOfGatesMaxWidth()) Routing.setSeaOfGatesMaxWidth(curSOGMaxWid); int curSOGComplexity = TextUtils.atoi(sogComplexityLimit.getText()); if (curSOGComplexity != Routing.getSeaOfGatesComplexityLimit()) Routing.setSeaOfGatesComplexityLimit(curSOGComplexity); boolean curSOGParallel = sogParallel.isSelected(); if (curSOGParallel != Routing.isSeaOfGatesUseParallelRoutes()) Routing.setSeaOfGatesUseParallelRoutes(curSOGParallel); curSOGParallel = sogParallelDij.isSelected(); if (curSOGParallel != Routing.isSeaOfGatesUseParallelFromToRoutes()) Routing.setSeaOfGatesUseParallelFromToRoutes(curSOGParallel); ArcProto ap = null; if (routOverrideArc.isSelected()) { String techName = (String) routTechnology.getSelectedItem(); Technology tech = Technology.findTechnology(techName); if (tech != null) { String curArcName = (String) routDefaultArc.getSelectedItem(); ap = tech.findArcProto(curArcName); } } if (ap != initRoutDefArc) { String newArcName = ""; if (ap != null) newArcName = ap.getTechnology().getTechName() + ":" + ap.getName(); Routing.setPreferredRoutingArc(newArcName); } boolean cur = routMimicPortsMustMatch.isSelected(); if (cur != Routing.isMimicStitchMatchPorts()) Routing.setMimicStitchMatchPorts(cur); cur = routMimicPortsWidthMustMatch.isSelected(); if (cur != Routing.isMimicStitchMatchPortWidth()) Routing.setMimicStitchMatchPortWidth(cur); cur = routMimicNumArcsMustMatch.isSelected(); if (cur != Routing.isMimicStitchMatchNumArcs()) Routing.setMimicStitchMatchNumArcs(cur); cur = routMimicNodeSizesMustMatch.isSelected(); if (cur != Routing.isMimicStitchMatchNodeSize()) Routing.setMimicStitchMatchNodeSize(cur); cur = routMimicNodeTypesMustMatch.isSelected(); if (cur != Routing.isMimicStitchMatchNodeType()) Routing.setMimicStitchMatchNodeType(cur); cur = routMimicNoOtherArcs.isSelected(); if (cur != Routing.isMimicStitchNoOtherArcsSameDir()) Routing.setMimicStitchNoOtherArcsSameDir(cur); cur = routMimicOnlyNewTopology.isSelected(); if (cur != Routing.isMimicStitchOnlyNewTopology()) Routing.setMimicStitchOnlyNewTopology(cur); cur = routMimicInteractive.isSelected(); if (cur != Routing.isMimicStitchInteractive()) Routing.setMimicStitchInteractive(cur); cur = routMimicKeepPins.isSelected(); if (cur != Routing.isMimicStitchPinsKept()) Routing.setMimicStitchPinsKept(cur); cur = routAutoCreateExports.isSelected(); if (cur != Routing.isAutoStitchCreateExports()) Routing.setAutoStitchCreateExports(cur); }