private boolean colorBases() { // System.out.println(_type); ArrayList<Integer> listBase = new ArrayList<Integer>(); String phrase = "Choose new " + _type; if (_color.equals("InnerColor")) { phrase += " inner color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_INNER_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { _vp.getRNA().get_listeBases().get(listBase.get(i)).getStyleBase().setBaseInnerColor(c); } _vp.repaint(); } } else if (_color.equals("OutlineColor")) { phrase += " outline color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_OUTLINE_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { _vp.getRNA().get_listeBases().get(listBase.get(i)).getStyleBase().setBaseOutlineColor(c); } _vp.repaint(); } } else if (_color.equals("NameColor")) { phrase += " name color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_NAME_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { _vp.getRNA().get_listeBases().get(listBase.get(i)).getStyleBase().setBaseNameColor(c); } _vp.repaint(); } } else if (_color.equals("NumberColor")) { phrase += " number color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_NUMBER_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { _vp.getRNA().get_listeBases().get(listBase.get(i)).getStyleBase().setBaseNumberColor(c); } _vp.repaint(); } } else if (_color.equals("BPColor")) { phrase += " base-pair color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_NUMBER_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { for (ModeleBP msbp : _vp.getRNA().getBPsAt(listBase.get(i))) { if (msbp != null) { msbp.getStyle().setCustomColor(c); } } } _vp.repaint(); } } else if (_color.equals("BPColor")) { phrase += " base-pair color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_NUMBER_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { ModeleBase mb = _vp.getRNA().get_listeBases().get(listBase.get(i)); if (mb.getElementStructure() != -1) { mb.getStyleBP().getStyle().setCustomColor(c); } } _vp.repaint(); } } else if (_color.equals("BPThickness")) { listBase = listSwitchType(_type); // System.out.println(listBase.size()); ArrayList<ModeleBP> styleBPs = new ArrayList<ModeleBP>(); for (int i = 0; i < listBase.size(); i++) { ModeleBase mb = _vp.getRNA().get_listeBases().get(listBase.get(i)); if (mb.getElementStructure() != -1) { styleBPs.add(mb.getStyleBP()); } } VueBPThickness vbpt = new VueBPThickness(_vp, styleBPs); if (JOptionPane.showConfirmDialog( _vp, vbpt.getPanel(), "Set base pair(s) thickness", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { vbpt.restoreThicknesses(); _vp.repaint(); } } else return false; return true; }