Package org.noos.xing.mydoggy.plaf.ui

Examples of org.noos.xing.mydoggy.plaf.ui.ToolWindowDescriptor



  class AvailableListener implements PropertyChangeListener {

    public void propertyChange(PropertyChangeEvent evt) {
      ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();

      if (descriptor.getToolWindow().getType() != ToolWindowType.FLOATING_FREE) {
        boolean oldAvailable = (Boolean) evt.getOldValue();
        boolean newAvailable = (Boolean) evt.getNewValue();

        boolean repaint = false;
        JLabel anchorLabel = descriptor.getAnchorLabel(contentPane);

        if (oldAvailable && !newAvailable) {
          // true -> false
          removeAnchorLabel(anchorLabel, descriptor);
          repaint = true;
View Full Code Here


    }
  }

  static class ActiveListener implements PropertyChangeListener {
    public void propertyChange(PropertyChangeEvent evt) {
      ToolWindowDescriptor toolWindowDescriptor = (ToolWindowDescriptor) evt.getSource();
      toolWindowDescriptor.getToolWindowContainer().propertyChange(evt);
    }
View Full Code Here


  class TypeListener extends AvailableListener {

    public void propertyChange(PropertyChangeEvent evt) {
      ToolWindowDescriptor toolWindowDescriptor = (ToolWindowDescriptor) evt.getSource();

      if (evt.getOldValue() == ToolWindowType.FLOATING_FREE) {
        addAnchorLabel(toolWindowDescriptor.getAnchorLabel(contentPane));
        ensureVisible(toolWindowDescriptor.getAnchorLabel());

        SwingUtil.repaint(contentPane);
      } else if (evt.getNewValue() == ToolWindowType.FLOATING_FREE &&
             toolWindowDescriptor.getAnchorLabel() != null) {

        removeAnchorLabel(toolWindowDescriptor.getAnchorLabel(), toolWindowDescriptor);
        SwingUtil.repaint(contentPane);
      }

    }
View Full Code Here

  class VisibleDockedListener implements PropertyChangeListener {
    private final SplitAnimation splitAnimation = new SplitAnimation();

    public void propertyChange(PropertyChangeEvent evt) {
      ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();
      boolean visible = (Boolean) evt.getNewValue();

      Component content = (visible) ? descriptor.getComponent() : null;
      if (content != null) {
        DockedContainer container = (DockedContainer) descriptor.getToolWindowContainer();
        content = container.getContentContainer();
      }

      if (content == null || descriptor.getDivederLocation() > 0 && splitPane.getDividerSize() != 0) {
        if (manager.getShowingGroup() == null) {
          synchronized (splitAnimation) {
            if (splitAnimation.isAnimating())
              splitAnimation.stop();
          }

          switch (anchor) {
            case LEFT:
            case TOP:
              descriptor.setDivederLocation(splitPane.getDividerLocation());
              break;
            case RIGHT:
              descriptor.setDivederLocation(splitPane.getWidth() - splitPane.getDividerLocation());
              break;
            case BOTTOM:
              descriptor.setDivederLocation(splitPane.getHeight() - splitPane.getDividerLocation());
          }
        }
      }

      if (content == null && descriptor.getToolWindow().isVisible())
        return;

      int divederLocation = descriptor.getDivederLocation();

      Object component = getSplitPaneContent();
      boolean animate = true;
      if (component != null) {
        if (component instanceof MultiSplitContainer) {
          MultiSplitContainer multiSplitContainer = (MultiSplitContainer) component;

          if (manager.getShowingGroup() != null) {
            multiSplitContainer.addContent(content);
          } else {
            if (content == null) {
              DockedContainer dockedContainer = (DockedContainer) descriptor.getToolWindowContainer();
              multiSplitContainer.removeContent(dockedContainer.getContentContainer());
              animate = false;

              if (multiSplitContainer.isEmpty()) {
                animate = true;
View Full Code Here

  }

  static class VisibleFloatingListener implements PropertyChangeListener {

    public void propertyChange(PropertyChangeEvent evt) {
      ToolWindowDescriptor toolWindowDescriptor = (ToolWindowDescriptor) evt.getSource();
      boolean visible = (Boolean) evt.getNewValue();

      Component content = (visible) ? toolWindowDescriptor.getComponent() : null;
      FloatingContainer container = (FloatingContainer) toolWindowDescriptor.getToolWindowContainer();

      if (content == null && toolWindowDescriptor.getToolWindow().isVisible())
        return;

      container.propertyChange(evt);
      container.setVisible(visible);
    }
View Full Code Here

  }

  static class VisibleFloatingWindowListener implements PropertyChangeListener {

    public void propertyChange(PropertyChangeEvent evt) {
      ToolWindowDescriptor toolWindowDescriptor = (ToolWindowDescriptor) evt.getSource();
      boolean visible = (Boolean) evt.getNewValue();

      Component content = (visible) ? toolWindowDescriptor.getComponent() : null;
      FloatingContainer container = (FloatingContainer) toolWindowDescriptor.getToolWindowContainer();

      if (content == null && toolWindowDescriptor.getToolWindow().isVisible())
        return;

      container.propertyChange(evt);
      container.setVisible(visible);
    }
View Full Code Here

  }

  class VisibleSlidingListener implements PropertyChangeListener {

    public void propertyChange(PropertyChangeEvent evt) {
      ToolWindowDescriptor toolWindowDescriptor = (ToolWindowDescriptor) evt.getSource();
      boolean visible = (Boolean) evt.getNewValue();

      Component content = (visible) ? toolWindowDescriptor.getComponent() : null;
      SlidingContainer container = (SlidingContainer) toolWindowDescriptor.getToolWindowContainer();

      if (content == null && toolWindowDescriptor.getToolWindow().isVisible())
        return;

      container.setVisible(visible, getToolScrollBar());
    }
View Full Code Here


  class IndexListener implements PropertyChangeListener {

    public void propertyChange(PropertyChangeEvent evt) {
      ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();
      JLabel anchorLabel = descriptor.getAnchorLabel();
      if (anchorLabel != null) {
        TableLayoutConstraints constraints = contentPaneLayout.getConstraints(anchorLabel);

        if (horizontal) {
          int width = anchorLabel.getPreferredSize().width + 6;
View Full Code Here

                      String title, Icon icon, Component component,
                      ResourceBundle resourceBundle) {
        this.internalListenerList = new EventListenerList();
        this.listenerList = new EventListenerList();

        this.descriptor = new ToolWindowDescriptor(manager, this, anchestor, component);
        this.resourceBoundle = resourceBundle;

        this.id = id;
        this.index = index;
        this.anchor = anchor;
View Full Code Here

        return toolWindow;
    }

    public void unregisterToolWindow(String id) {
        ToolWindowDescriptor toolWindowDescriptor = tools.get(id);

        if (toolWindowDescriptor != null) {
            toolWindowDescriptor.unregister();
            toolWindowDescriptor.getToolWindow().setAvailable(false);

            tools.remove(toolWindowDescriptor.getToolWindow().getId());

            fireUnregisteredToolEvent(toolWindowDescriptor.getToolWindow());
        } else
            throw new IllegalArgumentException("Doesn't exist a tool window with passed id. [id : " + id + "]");
    }
View Full Code Here

TOP

Related Classes of org.noos.xing.mydoggy.plaf.ui.ToolWindowDescriptor

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.