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


Java MatteBorder类代码示例

本文整理汇总了Java中javax.swing.border.MatteBorder的典型用法代码示例。如果您正苦于以下问题:Java MatteBorder类的具体用法?Java MatteBorder怎么用?Java MatteBorder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: fromField

import javax.swing.border.MatteBorder; //导入依赖的package包/类
static BorderBuilder fromField(Instance instance, String field, boolean uiresource, Heap heap) {
    Object _border = instance.getValueOfField(field);
    if (!(_border instanceof Instance)) return null;

    Instance border = (Instance)_border;

    // Make sure subclasses are listed before base class if using isSubclassOf
    if (DetailsUtils.isSubclassOf(border, BevelBorder.class.getName())) {
        return new BevelBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, MatteBorder.class.getName())) { // Must be before EmptyBorder (extends EmptyBorder)
        return new EmptyBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, EmptyBorder.class.getName())) {
        return new MatteBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, EtchedBorder.class.getName())) {
        return new EtchedBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, LineBorder.class.getName())) {
        return new LineBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, TitledBorder.class.getName())) {
        return new TitledBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, CompoundBorder.class.getName())) {
        return new CompoundBorderBuilder(border, heap);
    }

    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:BorderBuilders.java

示例2: instantiate

import javax.swing.border.MatteBorder; //导入依赖的package包/类
protected Expression instantiate(Object oldInstance, Encoder out) {
    MatteBorder border = (MatteBorder) oldInstance;
    Insets insets = border.getBorderInsets();
    Object object = border.getTileIcon();
    if (object == null) {
        object = border.getMatteColor();
    }
    Object[] args = new Object[] {
            insets.top,
            insets.left,
            insets.bottom,
            insets.right,
            object,
    };
    return new Expression(border, border.getClass(), "new", args);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:MetaData.java

示例3: testMatteBorder

import javax.swing.border.MatteBorder; //导入依赖的package包/类
public void testMatteBorder() {
    DumperOptions options = new DumperOptions();
    options.setWidth(400);
    Yaml yaml = new Yaml(new ImmutablesRepresenter(), options);
    Insets insets = new Insets(10, 20, 30, 40);
    Color color = new Color(100, 150, 200);
    MatteBorder border = BorderFactory.createMatteBorder(insets.top, insets.left,
            insets.bottom, insets.right, color);
    String dump = yaml.dump(border);
    assertEquals(
            "!!javax.swing.border.MatteBorder [!!java.awt.Insets [10, 20, 30, 40], !!java.awt.Color [100, 150, 200, 255]]\n",
            dump);
    Object loaded = yaml.load(dump);
    assertTrue(loaded instanceof MatteBorder);
    MatteBorder loadedBorder = (MatteBorder) loaded;
    assertEquals(insets, loadedBorder.getBorderInsets());
    assertEquals(color, loadedBorder.getMatteColor());
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:19,代码来源:MoreImmutablesTest.java

示例4: addComponent

import javax.swing.border.MatteBorder; //导入依赖的package包/类
public void addComponent(JPanelMenu menu) {
       
//        if (p.x > 20) {
//            p.x = 20;
//            p.y += 55;
//        }
//        p.y += 20; // 20 puntitos extra de separacion.
        
        JLabel lbl = new JLabel(AppLocal.getIntString(KeyText));
        lbl.applyComponentOrientation(menu.getComponentOrientation());
        lbl.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), new Color(0, 0, 0)));
//        lbl.setSize(670, 20);
//        lbl.setLocation(p);
//        p.y += 35;
//        comp.add(lbl);  
        
        menu.addTitle(lbl);
    }
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:19,代码来源:MenuTitleDefinition.java

示例5: updateDetailsBorder

import javax.swing.border.MatteBorder; //导入依赖的package包/类
private void updateDetailsBorder(@Nullable VcsFullCommitDetails data) {
  if (data == null || !myColorManager.isMultipleRoots()) {
    myMainContentPanel.setBorder(BorderFactory.createEmptyBorder());
  }
  else {
    Color color = VcsLogGraphTable.getRootBackgroundColor(data.getRoot(), myColorManager);
    myMainContentPanel.setBorder(new CompoundBorder(new MatteBorder(0, VcsLogGraphTable.ROOT_INDICATOR_COLORED_WIDTH, 0, 0, color),
                                                    new MatteBorder(0, VcsLogGraphTable.ROOT_INDICATOR_WHITE_WIDTH, 0, 0,
                                                                    new JBColor(new NotNullProducer<Color>() {
                                                                      @NotNull
                                                                      @Override
                                                                      public Color produce() {
                                                                        return getDetailsBackground();
                                                                      }
                                                                    }))));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DetailsPanel.java

示例6: initStatusBar

import javax.swing.border.MatteBorder; //导入依赖的package包/类
private void initStatusBar() {
	jlStatusBar = new JLabel();

	int rightPadding = 3;

	if (OperatingSystem.isMacOs()) {
		rightPadding = 15; // Allow extra padding in the grow box status bar
		// if using Mac OS
	}

	jlStatusBar.setBorder(new CompoundBorder(new MatteBorder(1, 0, 0, 0, Color.LIGHT_GRAY), new EmptyBorder(3, 3,
			3, rightPadding)));

	setDefaultStatusBarText();

	if (applicationSettings.getShowStatusBar()) {
		frame.getContentPane().add(jlStatusBar, BorderLayout.SOUTH);
	}
}
 
开发者ID:kaikramer,项目名称:keystore-explorer,代码行数:20,代码来源:KseFrame.java

示例7: addComponent

import javax.swing.border.MatteBorder; //导入依赖的package包/类
/**
     *
     * @param menu
     */
    @Override
    public void addComponent(JPanelMenu menu) {
       
//        if (p.x > 20) {
//            p.x = 20;
//            p.y += 55;
//        }
//        p.y += 20; // 20 puntitos extra de separacion.
        
        JLabel lbl = new JLabel(AppLocal.getIntString(KeyText));
        lbl.applyComponentOrientation(menu.getComponentOrientation());
        lbl.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), new Color(0, 0, 0)));
//        lbl.setSize(670, 20);
//        lbl.setLocation(p);
//        p.y += 35;
//        comp.add(lbl);  
//        lbl.setFont(new Font("DotumChe",Font.PLAIN,14));

        menu.addTitle(lbl);
    }
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:25,代码来源:MenuTitleDefinition.java

示例8: addComponent

import javax.swing.border.MatteBorder; //导入依赖的package包/类
/**
     *
     * @param menu
     */
    @Override
    public void addComponent(JPanelMenu menu) {
       
//        if (p.x > 20) {
//            p.x = 20;
//            p.y += 55;
//        }
//        p.y += 20; // 20 puntitos extra de separacion.
        
        JLabel lbl = new JLabel(AppLocal.getIntString(KeyText));
        lbl.applyComponentOrientation(menu.getComponentOrientation());
        lbl.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), new Color(0, 0, 0)));
//        lbl.setSize(670, 20);
//        lbl.setLocation(p);
//        p.y += 35;
//        comp.add(lbl);  
        
        menu.addTitle(lbl);
    }
 
开发者ID:sbandur84,项目名称:micro-Blagajna,代码行数:24,代码来源:MenuTitleDefinition.java

示例9: makeBotOrMiddle

import javax.swing.border.MatteBorder; //导入依赖的package包/类
private static void makeBotOrMiddle(final int index, final int bottom) {
    fileListingRows.get(index).setInGroup(true);

    JTextField textField = new JTextField();
    textField.setSize(200, 30);
    textField.setEditable(false);
    textField.setPreferredSize(new Dimension(200, 25));
    textField.setBorder(new MatteBorder(0, 0, bottom, 0, borderColor));
    new FileDrop(textField, textField.getBorder(), new FileDrop.Listener() {
        @Override
        public void filesDropped(final File[] files) {
            for (int i = 0; i < files.length; i++) {
                FileListing.addFile(files[i], fileListingRows.get(i)
                        .getXmlFormat().getSelectedItem().toString());
            }
        }
    });
    listing.add(textField, fileListingCons, (index * COLSINLISTING) + 2);
}
 
开发者ID:adamIqbal,项目名称:Health,代码行数:20,代码来源:FileListing.java

示例10: testBorder

import javax.swing.border.MatteBorder; //导入依赖的package包/类
@Test
public void testBorder() throws Exception {
    final int top = 9;
    final int left = 3;
    final int bottom = 1;
    final int right = 6;
    final Color matteColor = new Color(174, 2, 126);

    matteBorderDecorator.set(top, left, bottom, right, matteColor);
    final MatteBorder matte = new MatteBorder(top, left, bottom, right, matteColor);

    assertEquals(button.getBorder().getClass(), matte.getClass());
    final MatteBorder border = (MatteBorder) button.getBorder();
    assertEquals(border.getBorderInsets(), matte.getBorderInsets());
    assertEquals(border.getMatteColor(), matte.getMatteColor());
}
 
开发者ID:vicboma1,项目名称:ClassicDecoratorPattern,代码行数:17,代码来源:MatteBorderDecoratorTest.java

示例11: getListCellRendererComponent

import javax.swing.border.MatteBorder; //导入依赖的package包/类
@Override
public Component getListCellRendererComponent(
        JList<? extends TransactionBean> list,
        TransactionBean value, int index, boolean isSelected,
        boolean cellHasFocus)
{
    JTextPane client = new JTextPane();
    client.setEditable(false);
    client.setContentType("text/html");
    TransactionRenderOpsBean ops = mRuntime.getRenderOps();
    String html = TransactionLogic.renderAsHTML(value, ops);
    int w = list.getFixedCellWidth();
    if (w < 0)
        w = 750;
    else
        w = w*3/4;
    html = "<html><body><table width=\""+w+"px\">"+html+"</table></body></html>";
    client.setText(html);
    if (cellHasFocus)
        client.setBorder(new MatteBorder(1, 5, 1, 1, Color.DARK_GRAY));
    client.setBackground(isSelected ? SELECTED : DESELECTED);
    return client;
}
 
开发者ID:jjaquinta,项目名称:EchoSim,代码行数:24,代码来源:HistoryCellRenderer.java

示例12: initComponentDefaults

import javax.swing.border.MatteBorder; //导入依赖的package包/类
@Override
protected void initComponentDefaults(UIDefaults table) {
	super.initComponentDefaults(table);

	Border lineBorder = new BorderUIResource(new MatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY));
	Object textBorder = new BorderUIResource(new CompoundBorder(lineBorder, new BasicBorders.MarginBorder()));
	
	Object[] defaults = new Object[] { "ComboBox.selectionForeground", getHighlightedTextColor(), "Panel.font", getControlTextFont(), 
	        "ToolTip.border", lineBorder,
	        "TitledBorder.border", lineBorder,
	        "TextField.border", textBorder,
	        "PasswordField.border", textBorder,
	        "TextArea.border", textBorder,
	        "TextPane.border", textBorder,
	        "EditorPane.border", textBorder,
	        "Button.border", lineBorder,
			};
	table.putDefaults(defaults);
}
 
开发者ID:BrunoEberhard,项目名称:minimal-j,代码行数:20,代码来源:PrintLookAndFeel.java

示例13: addButton

import javax.swing.border.MatteBorder; //导入依赖的package包/类
/**
 * Adds a button to this {@link ComboButton}. Beware that this method does
 * change the styling (colors, borders etc.) of the button to make it fit
 * the {@link ComboButton}.
 *
 * @param button
 */
public void addButton(final AbstractButton button) {
    WidgetUtils.setDefaultButtonStyle(button);
    final EmptyBorder baseBorder =
            new EmptyBorder(WidgetUtils.BORDER_WIDE_WIDTH - 1, 9, WidgetUtils.BORDER_WIDE_WIDTH - 1, 9);
    if (getComponentCount() == 0) {
        button.setBorder(baseBorder);
    } else {
        final Component lastComponent = getComponent(getComponentCount() - 1);
        if (lastComponent instanceof AbstractButton) {
            // previous component was also a button - add a line on the left
            // side
            final Border outsideBorder = new MatteBorder(0, 1, 0, 0, WidgetUtils.BG_COLOR_LESS_BRIGHT);
            button.setBorder(new CompoundBorder(outsideBorder, baseBorder));
        } else {
            button.setBorder(baseBorder);
        }
    }
    button.setOpaque(false);
    _buttons.add(button);

    add(button);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:30,代码来源:ComboButton.java

示例14: createSmallButton

import javax.swing.border.MatteBorder; //导入依赖的package包/类
public static JButton createSmallButton(final String text, final Icon icon) {
    final JButton b = new JButton(icon);
    if (text != null) {
        b.setText(text);
        b.setFont(WidgetUtils.FONT_SMALL);
    }
    b.setMargin(new Insets(0, 0, 0, 0));

    b.setUI(new MetalButtonUI());
    b.setBackground(WidgetUtils.COLOR_WELL_BACKGROUND);

    final MatteBorder outerBorder = new MatteBorder(1, 1, 1, 1, WidgetUtils.BG_COLOR_LESS_BRIGHT);
    b.setBorder(new CompoundBorder(outerBorder, new EmptyBorder(2, 4, 2, 4)));
    b.setFocusPainted(false);

    return b;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:18,代码来源:WidgetFactory.java

示例15: MaterialTabBarButton

import javax.swing.border.MatteBorder; //导入依赖的package包/类
public MaterialTabBarButton(SwingViewContainer2 viewContainer, MaterialStyle materialStyle, SwingView view, boolean selected) {
		setContentAreaFilled(false);
		setFocusable(false);
		addMouseListener(createBackgroundPainter(viewContainer, ColorFactory.create(materialStyle.getTabToolbarStyle().getPressedColor()), view));
//		 setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, style.COLORS.getForeground1()));
//		setBorder(BorderFactory.createBevelBorder(1));
//		setText(view.getViewTitle().toUpperCase());
		//putting everything in a label so we can use borders 
		JLabel label = new JLabel(view.getViewTitle().toUpperCase());		
		EmptyBorder padding = new EmptyBorder(12,12,12,12);
		if (selected) {
			MatteBorder bottomBar = BorderFactory.createMatteBorder(0,  0, 2, 0,ColorFactory.create( materialStyle.getTabContainerStyle().getBackground()));
			label.setBorder(new CompoundBorder( bottomBar, padding));
		} else {
			label.setBorder(padding);
		}
		label.setFont(AwtFontFactory.create(materialStyle.getTabToolbarButtonStyle().getFont()));
		label.setForeground(ColorFactory.create(materialStyle.getTabToolbarButtonStyle().getTextColor()));
		add(label);
	}
 
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:21,代码来源:MaterialTabBarButton.java


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