Package com.l2fprod.common.swing

Examples of com.l2fprod.common.swing.JTaskPaneGroup


    highlightFavorites();
  }

  private void init(Dimension pluginsSize, boolean showSettings) {
    mShowSettings = showSettings;
    mFunctionGroup = new JTaskPaneGroup();
    mFunctionGroup.setTitle(mLocalizer.msg("functions", "Functions"));
    mFunctionGroup.setDoubleBuffered(true);

    mMainPanel = new JPanel(new BorderLayout());
    mMainPanel.setPreferredSize(new Dimension(750, 500));
View Full Code Here


      instance.resetFunctionGroupInternal();
    }
  }

  private void resetFunctionGroupInternal() {
    mFunctionGroup = new JTaskPaneGroup();
    mFunctionGroup.setTitle(mLocalizer.msg("functions", "Functions"));

    mPluginsPane = new JTaskPane();
    mPluginsPane.add(mFunctionGroup);
View Full Code Here

  private void addTaskPaneGroup(final JTaskPaneGroup parent,
      final Program program, final ActionMenu menu, final ProgramInfoDialog info,
      final String id) {
    final ActionMenu[] subs = menu.getSubItems();

    final JTaskPaneGroup group = new JTaskPaneGroup();
    group.setTitle((String) menu.getAction().getValue(Action.NAME));
    final boolean expanded = ProgramInfo
        .getInstance()
        .getSettings()
        .getExpanded(
        id + "_" + (String) menu.getAction().getValue(Action.NAME));
    group.setExpanded(expanded);
    group.setEnabled(true);
    mFind.installKeyListener(group);

    /*
     * Listener to get expand state changes and store the state in the
     * Properties for the Plugins menu.
     */
    group.addPropertyChangeListener(new PropertyChangeListener() {
      public void propertyChange(final PropertyChangeEvent evt) {
        ProgramInfo.getInstance().getSettings().setExpanded(
            id + "_" + (String) menu.getAction().getValue(Action.NAME),
            group.isExpanded());
      }
    });

    if (menu.getAction().getValue(Action.SMALL_ICON) != null) {
      group.setIcon((Icon) menu.getAction().getValue(Action.SMALL_ICON));
    }

    // delay group creation if it is not expanded
    if (expanded) {
      for (ActionMenu subMenu : subs) {
View Full Code Here

            icon = command.getIcon();
        }

        if (parentComponent instanceof JTaskPaneGroup)
        {
            final JTaskPaneGroup parent = (JTaskPaneGroup) parentComponent;
            final JTaskPaneGroup group = new JTaskPaneGroup();
            group.setTitle(command.getText());
            group.setIcon(icon);
            group.setExpanded(false);

            if (hasOnlyOneExpanded())
            {
                group.addPropertyChangeListener(JTaskPaneGroup.EXPANDED_CHANGED_KEY, new PropertyChangeListener()
                {
                    public void propertyChange(PropertyChangeEvent evt)
                    {
                        if ((Boolean) evt.getNewValue())
                        {
                            Component[] comps = parent.getComponents();
                            for (int i = 0; i < comps.length; i++)
                            {
                                if (comps[i] instanceof JTaskPaneGroup && comps[i] != group)
                                {
                                    JTaskPaneGroup g = ((JTaskPaneGroup) comps[i]);
                                    if (g.isExpanded())
                                    {
                                        g.setExpanded(false);
                                    }
                                }
                            }
                        }
                    }
                });
            }

            parent.add(group);

            return group;
        }
        else
        {
            final JTaskPane parent = (JTaskPane) parentComponent;
            final JTaskPaneGroup group = new JTaskPaneGroup();
            group.setTitle(command.getText());
            group.setIcon(icon);
            group.setExpanded(false);

            if (hasOnlyOneExpanded())
            {
                group.addPropertyChangeListener(JTaskPaneGroup.EXPANDED_CHANGED_KEY, new PropertyChangeListener()
                {
                    public void propertyChange(PropertyChangeEvent evt)
                    {
                        if ((Boolean) evt.getNewValue())
                        {
                            Component[] comps = parent.getComponents();
                            for (int i = 0; i < comps.length; i++)
                            {
                                if (comps[i] instanceof JTaskPaneGroup && comps[i] != group)
                                {
                                    JTaskPaneGroup g = ((JTaskPaneGroup) comps[i]);
                                    if (g.isExpanded())
                                    {
                                        g.setExpanded(false);
                                    }
                                }
                            }
                        }
                    }
View Full Code Here

                            XGrapherTaskPane.this.app.getModalGraphMouse().setMode(Mode.TRANSFORMING);
                        }
                    }
                });               
   
    actionsPane = new JTaskPaneGroup();
    actionsPane.setTitle("Actions");
    actionsPane.setToolTipText("This pane contains Actions which apply to the selected item");
    actionsPane.setExpanded(false);   
    actionsPane.add(panel);
   
   
    XGrapherPropertySheet propertySheet = new XGrapherPropertySheet(app);

    detailsPane = new JTaskPaneGroup();
    detailsPane.setTitle("Details");
    detailsPane.setToolTipText("This pane contains Details which apply to the selected item");
    detailsPane.setExpanded(true);   
    detailsPane.add(propertySheet);   
   
View Full Code Here

    public DemoPanel() {
      JTaskPane taskPane = new JTaskPane();

      // "System" GROUP
      JTaskPaneGroup systemGroup = new JTaskPaneGroup();
      systemGroup.setTitle(RESOURCE.getString("Main.tasks.systemGroup"));
      systemGroup.setToolTipText(RESOURCE
        .getString("Main.tasks.systemGroup.tooltip"));
      systemGroup.setSpecial(true);
      systemGroup.setIcon(new ImageIcon(TaskPaneMain.class
        .getResource("icons/tasks-email.png")));

      systemGroup.add(makeAction(RESOURCE.getString("Main.tasks.email"), "",
        "icons/tasks-email.png"));
      systemGroup.add(makeAction(RESOURCE.getString("Main.tasks.delete"), "",
        "icons/tasks-recycle.png"));

      taskPane.add(systemGroup);

      // "Office" GROUP
      JTaskPaneGroup officeGroup = new JTaskPaneGroup();
      officeGroup.setTitle(RESOURCE.getString("Main.tasks.office"));
      officeGroup.add(makeAction(RESOURCE.getString("Main.tasks.word"), "",
        "icons/tasks-writedoc.png"));
      officeGroup.setExpanded(false);
      officeGroup.setScrollOnExpand(true);

      taskPane.add(officeGroup);

      // "SEE ALSO" GROUP and ACTIONS
      JTaskPaneGroup seeAlsoGroup = new JTaskPaneGroup();
      // this group can not be collapsed
      seeAlsoGroup.setCollapsable(false);
      seeAlsoGroup.setTitle(RESOURCE.getString("Main.tasks.seealso"));
      seeAlsoGroup.add(makeAction("The Internet", RESOURCE
        .getString("Main.tasks.internet.tooltip"), "icons/tasks-internet.png"));

      seeAlsoGroup.add(makeAction(RESOURCE.getString("Main.tasks.help"),
        RESOURCE.getString("Main.tasks.help.tooltip"),
        "icons/tasks-question.png"));

      taskPane.add(seeAlsoGroup);

      // "Details" GROUP
      JTaskPaneGroup detailsGroup = new JTaskPaneGroup();
      detailsGroup.setTitle(RESOURCE.getString("Main.tasks.details"));
      detailsGroup.setScrollOnExpand(true);

      JEditorPane detailsText = new JEditorPane("text/html", "<html>");
      LookAndFeelTweaks.makeMultilineLabel(detailsText);
      LookAndFeelTweaks.htmlize(detailsText);
      detailsText.setText(RESOURCE.getString("Main.tasks.details.message"));
      detailsGroup.add(detailsText);

      taskPane.add(detailsGroup);

      JScrollPane scroll = new JScrollPane(taskPane);
      scroll.setBorder(null);
View Full Code Here

   * Display Info block in the task bar
   */
  private void displayTaskInfo()
  {

    loadedFile = new JTaskPaneGroup();
    loadedFile.setTitle(GUIMessages.getString("GeneratorInfoPanel.titleBorder.text"));
    loadedFile.setIcon(GUIUtils.getImageIcon("img/about.png"));
    loadedFile.setScrollOnExpand(true);
    loadedFile.setExpanded(true);

View Full Code Here

  /**
   * Display form to import resources in the task bar
   */
  private void displayTaskResources()
  {
    importResources = new JTaskPaneGroup();
    importResources.setTitle(GUIMessages.getString("GeneratorParamPanel.importResources.title"));
    importResources.setToolTipText(GUIMessages.getString("GeneratorParamPanel.importResources.tooltip"));
    importResources.setIcon(GUIUtils.getImageIcon("img/import.png"));
    importResources.setScrollOnExpand(true);
    importResources.setExpanded(true);
View Full Code Here


  private void displayTaskBar()
  {
    // "System" GROUP
    JTaskPaneGroup systemGroup = new JTaskPaneGroup();
    systemGroup.setTitle(GUIMessages.getString("Main.tasks.systemGroup"));
    systemGroup.setToolTipText(GUIMessages.getString("Main.tasks.systemGroup.tooltip"));
    //systemGroup.setSpecial(true);
    systemGroup.setIcon(new ImageIcon(TaskPaneMain.class.getResource("icons/tasks-email.png")));

    systemGroup.add(makeAction(GUIMessages.getString("Main.tasks.email"), "", "icons/tasks-email.png"));
    systemGroup.add(makeAction(GUIMessages.getString("Main.tasks.delete"), "", "icons/tasks-recycle.png"));

    taskPane.add(systemGroup);

    // "Office" GROUP
    JTaskPaneGroup officeGroup = new JTaskPaneGroup();
    officeGroup.setTitle(GUIMessages.getString("Main.tasks.office"));
    officeGroup.add(makeAction(GUIMessages.getString("Main.tasks.word"), "", "icons/tasks-writedoc.png"));
    officeGroup.setExpanded(false);
    officeGroup.setScrollOnExpand(true);

    taskPane.add(officeGroup);

    // "SEE ALSO" GROUP and ACTIONS
    JTaskPaneGroup seeAlsoGroup = new JTaskPaneGroup();
    // this group can not be collapsed
    seeAlsoGroup.setCollapsable(false);
    seeAlsoGroup.setTitle(GUIMessages.getString("Main.tasks.seealso"));
    seeAlsoGroup.add(makeAction("The Internet", GUIMessages.getString("Main.tasks.internet.tooltip"), "icons/tasks-internet.png"));

    seeAlsoGroup.add(makeAction(GUIMessages.getString("Main.tasks.help"), GUIMessages.getString("Main.tasks.help.tooltip"), "icons/tasks-question.png"));
    setLayout(new BorderLayout(0, 0));

    taskPane.add(seeAlsoGroup);

    // "Details" GROUP
    JTaskPaneGroup detailsGroup = new JTaskPaneGroup();
    detailsGroup.setTitle(GUIMessages.getString("Main.tasks.details"));
    detailsGroup.setScrollOnExpand(true);

    JEditorPane detailsText = new JEditorPane("text/html", "<html>");
    //LookAndFeelTweaks.makeMultilineLabel(detailsText);
    //LookAndFeelTweaks.htmlize(detailsText);
    detailsText.setText(GUIMessages.getString("Main.tasks.details.message"));
    detailsGroup.add(detailsText);

    taskPane.add(detailsGroup);
  }
View Full Code Here

      int x,
      int y,
      int width,
      int height) {

      JTaskPaneGroup group = (JTaskPaneGroup)c;

      // calculate position of title and toggle controls
      int controlWidth = TITLE_HEIGHT - 2 * ROUND_HEIGHT;
      // oval looks more like a circle with odd width
      if (controlWidth % 2 != 0) { controlWidth++; }
     
      int controlX = group.getWidth() - TITLE_HEIGHT;
      int controlY = ROUND_HEIGHT - 1;
      int titleX = 3;
      int titleY = 0;
      int titleWidth = group.getWidth() - getTitleHeight() - 3;
      int titleHeight = getTitleHeight();
     
      if (!group.getComponentOrientation().isLeftToRight()) {
        controlX = group.getWidth() - controlX - controlWidth;       
        titleX = group.getWidth() - titleX - titleWidth;
      }
     
      // paint the title background
      paintTitleBackground(group, g);

      // paint the the toggles
      if (group.isCollapsable()) {
        paintExpandedControls(group, g, controlX, controlY, controlWidth,
          controlWidth);
      }

      // paint the title text and icon
      Color paintColor = getPaintColor(group);

      // focus painted same color as text
      if (group.hasFocus()) {
        paintFocus(g,
          paintColor,
          3,
          3,
          width - 6,
View Full Code Here

TOP

Related Classes of com.l2fprod.common.swing.JTaskPaneGroup

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.