/** Returns true when the frame containing the canvas is the foreground window. */ public boolean isActive () { Component root = SwingUtilities.getRoot(canvas); return root instanceof Frame ? ((Frame)root).isActive() : true; }
/** Returns true when the frame containing the canvas is the foreground window. */ public boolean isActive () { Component root = SwingUtilities.getRoot(canvas); return root instanceof Frame ? ((Frame)root).isActive() : true; }
private Point getParentPoint(MagePermanent permanent) { if (parentPoint == null) { Component parentComponent = SwingUtilities.getRoot(permanent); parentPoint = parentComponent.getLocationOnScreen(); } return parentPoint; } }
@Override public void ancestorRemoved(AncestorEvent ancestorEvent) { if (ancestorEvent.getAncestor().equals(mainPanel)) { PDFDebugger debugger = (PDFDebugger) SwingUtilities.getRoot(mainPanel); debugger.getFindMenu().setEnabled(false); searcher.removeMenuListeners(debugger); } }
@Override public void ancestorAdded(AncestorEvent ancestorEvent) { if (ancestorEvent.getAncestor().equals(mainPanel)) { PDFDebugger debugger = (PDFDebugger) SwingUtilities.getRoot(mainPanel); debugger.getFindMenu().setEnabled(true); searcher.addMenuListeners(debugger); } }
private void updateMenuItem() { int index = menuItemsTable.getSelectedRow(); if (index == -1) return; MenuItem item = getPort().getMenuItems().get(index); MenuItemDialog dialog = new MenuItemDialog((Dialog) SwingUtilities.getRoot(this), item); dialog.setVisible(true); if (dialog.isSuccessful()) { nodeAttributesDialog.updatePortMenuItem(portName, index, dialog.getKey(), dialog.getLabel()); updateValues(); } }
MenuItemDialog dialog = new MenuItemDialog((Dialog) SwingUtilities.getRoot(this)); dialog.setVisible(true); if (dialog.isSuccessful()) {
private void handleOverNewView(TransferData data) { // Prevent to show tooltips from panes not in front MagePane topPane = MageFrame.getTopMost(null); if (topPane instanceof GamePane) { if (!((GamePane) topPane).getGameId().equals(data.gameId)) { return; } } else if (data.gameId != null) { return; } hideTooltipPopup(); cancelTimeout(); Component parentComponent = SwingUtilities.getRoot(data.component); Point parentPoint = parentComponent.getLocationOnScreen(); if (data.locationOnScreen == null) { data.locationOnScreen = data.component.getLocationOnScreen(); } ArrowUtil.drawArrowsForTargets(data, parentPoint); ArrowUtil.drawArrowsForSource(data, parentPoint); ArrowUtil.drawArrowsForPairedCards(data, parentPoint); ArrowUtil.drawArrowsForBandedCards(data, parentPoint); ArrowUtil.drawArrowsForEnchantPlayers(data, parentPoint); tooltipCard = data.card; showTooltipPopup(data, parentComponent, parentPoint); }
Component parentComponent = SwingUtilities.getRoot(transferData.component); if (cardPreviewPane != null && parentComponent != null) { Point parentPoint = parentComponent.getLocationOnScreen();
/** Returns true when the frame containing the canvas is the foreground window. */ public boolean isActive () { Component root = SwingUtilities.getRoot(canvas); return root instanceof Frame ? ((Frame)root).isActive() : true; }
@Override public void paint(final Graphics g) { if (hq) ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); final Component f = SwingUtilities.getRoot(this); if (this.image != null) g.drawImage(this.image, 0, 0, this.getWidth(), this.getHeight(), f); } }
@Override public Component getCurrentRootComponent() { final Component mapViewComponent = controller.getMapViewManager().getMapViewComponent(); return mapViewComponent != null ? SwingUtilities.getRoot(mapViewComponent) : frame; }
VideoCaptureExample() throws VideoCaptureException { // open the capture device and create a window to display in display = VideoDisplay.createVideoDisplay(new VideoCapture(320, 240)); // set the key listener of the display to this SwingUtilities.getRoot(display.getScreen()).addKeyListener(this); }
public VideoPixelHistogram() throws Exception { capture = new VideoCapture(640, 480); polygonListener = new PolygonDrawingListener(); videoFrame = VideoDisplay.createVideoDisplay(capture); SwingUtilities.getRoot(videoFrame.getScreen()).addKeyListener(this); SwingUtilities.getRoot(videoFrame.getScreen()).addMouseListener(polygonListener); videoFrame.addVideoListener(this); engine = new DoGSIFTEngine(); engine.getOptions().setDoubleInitialImage(false); hmodel = new HistogramPixelModel(10,10,10); this.learningFrames = new ArrayList<MBFImage>(); }
@Override public void run() { final JFrame frame = (JFrame)SwingUtilities.getRoot( MainPanel2.this ); frame.setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) ); DisablerPane.getInstance().setVisible( true ); PipeBitFinder.getInstance().scan(); _availablesListModel.setPipeBits( PipeBitFinder.getInstance().getPipeBits() ); DisablerPane.getInstance().setVisible( false ); frame.setCursor( Cursor.getDefaultCursor() ); } }
public VideoPatchHistogram() throws Exception { capture = new VideoCapture(640, 480); polygonListener = new PolygonDrawingListener(); videoFrame = VideoDisplay.createVideoDisplay(capture); SwingUtilities.getRoot(videoFrame.getScreen()).addKeyListener(this); videoFrame.getScreen().addMouseListener(polygonListener); videoFrame.addVideoListener(this); engine = new DoGSIFTEngine(); engine.getOptions().setDoubleInitialImage(false); hmodel = new HistogramPatchModel(10,10,10); this.learningFrames = new ArrayList<MBFImage>(); }
public VideoFace() throws Exception { capture = new VideoCapture(320, 240); innerEngine = new HaarCascadeDetector(); engine = new FKEFaceDetector(innerEngine); polygonListener = new PolygonDrawingListener(); videoFrame = VideoDisplay.createVideoDisplay(capture); videoFrame.getScreen().addMouseListener(polygonListener); videoFrame.addVideoListener(this); SwingUtilities.getRoot(videoFrame.getScreen()).addKeyListener(this); }
public VideoFace() throws Exception { capture = new VideoCapture(320, 240); innerEngine = new HaarCascadeDetector(); engine = new FKEFaceDetector(innerEngine); polygonListener = new PolygonDrawingListener(); videoFrame = VideoDisplay.createVideoDisplay(capture); videoFrame.getScreen().addMouseListener(polygonListener); videoFrame.addVideoListener(this); SwingUtilities.getRoot(videoFrame.getScreen()).addKeyListener(this); }
public VideoIPD() throws Exception { engine = getNewEngine(); capture = new VideoCapture(320, 240); polygonListener = new PolygonDrawingListener(); videoFrame = VideoDisplay.createVideoDisplay(capture); SwingUtilities.getRoot(videoFrame.getScreen()).addKeyListener(this); videoFrame.getScreen().addMouseListener(polygonListener); this.featureClickListener = new FeatureClickListener<Float[], MBFImage>(); videoFrame.getScreen().addMouseListener(featureClickListener); // videoFrame.getScreen().setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); videoFrame.addVideoListener(this); }
@Override public void actionPerformed(ActionEvent e) { config.setColor("gui.color.text", text.getColor()); config.setColor("gui.color.background", background.getColor()); config.setColor("gui.color.selection", selection.getColor()); config.setColor("gui.color.highlight", highlight.getColor()); config.setFont("gui.font.default", defaultFont.getSelectedFont()); config.setColor("tray.bgColor1", trayBg1.getColor()); config.setColor("tray.bgColor2", trayBg2.getColor()); SwingUtilities.updateComponentTreeUI(SwingUtilities.getRoot(owner)); } });