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


Java LookAndFeel.installColorsAndFont方法代码示例

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


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

示例1: installDefaults

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
protected void installDefaults(JScrollPane p)
{
  scrollpane = p;
  LookAndFeel.installColorsAndFont(p, "ScrollPane.background",
                                   "ScrollPane.foreground",
                                   "ScrollPane.font");
  LookAndFeel.installBorder(p, "ScrollPane.border");

  // Install Viewport border.
  Border vpBorder = p.getViewportBorder();
  if (vpBorder == null || vpBorder instanceof UIResource)
    {
      vpBorder = UIManager.getBorder("ScrollPane.viewportBorder");
      p.setViewportBorder(vpBorder);
    }

  p.setOpaque(true);
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:BasicScrollPaneUI.java

示例2: updateUI

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
 * Overridden to message super and forward the method to the tree. Since
 * the tree is not actually in the component hierarchy it will never receive
 * this unless we forward it in this manner.
 */
//----------//
// updateUI //
//----------//
@Override
public void updateUI ()
{
    super.updateUI();

    if (tree != null) {
        tree.updateUI();
    }

    // Use the tree's default foreground and background colors in the
    // table.
    LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font");
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:22,代码来源:JTreeTable.java

示例3: installDefaults

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
 * This method installs defaults for the JOptionPane.
 */
protected void installDefaults()
{
  LookAndFeel.installColorsAndFont(optionPane, "OptionPane.background",
                                   "OptionPane.foreground",
                                   "OptionPane.font");
  LookAndFeel.installBorder(optionPane, "OptionPane.border");
  optionPane.setOpaque(true);

  minimumSize = UIManager.getDimension("OptionPane.minimumSize");

  // FIXME: Image icons don't seem to work properly right now.
  // Once they do, replace the synthetic icons with these ones.

  /*
  warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon");
  infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon");
  errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon");
  questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon");
  */
}
 
开发者ID:vilie,项目名称:javify,代码行数:24,代码来源:BasicOptionPaneUI.java

示例4: updateUI

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
   * Overridden to message super and forward the method to the tree. Since the
   * tree is not actually in the component hieachy it will never receive this
   * unless we forward it in this manner.
   */
  public void updateUI() {
super.updateUI();
	if (tree != null) { 
	tree.updateUI();
	}


      // Use the tree's default foreground and background colors in the
      // table.
      LookAndFeel.installColorsAndFont(this, "Tree.background",
              "Tree.foreground", "Tree.font");
  }
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:18,代码来源:TaskTable.java

示例5: updateUI

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
@Override
public void updateUI()
{
	super.updateUI();
	setLineWrap(true);
	setWrapStyleWord(true);
	setHighlighter(null);
	setEditable(false);
	setFocusable(false);
	LookAndFeel.installBorder(this, LABEL_BORDER);
	LookAndFeel.installColorsAndFont(this, LABEL_BACKGROUND, LABEL_FOREGROUND, LABEL_FONT);
}
 
开发者ID:equella,项目名称:Equella,代码行数:13,代码来源:MultiLineLabel.java

示例6: installDefaults

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
 * Installs the default settings.
 *
 * @param b  the button (<code>null</code> not permitted).
 */
protected void installDefaults(AbstractButton b)
{
  String prefix = getPropertyPrefix();
  // Install colors and font.
  LookAndFeel.installColorsAndFont(b, prefix + "background",
                                   prefix + "foreground", prefix + "font");
  // Install border.
  LookAndFeel.installBorder(b, prefix + "border");

  // Install margin property.
  if (b.getMargin() == null || b.getMargin() instanceof UIResource)
    b.setMargin(UIManager.getInsets(prefix + "margin"));

  // Install rollover property.
  Object rollover = UIManager.get(prefix + "rollover");
  if (rollover != null)
    LookAndFeel.installProperty(b, "rolloverEnabled", rollover);

  // Fetch default textShiftOffset.
  defaultTextShiftOffset = UIManager.getInt(prefix + "textShiftOffset");

  // Make button opaque if needed.
  if (b.isContentAreaFilled())
    LookAndFeel.installProperty(b, "opaque", Boolean.TRUE);
  else
    LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
}
 
开发者ID:vilie,项目名称:javify,代码行数:33,代码来源:BasicButtonUI.java

示例7: installDefaults

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
protected void installDefaults() {
  LookAndFeel.installColorsAndFont(tipPane, "TipOfTheDay.background",
    "TipOfTheDay.foreground", "TipOfTheDay.font");
  LookAndFeel.installBorder(tipPane, "TipOfTheDay.border");
  tipFont = UIManager.getFont("TipOfTheDay.tipFont");
  tipPane.setOpaque(true);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:8,代码来源:BasicTipOfTheDayUI.java

示例8: installDefaults

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
 * This method installs the defaults that are defined in  the Basic look
 * and feel for this {@link JPopupMenu}.
 */
public void installDefaults()
{
  LookAndFeel.installColorsAndFont(popupMenu, "PopupMenu.background",
                                   "PopupMenu.foreground", "PopupMenu.font");
  LookAndFeel.installBorder(popupMenu, "PopupMenu.border");
  popupMenu.setOpaque(true);
}
 
开发者ID:vilie,项目名称:javify,代码行数:12,代码来源:BasicPopupMenuUI.java

示例9: installDefaults

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
 * Installs the defaults for this UI delegate in the specified panel.
 *
 * @param p  the panel (<code>null</code> not permitted).
 */
protected void installDefaults(JPanel p)
{
  LookAndFeel.installColorsAndFont(p, "Panel.background", "Panel.foreground",
                                   "Panel.font");

  // A test against the reference implementation shows that this method will
  // install a border if one is defined in the UIDefaults table (even though
  // the BasicLookAndFeel doesn't actually define a "Panel.border").  This
  // test was written after discovering that a null argument to
  // uninstallDefaults throws a NullPointerException in
  // LookAndFeel.uninstallBorder()...
  LookAndFeel.installBorder(p, "Panel.border");
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:BasicPanelUI.java

示例10: installDefaults

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
protected void installDefaults()
{
  LookAndFeel.installColorsAndFont(table, "Table.background",
                                   "Table.foreground", "Table.font");
  table.setGridColor(UIManager.getColor("Table.gridColor"));
  table.setSelectionForeground(UIManager.getColor("Table.selectionForeground"));
  table.setSelectionBackground(UIManager.getColor("Table.selectionBackground"));
  table.setOpaque(true);
}
 
开发者ID:vilie,项目名称:javify,代码行数:10,代码来源:BasicTableUI.java

示例11: installDefaults

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
 * This method installs defaults for the Look and Feel.
 */
protected void installDefaults()
{
  LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background",
                                   "TabbedPane.foreground",
                                   "TabbedPane.font");
  tabPane.setOpaque(false);

  lightHighlight = UIManager.getColor("TabbedPane.highlight");
  highlight = UIManager.getColor("TabbedPane.light");

  shadow = UIManager.getColor("TabbedPane.shadow");
  darkShadow = UIManager.getColor("TabbedPane.darkShadow");

  focus = UIManager.getColor("TabbedPane.focus");

  textIconGap = UIManager.getInt("TabbedPane.textIconGap");
  tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay");

  tabInsets = UIManager.getInsets("TabbedPane.tabInsets");
  selectedTabPadInsets
    = UIManager.getInsets("TabbedPane.selectedTabPadInsets");
  tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets");
  contentBorderInsets
    = UIManager.getInsets("TabbedPane.contentBorderInsets");
  tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque");

  // Although 'TabbedPane.contentAreaColor' is not defined in the defaults
  // of BasicLookAndFeel it is used by this class.
  selectedColor = UIManager.getColor("TabbedPane.contentAreaColor");
  if (selectedColor == null)
    selectedColor = UIManager.getColor("control");

  calcRect = new Rectangle();
  tabRuns = new int[10];
  tabAreaRect = new Rectangle();
  contentRect = new Rectangle();
}
 
开发者ID:vilie,项目名称:javify,代码行数:41,代码来源:BasicTabbedPaneUI.java

示例12: installDefaults

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
 * Installs various default settings (mostly colors) from the {@link
 * UIDefaults} into the {@link JList}
 *
 * @see #uninstallDefaults
 */
protected void installDefaults()
{
  LookAndFeel.installColorsAndFont(list, "List.background",
                                   "List.foreground", "List.font");
  list.setSelectionForeground(UIManager.getColor("List.selectionForeground"));
  list.setSelectionBackground(UIManager.getColor("List.selectionBackground"));
  list.setOpaque(true);
}
 
开发者ID:vilie,项目名称:javify,代码行数:15,代码来源:BasicListUI.java

示例13: updateUI

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
 * Overridden to message super and forward the method to the tree. Since the
 * tree is not actually in the component hieachy it will never receive this
 * unless we forward it in this manner.
 */
@Override
public void updateUI() {
	super.updateUI();
	if (tree != null) {
		tree.updateUI();
	}
	// Use the tree's default foreground and background colors in the
	// table.
	LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font");
}
 
开发者ID:cst316,项目名称:spring16project-Fortran,代码行数:16,代码来源:JTreeTable.java

示例14: updateUI

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
 * Overridden to message super and forward the method to the tree. Since the
 * tree is not actually in the component hieachy it will never receive this
 * unless we forward it in this manner.
 */
@Override
public void updateUI() {
	super.updateUI();
	if (tree != null) {
		tree.updateUI();
	}

	// Use the tree's default foreground and background colors in the
	// table.
	LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font");
}
 
开发者ID:cst316,项目名称:spring16project-Fortran,代码行数:17,代码来源:TaskTable.java

示例15: installDefaults

import javax.swing.LookAndFeel; //导入方法依赖的package包/类
/**
 * This method changes the settings for the progressBar to
 * the defaults provided by the current Look and Feel.
 */
protected void installDefaults()
{
  LookAndFeel.installColorsAndFont(progressBar, "ProgressBar.background",
                                   "ProgressBar.foreground",
                                   "ProgressBar.font");
  LookAndFeel.installBorder(progressBar, "ProgressBar.border");
  progressBar.setOpaque(true);

  selectionForeground = UIManager.getColor("ProgressBar.selectionForeground");
  selectionBackground = UIManager.getColor("ProgressBar.selectionBackground");
  cellLength = UIManager.getInt("ProgressBar.cellLength");
  cellSpacing = UIManager.getInt("ProgressBar.cellSpacing");

  int repaintInterval = UIManager.getInt("ProgressBar.repaintInterval");
  int cycleTime = UIManager.getInt("ProgressBar.cycleTime");

  if (cycleTime % repaintInterval != 0
      && (cycleTime / repaintInterval) % 2 != 0)
    {
      int div = (cycleTime / repaintInterval) + 2;
      div /= 2;
      div *= 2;
      cycleTime = div * repaintInterval;
    }
  setAnimationIndex(0);
  numFrames = cycleTime / repaintInterval;
  animationTimer.setDelay(repaintInterval);
}
 
开发者ID:vilie,项目名称:javify,代码行数:33,代码来源:BasicProgressBarUI.java


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