private void doUpdateMapControlSize() { mapControl.setBounds(0,0,layeredPane.getWidth(),layeredPane.getHeight()); if(mapsManager.isVisible()) { Dimension mapsManagerPreferredSize = mapsManager.getMinimalComponentDimension(); int hPos = layeredPane.getWidth() - Math.min(mapsManagerPreferredSize.width,layeredPane.getWidth()); mapsManager.setBounds(hPos,0,Math.min(mapsManagerPreferredSize.width,layeredPane.getWidth()),Math.min(mapsManagerPreferredSize.height,layeredPane.getHeight())); mapsManager.revalidate(); } } /**
@Override public void componentResized(ComponentEvent e) { Dimension dim = getSize(); if (dim != null) { // TODO: The following shouldn't be necessary, but it seems to be. int expectedWidth = frameLandscape.getWidth(); if (expectedWidth != graphPane.getWidth()) { Dimension goodSize = new Dimension(expectedWidth, graphPane.getHeight()); graphPane.setPreferredSize(goodSize); graphPane.setSize(goodSize); } setLegendVisible(true); } } });
pos.x = jLayeredPane.getLocationOnScreen().x + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2; pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;
pos.x = jLayeredPane.getLocationOnScreen().x + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2; pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;
public void mouseReleased(MouseEvent e) { JDialog aboutDialog = new JDialog(GraphicSimulator.this, guiTextConfig.getString("AboutDialogTitle"), true); Point pos = new Point(); pos.x = jLayeredPane.getLocationOnScreen().x + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2; pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2; aboutDialog.setLocation(pos); aboutDialog.setSize(getProperty("DialogWindowWidth"), getProperty("DialogWindowHeight")); aboutDialog.setTitle(guiTextConfig.getString("AboutDialogTitle")); JLabel text = new JLabel(guiTextConfig.getString("AboutDialogContent")); text.setHorizontalAlignment(JLabel.CENTER); aboutDialog.add(text); aboutDialog.setVisible(true); } });
public void mouseReleased(MouseEvent e) { JDialog aboutDialog = new JDialog(GraphicSimulatorServer.this, guiTextConfig.getString("AboutDialogTitle"), true); Point pos = new Point(); pos.x = jLayeredPane.getLocationOnScreen().x + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2; pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2; aboutDialog.setLocation(pos); aboutDialog.setSize(getProperty("DialogWindowWidth"), getProperty("DialogWindowHeight")); aboutDialog.setTitle(guiTextConfig.getString("AboutDialogTitle")); JLabel text = new JLabel(guiTextConfig.getString("AboutDialogContent")); text.setHorizontalAlignment(JLabel.CENTER); aboutDialog.add(text); aboutDialog.setVisible(true); } });
/** * Shows the management simulator dialog for the selected antenna. */ private void showMgmtSimDialog() { // compute position of the dialog final Point pos = new Point(); pos.x = jLayeredPane.getLocationOnScreen().x + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2; pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2; String readPointName = selectedAntenna.getId(); // create dialog if it does not already exists MgmtSimDialog mgmtSimDialog = mgmtSimDialogs.get(readPointName); if(mgmtSimDialog == null) { mgmtSimDialog = new MgmtSimDialog(readPointName, controller); mgmtSimDialogs.put(readPointName, mgmtSimDialog); } mgmtSimDialog.setLocation(pos); mgmtSimDialog.setModal(true); mgmtSimDialog.setVisible(true); }
pos.x = jLayeredPane.getLocationOnScreen().x + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2; pos.y = jLayeredPane.getLocationOnScreen().y + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;
/** * Makes the alphabetical markers visible. */ public void showMarkers() { UIThreadsUtil.mustBeSwingThread(); markers = createMarkers(getViewableSegmentLocations()); if (markers.isEmpty()) { return; } setSize(parent.getWidth() - 1, parent.getHeight() - 1); parent.add(this, JLayeredPane.POPUP_LAYER, 0); // top most parent.validate(); parent.repaint(); }
private void show() { frame.getLayeredPane().add(backgroundPanel, JLayeredPane.PALETTE_LAYER); imagePanel.setLocation(((frame.getLayeredPane().getWidth() - imagePanel.getWidth()) / 2), (frame.getLayeredPane().getHeight() - imagePanel.getHeight()) / 2); frame.getLayeredPane().add(imagePanel, JLayeredPane.POPUP_LAYER); }
JLayeredPane lp = JLayeredPane.getLayeredPaneAbove(f); lp.setLayer(modalInterceptor, JLayeredPane.MODAL_LAYER.intValue()); modalInterceptor.setBounds(0, 0, lp.getWidth(), lp.getHeight()); modalInterceptor.addMouseListener(new MouseAdapter(){}); modalInterceptor.addMouseMotionListener(new MouseMotionAdapter(){});
ownerCompBounds = SwingUtilities.convertRectangle( ownerComp.getParent(), ownerCompBounds, pane ); int paneWidth = pane.getWidth(); int paneHeight = pane.getHeight();
boolean sameSize = prevSize != null && getSize().equals(prevSize) && parentFrame.getFrameLandscape().getWidth() == oldWidth && parentFrame.getFrameLandscape().getHeight() == oldHeight; boolean sameRef = prevRef != null && lc.getReferenceName().equals(prevRef); boolean withinScrollBounds = bufferedImage != null && scroller.getValue() >= getOffset() && scroller.getValue() < getOffset() + getViewportHeight() * 2; oldViewHeight = newViewHeight; oldWidth = parentFrame.getFrameLandscape().getWidth(); oldHeight = parentFrame.getFrameLandscape().getHeight();