Creates a new swing plot. @param settings initial graph configuration
(RocPlotSettings settings)
| 199 | * @param settings initial graph configuration |
| 200 | */ |
| 201 | RocPlot(RocPlotSettings settings) { |
| 202 | mInterpolate = settings.mInterpolate; |
| 203 | mWeighted = settings.mWeighted; |
| 204 | mLineWidth = settings.mLineWidth; |
| 205 | mShowScores = settings.mShowScores; |
| 206 | mShowPoints = settings.mShowPoints; |
| 207 | mPlain = settings.mPlain; |
| 208 | mPaletteName = settings.mPaletteName; |
| 209 | mPalette = RocPlotPalettes.SINGLETON.getPalette(mPaletteName); |
| 210 | UIManager.put("FileChooser.readOnly", Boolean.TRUE); |
| 211 | mFileChooser = new JFileChooser(); |
| 212 | final Action details = mFileChooser.getActionMap().get("viewTypeDetails"); |
| 213 | if (details != null) { |
| 214 | details.actionPerformed(null); |
| 215 | } |
| 216 | mFileChooser.setMultiSelectionEnabled(true); |
| 217 | mFileChooser.setFileFilter(new RocFileFilter()); |
| 218 | mZoomPP.setOriginIsMin(true); |
| 219 | mZoomPP.setTextAntialiasing(true); |
| 220 | mProgressBar.setVisible(true); |
| 221 | mProgressBar.setStringPainted(true); |
| 222 | mProgressBar.setIndeterminate(true); |
| 223 | mScrollPane.setWheelScrollingEnabled(true); |
| 224 | mScoreCB.setSelected(mShowScores); |
| 225 | mPointsCB.setSelected(mShowPoints); |
| 226 | mTitleEntry.setMaximumSize(new Dimension(Integer.MAX_VALUE, mTitleEntry.getPreferredSize().height)); |
| 227 | mOpenButton.setToolTipText("Add a new curve from a file"); |
| 228 | mCommandButton.setToolTipText("Show the equivalent rocplot command-line for the current configuration"); |
| 229 | mIconLabel.setBackground(new Color(16, 159, 205)); |
| 230 | mIconLabel.setForeground(Color.WHITE); |
| 231 | mIconLabel.setOpaque(true); |
| 232 | mIconLabel.setFont(new Font("Arial", Font.BOLD, 24)); |
| 233 | mIconLabel.setHorizontalAlignment(JLabel.LEFT); |
| 234 | mIconLabel.setIconTextGap(50); |
| 235 | if (mIconLabel.getIcon() != null) { |
| 236 | mIconLabel.setMinimumSize(new Dimension(mIconLabel.getIcon().getIconWidth(), mIconLabel.getIcon().getIconHeight())); |
| 237 | } |
| 238 | mGraphType.setSelectedItem(settings.mPrecisionRecall ? PRECISION_SENSITIVITY : ROC_PLOT); |
| 239 | configureUI(); |
| 240 | setTitle(settings.getTitle()); |
| 241 | } |
| 242 | |
| 243 | protected static ImageIcon createImageIcon(String path, String description) { |
| 244 | final java.net.URL imgURL = Resources.getResource(path); |
nothing calls this directly
no test coverage detected