Package org.openbp.jaspira.option

Examples of org.openbp.jaspira.option.Option


    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

    if (getTitleMode() == TITLE_NAME)
      value = "name";
    else
      value = "text";

    Option option = OptionMgr.getInstance().getOption(TITLEMODE_OPTION);
    option.setValue(value);

    fireChanged("displayobject.changed.titlemode");
  }
View Full Code Here

TOP

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

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.