Package javax.swing

Examples of javax.swing.JLayeredPane


    cote = side;

    boardSize = new Dimension(600, 600);

    layeredPane = new JLayeredPane();
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(layeredPane, BorderLayout.CENTER);
    JPanel southPanel = new JPanel();
    deplacement = new JLabel("Déplacement : ");
    southPanel.add(deplacement);
View Full Code Here


     */
    public PeriodicTablePanel()
    {
        super();
        setLayout( new BorderLayout());
        layeredPane = new JLayeredPane();
        layeredPane.setPreferredSize(new Dimension(581, 435));
        JPanel tp = PTPanel();
        tp.setBounds(8,85,570, 340);

        panel = CreateLabelProperties(null);
View Full Code Here

  listeners = new EventListenerList();
  modal = new JPanel();
  modal.setOpaque(false);
  modal.addMouseListener(new MouseAdapter() {});
  titleBackground = defaultTitleBackground;
  layeredPane = new JLayeredPane();
  layeredPane.add(modal, Integer.valueOf(JLayeredPane.MODAL_LAYER));
  super.add(layeredPane);
  setBorder(BorderFactory.createLineBorder(separatorColor));
  setLayout(null);
  setOpaque(false);
View Full Code Here

    public DemoPanels() {
        super( "Vivid Swing Animations" );
        setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        setBackground( new Color( 0, 0, 0, 0 ) );

        final JLayeredPane contentPane = new JLayeredPane();
        contentPane.setBackground( Color.DARK_GRAY );
        setContentPane( contentPane );

        JPanel ground = new JPanel();
        ground.setOpaque( true );
        ground.setBackground( Color.DARK_GRAY );
        contentPane.add( ground, JLayeredPane.DEFAULT_LAYER );

        AlphaPanel alphaPanel = new AlphaPanel();
        alphaPanel.setLayout( new BorderLayout() );
        alphaPanel.setAlpha( 0f );
        contentPane.add( alphaPanel, JLayeredPane.PALETTE_LAYER );

        JPanel exampleFadePanel = new JPanel( new BorderLayout() );
        exampleFadePanel.setOpaque( false );
        exampleFadePanel.setBorder( new CompoundBorder( new EmptyBorder( 20, 20, 20, 20 ), BorderFactory.createBevelBorder( BevelBorder.LOWERED ) ) );
        alphaPanel.add( exampleFadePanel, BorderLayout.CENTER );

        JLabel exampleLabel = new JLabel( "I'm the example" );
        exampleLabel.setHorizontalAlignment( SwingUtilities.CENTER );
        exampleLabel.setVerticalAlignment( SwingUtilities.CENTER );
        exampleLabel.setBackground( Color.BLACK );
        exampleLabel.setOpaque( true );
        exampleLabel.setForeground( Color.RED );
        exampleFadePanel.add( exampleLabel, BorderLayout.CENTER );

        final SlidePanel slidePanel = new SlidePanel( DIRECTION.fromLeft );
        slidePanel.setLayout( new BorderLayout() );
        contentPane.add( slidePanel, JLayeredPane.POPUP_LAYER );

        JPanel slideInExample = new JPanel( new BorderLayout() );
        slidePanel.add( slideInExample, BorderLayout.CENTER );
        slideInExample.setBackground( Color.BLUE );
        slideInExample.setOpaque( true );
        slideInExample.setBorder( BorderFactory.createLineBorder( Color.red, 2 ) );

        exampleLabel = new JLabel( "Sliding in and out ..." );
        exampleLabel.setHorizontalAlignment( SwingUtilities.CENTER );
        exampleLabel.setVerticalAlignment( SwingUtilities.CENTER );
        exampleLabel.setForeground( Color.RED );
        slideInExample.add( exampleLabel, BorderLayout.CENTER );

        setSize( 400, 300 );
        setVisible( true );
        Toolkit.getDefaultToolkit().setDynamicLayout( true );

        Rectangle r = new Rectangle( 0, 0, contentPane.getWidth(), contentPane.getHeight() );
        ground.setBounds( r );
        alphaPanel.setBounds( r );
        slidePanel.setBounds( 0, 0, 200, contentPane.getHeight() );

        DefaultAnimationRunner runner = new DefaultAnimationRunner();
        AlphaPanelAnimation fadeIn = new AlphaPanelAnimation( alphaPanel, 1f );
        fadeIn.setStartOffset( 1000 );
        fadeIn.setDuration( 2000 );
        runner.addAnimation( fadeIn );

        AlphaPanelAnimation fadeOut = new AlphaPanelAnimation( alphaPanel, 0f );
        fadeOut.setStartOffset( 4000 );
        fadeOut.setDuration( 2000 );
        runner.addAnimation( fadeOut );

        SlidePanelAnimation slideIn = new SlidePanelAnimation( slidePanel, 1f );
        slideIn.setInterpolator( new AccelerateInterpolator() );
        slideIn.setStartOffset( 7000 );
        slideIn.setDuration( 1000 );
        runner.addAnimation( slideIn );

        SlidePanelAnimation slideOut = new SlidePanelAnimation( slidePanel, 0f );
        slideOut.setInterpolator( new AccelerateInterpolator() );
        slideOut.setStartOffset( 10000 );
        slideOut.setDuration( 1000 );
        slideOut.addAnimationListener( new AnimationAdapter() {
            @Override
            public void animationFinished() {
                slidePanel.setDirection( DIRECTION.fromRight );
                slidePanel.setBounds( contentPane.getWidth() - 200, 0, 200, contentPane.getHeight() );
                super.animationFinished();
            }
        } );
        runner.addAnimation( slideOut );

        slideIn = new SlidePanelAnimation( slidePanel, 1f );
        slideIn.setInterpolator( new AccelerateInterpolator() );
        slideIn.setStartOffset( 13000 );
        slideIn.setDuration( 1000 );
        runner.addAnimation( slideIn );

        slideOut = new SlidePanelAnimation( slidePanel, 0f );
        slideOut.setInterpolator( new AccelerateInterpolator() );
        slideOut.setStartOffset( 16000 );
        slideOut.setDuration( 1000 );
        slideOut.addAnimationListener( new AnimationAdapter() {
            @Override
            public void animationFinished() {
                slidePanel.setDirection( DIRECTION.fromTop );
                slidePanel.setBounds( 0, 0, contentPane.getWidth(), 200 );
                super.animationFinished();
            }
        } );
        runner.addAnimation( slideOut );

        slideIn = new SlidePanelAnimation( slidePanel, 1f );
        slideIn.setInterpolator( new AccelerateInterpolator() );
        slideIn.setStartOffset( 19000 );
        slideIn.setDuration( 1000 );
        runner.addAnimation( slideIn );

        slideOut = new SlidePanelAnimation( slidePanel, 0f );
        slideOut.setInterpolator( new AccelerateInterpolator() );
        slideOut.setStartOffset( 22000 );
        slideOut.setDuration( 1000 );
        slideOut.addAnimationListener( new AnimationAdapter() {
            @Override
            public void animationFinished() {
                slidePanel.setDirection( DIRECTION.fromBottom );
                slidePanel.setBounds( 0, contentPane.getHeight() - 200, contentPane.getWidth(), 200 );
                super.animationFinished();
            }
        } );
        runner.addAnimation( slideOut );
View Full Code Here

            Color bg = transparent ? new Color(0, 0, 0, 0) : null;
            if (w instanceof RootPaneContainer) {
                RootPaneContainer rpc = (RootPaneContainer)w;
                JRootPane root = rpc.getRootPane();
                JLayeredPane lp = root.getLayeredPane();
                Container c = root.getContentPane();
                JComponent content =
                    (c instanceof JComponent) ? (JComponent)c : null;
                if (transparent) {
                    lp.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                         Boolean.valueOf(lp.isOpaque()));
                    lp.setOpaque(false);
                    root.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                           Boolean.valueOf(root.isOpaque()));
                    root.setOpaque(false);
                    if (content != null) {
                        content.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                                  Boolean.valueOf(content.isOpaque()));
                        content.setOpaque(false);
                    }
                    root.putClientProperty(TRANSPARENT_OLD_BG,
                                           root.getParent().getBackground());
                }
                else {
                    lp.setOpaque(Boolean.TRUE.equals(lp.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                    lp.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
                    root.setOpaque(Boolean.TRUE.equals(root.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                    root.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
                    if (content != null) {
                        content.setOpaque(Boolean.TRUE.equals(content.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                        content.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
View Full Code Here

                public void run() {
                    User32 user = User32.INSTANCE;
                    HWND hWnd = getHWnd(w);
                    int flags = user.GetWindowLong(hWnd, User32.GWL_EXSTYLE);
                    JRootPane root = ((RootPaneContainer)w).getRootPane();
                    JLayeredPane lp = root.getLayeredPane();
                    Container content = root.getContentPane();
                    if (content instanceof W32TransparentContentPane) {
                        ((W32TransparentContentPane)content).setTransparent(transparent);
                    }
                    else if (transparent) {
                        W32TransparentContentPane w32content =
                            new W32TransparentContentPane(content);
                        root.setContentPane(w32content);
                        lp.add(new RepaintTrigger(w32content),
                               JLayeredPane.DRAG_LAYER);
                    }
                    if (transparent && !usingUpdateLayeredWindow(w)) {
                        flags |= User32.WS_EX_LAYERED;
                        user.SetWindowLong(hWnd, User32.GWL_EXSTYLE, flags);
View Full Code Here

            if (transparent == isTransparent)
                return;
            whenDisplayable(w, new Runnable() {
                public void run() {
                    JRootPane root = ((RootPaneContainer)w).getRootPane();
                    JLayeredPane lp = root.getLayeredPane();
                    Container content = root.getContentPane();
                    if (content instanceof X11TransparentContentPane) {
                        ((X11TransparentContentPane)content).setTransparent(transparent);
                    }
                    else if (transparent) {
                        X11TransparentContentPane x11content =
                            new X11TransparentContentPane(content);
                        root.setContentPane(x11content);
                        lp.add(new RepaintTrigger(x11content),
                               JLayeredPane.DRAG_LAYER);
                    }
                    setLayersTransparent(w, transparent);
                    setForceHeavyweightPopups(w, transparent);
                    setDoubleBuffered(w, !transparent);
View Full Code Here

  }

  private static Rectangle[] getChildrenVisibleArea(Component component, Filter<Component> filter, Rectangle[] shape, Container parent, Component c) {
    Component[] children;
    if(parent instanceof JLayeredPane) {
      JLayeredPane layeredPane = (JLayeredPane)parent;
      List<Component> childList = new ArrayList<Component>(layeredPane.getComponentCount() - 1);
      int layer = c == null? Integer.MIN_VALUE: layeredPane.getLayer(c);
      for(int i=layeredPane.highestLayer(); i>=layer; i--) {
        Component[] components = layeredPane.getComponentsInLayer(i);
        for(Component child: components) {
          if(child == c) {
            break;
          }
          childList.add(child);
View Full Code Here

      addHierarchyListener(hierarchyListener);
    }
    if(shapeAdjustmentEventListener != null) {
      Toolkit.getDefaultToolkit().addAWTEventListener(shapeAdjustmentEventListener, AWTEvent.COMPONENT_EVENT_MASK | AWTEvent.CONTAINER_EVENT_MASK);
    }
    JLayeredPane layeredPane = null;
    if(isProxiedFiliation) {
      // This call throws a runtime exception if the hierarchy is not compatible
      layeredPane = findLayeredPane(this);
    }
    boolean isEmbeddedPanelCreated = embeddedPanel != null;
    if(isEmbeddedPanelCreated) {
      if(isProxiedFiliation) {
        if(embeddedPanel.getParent() == null) {
          layeredPane.setLayer(embeddedPanel, Integer.MIN_VALUE);
          layeredPane.add(embeddedPanel);
          layeredPane.invalidate();
          layeredPane.validate();
        }
        JLayeredPane oldLayeredPane = findLayeredPane(embeddedPanel);
        if(layeredPane != oldLayeredPane) {
          embeddedPanel.isCrossWindowReparenting = true;
          nativeComponentWrapper.storeInHiddenParent();
          Container oldParent = embeddedPanel.getParent();
          oldParent.remove(embeddedPanel);
View Full Code Here

            Color bg = transparent ? new Color(0, 0, 0, 0) : null;
            if (w instanceof RootPaneContainer) {
                RootPaneContainer rpc = (RootPaneContainer)w;
                JRootPane root = rpc.getRootPane();
                JLayeredPane lp = root.getLayeredPane();
                Container c = root.getContentPane();
                JComponent content =
                    (c instanceof JComponent) ? (JComponent)c : null;
                if (transparent) {
                    lp.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                         Boolean.valueOf(lp.isOpaque()));
                    lp.setOpaque(false);
                    root.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                           Boolean.valueOf(root.isOpaque()));
                    root.setOpaque(false);
                    if (content != null) {
                        content.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                                  Boolean.valueOf(content.isOpaque()));
                        content.setOpaque(false);
                    }
                    root.putClientProperty(TRANSPARENT_OLD_BG,
                                           root.getParent().getBackground());
                }
                else {
                    lp.setOpaque(Boolean.TRUE.equals(lp.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                    lp.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
                    root.setOpaque(Boolean.TRUE.equals(root.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                    root.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
                    if (content != null) {
                        content.setOpaque(Boolean.TRUE.equals(content.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                        content.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
View Full Code Here

TOP

Related Classes of javax.swing.JLayeredPane

Copyright © 2018 www.massapicom. 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.