Layout and show the GUI.
()
| 254 | * Layout and show the GUI. |
| 255 | */ |
| 256 | private void configureUI() { |
| 257 | mMainPanel.setLayout(new BorderLayout()); |
| 258 | |
| 259 | final JPanel pane = new JPanel(new BorderLayout()); |
| 260 | pane.add(mIconLabel, BorderLayout.NORTH); |
| 261 | pane.add(mZoomPP, BorderLayout.CENTER); |
| 262 | pane.add(mProgressBar, BorderLayout.SOUTH); |
| 263 | |
| 264 | final JPanel rightPanel = new JPanel(new GridBagLayout()); |
| 265 | |
| 266 | mSplitPane.setLeftComponent(pane); |
| 267 | mSplitPane.setRightComponent(rightPanel); |
| 268 | mSplitPane.setContinuousLayout(true); |
| 269 | mSplitPane.setOneTouchExpandable(true); |
| 270 | mSplitPane.setResizeWeight(1); |
| 271 | |
| 272 | mMainPanel.add(mSplitPane, BorderLayout.CENTER); |
| 273 | mMainPanel.add(mStatusLabel, BorderLayout.SOUTH); |
| 274 | |
| 275 | mPopup.setLightWeightPopupEnabled(false); |
| 276 | mPopup.add(mZoomPP.getUndoZoomAction()); |
| 277 | mPopup.add(mZoomPP.getDefaultZoomAction()); |
| 278 | mPopup.addSeparator(); |
| 279 | mPopup.add(mZoomPP.getPrintAction()); |
| 280 | mPopup.add(mZoomPP.getSaveImageAction()); |
| 281 | mPopup.add(mZoomPP.getSnapShotAction()); |
| 282 | |
| 283 | mZoomPP.addMouseListener(new PopupListener()); |
| 284 | new DropTarget(mZoomPP, new RocDropListener()); |
| 285 | new DropTarget(mRocLinesPanel, new RocDropListener()); |
| 286 | |
| 287 | mZoomPP.setBackground(Color.WHITE); |
| 288 | if (!mPlain) { |
| 289 | mZoomPP.setGraphBGColor(new Color(0.8f, 0.9f, 1.0f), Color.WHITE); |
| 290 | mZoomPP.setGraphShadowWidth(4); |
| 291 | } |
| 292 | |
| 293 | final GridBagConstraints c = new GridBagConstraints(); |
| 294 | c.insets = new Insets(2, 2, 2, 2); |
| 295 | c.gridx = 0; |
| 296 | c.weightx = 1; c.weighty = 0; |
| 297 | c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.CENTER; |
| 298 | rightPanel.add(new JLabel("Title", JLabel.CENTER), c); |
| 299 | mTitleEntry.addKeyListener(new KeyAdapter() { |
| 300 | @Override |
| 301 | public void keyPressed(KeyEvent e) { |
| 302 | if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { |
| 303 | mTitleEntry.setText(mIconLabel.getText()); // revert edit |
| 304 | } |
| 305 | if (e.getKeyCode() == KeyEvent.VK_ENTER) { |
| 306 | setTitle(mTitleEntry.getText()); |
| 307 | showCurrentGraph(); |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | }); |
| 312 | mTitleEntry.addFocusListener(new FocusAdapter() { |
| 313 | @Override |
no test coverage detected