public void setVisible (String name, boolean visible) { for (Component component : rowsPanel.getComponents()) if (component instanceof EditorPanel && ((EditorPanel)component).getName().equals(name)) component.setVisible(visible); }
public void setVisible (String name, boolean visible) { for (Component component : controllerPropertiesPanel.getComponents()) if (component instanceof EditorPanel && ((EditorPanel)component).getName().equals(name)) component.setVisible(visible); }
public void setVisible (String name, boolean visible) { for (Component component : rowsPanel.getComponents()) if (component instanceof EditorPanel && ((EditorPanel)component).getName().equals(name)) component.setVisible(visible); }
/** * At the end of a task, shut down the progress monitor */ private void stopProgressMonitor() { timer.stop(); /*if(progressMonitor!=null) { progressMonitor.setProgress(progressMonitor.getMaximum()); progressMonitor.close(); }*/ progressBar.setVisible(false); if (glassPane != null) { glassPane.setVisible(false); // restore input to components } lpThread = null; parseThread = null; }
public void setVisible (String name, boolean visible) { for (Component component : controllerPropertiesPanel.getComponents()) if (component instanceof EditorPanel && ((EditorPanel)component).getName().equals(name)) component.setVisible(visible); }
@Override public void setReconnectViewEnabled(boolean enabled) { getGlassPane().setVisible(enabled); toggleButton.setEnabled(!enabled); }
/** * Initializes the progress bar with the status text, and the expected * number of seconds the process will take, and starts the timer. */ private void startProgressMonitor(String text, int maxCount) { if (glassPane == null) { if (getRootPane() != null) { glassPane = getRootPane().getGlassPane(); glassPane.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent evt) { Toolkit.getDefaultToolkit().beep(); } }); } } if (glassPane != null) { glassPane.setVisible(true); // block input to components } statusLabel.setText(text); progressBar.setMaximum(maxCount); progressBar.setValue(0); count = 0; timer.start(); progressBar.setVisible(true); }
/** * Hide the frame for the LogBrokerMonitor. */ public void hide() { _logMonitorFrame.setVisible(false); }
public synchronized void hide(Component component) { delayedViewers.remove(component); component.setVisible(false); }
public void run() { Thread.yield(); pause(delay); _logMonitorFrame.setVisible(true); } });
/** * Tells the editor to cancel editing and not accept any partially * edited value. */ public void cancelCellEditing() { if (activeEditor != null) { activeEditor.setVisible(false); fireEditingCancelled(); } }
@Override public synchronized void run() { while (true) { try { if (delayedViewers.isEmpty()) { wait(); } final long time = System.currentTimeMillis(); for (Iterator<Component> it = delayedViewers.keySet().iterator(); it.hasNext();) { Component component = it.next(); final long delayedTime = delayedViewers.get(component); if (delayedTime <= time) { component.setVisible(true); it.remove(); } } wait(100); } catch (final InterruptedException ex) { System.out.println("Interrupted : " + ex.getMessage()); } } } }
public void hideEnlargedCard() { enlargedWindowState = EnlargedWindowState.CLOSED; try { Component cardPreviewContainer = MageFrame.getUI().getComponent(MageComponents.CARD_PREVIEW_CONTAINER); if (cardPreviewContainer.isVisible()) { cardPreviewContainer.setVisible(false); cardPreviewContainer.repaint(); } cardPreviewContainer = MageFrame.getUI().getComponent(MageComponents.CARD_PREVIEW_CONTAINER_ROTATED); if (cardPreviewContainer.isVisible()) { cardPreviewContainer.setVisible(false); cardPreviewContainer.repaint(); } } catch (InterruptedException e) { LOGGER.warn("Can't hide enlarged card", e); } }
@Override protected void exportDone(JComponent c, Transferable data, int action) { DnDTabbedPane src = (DnDTabbedPane) c; src.getRootPane().getGlassPane().setVisible(false); src.setDropLocation(null, null, false); src.repaint(); src.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }
private void removePermanent(UUID permanentId, final int count) { for (Component c : this.jPanel.getComponents()) { final Component comp = c; if (comp instanceof Permanent) { if (((Permanent) comp).getPermanentId().equals(permanentId)) { comp.setVisible(false); this.jPanel.remove(comp); } } else if (comp instanceof MagePermanent) { if (((MagePermanent) comp).getOriginal().getId().equals(permanentId)) { Thread t = new Thread(() -> { Plugins.instance.onRemoveCard((MagePermanent) comp, count); comp.setVisible(false); BattlefieldPanel.this.jPanel.remove(comp); }); t.start(); } if (((MagePermanent) comp).getOriginal().isCreature()) { removedCreature = true; } } } }
public void showPopup(final Component popupContainer, final Component infoPane) throws InterruptedException { final Component c = MageFrame.getUI().getComponent(MageComponents.DESKTOP_PANE); SwingUtilities.invokeLater(() -> { if (!popupTextWindowOpen || enlargedWindowState != EnlargedWindowState.CLOSED) { return; } if (data.locationOnScreen == null) { data.locationOnScreen = data.component.getLocationOnScreen(); } Point location = new Point((int) data.locationOnScreen.getX() + data.popupOffsetX - 40, (int) data.locationOnScreen.getY() + data.popupOffsetY - 40); location = GuiDisplayUtil.keepComponentInsideParent(location, parentPoint, infoPane, parentComponent); location.translate(-parentPoint.x, -parentPoint.y); popupContainer.setLocation(location); popupContainer.setVisible(true); c.repaint(); } ); } });
@Override public void mouseDragged(MouseEvent e) { Point tabPt = e.getPoint(); // e.getDragOrigin(); if (Objects.nonNull(this.startPt) && this.startPt.distance(tabPt) > this.gestureMotionThreshold) { DnDTabbedPane src = (DnDTabbedPane) e.getComponent(); TransferHandler th = src.getTransferHandler(); DnDTabbedPane.this.dragTabIndex = src.indexAtLocation(tabPt.x, tabPt.y); th.exportAsDrag(src, e, TransferHandler.MOVE); RECT_LINE.setBounds(0, 0, 0, 0); src.getRootPane().getGlassPane().setVisible(true); src.setDropLocation(new DropLocation(tabPt, -1), null, true); this.startPt = null; } }
/** * Hides the text popup window */ public void hideTooltipPopup() { this.tooltipCard = null; if (tooltipPopup != null) { tooltipPopup.hide(); } if (jPopupMenu != null) { jPopupMenu.setVisible(false); } try { if (SessionHandler.getSession() == null) { return; } // set enlarged card display to visible = false Component popupContainer = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER); popupContainer.setVisible(false); } catch (Exception e2) { LOGGER.warn("Can't set tooltip to visible = false", e2); } }
private void setPopupVisibility(final Component container, final boolean show) throws InterruptedException { final Component c = MageFrame.getUI().getComponent(MageComponents.DESKTOP_PANE); SwingUtilities.invokeLater(() -> { tooltipCounter += show ? 1 : -1; if (tooltipCounter < 0) { tooltipCounter = 0; } if (tooltipCounter > 0) { Point location = new Point(getLocationOnScreen().x - container.getWidth(), MouseInfo.getPointerInfo().getLocation().y); Component parentComponent = MageFrame.getInstance(); location = GuiDisplayUtil.keepComponentInsideParent(location, parentComponent.getLocationOnScreen(), container, parentComponent); container.setLocation(location); } container.setVisible(tooltipCounter > 0); c.repaint(); }); }
@Override public int getSourceActions(JComponent c) { if (c instanceof DnDTabbedPane) { DnDTabbedPane src = (DnDTabbedPane) c; c.getRootPane().setGlassPane(new GhostGlassPane(src)); if (src.dragTabIndex < 0) { return TransferHandler.NONE; } this.setDragImage(this.makeDragTabImage(src)); c.getRootPane().getGlassPane().setVisible(true); return TransferHandler.MOVE; } return TransferHandler.NONE; }