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


Java DimensionUIResource类代码示例

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


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

示例1: register

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
public void register(ConverterRegistry registry) {
  registry.addConverter(Dimension.class, String.class, this);
  registry.addConverter(String.class, Dimension.class, this);
  registry.addConverter(DimensionUIResource.class, String.class, this);

  registry.addConverter(Insets.class, String.class, this);
  registry.addConverter(String.class, Insets.class, this);
  registry.addConverter(InsetsUIResource.class, String.class, this);

  registry.addConverter(Point.class, String.class, this);
  registry.addConverter(String.class, Point.class, this);
  
  registry.addConverter(Rectangle.class, String.class, this);
  registry.addConverter(String.class, Rectangle.class, this);
  
  registry.addConverter(Font.class, String.class, this);
  registry.addConverter(FontUIResource.class, String.class, this);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:19,代码来源:AWTConverters.java

示例2: init

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
public static void init(UIDefaults d)
{
	d.put("ScrollBarUI", AgScrollBarUI.class.getName());
	d.put("ScrollBar.minimumThumbSize", new DimensionUIResource(10, 10));
	d.put("ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096));
	d.put("ScrollBar.border", BORDER);
	d.put("ScrollBar.track", ThemeColor.shadow(ThemeKey.TEXT_BG, 0.05));
	
	d.put("ScrollBar.background", Theme.TEXT_BG);
	d.put("ScrollBar.foreground", Theme.TEXT_FG);
	
	//thumbHighlightColor = UIManager.getColor("ScrollBar.thumbHighlight");
	//thumbLightShadowColor = UIManager.getColor("ScrollBar.thumbShadow");
	//thumbDarkShadowColor = UIManager.getColor("ScrollBar.thumbDarkShadow");
	//thumbColor = UIManager.getColor("ScrollBar.thumb");
	//trackColor = UIManager.getColor("ScrollBar.track");
	//trackHighlightColor = UIManager.getColor("ScrollBar.trackHighlight");
}
 
开发者ID:andy-goryachev,项目名称:PasswordSafe,代码行数:19,代码来源:AgScrollBarUI.java

示例3: register

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
public void register(ConverterRegistry registry) {
  registry.addConverter(Dimension.class, String.class, this);
  registry.addConverter(String.class, Dimension.class, this);
  registry.addConverter(DimensionUIResource.class, String.class, this);

  registry.addConverter(Insets.class, String.class, this);
  registry.addConverter(String.class, Insets.class, this);
  registry.addConverter(InsetsUIResource.class, String.class, this);

  registry.addConverter(Point.class, String.class, this);
  registry.addConverter(String.class, Point.class, this);

  registry.addConverter(Rectangle.class, String.class, this);
  registry.addConverter(String.class, Rectangle.class, this);

  registry.addConverter(Font.class, String.class, this);
  registry.addConverter(FontUIResource.class, String.class, this);
}
 
开发者ID:calibre2opds,项目名称:calibre2opds,代码行数:19,代码来源:AWTConverters.java

示例4: register

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
@Override
public void register(Registry registry) {
    registry.addConverter(Dimension.class, String.class, this);
    registry.addConverter(String.class, Dimension.class, this);
    registry.addConverter(DimensionUIResource.class, String.class, this);

    registry.addConverter(Insets.class, String.class, this);
    registry.addConverter(String.class, Insets.class, this);
    registry.addConverter(InsetsUIResource.class, String.class, this);

    registry.addConverter(Point.class, String.class, this);
    registry.addConverter(String.class, Point.class, this);

    registry.addConverter(Rectangle.class, String.class, this);
    registry.addConverter(String.class, Rectangle.class, this);

    registry.addConverter(Font.class, String.class, this);
    registry.addConverter(FontUIResource.class, String.class, this);
}
 
开发者ID:ZenHarbinger,项目名称:l2fprod-properties-editor,代码行数:20,代码来源:AWTConverters.java

示例5: getUIDefaults

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
public static final Object[] getUIDefaults()
{
	return new Object[] {
			//
			// Notifications settings
			NOTIFICATIONS_MaxDisplayed, NOTIFICATIONS_MaxDisplayed_Default
			, NOTIFICATIONS_AutoFadeAwayTimeMillis, NOTIFICATIONS_AutoFadeAwayTimeMillis_Default
			, NOTIFICATIONS_BottomGap, NOTIFICATIONS_BottomGap_Default

			//
			// Item settings
			, ITEM_BackgroundColor, AdempierePLAF.createActiveValueProxy(AdempiereLookAndFeel.MANDATORY_BG_KEY, Color.WHITE) // same as mandatory background color
			, ITEM_Border, new BorderUIResource(BorderFactory.createLineBorder(Color.GRAY, 1))
			, ITEM_SummaryText_Font, new FontUIResource("Serif", Font.BOLD, 12)
			, ITEM_DetailText_Font, new FontUIResource("Serif", Font.PLAIN, 12)
			, ITEM_TextColor, null
			, ITEM_MinimumSize, new DimensionUIResource(230, 45)
			, ITEM_MaximumSize, null
			//
			// Button settings (i.e. the close button)
			, ITEM_Button_Insets, new InsetsUIResource(1, 4, 1, 4)
			, ITEM_Button_Size, 20
			, ITEM_Button_Border, new BorderUIResource(BorderFactory.createEmptyBorder())
	};
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:26,代码来源:SwingEventNotifierUI.java

示例6: initComponent

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
private void initComponent(Image imageNumber) {

        setName(NbBundle.getMessage(Costanti.class, Costanti.VIEW_BEST_MAPPINGS_TOP_COMPONENT));
        setToolTipText(NbBundle.getMessage(Costanti.class, Costanti.VIEW_BEST_MAPPINGS_TOP_COMPONENT_TOOLTIP));

        Image imageDefault = ImageUtilities.loadImage(Costanti.ICONA_VIEW_BEST_MAPPINGS, true);
        this.setIcon(ImageUtilities.mergeImages(imageDefault, imageNumber, Scenario.X_OFFSET_IMAGE_NUMBER, Scenario.Y_OFFSET_IMAGE_NUMBER));

        messageLabel = new JTextArea();
        messageLabel.setRows(2);
        messageLabel.setEditable(false);
        messageLabel.setBackground(this.getBackground());
        tabellaBestMappings = new JTable();
        jScrollPane = new JScrollPane();
        jScrollPane.setPreferredSize(new DimensionUIResource(150, this.getHeight()));
        this.setPreferredSize(new Dimension(150, this.getHeight()));
        this.setLayout(new BorderLayout());
        this.add(messageLabel, BorderLayout.NORTH);
        this.add(jScrollPane, BorderLayout.CENTER);
        addSelectionListener();
    }
 
开发者ID:dbunibas,项目名称:spicy,代码行数:22,代码来源:BestMappingsTopComponent.java

示例7: testInstallDefaults

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
public void testInstallDefaults() {
    JOptionPane pane = new JOptionPane();
    UIManager.put("OptionPane.background", new ColorUIResource(Color.red));
    UIManager.put("OptionPane.foreground", new ColorUIResource(Color.yellow));
    UIManager.put("OptionPane.messageForeground", new ColorUIResource(Color.green));
    Font font = new FontUIResource(pane.getFont().deriveFont(100f));
    UIManager.put("OptionPane.font", font);
    Border border = new BorderUIResource(BorderFactory.createEmptyBorder(1, 1, 1, 1));
    UIManager.put("OptionPane.border", border);
    Dimension minimumSize = new DimensionUIResource(123, 456);
    UIManager.put("OptionPane.minimumSize", minimumSize);
    pane.setUI(paneUI);
    pane.setOptions(new Object[] { "button" });
    paneUI.installDefaults();
    assertEquals(Color.red, pane.getBackground());
    assertEquals(Color.yellow, pane.getForeground());
    assertEquals(font, pane.getFont());
    assertEquals(border, pane.getBorder());
    assertEquals(minimumSize, paneUI.getMinimumOptionPaneSize());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:BasicOptionPaneUITest.java

示例8: installOther

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
@Override
protected void installOther(UIDefaults table)
{
    table.put(SCROLLBAR_WIDTH, 9);

    table.put(SCROLLBAR_BACKGROUND, getColorRes(Color.WHITE));

    table.put(MINIMUMTHUMBSIZE, new DimensionUIResource(48, 48));
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:10,代码来源:LuckScrollUIBundle.java

示例9: uiImpl

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
/**
 * Ui impl.
 */
public static void uiImpl()
{
	UIManager.put("ProgressBar.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
	UIManager.put("ProgressBar.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
	//* 此属性决定水平进度条的默认最小大小:15是相关于.9.png图片的最小填充
	//* 高度或长度的(小于此高度则NinePatch算法无法解决而很难看)
	UIManager.put("ProgressBar.horizontalSize",new DimensionUIResource(146,15));//默认是146,12
	//* 此属性决定垂直进度条的默认最小大小:15是相关于.9.png图片的最小填充
	//* 高度或长度的(小于此高度则NinePatch算法无法解决而很难看)
	UIManager.put("ProgressBar.verticalSize",new DimensionUIResource(15,146));//默认是12,146
	UIManager.put("ProgressBar.border",new BorderUIResource(BorderFactory.createEmptyBorder(0,0,0,0)));
	UIManager.put("ProgressBarUI",org.jb2011.lnf.beautyeye.ch12_progress.BEProgressBarUI.class.getName());
}
 
开发者ID:JackJiang2011,项目名称:beautyeye,代码行数:17,代码来源:__UI__.java

示例10: myInitComponents

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
private void myInitComponents() {
        this.setLayout(new BorderLayout());
        this.scrollPane = new JScrollPane();
        scrollPane.setPreferredSize(new DimensionUIResource(100, this.getHeight()));
        this.setPreferredSize(new Dimension(100, this.getHeight()));
        this.jTree = new JTree(null, false);
        new TreeDragSource(jTree, DnDConstants.ACTION_COPY_OR_MOVE);
        this.jTree.setDragEnabled(true);
//        new TreeDropTarget(tree);
        this.scrollPane.setViewportView(jTree);
        this.add(this.scrollPane, BorderLayout.CENTER);
    }
 
开发者ID:dbunibas,项目名称:spicy,代码行数:13,代码来源:ProjectTreeTopComponent.java

示例11: initComponent

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
private void initComponent() {
    messageLabel = new JTextArea();
    messageLabel.setRows(2);
    messageLabel.setEditable(false);
    messageLabel.setBackground(this.getBackground());
    tabellaRankedTransformations = new JTable();
    jScrollPane = new JScrollPane();
    jScrollPane.setPreferredSize(new DimensionUIResource(150, this.getHeight()));
    this.setPreferredSize(new Dimension(150, this.getHeight()));
    this.setLayout(new BorderLayout());
    this.add(messageLabel, BorderLayout.NORTH);
    this.add(jScrollPane, BorderLayout.CENTER);
    addSelectionListener();
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:15,代码来源:RankedTransformationsTopComponent.java

示例12: testGetPreferredSize

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
public void testGetPreferredSize() {
    JOptionPane pane = new JOptionPane() {
        private static final long serialVersionUID = 1L;

        @Override
        public FontMetrics getFontMetrics(Font font) {
            return BasicOptionPaneUITest.this.getFontMetrics(font);
        }
    };
    Border messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(3, 3,
            3, 3));
    UIManager.put("OptionPane.messageAreaBorder", messageAreaBorder);
    messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    UIManager.put("OptionPane.messageAreaBorder", messageAreaBorder);
    Border border = new BorderUIResource(BorderFactory.createEmptyBorder(1, 1, 1, 1));
    UIManager.put("OptionPane.border", border);
    Dimension minimumSize = new DimensionUIResource(123, 456);
    UIManager.put("OptionPane.minimumSize", minimumSize);
    pane.setUI(paneUI);
    assertNull(paneUI.getPreferredSize(null));
    Dimension preferredSize = paneUI.getPreferredSize(pane);
    assertNotNull(preferredSize);
    assertTrue(preferredSize.width > 0);
    assertTrue(preferredSize.height > 0);
    LayoutManager layout = new MyLayoutManager(new Dimension(200, 500));
    pane.setLayout(layout);
    assertEquals(new Dimension(200, 500), paneUI.getPreferredSize(pane));
    layout = new MyLayoutManager(new Dimension(200, 300));
    pane.setLayout(layout);
    assertEquals(new Dimension(200, 456), paneUI.getPreferredSize(pane));
    layout = new MyLayoutManager(new Dimension(100, 500));
    pane.setLayout(layout);
    assertEquals(new Dimension(123, 500), paneUI.getPreferredSize(pane));
    layout = new MyLayoutManager(new Dimension(10, 10));
    pane.setLayout(layout);
    assertEquals(new Dimension(123, 456), paneUI.getPreferredSize(pane));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:38,代码来源:BasicOptionPaneUITest.java

示例13: createArrowButton

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
@Override
protected JButton createArrowButton() {
  final Color bg = myComboBox.getBackground();
  final Color fg = myComboBox.getForeground();
  JButton button = new BasicArrowButton(SwingConstants.SOUTH, bg, fg, fg, fg) {

    @Override
    public void paint(Graphics g) {
      Color borderColor = ModernUIUtil.getBorderColor(myComboBox);
      GraphicsConfig config = new GraphicsConfig(g);

      final int w = getWidth();
      final int h = getHeight();
      g.setColor(UIUtil.getControlColor());
      g.fillRect(0, 0, w, h);
      g.setColor(myComboBox.isEnabled() ? getForeground() : borderColor);
      GraphicsUtil.setupAAPainting(g);
      g.drawLine(JBUI.scale(3), JBUI.scale(7), JBUI.scale(7), JBUI.scale(11));
      g.drawLine(JBUI.scale(7), JBUI.scale(11), JBUI.scale(11), JBUI.scale(7));
      config.restore();
    }

    @Override
    public Dimension getPreferredSize() {
      int size = getFont().getSize() + JBUI.scale(4);
      if (size % 2 == 1) size += JBUI.scale(1);
      return new DimensionUIResource(size, size);
    }
  };
  button.setBorder(BorderFactory.createEmptyBorder());
  button.setOpaque(false);
  return button;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:34,代码来源:ModernComboBoxUI.java

示例14: getDimensionRes

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
protected DimensionUIResource getDimensionRes(int w, int h)
{
    return new DimensionUIResource(w, h);
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:5,代码来源:LuckResourceBundle.java

示例15: createArrowButton

import javax.swing.plaf.DimensionUIResource; //导入依赖的package包/类
protected JButton createArrowButton() {
  final Color bg = myComboBox.getBackground();
  final Color fg = myComboBox.getForeground();
  JButton button = new BasicArrowButton(SwingConstants.SOUTH, bg, fg, fg, fg) {

    @Override
    public void paint(Graphics g2) {
      final Graphics2D g = (Graphics2D)g2;
      final GraphicsConfig config = new GraphicsConfig(g);

      final int w = getWidth();
      final int h = getHeight();
      if (!isTableCellEditor(myComboBox)) {
        g.setColor(getArrowButtonFillColor(UIUtil.getControlColor()));
        g.fillRect(0, 0, w, h);
      }
      g.setColor(comboBox.isEnabled() ? new JBColor(Gray._255, getForeground()) : new JBColor(Gray._255, getBorderColor()));
      g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
      g.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
      final int tW = JBUI.scale(8);
      final int tH = JBUI.scale(6);
      final int xU = (w - tW) / 2;
      final int yU = (h - tH) / 2;
      g.translate(JBUI.scale(2), JBUI.scale(1));
      final Path2D.Double path = new Path2D.Double();
      path.moveTo(xU, yU);
      path.lineTo(xU + tW, yU);
      path.lineTo(xU + tW/2, yU + tH);
      path.lineTo(xU, yU);
      //path.moveTo(xU + 1, yU + 2);
      //path.lineTo(3 * xU + 1, yU + 2);
      //path.lineTo(2 * xU + 1, 3 * yU);
      //path.lineTo(xU + 1, yU + 2);
      path.closePath();
      g.fill(path);
      g.translate(-JBUI.scale(2), -JBUI.scale(1));
      if (!isTableCellEditor(myComboBox)) {
        g.setColor(getArrowButtonFillColor(getBorderColor()));
        g.drawLine(0, -1, 0, h);
      }
      config.restore();
    }

    @Override
    public Dimension getPreferredSize() {
      int size = getFont().getSize() + 4;
      if (size%2==1) size++;
      return new DimensionUIResource(size, size);
    }
  };
  button.setBorder(BorderFactory.createEmptyBorder());
  button.setOpaque(false);
  return button;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:56,代码来源:DarculaComboBoxUI.java


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