Package org.openbp.jaspira.option

Examples of org.openbp.jaspira.option.Option$PriorityComparator


  }

  public void addToViewGroups(CmsGroup group) {
    Set<CmsGroup> groups = getViewGroups();
    if (groups == null) {
      groups = new TreeSet<CmsGroup>(new PriorityComparator());
      setViewGroups(groups);
    }
    groups.add(group);
    group.getViewChannels().add(this);
  }
View Full Code Here


  }

  public void addToContriGroups(CmsGroup group) {
    Set<CmsGroup> groups = getContriGroups();
    if (groups == null) {
      groups = new TreeSet<CmsGroup>(new PriorityComparator());
      setContriGroups(groups);
    }
    groups.add(group);
    group.getContriChannels().add(this);
  }
View Full Code Here

  }

  public void addToUsers(CmsUser user) {
    Set<CmsUser> set = getUsers();
    if (set == null) {
      set = new TreeSet<CmsUser>(new PriorityComparator());
      setUsers(set);
    }
    set.add(user);
    user.addToChannels(this);
  }
View Full Code Here

    return ids;
  }
  public void addToViewChannels(Channel channel) {
    Set<Channel> channels = getViewChannels();
    if (channels == null) {
      channels = new TreeSet<Channel>(new PriorityComparator());
      setViewChannels(channels);
    }
    channels.add(channel);
    channel.getViewGroups().add(this);
  }
View Full Code Here

  }

  public void addToContriChannels(Channel channel) {
    Set<Channel> channels = getContriChannels();
    if (channels == null) {
      channels = new TreeSet<Channel>(new PriorityComparator());
      setContriChannels(channels);
    }
    channels.add(channel);
    channel.getContriGroups().add(this);
  }
View Full Code Here

    if (options != null)
    {
      int n = options.size();
      for (int i = 0; i < n; ++i)
      {
        Option option = (Option) options.get(i);
        option.uninstall();
      }
      options = null;
    }
  }
View Full Code Here

          // Note that this constructor is an implicit, private constructor of the
          // inner class mechanism.
          Constructor contr = innerClasses [i].getDeclaredConstructors() [0];

          // Create a new instance of the module using us a reference parameter.
          Option option = (Option) contr.newInstance(new Object [] { this });

          addOption(option);
        }
        catch (InvocationTargetException e)
        {
          ExceptionUtil.printTrace(e);
        }
        catch (InstantiationException e)
        {
          ExceptionUtil.printTrace(e);
        }
        catch (IllegalAccessException e)
        {
          ExceptionUtil.printTrace(e);
        }
        catch (ClassCastException e)
        {
          ExceptionUtil.printTrace(e);
        }
      }
    }

    // Now load the external options
    List externalOptions = getExternalOptionClasses();
    if (externalOptions != null)
    {
      for (Iterator it = externalOptions.iterator(); it.hasNext();)
      {
        Class cls = (Class) it.next();

        if (Option.class.isAssignableFrom(cls))
        {
          Option option = (Option) ReflectUtil.instantiate(cls, Option.class, "external option");
          addOption(option);
        }
      }
    }
  }
View Full Code Here

  /**
   * Reloads the history size.
   */
  public void reloadHistorySize()
  {
    Option opt = OptionMgr.getInstance().getOption(TRANSITION_OPTION_NAME);
    if (opt != null)
    {
      transitionHistorySize = ((Integer) opt.getValue()).intValue();
    }
    else
    {
      transitionHistorySize = DEFAULT_HISTORY_SIZE;
    }
View Full Code Here

    // such as in-place editors around the workspace.
    setLayout(null);

    // Set the background color
    Color workspaceColor = ModelerColors.WORKSPACE;
    Option o = OptionMgr.getInstance().getOption("editor.color.workspace");
    if (o != null)
    {
      workspaceColor = (Color) o.getValue();
    }
    setBackground(workspaceColor);

    // setDisplayUpdate (new BufferedUpdateStrategy ());
    setDisplayUpdate(new SimpleUpdateStrategy());

    ToolTipManager.sharedInstance().registerComponent(this);

    // Decorator handles its own adding to the decomgr.
    selectionDecorator = new SelectionDecorator(this, editor);
    selection = new LinkedList();

    // Mouse and mouse wheel handling
    addMouseListener(new MouseAdapter()
    {
      public void mouseEntered(final MouseEvent e)
      {
        mouseInView = true;
      }

      public void mouseExited(final MouseEvent e)
      {
        mouseInView = false;
      }
    });
    addMouseWheelListener(new MouseWheelListener()
    {
      public void mouseWheelMoved(MouseWheelEvent e)
      {
        int notches = e.getWheelRotation();

        if (InputState.isCtrlDown())
        {
          invalidate();

          // Scale according to mouse movement using heuristic values
          double scaleFactor = getScaleFactor();
          scaleFactor *= (100d + (notches * 2)) / 100;
          setScaleFactor(scaleFactor);

          redraw();
        }
        else
        {
          int mult = e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL ? 25 : 100;
          ((Trackable) editor()).moveTrackerBy(0, notches * mult);
        }
      }
    });

    // Add support for selection and workspace movement by cursor keys
    addCursorKeySupport();

    // Breakout menu support for standard and user toolbox breakout
    addBreakoutSupport("breakout", KeyEvent.VK_SPACE);
    addBreakoutSupport("userbreakout", KeyEvent.VK_1);

    // Load user options
    gridType = OptionMgr.getInstance().getIntegerOption("editor.grid.type", gridType);
    gridDisplayed = OptionMgr.getInstance().getBooleanOption("editor.grid.display", gridDisplayed);
    o = OptionMgr.getInstance().getOption("editor.shadow");
    if (o != null)
    {
      shadowLayouter = (ShadowLayouter) o.getValue();
    }
  }
View Full Code Here

     * @param je Event
     * @return The event status code
     */
    public JaspiraEventHandlerCode modeler_miniview_numberoption(JaspiraEvent je)
    {
      Option opt = (Option) je.getObject();
      if (opt instanceof MiniViewOptionModule.NumberOption)
      {
        setMaximumDisplayedViews(((Integer) opt.getValue()).intValue());
      }

      return EVENT_HANDLED;
    }
View Full Code Here

TOP

Related Classes of org.openbp.jaspira.option.Option$PriorityComparator

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.