当前位置: 首页>>代码示例>>Java>>正文


Java WebPanel.setMargin方法代码示例

本文整理汇总了Java中com.alee.laf.panel.WebPanel.setMargin方法的典型用法代码示例。如果您正苦于以下问题:Java WebPanel.setMargin方法的具体用法?Java WebPanel.setMargin怎么用?Java WebPanel.setMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.alee.laf.panel.WebPanel的用法示例。


在下文中一共展示了WebPanel.setMargin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
private void init() {

        setLayout(new BorderLayout());

        tree = new WebTree(root);
        tree.setToggleClickCount(2);
        tree.setScrollsOnExpand(true);
        tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
        tree.setRootVisible(true);
        tree.addTreeSelectionListener(this);

        WebScrollPane treeScrollWrapper = new WebScrollPane(tree);

        WebPanel wrapper = new WebPanel(treeScrollWrapper);
        wrapper.setMargin(5, 10, 10, 0);

        MButtonPanel buttonPanel = new MButtonPanel(moveUpButton, moveDownButton,
                addButton, addSubRelationButton, removeButton)
                .withVerticalLayout()
                .withAllButtonsEnabled(true)
                .withMargin(10);

        add(wrapper, BorderLayout.CENTER);
        add(buttonPanel, BorderLayout.EAST);

    }
 
开发者ID:CLARIN-PL,项目名称:WordnetLoom,代码行数:27,代码来源:RelationTreePanel.java

示例2: showNothing

import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
void showNothing() {
    WebPanel nothing = new WebPanel();
    WebPanel topPanel = new WebPanel(new GridBagLayout());
    topPanel.setMargin(40);
    topPanel.add(new WebLabel(Utils.getIcon("kontalk-big.png")));
    nothing.add(topPanel, BorderLayout.NORTH);
    this.show(nothing);
}
 
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:9,代码来源:Content.java

示例3: build

import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
public RelationTypePanel build() {

        WebTabbedPane tabs = new WebTabbedPane();

        WebPanel tabsWrapper = new WebPanel(tabs);
        tabsWrapper.setMargin(5);

        tabs.add("Synset relation", synsetRelationTreePanel);
        tabs.add("Lexical units relations ", senseRelationTreePanel);

        WebPanel propertiesWrapper = new WebPanel(propertiesPanel);
        propertiesWrapper.setMargin(10);

        WebPanel testsWrapper = new WebPanel(testsPanel);
        testsWrapper.setMargin(10);

        MSplitPane properties = buildSplitPanel(propertiesWrapper, testsWrapper, (int) (parentWidth * 0.55), JSplitPane.HORIZONTAL_SPLIT);
        MSplitPane main = buildSplitPanel(tabsWrapper, properties, parentHeight / 3, JSplitPane.VERTICAL_SPLIT);

        add(main, BorderLayout.CENTER);

        return this;
    }
 
开发者ID:CLARIN-PL,项目名称:WordnetLoom,代码行数:24,代码来源:RelationTypePanel.java

示例4: EditItemForm

import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
public EditItemForm() {
		super();
		originalNameTextField = new WebTextField();
//		originalNameTextField.setMinimumWidth(100);
		localizedNameTextField = new WebTextField();
//		localizedNameTextField.setMinimumWidth(100);
		countryComboBox = new WebComboBox(getCountries());
		typeComboBox = new WebComboBox(MediaType.values());
		statusComboBox = new WebComboBox(MediaStatus.values());
		maxEpisodes = new WebSpinner(new SpinnerNumberModel(1, 1, 999, 1));
		episodesWatched = new WebSpinner(new SpinnerNumberModel(0, 0, 1, 1));
		startDate = new WebDateField();
		endDate = new WebDateField();
		WebButton startDateClearButton = new WebButton("Clear", new ClearDateActionListener(startDate));
		WebButton endDateClearButton = new WebButton("Clear", new ClearDateActionListener(endDate));
		statusComboBox.addActionListener(new StatusChangeListener(maxEpisodes, episodesWatched,
				startDate, endDate, new WebButton[]{startDateClearButton, endDateClearButton}));
		maxEpisodes.addChangeListener(new MaxEpisodesChangeListener(episodesWatched, statusComboBox));
		statusComboBox.setSelectedIndex(0); // fires initial notification
		setModal(true);
		setResizable(false);
		setMinimumSize(new Dimension(500, 400));
		setLayout(new BorderLayout(5, 5));
		WebPanel panel = new WebPanel();
		panel.setLayout(createLayout());
		panel.setMargin(5, 5, 5, 5);
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.originalName")), "0,0");
		panel.add(originalNameTextField, "1,0,3,0");
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.localizedName")), "0,1");
		panel.add(localizedNameTextField, "1,1,3,1");
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.country")), "0,2");
		panel.add(countryComboBox, "1,2,3,2");
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.type")), "0,3");
		panel.add(typeComboBox, "1,3,3,3");
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.status")), "0,4");
		panel.add(statusComboBox, "1,4,3,4");
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.progress")), "0,5");
		panel.add(episodesWatched, "1,5");
		panel.add(new WebLabel("/"), "2,5");
		panel.add(maxEpisodes, "3,5");
		panel.add(new WebLabel("startDate"), "0,6");
		panel.add(startDate, "1,6");
		panel.add(startDateClearButton, "3,6");
		panel.add(new WebLabel("endDate"), "0,7");
		panel.add(endDate, "1,7");
		panel.add(endDateClearButton, "3,7");
//		panel.setLayout(new FormLayout(false, true));
//		panel.setMargin(5, 5, 5, 5);
//		panel.add(new WebLabel("nameOrig"), FormLayout.LEFT);
//		panel.add(nameOrigTextField, FormLayout.RIGHT);
//		panel.add(new WebLabel("country"), FormLayout.LEFT);
//		panel.add(countryTextField, FormLayout.RIGHT);
//		panel.add(new WebLabel("type"), FormLayout.LEFT);
//		panel.add(typeComboBox, FormLayout.RIGHT);
//		panel.add(new WebLabel("status"), FormLayout.LEFT);
//		panel.add(statusComboBox, FormLayout.RIGHT);
		add(panel, BorderLayout.NORTH);
		add(createSaveButton(), BorderLayout.SOUTH);
		setTitle(AppSettings.getLocalizedString("editForm.title"));
	}
 
开发者ID:DiscoElevator,项目名称:MyMediaList,代码行数:61,代码来源:EditItemForm.java

示例5: showNotification

import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
private void showNotification() {
    final WebDialog dialog = new WebDialog();
    dialog.setUndecorated(true);
    dialog.setBackground(Color.BLACK);
    dialog.setBackground(StyleConstants.transparent);

    WebNotificationPopup popup = new WebNotificationPopup(PopupStyle.dark);
    popup.setIcon(Utils.getIcon("kontalk_small.png"));
    popup.setMargin(View.MARGIN_DEFAULT);
    popup.setDisplayTime(6000);
    popup.addNotificationListener(new NotificationListener() {
        @Override
        public void optionSelected(NotificationOption option) {
        }
        @Override
        public void accepted() {
        }
        @Override
        public void closed() {
            dialog.dispose();
        }
    });

    // content
    WebPanel panel = new WebPanel();
    panel.setMargin(View.MARGIN_DEFAULT);
    panel.setOpaque(false);
    WebLabel title = new WebLabel("A new Message!");
    title.setFontSize(View.FONT_SIZE_BIG);
    title.setForeground(Color.WHITE);
    panel.add(title, BorderLayout.NORTH);
    String text = "this is some message, and some longer text was added";
    WebLabel message = new WebLabel(text);
    message.setForeground(Color.WHITE);
    panel.add(message, BorderLayout.CENTER);
    popup.setContent(panel);

    //popup.packPopup();
    dialog.setSize(popup.getPreferredSize());

    // set position on screen
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gd = ge.getDefaultScreenDevice();
    GraphicsConfiguration gc = gd.getDefaultConfiguration();
    Rectangle screenBounds = gc.getBounds();
    // get height of the task bar
    // doesn't work on all environments
    //Insets toolHeight = toolkit.getScreenInsets(popup.getGraphicsConfiguration());
    int toolHeight  = 40;
    dialog.setLocation(screenBounds.width - dialog.getWidth() - 10,
            screenBounds.height - toolHeight - dialog.getHeight());

    dialog.setVisible(true);
    NotificationManager.showNotification(dialog, popup);
}
 
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:56,代码来源:Notifier.java


注:本文中的com.alee.laf.panel.WebPanel.setMargin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。