Examples of GlassPanel


Examples of org.noos.xing.mydoggy.plaf.ui.cmp.GlassPanel

        glassPane.repaint();
        this.updatedGhostImage = ghostImage;
    }

    protected void updateGhostImage(Point point) {
        GlassPanel glassPane = manager.getGlassPanel();
        glassPane.setPoint(SwingUtil.convertPointFromScreen(point, glassPane));
        glassPane.repaint();
    }
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.GlassPanel

        glassPane.setPoint(SwingUtil.convertPointFromScreen(point, glassPane));
        glassPane.repaint();
    }

    protected void resetGhostImage() {
        GlassPanel glassPane = manager.getGlassPanel();
        Rectangle dirtyRegion = glassPane.getRepaintRect();
        glassPane.setDraggingImage(null);
        glassPane.repaint(dirtyRegion);
    }
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.GlassPanel

        glassPane.setDraggingImage(null);
        glassPane.repaint(dirtyRegion);
    }

    protected void cleanupGhostImage() {
        GlassPanel glassPane = manager.getGlassPanel();
        glassPane.setDraggingImage(null);
        glassPane.setVisible(false);
        ghostImage = null;
        SwingUtilities.getWindowAncestor(manager).repaint();
    }
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.GlassPanel

            // Start Drag
            dge.startDrag(Cursor.getDefaultCursor(), new ToolWindowTrasferable(toolWindow), this);

            // Prepare glassPane for ghost image
            GlassPanel glassPane = descriptor.getManager().getGlassPanel();

            glassPane.setVisible(true);

            // Build orginalDragImage
            Component contentContainer = ((DockedContainer) descriptor.getToolWindowContainer()).getContentContainer();
            ghostImage = new BufferedImage(contentContainer.getWidth(),
                                           contentContainer.getHeight(), BufferedImage.TYPE_INT_RGB);
            contentContainer.print(ghostImage.getGraphics());

            // Setup glasspane
            Point p = (Point) dge.getDragOrigin().clone();
            SwingUtilities.convertPointFromScreen(p, glassPane);
            glassPane.setPoint(p);
            glassPane.setDraggingImage(ghostImage.getScaledInstance(contentContainer.getWidth() / 3,
                                                                    contentContainer.getHeight() / 3, BufferedImage.SCALE_SMOOTH));
            glassPane.repaint();

            lastAnchor = null;
        }
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.GlassPanel

        public void dragMouseMoved(DragSourceDragEvent dsde) {
            if (!DragAndDropLock.isDragAndDropStarted() || ghostImage == null)
                return;

            GlassPanel glassPane = descriptor.getManager().getGlassPanel();

            Point p = (Point) dsde.getLocation().clone();
            SwingUtilities.convertPointFromScreen(p, glassPane);
            glassPane.setPoint(p);

            Container contentPane = descriptor.getManager().getRootPane().getContentPane();
            Component component = SwingUtilities.getDeepestComponentAt(contentPane, p.x, p.y);
            if (component != null) {
                if (lastToolWindowContainer != null)
                    lastToolWindowContainer.setBorder(oldBorder);

                lastToolWindowContainer = (JPanel) SwingUtil.getParent(component, "toolWindow.container");
                if (lastToolWindowContainer != null) {
                    oldBorder = lastToolWindowContainer.getBorder();
                    lastToolWindowContainer.setBorder(highligthBorder);
                }
            }

            p = (Point) dsde.getLocation().clone();
            SwingUtilities.convertPointFromScreen(p, descriptor.getManager());
            ToolWindowAnchor newAnchor = descriptor.getToolWindowAnchor(p);

            if (newAnchor != lastAnchor) {
                Rectangle dirtyRegion = glassPane.getRepaintRect();

                if (newAnchor == null) {
                    descriptor.getToolBar(lastAnchor).setTempShowed(false);
                } else {
                    if (descriptor.getToolBar(newAnchor).getAvailableTools() == 0)
                        descriptor.getToolBar(newAnchor).setTempShowed(true);
                }

                lastAnchor = newAnchor;
                glassPane.repaint(dirtyRegion);
            }

            glassPane.repaint(glassPane.getRepaintRect());
        }
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.GlassPanel

                } finally {
                    toolWindow.setAggregateMode(oldAM);
                }
            }

            GlassPanel glassPane = descriptor.getManager().getGlassPanel();

            Point p = (Point) dsde.getLocation().clone();
            SwingUtilities.convertPointFromScreen(p, glassPane);

            glassPane.setDraggingImage(null);
            glassPane.setVisible(false);

            ghostImage = null;

            DragAndDropLock.setLocked(false);
            SwingUtilities.getWindowAncestor(descriptor.getManager()).repaint();
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.GlassPanel

        }
    }

    protected void hideAllPreview() {
        if (previewPanel != null) {
            GlassPanel glassPane = descriptor.getManager().getGlassPanel();
            glassPane.remove(previewPanel);
        }
    }
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.GlassPanel

                if ("stop".equals(e.getActionCommand())) {
                    if (previewPanel != null && !firstPreview) {
                        JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(label);

                        if (frame != null) {
                            GlassPanel glassPane = descriptor.getManager().getGlassPanel();
                            glassPane.remove(previewPanel);
                            SwingUtil.repaint(glassPane);
                            glassPane.setVisible(false);

                            SwingUtil.repaint(frame);

                            previewPanel = null;
                        }
                    }
                    firstPreview = false;
                } else if (dockedTypeDescriptor.isPreviewEnabled()) {
                    Container contentContainer = ((DockedContainer) descriptor.getToolWindowContainer()).getContentContainer();
                    int width = 176;
                    int height = 132;

                    // Show Preview
                    RootPaneContainer rootPaneContainer = (RootPaneContainer) SwingUtilities.getWindowAncestor(label);
                    if (rootPaneContainer != null) {
                        JMenuBar jMenuBar = rootPaneContainer instanceof JFrame ?
                                            ((JFrame) rootPaneContainer).getJMenuBar() : null;

                        firstPreview = true;
                        previewTimer.stop();

                        GlassPanel glassPane = descriptor.getManager().getGlassPanel();

                        if (previewPanel != null)
                            glassPane.remove(previewPanel);

                        previewPanel = new TranslucentPanel(new ExtendedTableLayout(new double[][]{{2, TableLayout.FILL, 2}, {2, TableLayout.FILL, 2}}));
                        previewPanel.setAlphaModeRatio(dockedTypeDescriptor.getPreviewTransparentRatio());
                        previewPanel.setSize(width + 4, height + 4);

                        Container mainContainer = descriptor.getManager();
                        switch (descriptor.getToolWindow().getAnchor()) {
                            case LEFT:
                                previewPanel.setLocation(
                                        mainContainer.getX() +
                                        label.getX() + label.getWidth() + 3,

                                        (jMenuBar != null ? jMenuBar.getHeight() : 0) +
                                        mainContainer.getY() +
                                        label.getY() +
                                        (descriptor.getToolBar(TOP).getAvailableTools() != 0 ? 23 : 0)
                                );
                                break;
                            case TOP:
                                previewPanel.setLocation(
                                        mainContainer.getX() +
                                        label.getX() +
                                        (descriptor.getToolBar(LEFT).getAvailableTools() != 0 ? 23 : 0),

                                        (jMenuBar != null ? jMenuBar.getHeight() : 0) +
                                        mainContainer.getY() +
                                        label.getY() + label.getHeight() + 3
                                );
                                break;
                            case BOTTOM:
                                previewPanel.setLocation(
                                        mainContainer.getX() +
                                        label.getX() +
                                        (descriptor.getToolBar(LEFT).getAvailableTools() != 0 ? 23 : 0),

                                        (jMenuBar != null ? jMenuBar.getHeight() : 0) +
                                        mainContainer.getY() +
                                        mainContainer.getHeight() -
                                                                  previewPanel.getHeight() - 26
                                );
                                break;
                            case RIGHT:
                                previewPanel.setLocation(
                                        mainContainer.getX() +
                                        mainContainer.getWidth() -
                                                                 previewPanel.getWidth() - 26,

                                        (jMenuBar != null ? jMenuBar.getHeight() : 0) +
                                        mainContainer.getY() +
                                        label.getY() +
                                        (descriptor.getToolBar(TOP).getAvailableTools() != 0 ? 23 : 0)
                                );
                                break;
                        }

                        if (previewPanel.getY() + previewPanel.getHeight() >
                            mainContainer.getY() + mainContainer.getHeight() - 26) {

                            previewPanel.setLocation(
                                    previewPanel.getX(),

                                    (jMenuBar != null ? jMenuBar.getHeight() : 0) +
                                    mainContainer.getY() +
                                    mainContainer.getHeight() -
                                                              (descriptor.getToolBar(BOTTOM).getAvailableTools() != 0 ? 23 : 0) -
                                                              previewPanel.getHeight() - 3
                            );
                        }

                        if (previewPanel.getX() + previewPanel.getWidth() >
                            mainContainer.getX() + mainContainer.getWidth() - 26) {

                            previewPanel.setLocation(
                                    mainContainer.getX() +
                                    mainContainer.getWidth() -
                                                             (descriptor.getToolBar(RIGHT).getAvailableTools() != 0 ? 23 : 0) -
                                                             previewPanel.getWidth() - 3,

                                    previewPanel.getY()
                            );
                        }


                        previewPanel.add(contentContainer, "1,1,FULL,FULL");

                        glassPane.add(previewPanel);
                        glassPane.setVisible(true);
                        SwingUtil.repaint(glassPane);
                    }
                }
            }
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.GlassPanel

            // Start Drag
            dge.startDrag(Cursor.getDefaultCursor(), new ToolWindowTrasferable(toolWindow), this);

            // Prepare glassPane for ghost image
            GlassPanel glassPane = descriptor.getManager().getGlassPanel();
            glassPane.setVisible(true);

            // Build orginalDragImage
            JComponent representativeAnchor = descriptor.getRepresentativeAnchor();
            ghostImage = new BufferedImage(representativeAnchor.getWidth(), representativeAnchor.getHeight(), BufferedImage.TYPE_INT_RGB);
            representativeAnchor.print(ghostImage.createGraphics());

            descriptor.getToolBar().propertyChange(new PropertyChangeEvent(label, "startDrag", null, dge));

            // Setup glasspane
            Point p = (Point) dge.getDragOrigin().clone();
            SwingUtilities.convertPointFromScreen(p, glassPane);
            glassPane.setPoint(p);
            glassPane.setDraggingImage(ghostImage);
            glassPane.repaint();

            lastAnchor = null;
        }
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.GlassPanel

        public void dragMouseMoved(DragSourceDragEvent dsde) {
            if (!DragAndDropLock.isDragAndDropStarted() || ghostImage == null)
                return;

            GlassPanel glassPane = descriptor.getManager().getGlassPanel();

            Point p = (Point) dsde.getLocation().clone();
            SwingUtilities.convertPointFromScreen(p, glassPane);
            glassPane.setPoint(p);

            p = (Point) dsde.getLocation().clone();
            SwingUtilities.convertPointFromScreen(p, descriptor.getManager());
            ToolWindowAnchor newAnchor = descriptor.getToolWindowAnchor(p);

            if (newAnchor != lastAnchor) {
                Rectangle dirtyRegion = glassPane.getRepaintRect();
                glassPane.setDraggingImage(null);
                glassPane.repaint(dirtyRegion);

                if (newAnchor == null) {
                    glassPane.setDraggingImage(ghostImage);
                    descriptor.getToolBar(lastAnchor).setTempShowed(false);
                } else {
                    if (descriptor.getToolBar(newAnchor).getAvailableTools() == 0)
                        descriptor.getToolBar(newAnchor).setTempShowed(true);

                    switch (newAnchor) {
                        case LEFT:
                            switch (descriptor.getToolWindow().getAnchor()) {
                                case LEFT:
                                    glassPane.setDraggingImage(ghostImage);
                                    break;
                                case RIGHT:
                                    glassPane.setDraggingImage(GraphicsUtil.rotate(ghostImage, Math.PI));
                                    break;
                                default:
                                    glassPane.setDraggingImage(GraphicsUtil.rotate(ghostImage, 1.5 * Math.PI));
                                    break;
                            }
                            break;
                        case RIGHT:
                            switch (descriptor.getToolWindow().getAnchor()) {
                                case LEFT:
                                    glassPane.setDraggingImage(GraphicsUtil.rotate(ghostImage, Math.PI));
                                    break;
                                case RIGHT:
                                    glassPane.setDraggingImage(ghostImage);
                                    break;
                                default:
                                    glassPane.setDraggingImage(GraphicsUtil.rotate(ghostImage, -1.5 * Math.PI));
                                    break;
                            }
                            break;
                        case TOP:
                        case BOTTOM:
                            switch (descriptor.getToolWindow().getAnchor()) {
                                case LEFT:
                                    glassPane.setDraggingImage(GraphicsUtil.rotate(ghostImage, -1.5 * Math.PI));
                                    break;
                                case RIGHT:
                                    glassPane.setDraggingImage(GraphicsUtil.rotate(ghostImage, 1.5 * Math.PI));
                                    break;
                                default:
                                    glassPane.setDraggingImage(ghostImage);
                                    break;
                            }
                            break;
                    }
                }

                lastAnchor = newAnchor;
                dirtyRegion = glassPane.getRepaintRect();
                glassPane.repaint(dirtyRegion);
            }

            glassPane.repaint(glassPane.getRepaintRect());
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.