public int getCanvasVisualizationOrderRemovingNonVisible(NetworkLayer layer) { Integer res = cache_mapCanvasVisibleLayer2VisualizationOrderRemovingNonVisible.get(layer); if (res == null) throw new RuntimeException(""); return res; }
/** * Under testing, do not use just yet **/ public Optional<Integer> getRowModelIndexOfElement(Object element) { final Integer res = this.mapElementId2ModelIndexWithThatValue.get(element); return res == null? Optional.empty() : Optional.of(res); }
public GUILink getCanvasIntraNodeGUILink(Node n, NetworkLayer from, NetworkLayer to) { final Integer fromRealVIndex = cache_mapCanvasVisibleLayer2VisualizationOrderRemovingNonVisible.get(from); final Integer toRealVIndex = cache_mapCanvasVisibleLayer2VisualizationOrderRemovingNonVisible.get(to); if ((fromRealVIndex == null) || (toRealVIndex == null)) return null; return cache_mapNode2IntraNodeCanvasGUILinkMap.get(n).get(Pair.of(fromRealVIndex, toRealVIndex)); }
protected Class<?> getClass(String name) throws ClassNotFoundException { if (classMap.containsKey(name)) { return classMap.get(name); } else { return Class.forName(name); } }
/** * Under testing, do not use just yet **/ public T getElementAtModelRowIndex(int rowModelIndex) { return this.mapElementId2ModelIndexWithThatValue.inverseBidiMap().get(rowModelIndex); }
public GUINode getCanvasAssociatedGUINode(Node n, NetworkLayer layer) { final Integer trueVisualizationIndex = cache_mapCanvasVisibleLayer2VisualizationOrderRemovingNonVisible.get(layer); if (trueVisualizationIndex == null) return null; return getCanvasVerticallyStackedGUINodes(n).get(trueVisualizationIndex); }
public NetworkLayer getCanvasNetworkLayerAtVisualizationOrderRemovingNonVisible(int trueVisualizationOrder) { if (trueVisualizationOrder < 0) throw new RuntimeException(""); if (trueVisualizationOrder >= getCanvasNumberOfVisibleLayers()) throw new RuntimeException(""); return cache_mapCanvasVisibleLayer2VisualizationOrderRemovingNonVisible.inverseBidiMap().get(trueVisualizationOrder); }
private List<EvaluatedAxiom> getEvaluatedAxioms(SparqlEndpointKS endpoint, SPARQLReasoner reasoner, OWLEntity entity, AxiomType axiomType, int maxExecutionTimeInSeconds, double threshold, int maxNrOfReturnedAxioms, boolean useInference) { List<EvaluatedAxiom> learnedAxioms = new ArrayList<>(); try { learnedAxioms = applyLearningAlgorithm(axiomType2Class.get(axiomType), endpoint, reasoner, entity, maxExecutionTimeInSeconds, threshold, maxNrOfReturnedAxioms); } catch (ComponentInitException e) { e.printStackTrace(); } return learnedAxioms; }
@SuppressWarnings("unchecked") protected <C> Class<C> getClass(nu.xom.Element eElement) throws ClassNotFoundException { Class<C> type = null; if (eElement.getAttribute("class") != null) { type = (Class<C>) Class.forName(eElement.getAttributeValue("class")); } else { type = (Class<C>) classMap.get(eElement.getLocalName()); } if (type == null) { throw new RuntimeException("Unknown node type for " + eElement); } return type; }
public List<GUILink> getCanvasIntraNodeGUILinkSequence(Node n, NetworkLayer from, NetworkLayer to) { if (from.getNetPlan() != this.getNetPlan()) throw new RuntimeException("Bad"); if (to.getNetPlan() != this.getNetPlan()) throw new RuntimeException("Bad"); final Integer fromRealVIndex = cache_mapCanvasVisibleLayer2VisualizationOrderRemovingNonVisible.get(from); final Integer toRealVIndex = cache_mapCanvasVisibleLayer2VisualizationOrderRemovingNonVisible.get(to); final List<GUILink> res = new LinkedList<>(); if ((fromRealVIndex == null) || (toRealVIndex == null)) return res; if (fromRealVIndex == toRealVIndex) return res; final int increment = toRealVIndex > fromRealVIndex ? 1 : -1; int vLayerIndex = fromRealVIndex; do { final int origin = vLayerIndex; final int destination = vLayerIndex + increment; res.add(cache_mapNode2IntraNodeCanvasGUILinkMap.get(n).get(Pair.of(origin, destination))); vLayerIndex += increment; } while (vLayerIndex != toRealVIndex); return res; }
public final SortedSet<T> getSelectedElements() { final int[] rowViewIndexes = this.getSelectedRows(); final SortedSet<T> elements = new TreeSet<> (); if (rowViewIndexes.length != 0) { final int maxValidRowIndex = this.getModel().getRowCount() - 1 - (hasAggregationRow() ? 1 : 0); final List<Integer> validRows = new ArrayList<>(); for (int a : rowViewIndexes) if ((a >= 0) && (a <= maxValidRowIndex)) validRows.add(a); for (int rowViewIndex : validRows) { final int viewRowIndex = this.convertRowIndexToModel(rowViewIndex); final T element = this.mapElementId2ModelIndexWithThatValue.inverseBidiMap().get(viewRowIndex); if (element != null) elements.add(element); } } return elements; }
public Pair<BidiMap<NetworkLayer, Integer>, Map<NetworkLayer, Boolean>> suggestCanvasUpdatedVisualizationLayerInfoForNewDesign(Set<NetworkLayer> newNetworkLayers) { final Map<NetworkLayer, Boolean> oldLayerVisibilityMap = getCanvasLayerVisibilityMap(); final BidiMap<NetworkLayer, Integer> oldLayerOrderMap = new DualHashBidiMap<>(getCanvasLayerOrderIndexMap(true)); final Map<NetworkLayer, Boolean> newLayerVisibilityMap = new HashMap<>(); final BidiMap<NetworkLayer, Integer> newLayerOrderMap = new DualHashBidiMap<>(); for (int oldVisibilityOrderIndex = 0; oldVisibilityOrderIndex < oldLayerOrderMap.size(); oldVisibilityOrderIndex++) { final NetworkLayer oldLayer = oldLayerOrderMap.inverseBidiMap().get(oldVisibilityOrderIndex); if (newNetworkLayers.contains(oldLayer)) { newLayerOrderMap.put(oldLayer, newLayerVisibilityMap.size()); newLayerVisibilityMap.put(oldLayer, oldLayerVisibilityMap.get(oldLayer)); } } final Set<NetworkLayer> newLayersNotExistingBefore = Sets.difference(newNetworkLayers, oldLayerVisibilityMap.keySet()); for (NetworkLayer newLayer : newLayersNotExistingBefore) { newLayerOrderMap.put(newLayer, newLayerVisibilityMap.size()); newLayerVisibilityMap.put(newLayer, true); // new layers always visible } return Pair.of(newLayerOrderMap, newLayerVisibilityMap); }
String newName = rename.get(oldName);
TagState type = tag_state.get(for_type); switch (type)
List<Link> sortedListUpToDown = linksThisHopIndex.stream().sorted(Comparator.comparingInt(e1 -> nodesToDnMap.get(e1.getOriginNode()).getPosTopLeftCornerToSetByPainter().y)).collect(Collectors.toList()); for (Link e : sortedListUpToDown) final DrawNode dnOrigin = nodesToDnMap.get(e.getOriginNode()); final DrawLine dlLink = new DrawLine(dnOrigin, dn, e, dnOrigin.posEast(), dn.posWest(), tree.getOccupiedLinkCapacity()); DrawLine.addLineToGraphics(g2d, dlLink, fontMetrics, regularInterlineSpacePixels);
public void stateChanged(ChangeEvent e) { for(V v : graph.getVertices()) { VertexGroup<V> vg = vertexMap.get(v); Appearance look = redLook; if(renderContext.getPickedVertexState().isPicked(v)) { look = yellowLook; } Node node = vg.getShape(); if(node instanceof Primitive) { ((Primitive)node).setAppearance(look); } } }});
public void stateChanged(ChangeEvent e) { for(V v : vertexMap.keySet()) { Point3f p = VisualizationViewer.this.layout.transform(v); Vector3f pv = new Vector3f(p.getX(), p.getY(), p.getZ()); Transform3D tx = new Transform3D(); tx.setTranslation(pv); vertexMap.get(v).setTransform(tx); } for(E edge : graph.getEdges()) { Pair<V> endpoints = graph.getEndpoints(edge); V start = endpoints.getFirst(); V end = endpoints.getSecond(); EdgeGroup eg = edgeMap.get(edge); eg.setEndpoints(layout.transform(start), layout.transform(end)); } }});
if(geneTaxID.equals(taxID) && geneChr == chromBidiMap.inverseBidiMap().get(chr) && geneBeg >= start && geneBeg <= end){ geneCount++;
final int defaultLayerIndex = layerOrderMapConsideringNonVisible.get(defaultLayer); final NetworkLayer neighbourLayer = layerOrderMapConsideringNonVisible.inverseBidiMap().get(defaultLayerIndex - 1); final int defaultLayerIndex = layerOrderMapConsideringNonVisible.get(defaultLayer); final NetworkLayer neighbourLayer = layerOrderMapConsideringNonVisible.inverseBidiMap().get(defaultLayerIndex + 1);
final int lowerVIndex = originIndexInVisualization < destinationIndexInVisualization ? originIndexInVisualization : destinationIndexInVisualization; final int upperVIndex = originIndexInVisualization > destinationIndexInVisualization ? originIndexInVisualization : destinationIndexInVisualization; cache_mapCanvasVisibleLayer2VisualizationOrderRemovingNonVisible.get(gl.getOriginNode()); boolean atLeastOneLowerLayerVisible = false; for (int vIndex = 0; vIndex <= lowerVIndex; vIndex++)