public void setGraph(TopGraph graph) { graphOutline.setGraph(graph); if (popupOutline != null) { popupOutline.setGraph(graph); dirtyPopup = false; } this.graph = graph; }
protected JFrame getPopupWindow() { if (popupWindow == null) { popupWindow = new JFrame(STLConstants.K1063_TOP_OUTLINE.getValue()); Image[] images = new Image[] { UIImages.LOGO_24.getImage(), UIImages.LOGO_32.getImage(), UIImages.LOGO_64.getImage(), UIImages.LOGO_128.getImage() }; popupWindow.setIconImages(Arrays.asList(images)); popupWindow.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); popupWindow.addComponentListener( new ComponentAdapter() { /* * (non-Javadoc) * * @see * java.awt.event.ComponentAdapter#componentResized(java.awt * .event.ComponentEvent) */ @Override public void componentResized(ComponentEvent e) { popupBound = popupWindow.getBounds(); popupState = popupWindow.getExtendedState(); } /* * (non-Javadoc) * * @see * java.awt.event.ComponentAdapter#componentMoved(java.awt.event * .ComponentEvent) */ @Override public void componentMoved(ComponentEvent e) { popupBound = popupWindow.getBounds(); popupState = popupWindow.getExtendedState(); } }); JPanel content = (JPanel) popupWindow.getContentPane(); content.setLayout(new BorderLayout()); content.setBackground(UIConstants.INTEL_WHITE); content.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); popupOutline = new TopologyOutlinePanel(updateService, Fit.WINDOW); popupOutline.setBackground(UIConstants.INTEL_WHITE); popupOutline.setPreferredSize(new Dimension(800, 600)); popupOutline.setMinimumSize(new Dimension(400, 300)); popupOutline.setToolTipText(""); popupOutline.setGraph(graph); content.add(popupOutline, BorderLayout.CENTER); popupWindow.pack(); } return popupWindow; }