⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lnfsettingspanel.java

📁 It is all about project scheduling. GanttProject is a tool for creating a project schedule by means
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*************************************************************************** LnFSettingsPanel  ------------------------------------------ begin                : 27 juin 2004 copyright            : (C) 2004 by Thomas Alexandre email                : alexthomas(at)ganttproject.org ***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/package net.sourceforge.ganttproject.gui.options;import java.awt.BorderLayout;import java.awt.Dimension;import java.awt.FlowLayout;import java.awt.event.ItemEvent;import java.awt.event.ItemListener;import javax.swing.Box;import javax.swing.DefaultListModel;import javax.swing.ImageIcon;import javax.swing.JButton;import javax.swing.JCheckBox;import javax.swing.JComboBox;import javax.swing.JLabel;import javax.swing.JList;import javax.swing.JPanel;import javax.swing.JScrollPane;import net.sourceforge.ganttproject.GPToolBar;import net.sourceforge.ganttproject.GanttProject;import net.sourceforge.ganttproject.gui.GanttLookAndFeelInfo;import net.sourceforge.ganttproject.gui.GanttLookAndFeels;import net.sourceforge.ganttproject.gui.TestGanttRolloverButton;import net.sourceforge.ganttproject.language.GanttLanguage;/** * @author athomas Panel to choose the look'n'feel for GanttProject */public class LnFSettingsPanel extends GeneralOptionPanel implements        ItemListener {    // combo box to store all looknfeel data    private JComboBox cbLnf;    private JCheckBox cbSmallIcon;    private JComboBox cbButtonType;//    private JCheckBox cbShowStatus;    private JList list;    private DefaultListModel iconList;    private DefaultListModel buttonList;    private JList listDeleted;    private DefaultListModel deletedIconList;    private DefaultListModel deletedButtonList;    private boolean bIconMoved = false;    private JScrollPane scrollPane;    private GanttProject appli;    /** Constructor. */    public LnFSettingsPanel(GanttProject parent) {        super(GanttLanguage.getInstance().getText("looknfeel"), GanttLanguage                .getInstance().getText("settingsLooknFeel"), parent);        appli = parent;        // create the combo box with all languages        cbLnf = new JComboBox();        cbLnf.setName("comboLnf");        // cbLnf.addActionListener(this);        GanttLookAndFeelInfo[] lookAndFeels = GanttLookAndFeels                .getGanttLookAndFeels().getInstalledLookAndFeels();        for (int i = 0; i < lookAndFeels.length; i++) {            cbLnf.addItem(lookAndFeels[i]);        }        cbLnf.addItemListener(this);        JPanel languagePanel = new JPanel(new BorderLayout());        languagePanel.add(cbLnf, BorderLayout.NORTH);        vb.add(languagePanel);        vb.add(new JPanel());        // use small icons        JPanel iconTextPanel = new JPanel(new FlowLayout());        iconTextPanel.add(new JLabel(language.getText("show")));        iconTextPanel.add(cbButtonType = new JComboBox());        cbButtonType.addItem(language.getText("buttonIcon"));        cbButtonType.addItem(language.getText("buttonIconText"));        cbButtonType.addItem(language.getText("buttonText"));        iconTextPanel.add(new JLabel("  "));        iconTextPanel.add(cbSmallIcon = new JCheckBox());        iconTextPanel.add(new JLabel(language.getText("useSmalIcons")));        JPanel iconTextPanel2 = new JPanel(new BorderLayout());        iconTextPanel2.add(iconTextPanel, BorderLayout.WEST);        vb.add(iconTextPanel2);        vb.add(new JPanel());//        // status bar setting//        JPanel statusPanel = new JPanel(new BorderLayout());//        statusPanel.add(cbShowStatus = new JCheckBox(), BorderLayout.WEST);//        statusPanel.add(new JLabel(language.getText("showStatusBar")),//                BorderLayout.CENTER);//        vb.add(statusPanel);//        vb.add(new JPanel());        JPanel positionPanel = new JPanel(new FlowLayout());        JPanel currentPanel = new JPanel(new BorderLayout());        JPanel deletedPanel = new JPanel(new BorderLayout());        currentPanel.add(new JLabel(language.getText("currentToolBar")),                BorderLayout.NORTH);        deletedPanel.add(new JLabel(language.getText("availableToolBar")),                BorderLayout.NORTH);        /*         * iconList = new DefaultListModel (); buttonList = new DefaultListModel         * (); for (int i = 0 ; i < appli.getButtonList().size() ; i++)         * buttonList.addElement(appli.getButtonList().getElementAt(i)); for         * (int i = 0 ; i < buttonList.size() ; i++) { if         * (buttonList.elementAt(i).equals(language.getText("separator").toUpperCase()))         * iconList.addElement (buttonList.getElementAt(i)); else { if         * (((TestGanttRolloverButton)buttonList.getElementAt(i)).getIcon() ==         * null) iconList.addElement         * (((TestGanttRolloverButton)buttonList.getElementAt(i)).getText());         * else iconList.addElement         * (((TestGanttRolloverButton)buttonList.getElementAt(i)).getIcon()); } }         */        list = new JList();        listDeleted = new JList();        listDeleted.setName("listDeleted");        scrollPane = new JScrollPane(listDeleted);        scrollPane.setPreferredSize(new Dimension(110, 200));        deletedPanel.add(scrollPane, BorderLayout.EAST);        // list = new JList(iconList);        list.setName("list");        scrollPane = new JScrollPane(list);        scrollPane.setPreferredSize(new Dimension(110, 200));        currentPanel.add(scrollPane, BorderLayout.EAST);        Box currentButtonBox = Box.createVerticalBox();        Box deletedButtonBox = Box.createVerticalBox();        JButton bUp = new JButton();        bUp.setIcon(new ImageIcon(getClass().getResource("/icons/up_16.gif")));        bUp.setToolTipText(GanttProject.getToolTip(GanttProject                .correctLabel(language.getText("upTask"))));        bUp.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                upButtonActionPerformed(evt);            }        });        JButton bDown = new JButton();        bDown.setIcon(new ImageIcon(getClass()                .getResource("/icons/down_16.gif")));        bDown.setToolTipText(GanttProject.getToolTip(GanttProject                .correctLabel(language.getText("downTask"))));        bDown.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                downButtonActionPerformed(evt);            }        });        JButton bSeparator = new JButton();        bSeparator.setIcon(new ImageIcon(getClass().getResource(                "/icons/separator_16.gif")));        bSeparator.setToolTipText(GanttProject.getToolTip(GanttProject                .correctLabel(language.getText("separator"))));        bSeparator.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                separatorButtonActionPerformed(evt);            }        });        JButton bDelete = new JButton();        bDelete.setIcon(new ImageIcon(getClass().getResource(                "/icons/indent_16.gif")));        bDelete.setToolTipText(GanttProject.getToolTip(GanttProject                .correctLabel(language.getText("delete"))));        bDelete.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                deleteButtonActionPerformed(evt);            }        });        JButton bAdd = new JButton();        bAdd.setIcon(new ImageIcon(getClass().getResource(                "/icons/unindent_16.gif")));        bAdd.setToolTipText(GanttProject.getToolTip(GanttProject                .correctLabel(language.getText("add"))));        bAdd.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                addButtonActionPerformed(evt);            }        });        currentButtonBox.add(new JPanel());        currentButtonBox.add(new JPanel());        currentButtonBox.add(bUp);        currentButtonBox.add(new JPanel());        currentButtonBox.add(bDown);        currentButtonBox.add(new JPanel());        currentButtonBox.add(new JPanel());        deletedButtonBox.add(new JPanel());        deletedButtonBox.add(new JPanel());        deletedButtonBox.add(bAdd);        deletedButtonBox.add(new JPanel());        deletedButtonBox.add(bDelete);        deletedButtonBox.add(new JPanel());        deletedButtonBox.add(new JPanel());        positionPanel.add(currentButtonBox);        positionPanel.add(currentPanel);        positionPanel.add(new JPanel());        positionPanel.add(deletedButtonBox);        positionPanel.add(new JPanel());        positionPanel.add(deletedPanel);        positionPanel.add(new JPanel());

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -