Package com.greentea.relaxation.jnmf.gui.components

Examples of com.greentea.relaxation.jnmf.gui.components.AbstractComponent


      {
         DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value;

         if (treeNode.getUserObject() instanceof AbstractComponent)
         {
            AbstractComponent userComponent = (AbstractComponent) treeNode.getUserObject();

            Icon icon = userComponent.getIcon();

            if (icon != null)
            {
               component.setIcon(icon);
            }

            Color color = userComponent.getForegroundColor();
            if (color != null)
            {
               component.setForeground(color);
            }
            else
View Full Code Here


      {
         public void mouseClicked(MouseEvent e)
         {
            if (e.getButton() == MouseEvent.BUTTON3)
            {
               AbstractComponent selectedComponent = getSelectedComponent();

               if (selectedComponent != null)
               {
                  JPopupMenu menu = selectedComponent.getMenu();

                  if (menu != null)
                  {
                     menu.show(projectTree, e.getX(), e.getY());
                  }
               }
            }
         }
      });
      projectTree.addTreeSelectionListener(new TreeSelectionListener()
      {
         public void valueChanged(TreeSelectionEvent e)
         {
            AbstractComponent oldComponent = getComponent(e.getOldLeadSelectionPath());

            if (oldComponent != null)
            {
               oldComponent.onComponentLeave();
            }

            AbstractComponent selectedComponent = getSelectedComponent();

            if (componentSelectedListener != null)
            {
               componentSelectedListener.fireComponentSelected(selectedComponent);
            }
View Full Code Here

      projectTree.addTreeWillExpandListener(new TreeWillExpandListener()
      {
         public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException
         {
            AbstractComponent component = getComponent(event.getPath());

            if (!component.isExpandEnabled())
            {
               throw new ExpandVetoException(event);
            }
         }

         public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException
         {
            AbstractComponent component = getComponent(event.getPath());

            if (!component.isCollapseEnabled())
            {
               throw new ExpandVetoException(event);
            }
         }
      });
View Full Code Here

      });
   }

   private AbstractComponent getComponent(TreePath path)
   {
      AbstractComponent component = null;

      if (path != null)
      {
         DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
View Full Code Here

      return getComponent(projectTree.getSelectionPath());
   }

   private ProjectComponent getSelectedProject()
   {
      AbstractComponent component = getComponent(projectTree.getSelectionPath());

      ProjectComponent project = null;

      if (component != null)
      {
         while (component != null && !(component instanceof ProjectComponent))
         {
            component = component.getParentComponent();
         }

         project = (ProjectComponent) component;
      }
View Full Code Here

TOP

Related Classes of com.greentea.relaxation.jnmf.gui.components.AbstractComponent

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.