/** @see ShrimpOptions#ok() */ public void ok() { MagnifyZoomHandler.setAnimationTime(magnifySelectedSpeed); PNormalZoomHandler.setZoomSpeed(zoomSelectedSpeed); try { DisplayBean displayBean = (DisplayBean) project.getTool(toolName).getBean(ShrimpTool.DISPLAY_BEAN); displayBean.setStaticRenderingQuality(staticRendQual); displayBean.setDynamicRenderingQuality(dynamicRendQual); } catch (BeanNotFoundException e1) { } catch (ShrimpToolNotFoundException e1) { } }
private void loadInitialValues() { staticRendQual = PPaintContext.HIGH_QUALITY_RENDERING; dynamicRendQual = PPaintContext.HIGH_QUALITY_RENDERING; try { DisplayBean displayBean = (DisplayBean) project.getTool(toolName).getBean(ShrimpTool.DISPLAY_BEAN); staticRendQual = displayBean.getStaticRenderingQuality(); dynamicRendQual = displayBean.getDynamicRenderingQuality(); } catch (BeanNotFoundException e1) { } catch (ShrimpToolNotFoundException e1) { } zoomSelectedSpeed = PNormalZoomHandler.getZoomSpeed(); }
/** @see ca.uvic.csr.shrimp.usercontrols.UserAction#startAction() */ public void startAction() { try { DisplayBean displayBean = (DisplayBean) tool.getBean(ShrimpTool.DISPLAY_BEAN); Vector selectedNodes = getSelectedNodes(); Vector newSelectedNodes = new Vector(); if (!selectedNodes.isEmpty()) { if (displayBean.getCprels().length == 0) { newSelectedNodes = displayBean.getDataDisplayBridge().getRootNodes(); newSelectedNodes.removeAll(selectedNodes); } else { // Group all the sibling together Map parentNodeIdToSelectedChildrenMap = new HashMap(); for (int i = 0; i < selectedNodes.size(); i++) { ShrimpNode node = (ShrimpNode) selectedNodes.get(i); ShrimpNode parentNode = node.getParentShrimpNode(); if (parentNode != null) { // weeds out the root Long parentNodeId = new Long(node.getParentShrimpNode().getID()); Vector nodes = (Vector) parentNodeIdToSelectedChildrenMap.get(parentNodeId); if (nodes == null) { nodes = new Vector(); parentNodeIdToSelectedChildrenMap.put(parentNodeId, nodes); } nodes.add(node); } } for (Iterator iter = parentNodeIdToSelectedChildrenMap.values().iterator(); iter.hasNext(); ) { Vector nodes = (Vector) iter.next(); ShrimpNode firstNode = (ShrimpNode) nodes.firstElement(); ShrimpNode parentNode = firstNode.getParentShrimpNode(); Vector siblings = displayBean.getDataDisplayBridge().getChildNodes(parentNode); siblings.removeAll(nodes); newSelectedNodes.addAll(siblings); } } setSelectedNodes(newSelectedNodes); } } catch (BeanNotFoundException e) { e.printStackTrace(); } }