public static JXPanel getDescription(CardView card, int width, int height) { JXPanel descriptionPanel = new JXPanel(); //descriptionPanel.setAlpha(.8f); descriptionPanel.setBounds(0, 0, width, height); descriptionPanel.setVisible(false); descriptionPanel.setLayout(null); //descriptionPanel.setBorder(BorderFactory.createLineBorder(Color.green)); JButton j = new JButton(""); j.setBounds(0, 0, width, height); j.setBackground(Color.black); j.setLayout(null); JLabel cardText = new JLabel(); cardText.setBounds(5, 5, width - 10, height - 10); cardText.setForeground(Color.white); cardText.setFont(cardNameFont); cardText.setVerticalAlignment(SwingConstants.TOP); j.add(cardText); TextLines textLines = GuiDisplayUtil.getTextLinesfromCardView(card); cardText.setText(getRulefromCardView(card, textLines).toString()); descriptionPanel.add(j); return descriptionPanel; }
private void drawCardText(CardView card) { JXPanel panel = GuiDisplayUtil.getDescription(card, bigCard.getWidth(), bigCard.getHeight()); panel.setVisible(true); bigCard.hideTextComponent(); bigCard.addJXPanel(card.getId(), panel); }
private void displayCardInfo(MageCard mageCard, Image image, BigCard bigCard) { if (image instanceof BufferedImage) { // XXX: scaled to fit width bigCard.setCard(mageCard.getOriginal().getId(), enlargeMode, image, mageCard.getOriginal().getRules(), mageCard.getOriginal().isToRotate()); // if it's an ability, show only the ability text as overlay if (mageCard.getOriginal().isAbility() && enlargeMode == EnlargeMode.NORMAL) { bigCard.showTextComponent(); } else { bigCard.hideTextComponent(); } } else { JXPanel panel = GuiDisplayUtil.getDescription(mageCard.getOriginal(), bigCard.getWidth(), bigCard.getHeight()); panel.setVisible(true); bigCard.hideTextComponent(); bigCard.addJXPanel(mageCard.getOriginal().getId(), panel); } enlargeredViewOpened = new Date(); }
public void setBusy (final boolean busy) { assert EventQueue.isDispatchThread(); // FIXME: it doesn't block interactions this.busy = busy; busyLabel.setBusy(busy); shadingPanel.setVisible(busy); } }
public void setBusy (final boolean busy) { assert EventQueue.isDispatchThread(); // FIXME: it doesn't block interactions this.busy = busy; busyLabel.setBusy(busy); shadingPanel.setVisible(busy); } }
private void createPanImage() { // create a still image of the current state of this map panel. This // image is following the mouse and thus // providing a visual clue that panning occurs // hide the underlying map panel when making the snapshot mapPanel.setVisible(false); layerListPanel.setVisible(false); this.layeredPaneDragImage = createImage(layerPanelContainer, BufferedImage.TYPE_INT_ARGB_PRE); mapPanel.setVisible(true); layerListPanel.setVisible(true); this.drawingLayerPanel.paint(this.layeredPaneDragImage.getGraphics()); // // hide object layers // for (Component c : this.layerPanelContainer.getComponentsInLayer(LAYER_ACTIVE)) { c.setVisible(false); } this.drawingLayerPanel.setVisible(true); // a separate flag indicating whether or not to draw the drag image is // needed. // mouseDragging is not sufficient because it is reset before the new // map is available. this.drawOldStateImage = true; }
public void setVisible(boolean visible) { boolean old = isVisible(); setAlpha(alphaStart); super.setVisible(visible); firePropertyChange("visible", old, isVisible()); }
public SimpleExplorerPanel() { assert EventQueue.isDispatchThread(); setLayout(new OverlayLayout(this)); busyLabel.setText("Loading..."); busyLabel.setHorizontalAlignment(SwingConstants.CENTER); final MattePainter painter = new MattePainter(new Color(255, 255, 255, 128)); // painter.setFilters(new GaussianBlurFilter(10)); shadingPanel.setVisible(false); shadingPanel.setOpaque(false); shadingPanel.setBackgroundPainter(painter); shadingPanel.add(busyLabel, BorderLayout.CENTER); add(shadingPanel); final ActionMap actionMap = getActionMap(); actionMap.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(explorerManager)); actionMap.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(explorerManager)); actionMap.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(explorerManager)); actionMap.put("delete", ExplorerUtils.actionDelete(explorerManager, true)); explorerManager.addPropertyChangeListener(pcl); }
public SimpleExplorerPanel() { assert EventQueue.isDispatchThread(); setLayout(new OverlayLayout(this)); busyLabel.setText("Loading..."); busyLabel.setHorizontalAlignment(SwingConstants.CENTER); final MattePainter painter = new MattePainter(new Color(255, 255, 255, 128)); // painter.setFilters(new GaussianBlurFilter(10)); shadingPanel.setVisible(false); shadingPanel.setOpaque(false); shadingPanel.setBackgroundPainter(painter); shadingPanel.add(busyLabel, BorderLayout.CENTER); add(shadingPanel); final ActionMap actionMap = getActionMap(); actionMap.put(DefaultEditorKit.copyAction, ExplorerUtils.actionCopy(explorerManager)); actionMap.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(explorerManager)); actionMap.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(explorerManager)); actionMap.put("delete", ExplorerUtils.actionDelete(explorerManager, true)); explorerManager.addPropertyChangeListener(pcl); }